Documentation
¶
Overview ¶
Package mkskill is the minimal face a host application imports: its docs come already composed (the compiler package renders them at build time and the generated embed carries them in the binary); this package only handles the parameters — recognizing the generate commands on the host's command line, writing or installing the documents, and lending the usage text for the host's own help.
Index ¶
- type Spec
- func (s Spec) CheckParams() (err error, done bool)
- func (s Spec) Dispatch(cmd string, args []string) (handled bool, err error)
- func (s Spec) RunGenerateAgentDocs(args []string) error
- func (s Spec) RunGenerateClaudeSkill(args []string) error
- func (s Spec) RunGenerateReadme(args []string) error
- func (s *Spec) Usage(detail bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Spec ¶
type Spec struct {
Name string // skill name; also the skill directory name
Description string // the trigger text Claude uses to decide when to load the skill
Readme string // the composed README.md
Agents string // the composed AGENTS.md
Skill string // the composed SKILL.md, wrapper included
}
Spec is everything the host carries: its name, the trigger description, and the composed documents — ready to write, never rendered here.
func (Spec) CheckParams ¶
CheckParams is the one-call host integration: it inspects os.Args and runs a generate command if the program was invoked as one. It returns done=true when a generate command ran successfully (the host should stop), err!=nil when a generate command was recognised but failed, and both zero when os.Args is not a generate command (so the host falls through to its own argument handling):
if err, done := Skill.CheckParams(); done {
return
} else if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
// …not a mkskill command: the host handles os.Args itself…
func (Spec) Dispatch ¶
Dispatch routes the generate commands. They are flag-shaped (-generate-claude-skill, one or two dashes) so they never collide with the host's own subcommands; the bare form is accepted too. It returns handled=false for anything else so a host CLI can fall through to its own commands:
if ok, err := spec.Dispatch(cmd, args); ok { return err }
func (Spec) RunGenerateAgentDocs ¶
RunGenerateAgentDocs parses [-dst f] [-force] and writes the composed AGENTS.md (default destination AGENTS.md).
func (Spec) RunGenerateClaudeSkill ¶
RunGenerateClaudeSkill parses [-dst f] [-global] [-force] and writes the composed SKILL.md. Default destination is the project-local .claude/skills/<name>/SKILL.md; -global writes ~/.claude/skills/<name>/SKILL.md (available from every project, no elevation — it is under the user's own home); -global and -dst are mutually exclusive.
func (Spec) RunGenerateReadme ¶ added in v0.2.0
RunGenerateReadme parses [-dst f] [-force] and writes the composed README.md (default destination README.md).
func (*Spec) Usage ¶ added in v0.2.0
Usage returns mkskill's command help for a host to embed in its own help, so it stays in sync as mkskill gains commands or flags. detail=false is the compact header (one aligned "name flags" line per command); detail=true adds a description line under each. Both have no leading indent or trailing newline — the host positions them. It is a method of Spec so a host's main needs no mkskill import of its own: the generated embed already brings the type, and MkskillSpec.Usage(true) just works.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
mkskill
command
mkskill.exe barely parses the command line and calls the compiler: the engine lives in github.com/ot4go/mkskill/compiler and the self-doc machinery in the root package.
|
mkskill.exe barely parses the command line and calls the compiler: the engine lives in github.com/ot4go/mkskill/compiler and the self-doc machinery in the root package. |