The starter driven gear is not secured by a woodruff key, it is supported on the crankshaft by a needle roller bearing and its outer hub journal serves as the inner half of the one-way starter clutch. Support in this manner allows the crankshaft to spin freely inside of the driven gear (driven gear remains stationary) while the motor is running. While cranking the motor over using the electric starter, the driven gear engages the flywheel through its' one-way clutch and cranks the motor over.
The woodruff key locates the flywheel onto the crankshaft at a precise location where the pulse generator is passed by the reluctor on the flywheel at a certain (pre-determined by Honda at the factory) number of degrees of crankshaft rotation before top-dead-center (BTDC) every revolution. The reluctor passing the stationary pulse generator windings generates a voltage that the CDI receives long before the CDI must energize the ignition coil to generate a high voltage spark. The reason for this early initiation sequence of ignition events is because the CDI must tailor ignition timing advance BTDC according to the RPMs of the motor. So that means the reluctor must pass the pulse generator "equal to or greater than" (slightly > to allow for latency) the total number of degrees BTDC of ignition timing advance designed into the CDI.
A woodruff key locates the flywheel precisely and a tight flywheel bolt holds it in place on the tapered crankshaft, we know that... but what we think might happen in event a woodruff key shears, and what actually happens in the real world may be two entirely different outcomes. The flywheel bolt almost always remains tight AND the flywheel itself remains tight on its taper. The key shears, the flywheel rotates on the crankshaft which throws the ignition sequence out of time and the motor immediately stalls and won't restart. The only way to find out if the woodruff key has sheared is to remove the still very tight flywheel.
I realize you may fully understand these relationships and how everything works, but I am seeding and watering your garden anyway in hopes this might help others performing searches, long after this thread goes dormant. I do this stuff in everyone else's threads too (in all my free time!), because I believe that knowledge and understanding how stuff works should be learned (and shared with others like myself, that's why I am here every day) before any serious wrench flipping commences.
Anyway, the reason I asked whether your CDI (and other ignition replacement parts) are OEM Honda is because almost every other CDI being peddled nowadays are china knockoffs. Those cheap china parts rarely work right... and many times won't work at all right out of the box. In those cases where china parts are put on the bike we can't help anyone... except to remind them that china exports are dumped here as garbage.
With all of that said... generally when spark is intermittent the issue lies with the CDI or the ignition coil/plug wire. Sometimes it is due to a wiring connection problem or a failed component elsewhere in the starting or ignition circuits though, so an orderly diagnosis procedure must be performed before spending money on it.
The CDI is almost always at fault when you see spark only after releasing the starter button. However, if your bike is equipped with a diode to protect the CDI from voltage spikes from the starter solenoid, the diode should be checked before suspecting the CDI.
You can get a copy of the service manual for your bike HERE
in case you haven't a copy yet.
Hope this helps!