Files
holocron/plugins/kyberforge/.apm/skills/agent-author
Defame1297 fc305ba7d9 fix(kyberforge): correct the routing-tier contract and make agent-audit rubrics conditional
Five documents told authors that a prose-form dangling routing target blocks. The
gate reports it as a SUGGESTION and exits 0. Verified on fixtures: `-> name` and
`/name` are blocking ERRORs, the prose form is SUGGESTION-tier unless a second
resolving target in the same sentence corroborates it. ADR-0020 and gates.md were
right; contract.md, retrofit.md, description-quality.md, finding-criteria.md and
agent-author's contract.md were wrong — and they are what an author and an auditor
actually read. The whole 39-skill corpus was retrofitted against them.

skill-audit was also self-contradictory: it imports validate.sh's SUGGESTIONs into
the Structure dimension verbatim while its own rubric grades the same target a FAIL,
so one target got reported twice at two tiers. The script owns the grade; the rubric
now says so.

The YAML-fold trap that broke gitea-labels-milestones (#100) was warned about only
in retrofit.md, reachable only from the improve flow when a budget is exceeded. It
is now in both contract.md files, which SKILL.md mandates on the create flow too.

agent-audit loaded both rubrics unconditionally on every run — 3,323 words for a
clean audit against skill-audit's 1,636. dac9cad fixed exactly this in skill-audit
and edited agent-audit in the same commit without applying it. Same treatment: the
criteria move to a new finding-criteria.md and load per dimension. Clean run now
2,083 words, a 37% cut.

Routing: apm-workflow's description shed dependency installation while still owning
the flow, and apm-install's boundary did not exclude it, so "install my apm
dependencies" matched the CLI-binary skill with no route back. Fixed on both sides.
forge regains two of the three phrasings the retrofit deleted.

forge Step 1 called grill-with-docs unconditionally — a skill in plugins/bin, which
kyberforge does not declare as a dependency. It resolves here only because the
walk-up sweeps sibling plugins; a standalone install dead-ends. Step 1 now names
the cross-plugin dependency and gives an inline fallback. Declaring it properly in
apm.yml remains the better fix.

Also: both audit SKILL.md files now grade exit 2 as "did not run, dimension
unverified" rather than as findings; skill-audit's README row described content that
moved, which its own finding-criteria.md grades a FAIL; and body-discipline.md's
`git show <sha>:plugins/...` command is fenced, since an installed plugin cache has
no repo and file-structure.md makes a bare repo path a FAIL.

Refs: #100, #101, #125
ADR: 0020
2026-09-01 12:38:22 +00:00
..

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.