Three related half-applied changes from #130, each leaving the corpus in a state its own documentation contradicts. Why: - `assets/templates/SKILL.md` shipped `metadata:` fully commented out, and `new-skill.sh` only substitutes SKILL_NAME. Every scaffolded skill therefore lacked the `metadata.version` ADR-0022 made mandatory and was blocked at first commit by the very hook this PR added. The commented example also read `"1.0"` — neither the `0.1.0` new-skill seed nor valid semver. - `agent-audit/references/scope-project-user.md` still joined `disable-model-invocation` and `user-invocable` with a slash — #125's defect verbatim — while pointing the reader at the file this PR had just corrected to say the opposite. - ADR-0022 required the "when present" bump conditional dropped and `metadata.version` moved into create.md's required list. It was dropped from SKILL.md but left in README.md, and the field was edited in place under a heading that still authorises removing it entirely. Implementation notes: - The template emits `metadata: version: "0.1.0"` live, captioned as required, with the optional keys left commented. `new-skill.bats` gains a case asserting a live key and three-part semver, so this cannot regress. - `description-quality.md` now asserts only what the vendored Copilot research supports: two fields with opposite defaults, and the retired `infer` replaced by the pair rather than by either alone. The unsupported negative it previously stated as fact is gone. - The `1.0.0` retrofit seed is stated in improve.md and retrofit.md, which the retrofit flow actually reads — create.md, where it lived, is unreachable from that path. The compression item moved out of the file-churn checklist, whose preamble excluded the wording-only change it covers. - Executable git commands in these three skills now carry the ADR-0023 rtk prefix. Refs: #125, #127 ADR: 0022, 0023 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeH8SCbcrCAQrtymkNuhKP
agent-author
Creates and improves agent definition files for Claude Code and GitHub Copilot CLI.
What it does
Scaffolds and fills in agent definition files at plugin/APM, project, or user scope. Project and user scope always generate a Claude Code + Copilot CLI file pair (.md + .agent.md) in one pass. Plugin/APM scope generates a single vendor-neutral .apm/agents/<name>.agent.md file instead — no separate Claude Code / Copilot split, since apm compile has no per-target field integrator (see ADR-0016). Also applies improvement signals — grill output, inline feedback, session context — to existing agent files. Bumps the version after every change: the resolved package's apm.yml at plugin/APM scope (minor for new agents, patch for improvements); project/user scope has no manifest to bump.
Before you start
Have ready: the agent's name (kebab-case), the root directory (plugin root, project root, or ~), a one-sentence purpose, and the triggering condition (when should the runtime delegate to this agent?).
Usage
/agent-author
Manual scaffold (human workflow):
bash scripts/new-agent.sh <agent-name> <root>
# Examples:
bash scripts/new-agent.sh code-reviewer packages/my-package/ # plugin/APM scope if packages/my-package/apm.yml has a type: field
bash scripts/new-agent.sh deploy-assistant .
bash scripts/new-agent.sh security-reviewer ~
Files
| File | Purpose |
|---|---|
SKILL.md |
Skill instructions for agents — gotchas, the create/improve dispatch table, the scope dispatch table, the shared gates, and validation/close |
scripts/new-agent.sh |
Scaffolds agent definition file(s) from templates — a single .apm/agents/<name>.agent.md at plugin/APM scope, or a Claude Code + Copilot CLI pair at project/user scope |
references/create.md |
Create flow: prerequisites, scaffold and scope walk-up, what to fill in, package-root sources.md |
references/improve.md |
Improve flow: signal verification, root-cause grouping, generalizing, delegation over growth, ADR-0020 retrofit |
references/contract.md |
Description and body contract: three-part description shape, 250/400 tiers, delegation rule in place of a body word gate, invocation axis |
references/plugin-scope.md |
Plugin/APM scope field rules for the single vendor-neutral file, plus its pre-audit checklist |
references/project-user-scope.md |
Project/user scope field rules for the Claude Code + Copilot pair, both Copilot formats, plus its pre-audit checklist |
references/deployment-modes.md |
Scope hierarchy and precedence, scoped identifiers, cache isolation, path conventions |
references/scripts.md |
Conventions for new-agent.sh and the templates it copies: contract, template variables, file placement, error messages |
references/sources.md |
Research provenance — sources that informed this skill |
assets/templates/claude-code.md |
Annotated Claude Code agent definition template (project/user scope) |
assets/templates/copilot.agent.md.template |
Annotated Copilot CLI agent definition template (project/user scope) |
assets/templates/apm-agent.md |
Annotated vendor-neutral APM agent definition template (plugin/APM scope) |
tests/new-agent.bats |
(source-only) bats tests for scripts/new-agent.sh |
assets/README.md |
Directory meta-documentation for assets/ |
references/README.md |
Directory meta-documentation for references/ |
scripts/README.md |
Directory meta-documentation for scripts/ |
tests/README.md |
(source-only) bats dependency instructions and run command |
Rows marked (source-only) exist in the authoring source (.apm/skills/agent-author/) but are
not present in an installed plugin: scripts/sync-plugin-content.sh strips
<category>/<name>/tests when it generates the flat mirror, because these are dev-time fixtures no
plugin host needs to discover (ADR-0017). Run them from a repo checkout, not from an install. The
assets/templates/ rows above are unaffected — the exclusion is depth-scoped to
<category>/<name>/tests, so template trees that themselves contain a tests/ directory ship
intact.