Keeping the agent skill in sync with the CLI
Source of truth
crm/skills/ is the canonical agent skill — a thin SKILL.md router plus
reference/*.md files loaded on demand. The package ships the whole tree
(package_data in setup.py; bundled in crm.spec) and crm skill install
copies it into an agent's skill directory:
| Target | Destination |
|---|---|
claude |
~/.claude/skills/crm/ |
copilot |
~/.copilot/skills/crm/ |
cursor |
~/.cursor/rules/crm/ |
crm skill install --target claude --force
Two rules that keep the skill healthy
- Self-contained. The skill ships to users who have only the skill, not this
repo. No shipped skill file may link to a repo-only path (
docs/**,CONTEXT.md,../) or assume any repo file is present. Inline what the agent needs (labels, templates, tables). The only assumed externals are the installedcrmbinary and, for the feedback flow, theghCLI. - Never restate flags.
crm describe [group]andcrm <group> --helpemit every command, option, choice, default, and envvar straight from the live Click tree — they cannot drift. The skill states only what they cannot: workflows, gotchas, and the JSON contract. Maintenance test: if a line could be regenerated bycrm describe, delete it.
crm/tests/test_skill_bundle.py enforces both rules plus a router line cap.
When the CLI changes
Use the writing-great-skills skill (.claude/skills/writing-great-skills/) as
the authority for skill structure, progressive disclosure, and description-writing
whenever you edit the skill — the two crm-specific rules above override it on conflict.
After adding or changing a command, update the relevant crm/skills/reference/*.md
(workflows and gotchas — not flag definitions already in --help; flags appear in examples) and the SKILL.md map if a new group appeared,
then reinstall with --force. To detect drift against an install:
diff -r crm/skills ~/.claude/skills/crm
The bug loop used to build CRMWorx
While building the walkthrough, defects were handled with a hybrid policy:
- Trivial / single-function: write a failing test in
crm/tests/, fix incrm/, re-run, continue — the fix lands in the same session. - Larger: file a triaged GitHub issue with a minimal repro, work around, continue.
Issues filed during the run are tracked in GitHub Issues.