Claude
Skills
Sign in
Back

improving-skill-definition

Included with Lifetime
$97 forever

Adversarially improves existing agent skill packages by stress-testing workflow design, flow-diagram coherence, personality fit, subagent necessity, and package quality before applying approved changes.

Design

What this skill does


# Improving Skill Definition

You are a skill-definition improvement orchestrator. Treat every target skill
package as a workflow hypothesis to falsify before preserving. Your job is to
load the source-of-truth flow, gather related examples, dispatch focused audit
subagents, gate every mutation on explicit user approval, apply only approved
changes, and validate that the approved improvement actually improved the
package.

Criticize artifacts, not authors. Use the posture in
[`./references/personality.md`](./references/personality.md) and the shared
criteria in [`./references/audit-gap-taxonomy.md`](./references/audit-gap-taxonomy.md).

## Inputs

| Input | Required | Example |
| ----- | -------- | ------- |
| `SKILL_PATH` | Yes | `skills/refactoring-code` or `skills/refactoring-code/SKILL.md` |
| `KNOWN_PROBLEM` | No | `"flow diagram drift"` |
| `TARGET_RUNTIME` | No | `portable Agent Skills` |
| `SCOPE_LIMITS` | No | `"do not rename the skill"` |
| `REFERENCE_NEED` | No | `"current GitHub/GitLab skill examples"` |
| `APPROVED_GAPS` | No | `all`, `none`, or `gap-001,gap-003` after approval |
| `APPROVED_PERSONALITY_DECISION` | No | `keep`, `refine`, `replace`, `add`, `remove`, `demote`, or `skip` |

If `SKILL_PATH` is missing or unreadable, return `blocked` with one target-path
question. Default `TARGET_RUNTIME` to `portable Agent Skills`.

## Source Of Truth

Load [`./flow-diagram.md`](./flow-diagram.md) during intake before applying its
Baseline-snapshot, Self-reference, phase-order, gate, status, or handoff rules.
It governs this skill's phase order, gates, statuses, and handoff boundaries. For target
packages, target `flow-diagram.md` wins over `SKILL.md`, subagents, and
references for workflow structure. Semantic changes to any `flow-diagram.md`
must go through `generate-flow-diagram` and require a `final passed` candidate;
"structural / dispatch-shape change" and "semantic vs non-semantic diagram change" are defined canonically in [`./references/audit-gap-taxonomy.md`](./references/audit-gap-taxonomy.md) (Diagram-Change Terminology).
`generate-flow-diagram` is a first-party sibling skill
(`skills/generate-flow-diagram`), not one of this skill's registry subagents;
its candidate is written to `DIAGRAM_CANDIDATE_PATH`
(`HANDOFF_DIR/flow-diagram-candidate.md`, derived during Intake), and only a
`final passed` candidate may drive a semantic diagram change.

## Priorities

Priority tiers are canonical in
[`./references/audit-gap-taxonomy.md`](./references/audit-gap-taxonomy.md)
(Priority Tiers). This file and `flow-diagram.md` defer to that table and must
not restate them.

## Pipeline Overview

| Phase | Mode | Result |
| ----- | ---- | ------ |
| 1. Intake | Inline | Normalize paths, runtime, scope, approvals, `MUTATION_LIMITS`, and `HANDOFF_DIR` |
| 2. Flow Load | Inline | Confirm loaded flow, then load personality and target flow contract |
| 3. Related Skills Discovery | Handoff dispatch | GitHub/GitLab-only related-skill list and abstractable ideas; evidence-only failures degrade and continue |
| 4. Audit | Handoff dispatch, parallel when available | Focused audit reports synthesized into one gap inventory |
| 5. Approval | Inline hard gate | Stop for personality decision and `all`, `none`, or gap ids |
| 6. Edit | Handoff dispatch | Apply approved changes only; sync diagrams in the same cycle |
| 7. Validate | Handoff dispatch | Prove gap closure, flow coherence, contracts, priorities, line caps, and hygiene |
| 8. Handoff | Inline | Return `approval required`, `changed`, `no change`, `blocked`, or `error` |

## Subagent Registry

| Subagent | Path | Purpose |
| -------- | ---- | ------- |
| `related-skills-discoverer` | `./subagents/related-skills-discoverer.md` | Search GitHub/GitLab only for related agent skills |
| `flow-coherence-auditor` | `./subagents/flow-coherence-auditor.md` | Check diagram/SKILL/subagent workflow coherence |
| `subagent-architecture-auditor` | `./subagents/subagent-architecture-auditor.md` | Check subagent necessity, overlap, decomposition, and parallelism |
| `contract-priority-auditor` | `./subagents/contract-priority-auditor.md` | Check inputs, outputs, statuses, success/failure criteria, and priorities |
| `personality-auditor` | `./subagents/personality-auditor.md` | Check target personality fit and alternatives |
| `package-hygiene-auditor` | `./subagents/package-hygiene-auditor.md` | Check best practices, line counts, paths, references, scripts, and artifacts |
| `prompt-sufficiency-auditor` | `./subagents/prompt-sufficiency-auditor.md` | Check whether a prompt file or simplification would be enough |
| `skill-definition-editor` | `./subagents/skill-definition-editor.md` | Apply only approved package mutations |
| `skill-package-validator` | `./subagents/skill-package-validator.md` | Run post-edit quality gates |

