agentleFS
Ar9avAr9av/game-exa/skills/refiner/SKILL.md

refiner

Skill4 starsChanged 7 months agoMITView on GitHub

Reads a structured QA failure report and the current source files, emits replacement file contents that fix the listed failures. Bounded — at most 3 iterations per generation pipeline. Use after playtester reports failures.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When qa/qa-report.json has passed === false and the orchestrator has not yet hit its 3-iteration cap.

    line 12
  2. Very specific:

    Don't modify files outside src/.

    line 28
  3. Very specific:

    If a failure is console-error: <X>, fix the cause — do not silence the log.

    line 30
  4. Very specific:

    If winCondition is unreachable, fix the level OR the code so the QA scenario can complete.

    line 31
  5. Very specific:

    Read the latest QA report from qa/qa-report.json.

    line 35
  6. Very specific:

    Read the GDD + manifest from game-state.json.

    line 36
  7. Very specific:

    Read all relevant source files under src/ (use scripts/collect_files.mjs <dir>).

    line 37
  8. Very specific:

    Run scripts/apply_fixes.mjs <project-dir> <fixes-json> — refuses paths outside src/.

    line 40
  9. Very specific:

    After every successful fix, call scripts/debug_library.mjs --add to record the lesson so future generations don't repeat the same mistake:

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Refiner

Apply targeted fixes to the codesmith's output based on structured QA failures. Conservative — patches the listed failures only, doesn't refactor.

When to use

When qa/qa-report.json has passed === false and the orchestrator has not yet hit its 3-iteration cap.

Output contract

Output ONLY a JSON object:

{
  "files": [
    { "path": "src/scenes/Game.js", "content": "<full new contents>" }
  ],
  "rationale": "<one short paragraph explaining the fixes>"
}
  • Provide full file contents, not patches.
  • Don't modify files outside src/.
  • Preserve the GameScene contract (init, create, scene-ready event, window.__gameState shape).
  • If a failure is console-error: <X>, fix the cause — do not silence the log.
  • If winCondition is unreachable, fix the level OR the code so the QA scenario can complete.

Process

  1. Read the latest QA report from qa/qa-report.json.
  2. Read the GDD + manifest from game-state.json.
  3. Read all relevant source files under src/ (use scripts/collect_files.mjs <dir>).
  4. Build context: failures, GDD essentials, manifest, current files.
  5. Produce the JSON.
  6. Run scripts/apply_fixes.mjs <project-dir> <fixes-json> — refuses paths outside src/.
  7. Re-invoke playtester (orchestrator's job, not yours).

Failure → fix recipe

Failure kindLikely causeFix to consider
boot-timeoutscene-ready never emitted, or asset 404Verify events.emit('scene-ready') at end of create(); verify manifest paths
exceptionRuntime JS errorRead message; locate file; correct
console-errorAsset 404, animation key missing, etc.Cross-check manifest
no-movement (walk-right Δx ≤ 0)Player blocked by wall, or input wiring wrongCheck spawn is on passable tile + body size; check input dispatch
no-jump (jumpDelta ≤ 0)Using isDown instead of JustDown for jump; or no ground beneath spawnSwitch to JustDown(SPACE); check b.blocked.down
screenshot-diff (≥ 5%)Visual regression OR genuine improvementInspect diff image; if intentional, run with --update-baselines
low-fpsToo many objects, missing cullingPool projectiles, cull off-screen
blank-canvasRender layer setup wrongConfirm tilemap layer created; confirm pixelArt config

Halt conditions

  • 3 iterations reached → halt, surface to user with the persistent failures.
  • Refiner output references a file outside src/ → reject, request resubmit.
  • Refiner output references a non-existent animation key → reject, request resubmit.

Persistent debug library

After every successful fix, call scripts/debug_library.mjs --add to record the lesson so future generations don't repeat the same mistake:

node scripts/debug_library.mjs --add "<symptom>" "<cause>" "<one-line fix>" [genre]
# e.g.
node scripts/debug_library.mjs --add \
  "Cannot read properties of null (reading 'setVelocity')" \
  "body accessed before physics world resolves the sprite" \
  "guard all body access with: if (!sprite.body) return;" \
  "any"

The library lives at ~/.game-creation-agent/debug-library.json. The codesmith reads the top entries on each generation to pre-empt known bugs. View library: node scripts/debug_library.mjs --list.

Scripts

  • scripts/collect_files.mjs <project-dir> — emits all .js/.mjs under src/ with contents.
  • scripts/apply_fixes.mjs <project-dir> <fixes-json> — safety-checked file writer.
  • scripts/debug_library.mjs --add <symptom> <cause> <fix> [genre] — record a fix.
  • scripts/debug_library.mjs --list — view all entries sorted by hit count.

References

  • references/failure-taxonomy.md — the canonical list of failure kinds and recipes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.