pub fn extract_documented_invocation(skill_md: &str) -> Option<String>Expand description
Pull the text of the SKILL.md that documents the CLI invocation, so flag-
drift extraction reads only the documented invocation area (not the templated
prose/footguns/metadata). Returns None when the skill is a pure library.
Two signals, in order:
- A
## Invocationheading — the section the skillpack CLI template emits. skillpack libraries use## Usage(never## Invocation), so this cleanly separates the two for generated packs. - A fenced code block containing a
--flagtoken — the fallback for hand-written skills (e.g. thebroken-clifixture) that document a CLI without the## Invocationheading. A pure-library import block (import { parse } from 'x') has no--flag, so it correctly stays a library (Bug 2 + Improvement F, without the prose false-positives that scoping to the whole body would reintroduce).