Expand description
Reusable helpers for skills-related CLI subcommands.
Downstream binaries (mcp-server, kglite-mcp-server, …) plug
these into their own clap setup to offer skills-lint,
skills-list, and skills-show without re-implementing the
load / resolve / format flow. Each helper returns a string ready
to print, plus an exit-code indicator where relevant.
ⓘ
use mcp_methods::server::cli;
match cli::skills_lint(&dir) {
Ok(report) => println!("{report}"),
Err(e) => { eprintln!("{e}"); std::process::exit(2); }
}Structs§
- Lint
Report - Result of
skills_lint— a one-line report per file and a boolean indicating whether any error was found.
Functions§
- skills_
lint - Walk
dirfor*.mdfiles, parse each as a skill, and report per-file status. Soft warnings (size 4–16 KB) annotate the line but don’t fliphas_errors. Hard failures (missing frontmatter, missing required field, >16 KB) emit anERRORline and fliphas_errorsso operators can wire a non-zero exit on lint failure. - skills_
list - Build a registry from a manifest YAML and return a one-line-per- skill summary suitable for stdout. Output columns: name, provenance, description (truncated).
- skills_
new - Scaffold a starter SKILL.md at
destand return the resolved path written. Thin wrapper aroundwrite_skill_templatethat bubbles errors asStringfor symmetric handling alongsideskills_list/skills_show. - skills_
show - Look up a single skill by name and return its full body, prefixed
with a header line showing the name and provenance. Returns
Errif the skill is not present in the resolved set.