Turn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Skill Test Spec: /skill-improve
Skill Summary
/skill-improve [skill-name] runs one test → fix → retest → keep-or-revert
cycle on a single skill. It records a static baseline with
/skill-test static [name] (FAIL and WARN counts, and which of Checks 1–7
failed), then a category baseline with /skill-test category [name] when the
skill has a category: in studio-tests/catalog.yaml. If both
baselines are clean it stops with "No improvements needed." Otherwise it shows
a diagnosis, proposes before/after fixes, asks "May I write this improved
version to .claude/skills/[name]/SKILL.md?" (naming each references/ file
the fix changes too — a phase's fix goes in its references/ file), writes,
re-runs the same tests,
and shows a before → after comparison per dimension plus one combined line
(Combined: 3 → 0 (improved)).
Phase 6 compares the combined count (static FAILs + category FAILs + static
WARNs + category WARNs). Lower than baseline → "Score improved. Changes kept."
Same or worse → "Combined score did not improve." followed by "May I restore
.claude/skills/[name]/SKILL.md to the content it had before this run?" (naming every file Phase 5 wrote) — the
restore runs only on a yes, and writes back the copy recorded in Phase 5 (never
git checkout, which would also drop earlier uncommitted edits). No director gates apply.
Static Assertions (Structural)
Checked against the SKILL.md by /skill-test spec — no fixture needed.
- Has required frontmatter fields:
name,description,argument-hint,user-invocable,allowed-tools - Has ≥2 phase headings
- Phase 6 states both outcomes: "Score improved. Changes kept." and "Combined score did not improve."
- Contains "May I write" collaborative protocol language before applying fixes
- Has a next-step handoff (Phase 7:
/skill-test static all,/skill-improve [next-name],/skill-test audit)
Director Gate Checks
None. /skill-improve is a meta-utility skill. No director gates apply.
Fixture Defaults
Every case's project.yaml sets modes.rigor: minimal and
modes.automation: collaborative, with no project.local.yaml, unless its own
Fixture says otherwise. Rules: studio-tests/CLAUDE.md §
Fixture defaults.
Test Cases
Case 1: Happy Path — Check 4 FAIL and Check 5 WARN fixed, changes kept
Fixture:
.claude/skills/some-skill/SKILL.mdhasWriteinallowed-toolsbut no ask-before-write language (Check 4 FAIL) and no next-step section (Check 5 WARN)- catalog gives
some-skillcategory: utility; its category baseline is 1 FAIL (U1, because static checks fail) - The user approves the write; the re-test is clean in both dimensions
Input: /skill-improve some-skill
Expected behavior:
- Static baseline displayed: "Static baseline: 1 failures, 1 warnings" with "Failing: Check 4 (no ask-before-write), Check 5 (no handoff)"
- Category baseline displayed: "Category baseline: 1 failures, 0 warnings (utility rubric)"
- Full diagnosis shown before any change is proposed
- Before/after blocks proposed for only the failing parts; skill asks
"May I write this improved version to
.claude/skills/some-skill/SKILL.md?" - File written; both tests re-run; comparison shows
Static: Before 1 failures, 1 warnings → After 0 failures, 0 warnings, the category line, and one combined line,Combined: 3 → 0 (improved) - "Score improved. Changes kept." with a per-dimension summary
Assertions:
- Static and category baselines are displayed before any change is proposed
- Both Check 4 and Check 5 are diagnosed and addressed in the proposed fix
- "May I write" is asked before the file is written
- The before → after comparison is shown for both dimensions, plus the single line
Combined: 3 → 0 (improved) - Outcome is "Score improved. Changes kept."
Case 2: Fix Causes Regression — revert offered, runs only on yes
Fixture:
.claude/skills/some-skill/SKILL.mdhas a static baseline of 0 FAILs and 1 WARN (Check 5, no handoff)- The applied fix adds a handoff but deletes the section holding the verdict keywords and the ask-before-write line: the static re-test shows 2 FAILs (Checks 3 and 4), and the category result is no better than its baseline — the combined count rises
- The user approves the write, then answers yes to the revert
Input: /skill-improve some-skill
Expected behavior:
- Baseline recorded; fix proposed; "May I write …" approved; file written
- The re-test comparison's combined line reads
Combined: [before] → [after] (worse), with the after count higher; the after figures are what the re-run of/skill-test static some-skillmeasured, not what the edit was meant to achieve (the added handoff is not counted as clearing Check 5 unless the re-run says so) - Skill reports "Combined score did not improve." and shows what changed and why it may not have helped
- Skill asks "May I restore
.claude/skills/some-skill/SKILL.mdto the content it had before this run?" - On yes: writes the Phase 5 copy back with Write — it does not run
git checkout
Assertions:
- Re-test combined count is compared to the baseline before finalizing
- A higher combined count takes the "did not improve" branch
- The after score is read from the re-run of
/skill-test static, never stated from the edit: the re-run is visible in the transcript, and the displayed after counts match its result (2 FAILs), not the 0 FAILs the edit aimed for - The revert is asked for, not automatic
- The file is restored only after the user says yes, from the recorded copy — never via
git checkout - "Score improved. Changes kept." is NOT reported
Case 3: Gate Skill — combined static + category baseline
Fixture:
- A sandbox copy of the live
gate-checkskill (itsSKILL.mdand all 12references/files), with three planted defects — the live skill is clean, so the case never depends on its current state:SKILL.mdfrontmatter has noargument-hint:line (static Check 1 FAIL)references/4-assessment.mdhas no "Name the omissions in the output" paragraph (G2 FAIL — a narrow panel no longer names who was left out)references/4-assessment.mdhas itssolobullet changed to "run the panel" (G4 FAIL — directors spawn in solo mode)
- G2 and G4 are the
### gatemetrics instudio-tests/quality-rubric.md - catalog gives
gate-checkcategory: gate; the user approves the write, and the re-test is clean in both dimensions
Input: /skill-improve gate-check
Expected behavior:
- Static baseline and category baseline (
gate rubric) both recorded - Diagnosis names the static check and the two G-metrics with the exact text gap for each
- The Check 1 fix goes in
SKILL.md; the G2 and G4 fixes go inreferences/4-assessment.md, not back intoSKILL.md - The write question names both files: "May I write this improved version to
.claude/skills/gate-check/SKILL.mdand.claude/skills/gate-check/references/4-assessment.md?" - Both
/skill-test static gate-checkand/skill-test category gate-checkre-run - The comparison ends
Combined: 3 → 0 (improved): "Score improved. Changes kept."
Assertions:
- Both static and category scores are captured in the baseline
- The combined count (FAILs + WARNs, both dimensions) is what Phase 6 compares
- All 3 failures are addressed in the proposed fix
- Each fix lands in the file that holds the failing text — the phase fixes in
references/4-assessment.md - The write question names every file the fix changes, not only
SKILL.md - Both test types are re-run after the write
- Outcome is "Score improved. Changes kept." with the combined before/after
Case 4: Skill Already Clean — No improvements needed
Fixture:
.claude/skills/some-skill/SKILL.mdis written for the case to pass all 7 static checks with no WARN: the five frontmatter fields, anargument-hintthat matches its documented modes, three## Phase Nheadings, aPASS/FAILverdict,Writeinallowed-toolswith "May I write" before it, a closing next-step section naming/skill-test, and nocontext: fork- catalog gives
some-skillcategory: utility; U1 and U2 both pass - A purpose-built skill, not a live one such as
brainstorm: whether a live skill is clean today can only be known by running/skill-test, so it is not a fixed fixture
Input: /skill-improve some-skill
Expected behavior:
- Static baseline 0/0 → proceeds to the category baseline (not an immediate stop)
- Category baseline 0/0 (utility rubric)
- Skill stops: "This skill already passes all static and category checks. No improvements needed."
- No diagnosis, no proposed change, no "May I write", no file modified
Assertions:
- The category baseline is run before stopping (a clean static result alone does not stop)
- "No improvements needed" message is shown
- No changes are proposed
- No "May I write" is asked and no file is modified
Case 5: Director Gate Check — No gate; skill-improve is a meta utility
Fixture:
.claude/skills/some-skill/SKILL.mdhas at least 1 static failure; the user approves the write
Input: /skill-improve some-skill
Expected behavior:
- Skill runs the test-fix-retest loop
- No director agents are spawned
- No gate IDs appear in output
Assertions:
- No director gate is invoked
- No gate skip messages appear
- The run ends with one of Phase 6's two outcome messages — no gate verdict
Case 6: Equal Score — "no change" does not keep the fix as an improvement
Fixture:
.claude/skills/some-skill/SKILL.mdhas a static baseline of 0 FAILs and 1 WARN (Check 7, argument hint does not match the documented modes)- catalog gives
some-skillnocategory:, so category checks are skipped - The applied fix corrects the hint but drops the closing next-step section: the re-test shows 0 FAILs and 1 WARN (Check 5)
- The user approves the write, then answers no to the restore
Input: /skill-improve some-skill
Expected behavior:
- "Category: not yet assigned — skipping category checks." is shown
- The comparison's combined line reads
Combined: 1 → 1 (no change) - An equal count takes the "did not improve" branch: "Combined score did not
improve.", then "May I restore
.claude/skills/some-skill/SKILL.mdto the content it had before this run?" - On no, the file is left as written and nothing is restored
Assertions:
- An equal combined count is treated as "did not improve", not as improved
- The combined line reads
Combined: 1 → 1 (no change) - "Score improved. Changes kept." is NOT reported
- The restore is asked for, and declining it leaves the written file in place
Case 7: Split Skill Regression — every file named, recorded and restored
Fixture:
- A purpose-built skill
.claude/skills/split-skill/withSKILL.mdand two files inreferences/:1-gather.mdand2-report.md. Thereferences/files hold the phases' steps;SKILL.mdholds the frontmatter and the phase list - Static baseline: 0 FAILs and 2 WARNs — Check 7 in
SKILL.md(theargument-hintdoes not match the documented modes) and Check 5 inreferences/2-report.md(the closing phase has no next-step section). The verdict keywords and the "May I write" line both live inreferences/2-report.md - catalog gives
split-skillnocategory:, so category checks are skipped - The fix changes
SKILL.md(the hint) andreferences/2-report.md, but the rewrite of2-report.mddrops its verdict line and its "May I write" line and adds only a bare "Next steps" heading: the re-test shows 2 FAILs (Checks 3 and 4) and 1 WARN (Check 5), so the combined count rises from 2 to 3 references/1-gather.mdis not changed by the fix- The user approves the write, then answers yes to the restore
Input: /skill-improve split-skill
Expected behavior:
- Phase 3 reads
SKILL.mdand every file inreferences/(1-gather.mdand2-report.md) before diagnosing - The diagnosis names the file each gap is in: Check 7 in
SKILL.md, Check 5 inreferences/2-report.md - The proposed fix puts the hint change in
SKILL.mdand the closing-phase change inreferences/2-report.md; the write question names both files and not1-gather.md - Before writing, the current text of both changed files is recorded; both are then written
- The re-run measures the new score; the comparison ends
Combined: 2 → 3 (worse), and the skill reports "Combined score did not improve." - The restore question names every file Phase 5 wrote: "May I restore
.claude/skills/split-skill/SKILL.mdand.claude/skills/split-skill/references/2-report.mdto the content they had before this run?" - On yes: the recorded text of each file is written back with Write; no
git checkout;1-gather.mdis not touched
Assertions:
- Both
references/files are read during the diagnosis, not onlySKILL.md - Each diagnosed gap names the file it is in (
SKILL.mdfor Check 7,references/2-report.mdfor Check 5) - The phase fix is written to
references/2-report.md, not folded back intoSKILL.md - The text of every file the fix changes is recorded before the first write: both
SKILL.mdandreferences/2-report.md - The after score comes from the re-run of
/skill-test static split-skill, not from the edit's intent - The restore question names both files the run wrote, and not
references/1-gather.md - After the yes, both files hold exactly their pre-run text, and
references/1-gather.mdwas never written - The restore uses the recorded copy, never
git checkout
Protocol Compliance
- Always establishes a baseline before proposing any changes
- Shows the full diagnosis, then before/after blocks, before asking to write
- Asks "May I write" before applying any fix
- Detects a non-improvement by comparing the re-test combined count to the baseline — an equal count is a non-improvement
- Shows one combined before → after line, e.g.
Combined: 3 → 0 (improved), beside the per-dimension lines - Asks for user confirmation before reverting (not automatic)
- Ends with "Score improved. Changes kept." or "Combined score did not improve." — or stops earlier with "No improvements needed." / a declined write
Coverage Notes
- One fix-retest cycle per invocation; a further pass needs a new
/skill-improverun. - Behavioral (spec-mode) results are not part of the loop — only static and category scores are.
- The Phase 1 stops — usage text when no argument is given, "Skill '[name]' not
found." when no
SKILL.mdexists — and the user declining the write in Phase 4 are not separately fixture-tested.