Files
holocron/plugins/kyberforge/.apm/skills/skill-author/references/improve.md
Defame1297 baa2f5dc7f docs(kyberforge): restore the retrofit cut order in skill-author
improve.md still required a retrofit before extending but lost the
procedure with retrofit.md. Restore the ordered cuts inline, and fix
the stale hook name and plugin-mode wording in skill-author's tests and
deployment-modes reference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 15:27:32 +00:00

5.0 KiB

source_keys
source_keys
agentskills-best-practices
agentskills-evaluating-skills
agentskills-optimizing-descriptions

Improving an existing skill

Return to SKILL.md Step 4 once Step 4 below is done — validation, versioning and commit verification are shared with the create flow and are not repeated here.

Step 1 — Verify inputs

Confirm the skill directory path exists and that at least one improvement signal is present in the conversation or a referenced file.

If the skill directory is missing, ask for it. If no signals are present, stop: "This skill applies existing signals to a skill. For a blind review without signals, use /factory-audit instead."

Signals can come from anywhere in the conversation or referenced files:

  • Grill session output (most common predecessor in the factory sequence)
  • /factory-audit findings (PASS/FAIL/SUGGESTION punch list)
  • Human feedback (feedback.json, inline in conversation, PR or issue comments)
  • Session context describing what went wrong

Also verify the name field in frontmatter matches the skill's directory name exactly.

Step 2 — Gather and group signals

Read the current skill files (SKILL.md and any files in scripts/, references/, assets/, tests/). Then collect all signals from the conversation and any file paths the user has referenced.

Group signals by root cause, not symptom. Patching per symptom is the default failure mode: three eval failures may all trace to one missing instruction. Ask: "What single gap in the skill causes this cluster of failures?" One root cause → one fix. Do not make a separate edit for each symptom.

Example:
- Session context: output format is wrong on every run
- Audit finding: no output template defined
- User feedback: "I always have to ask it to format the output"
→ Root cause: SKILL.md has no output format specification → one fix: add an output template

Step 3 — Announce planned changes

Before editing, state:

  • Which root causes were identified and what evidence supports each
  • Which files will be changed and what will change in each

Then proceed — edits are reversible via git, no approval checkpoint needed.

Step 4 — Apply changes

Edit any file in the skill directory that the signals point to: SKILL.md, scripts/, references/, assets/, tests/, README.md.

Generalize, do not patch. Find the underlying gap, not the specific example that failed. A fix scoped only to the test cases you have seen will overfit and perform worse on new inputs.

Keep it lean. Remove instructions that are not pulling their weight. For every sentence you add, ask: "Would the agent get this wrong without it?" A shorter, focused skill consistently outperforms an exhaustive one.

Explain the why. Reasoning-based instructions outperform rigid directives. If you find yourself writing a rule in all caps (ALWAYS/NEVER), reframe it: explain why the behavior matters so the agent can apply judgment in edge cases.

Retrofit before extending. Any edit to a skill that does not meet the contract has to bring it into compliance first — the gates are hot and carry no baseline file, so a one-line fix to a non-compliant skill cannot be committed until the description and body meet references/contract.md. Treat that retrofit as part of the same change, not a follow-up.

Retrofit against the number that actually failed: the audit reports description characters and body-only words separately. Audit the skill in its real package directory, never a scratch copy, where boundary resolution reports DID NOT RUN and exits 0 without checking anything. Cut in this order, stopping once the gate clears; the order puts the cuts that lose the least behaviour first:

  1. Gotchas that paraphrase a step below them — delete the Gotcha, keep the step.
  2. Spec restatements — text repeating a published spec, a tool's --help, or a limit the validator already enforces.
  3. Capability enumeration — keep one capability clause in the description; drop the rest.
  4. Per-flow prose — move each flow into its own references/ file behind a dispatch table.

Still over after all four means the skill does two jobs: split it rather than compressing prose.

If a signal points to a script or reference file, edit that file directly rather than adding a workaround in SKILL.md.

A skill carrying no metadata.version is seeded at "1.0.0", not bumped — SKILL.md Step 4's patch bump presumes a version to bump, and ADR-0022 reserves "0.1.0" for a newly created skill.

Check for regressions before handing back. SKILL.md Step 4 tells you to resolve every FAIL, which says nothing about a check that passed before these edits and no longer does. Compare the closing audit against the skill's pre-edit state — a PASS that has become a SUGGESTION, or a SUGGESTION that has become a FAIL, is damage this flow caused and is in scope for it. Only the improve flow can make that comparison; the create flow has no prior state to compare against.

Then return to SKILL.md Step 4.