Skip to content

The agent skill

The skill is a folder: SKILL.md plus references and examples. Agents that support skills load it when you ask for a map, a diagram or an explanation of a system.

Install it with npx skills add decimozs/schemap (see Quick start). The installer copies the whole folder below.

skill/
├── SKILL.md the steps the agent follows
├── bin/schemap.mjs the CLI as one file: elkjs and the viewer inlined
├── references/
│ ├── authoring-contract.md how to model a system
│ ├── schema.md every field
│ └── schemap.schema.json JSON Schema for editors and agents
└── examples/ one map per kind
  1. Pick the kind by what the edges mean.
  2. Gather facts: from the code for repository maps, or only what the user said.
  3. Write the complete map.json in .schemap/<slug>/, following the authoring contract.
  4. Validate with validate --json.
  5. Repair only what the diagnostics name, using an allowed fix at the named place. Stop and report if two rounds don’t reduce the errors.
  6. Deliver with deliver --open.
  7. Embed when asked, with --md-dir set to the markdown file’s directory.
  8. Check evidence for repository maps: every cited file must exist.
  9. Report the file paths, the receipt and any warnings left.

The agent runs node <skill-dir>/bin/schemap.mjs, the CLI that ships with the skill. It needs Node.js 22.12 or later and nothing else. If SCHEMAP_BIN is set, it runs node "$SCHEMAP_BIN" instead, to try another build. A failure with no JSON on stdout means the CLI never ran (Node missing or too old); the agent reports that instead of editing the map.

  • Write coordinates or styling: layout and look are schemap’s job.
  • Copy secrets, hostnames or IPs from config: nodes are named by role.
  • Start over when asked for an edit: it edits the same map.json and keeps ids stable.
  • Add a theme unless you ask for your own colours.