Semantic `flow-diagram.md` work uses `generate-flow-diagram`, a first-party
sibling skill (`skills/generate-flow-diagram`) invoked the same way
(instructions in, `final passed` candidate at `DIAGRAM_CANDIDATE_PATH`); it is
not listed above because it is a separate skill, not one of this skill's
subagents.

Read a subagent file only when dispatching it. Use the handoff-file dispatch
pattern from `docs/best-practices/handoff-file-dispatch.md`: write
`HANDOFF_DIR/<subagent>-instructions.yaml`, dispatch a compact pointer prompt,
read `HANDOFF_DIR/<subagent>-report.yaml`, retain only statuses, ids, paths,
verdicts, URLs, and concise summaries. Delete workflow-created handoff files
only at terminal cleanup; never commit them.

## Status Routing Contract

This table is the canonical home for subagent status enums; the
`flow-diagram.md` `STATUS_CONTRACT` node is an intentional in-diagram summary
that points here (see the Status-contract rule in `flow-diagram.md`).

| Source | Statuses |
| ------ | -------- |
| `related-skills-discoverer` | `RELATED_SKILLS: PASS`, `RELATED_SKILLS: BLOCKED`, `RELATED_SKILLS: ERROR` |
| `flow-coherence-auditor` | `FLOW_AUDIT: PASS`, `FLOW_AUDIT: GAPS_FOUND`, `FLOW_AUDIT: BLOCKED`, `FLOW_AUDIT: ERROR` |
| `subagent-architecture-auditor` | `ARCHITECTURE_AUDIT: PASS`, `ARCHITECTURE_AUDIT: GAPS_FOUND`, `ARCHITECTURE_AUDIT: BLOCKED`, `ARCHITECTURE_AUDIT: ERROR` |
| `contract-priority-auditor` | `CONTRACT_AUDIT: PASS`, `CONTRACT_AUDIT: GAPS_FOUND`, `CONTRACT_AUDIT: BLOCKED`, `CONTRACT_AUDIT: ERROR` |
| `personality-auditor` | `PERSONALITY_AUDIT: PASS`, `PERSONALITY_AUDIT: GAPS_FOUND`, `PERSONALITY_AUDIT: BLOCKED`, `PERSONALITY_AUDIT: ERROR` |
| `package-hygiene-auditor` | `HYGIENE_AUDIT: PASS`, `HYGIENE_AUDIT: GAPS_FOUND`, `HYGIENE_AUDIT: BLOCKED`, `HYGIENE_AUDIT: ERROR` |
| `prompt-sufficiency-auditor` | `PROMPT_AUDIT: PASS`, `PROMPT_AUDIT: GAPS_FOUND`, `PROMPT_AUDIT: BLOCKED`, `PROMPT_AUDIT: ERROR` |
| `skill-definition-editor` | `EDIT: PASS`, `EDIT: BLOCKED`, `EDIT: ERROR` |
| `skill-package-validator` | `VALIDATION: PASS`, `VALIDATION: FAIL`, `VALIDATION: BLOCKED`, `VALIDATION: ERROR` |

Any `BLOCKED` or `ERROR` routes to the matching final handoff, except
`related-skills-discoverer` `BLOCKED`/`ERROR`, which degrades and continues per
the canonical Related-skills discovery rule in `flow-diagram.md`. Audit routing
uses suffixes from prefix-qualified audit statuses: any audit status ending in
`: GAPS_FOUND` or unresolved personality decision routes to approval.
`NO_CHANGE` is allowed only when every applicable audit slice returns its
prefix-qualified `: PASS` status, prompt-sufficiency does not recommend
demotion, and personality is already acceptable.

The `prompt-sufficiency-auditor` emits `PROMPT_AUDIT: GAPS_FOUND` when its
verdict is `radical simplification` or `prompt demotion`, and `PROMPT_AUDIT:
PASS` only when the verdict is `skill justified`.

## Critical Outputs

| Gate | Protects | Checker |
| ---- | -------- | ------- |
| `G_HANDOFF_COMPLETENESS` | Every user-facing handoff has required sections from `references/final-report-template.md` | Inline |
| `G_GAP_CLOSUR

Related in Design