Use when developing or debugging spf13/cobra internals — Command struct internals, ExecuteC dispatch, Find vs Traverse, flag set hierarchy, completion engine (__complete, getCompletions, ShellCompDirective), shell script generation (bash V1/V2, zsh, fish, powershell), flag group validation, global state, Levenshtein suggestions, or understanding the internal execution model. Triggers on: "cobra internals", "cobra ExecuteC", "cobra Find", "cobra Traverse", "cobra findNext", "cobra mergePersistentFlags", "cobra ParseFlags", "cobra getCompletions", "cobra __complete", "cobra completion engine", "cobra bash V2", "cobra flag resolution", "cobra flag groups internals", "cobra global state", "cobra EnablePrefixMatching", "cobra EnableCaseInsensitive", "cobra Levenshtein", "cobra stripFlags", "cobra legacyArgs", "cobra execute", "cobra preRun", "cobra postRun", "cobra mousetrap", "cobra templateFuncs".
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Use when developing or debugging spf13/cobra internals — Command struct internals, ExecuteC dispatch, Find vs Traverse, flag set hierarchy, completion engine (__complete, getCompletions, ShellCompDirective), shell script generation (bash V1/V2, zsh, fish, powershell), flag group validation, global state, Levenshtein suggestions, or understanding the internal execution model. Triggers on: "cobra internals", "cobra ExecuteC", "cobra Find", "cobra Traverse", "cobra findNext", "cobra mergePersistentFlags", "cobra ParseFlags", "cobra getCompletions", "cobra __complete", "cobra completion engine", "cobra bash V2", "cobra flag resolution", "cobra flag groups internals", "cobra global state", "cobra EnablePrefixMatching", "cobra EnableCaseInsensitive", "cobra Levenshtein", "cobra stripFlags", "cobra legacyArgs", "cobra execute", "cobra preRun", "cobra postRun", "cobra mousetrap", "cobra templateFuncs".
user-invocable
true
Cobra Development Reference
Reference for developing and debugging cobra internals. Covers the Command struct, execution flow, flag resolution, completion engine, and shell script generation.
Data Flow
os.Args[1:]
→ ExecuteC()
→ Root().ExecuteC() (always starts at root)
→ InitDefaultHelpCmd, initCompleteCmd, InitDefaultCompletionCmd
→ Find(args) or Traverse(args) (based on TraverseChildren)
→ findNext() (exact match → alias → prefix match)
→ execute(flags)
→ ParseFlags
→ ValidateArgs
→ PersistentPreRun chain (parent → child)
→ PreRun
→ ValidateRequiredFlags, ValidateFlagGroups
→ Run / RunE
→ PostRun
→ PersistentPostRun chain (child → parent)
Sub-Resources
Load the reference that matches your task. When in doubt, load multiple references.