/docent:docent-migratefrom docent
Replace a CLI's hand-rolled agent guide/schema surface with docent, with captured before/after evidence and no information loss. Use when a Go CLI already ships bespoke agent docs, guide strings, or a custom schema walker.
Ships in docent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Replace a hand-rolled agent surface — guide strings in Go files, bespoke schema walkers, custom guide commands — with docent, proving along the way that nothing an agent relied on was lost. Distilled from executed trial migrations of real hosts (one replaced ~1,700 hand-rolled lines with ~300; another carried domain-reference guides and an envelope schema).
Build the current binary and capture every agent-facing output before touching anything; these are the baseline for every later diff:
tool agent guide > before/guide-list.txt
tool agent guide <name> > before/guide-name.txt
tool agent schema > before/schema.json
If capture fails on a clean machine (keyring, credentials), that is your first finding: the standard requires a credential-free agent surface.
The old surface's package almost never contains only the surface. Both executed migrations found envelope types, attribution logic, or agent-detection helpers sharing the package with the docs code. Map what stays before deleting anything — expect a package split, not a removal.
Guide prose trapped in Go strings becomes one .md file per guide
(see docent-onboarding for the format and package).
Slug rules forbid underscores and uppercase — renamed guides declare their old names so nothing memorized breaks:
slug: send-msg
aliases: [send_msg]
Headings that do not match the six sections fold by what they govern:
invocation semantics → Run, parsing semantics → Save, failure
semantics → Recover. Cross-cutting "contract" documents map as
reference-style guides with commands: [].
Hand-rolled schemas carry contract metadata the neutral IR deliberately does not model — auth, env vars, exit codes, output modes, examples. Diff your before-schema's top-level keys and move them into the host-owned extensions slot:
tree := docentcobra.Tree(root)
tree.Extensions = map[string]any{
"auth": map[string]any{"env_var": "TOOL_TOKEN"},
"exit_codes": map[string]any{"auth": 1, "not_found": 2},
"output": map[string]any{"modes": []string{"json", "human"}},
}
One top-level key does NOT go into extensions: a hand-rolled
contract_version (or schema-version) field moves to
Config.ContractVersion, which adapters stamp onto both the schema root
and the guide index — an extensions entry of that name would be silently
overwritten by the stamp.
Enums declared through gechr/clib extras surface automatically; other flag
libraries need docent.enum annotations or an Enum() method.
Remove the old commands, mount docentcobra.NewCommand(cfg) after full
tree assembly, and fix what falls out: completion hooks referencing old
guide-name lists, help text, and the tests pinned to the old schema shape
(point those at docenttest.SchemaGolden).
Re-capture everything from Step 1 and diff. Expected changes are the migration's evidence; any unexpected drift is a finding. Record the numbers — they justify the migration:
bunx skills-ref validate on every exported agent-skill artifact.tool agent guide old_name.commands: validation on a
cross-cutting guide. ✅ commands: [] means whole-tool.docenttest.MaskFlagDefaults first.extensions.docenttest.SchemaGolden, and exported artifacts are
skills-ref-clean.docent-onboarding — the target state this migration lands on, and
the authoring/mounting reference.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (matcra587/docent) — no native marketplace selected
npx claudepluginhub p/matcra587-docent2 skills in this plugin