with one click
game-refactor
// Batch refactor code quality for Godot projects after testing with parallel analysis and GDScript-aware patterns. Use with /game-refactor after /game-verify.
// Batch refactor code quality for Godot projects after testing with parallel analysis and GDScript-aware patterns. Use with /game-refactor after /game-verify.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | game-refactor |
| description | Batch refactor code quality for Godot projects after testing with parallel analysis and GDScript-aware patterns. Use with /game-refactor after /game-verify. |
| reads | ["feature.build","feature.tests","backlog.stage"] |
| writes | ["feature.refactor","backlog.stage"] |
| metadata | {"author":"mileszeilstra","version":"1.3.0","category":"game"} |
Optional quality step on completed features. Not a status-gate â features are DONE after /game-verify. This skill improves code structure, naming, and patterns on already-finished features.
Batch-first architecture: analyzes ALL features in parallel via Explore agents, triages clean vs dirty, generates GDScript-aware refactor patterns via Context7, creates one combined plan with one approval, and applies changes with per-feature rollback.
Trigger: /game-refactor or /game-refactor {feature-name}
This skill ONLY refactors files that belong to the feature.
feature.json â files[] â these are the pipeline filesscripts/, scenes/, resources/, tests/utils/ script). Existing external files may NEVER be modified.This rule exists because refactoring external files risks breaking other features and creates unpredictable side effects.
/game-verify completes (features in DONE status).project/features/{name}/feature.json exists with tests sectionReads .project/features/{feature-name}/feature.json: requirements, files, build, tests sections.
.project/features/{feature-name}/
âââ feature.json # Enriched with refactor section (status, improvements, decisions)
.claude/research/
âââ architecture-baseline.md â EXISTING: Godot patterns, scene architecture, conventions
â Read in FASE 2 for research decision
â
âââ refactor-patterns.md â NEW: GDScript-specific code smells & anti-patterns
Generated via Context7 on first refactor
Reused on subsequent refactors
architecture-baseline.md = "how to use Godot/GDScript correctly" (conventions) refactor-patterns.md = "what mistakes to look for in GDScript code" (anti-patterns)
Fase tracking â eerste actie van de skill: roep TaskCreate aan met deze 6 items (status pending), daarna gebruik TaskUpdate om per fase in_progress te zetten aan begin en completed aan einde. Bij context compaction blijft de task list zichtbaar â geen risico op vergeten fases.
Todo: roep
TaskCreateaan met de 6 fase-items (zie boven). Markeer FASE 0 âin_progressviaTaskUpdate.
Read backlog for pipeline status:
Read .project/backlog.html (if exists), parse JSON uit <script id="backlog-data"> blok (zie shared/BACKLOG.md):
data.features.filter(f => f.status === "DONE").project/features/{name}/feature.json for existing refactor sectieunrefactored (no refactor section) vs refactored (has refactor section)Determine feature queue:
a) Feature name provided (/game-refactor water-ability):
.project/features/[water-ability] (regardless of refactor status)b) No feature name (/game-refactor):
c) "recent": find most recently modified feature.json with tests section, queue = [that feature]
Codebase mode ("Hele codebase"):
src/, scripts/, of scene directories uit project.json of CLAUDE.md).godot/, .project/, addons/gut/, test files.project/session/codebase-refactor.jsonrefactor(codebase): {summary}Worktree switch (single-mode only):
Als feature_queue.length == 1 en niet in codebase-mode: voer de procedure in shared/WORKTREE.md uit met de feature-name. Switcht automatisch naar worktree-{feature-name} als die bestaat. Bij FAIL: stop met de melding uit WORKTREE.md.
Batch-mode (queue > 1) of codebase-mode: skip â blijf op main, refactor over al-gemergede code.
Load feature.json for every feature in queue:
For each feature, read feature.json. Extract:
requirements[] for requirements and architecturefiles[] for implementation details and file listtests.checklist[] for playtest itemstests section for verification resultsValidate feature.json exists with tests section for each feature. If any missing â remove from queue and warn.
Build pipeline files list per feature:
For each feature, extract all code file paths from feature.json â files[]:
files[].path from feature.jsonscripts/, scenes/, resources/, tests/pipeline_files[feature_name]Load project conventions + learnings (voor Explore agent context):
Read .project/project-context.json (als bestaat) â extract context.patterns.
Sla op als PROJECT_CONVENTIONS voor injectie in Explore agent prompts (FASE 1).
Learnings load via shared/LEARNINGS-LOAD.md:
scopes: [component]
pitfall-prefix: true
current-feature: <feature-name als feature-mode, anders "none">
Sla op als KNOWN_PITFALLS voor injectie in Explore agent prompts (FASE 1) â voorkomt herintroductie van bekende Godot/GDScript bugs en helpt agents onderscheid maken tussen "intentioneel project pattern" en "code smell".
Load or generate refactor-patterns.md:
IF .claude/research/refactor-patterns.md exists:
â Load cached patterns, skip Context7
â Log: "Refactor patterns loaded (cached)"
IF NOT exists:
â Context7 resolve-library-id for Godot/GDScript
â Context7 query-docs:
"Common code smells, anti-patterns, and refactoring opportunities
in GDScript/Godot 4 projects. Focus on: performance pitfalls,
signal misuse, scene tree anti-patterns, memory leaks, and
code organization issues."
â Compile results into .claude/research/refactor-patterns.md
â Log: "Refactor patterns generated via Context7 (Godot/GDScript)"
Format for refactor-patterns.md:
# Refactor Patterns
<!-- Generated via Context7 for: Godot 4.x / GDScript -->
<!-- Regenerate: delete this file and run /game-refactor -->
## Performance Anti-patterns
- {pattern}: {description} â {what to look for in code}
## Signal Anti-patterns
- {pattern}: {description} â {what to look for in code}
## Scene Tree Anti-patterns
- {pattern}: {description} â {what to look for in code}
## Memory Management Anti-patterns
- {pattern}: {description} â {what to look for in code}
## Code Organization Anti-patterns
- {pattern}: {description} â {what to look for in code}
Output:
BATCH CONTEXT LOADED
| Metric | Value |
|--------|-------|
| Features in queue | {N} |
| Total pipeline files | {sum across all features} |
| Refactor patterns | {cached / generated via Context7} |
Features:
{for each feature:}
- {name}: {M} pipeline files
â Starting parallel analysis...
Capture git baseline (for scoped commit at end of skill):
mkdir -p .project/session
git status --porcelain | sort > .project/session/pre-skill-status.txt
echo '{"feature":"{feature-name}","skill":"refactor","startedAt":"{ISO timestamp}"}' > .project/session/active-{feature-name}.json
Todo: markeer FASE 0 â
completed, FASE 1 âin_progress.
Goal: Analyze ALL features in parallel, then triage into CLEAN vs HAS_FINDINGS.
Launch ALL Explore agents IN PARALLEL (1 per feature, max 10 concurrent):
For each feature, launch a Task agent (Explore) with this prompt:
Feature: {feature-name}
Pipeline files:
{list of all pipeline_files paths for this feature}
PROJECT CONVENTIONS:
{PROJECT_CONVENTIONS from FASE 0 step 5, of "niet beschikbaar"}
Lees ALLE bovenstaande pipeline files. Scan voor:
1. UNIVERSEEL (altijd scannen):
SECURITY:
- Injection: OS.execute, ClassDB abuse
- Unsafe deserialization: var_to_str/str_to_var with untrusted input
- Path traversal in file operations
DRY violations (ALLEEN binnen pipeline files):
- Duplicate code blocks (>5 lines identiek)
- Vergelijkbare logica patronen (>70% gelijkheid)
- Herhaalde conditionals, copy-paste
- Extract opportunities (zelfde code in 3+ locaties)
OVER-ENGINEERING:
- Helpers die maar 1x gebruikt worden
- >3 indirectie-niveaus voor simpele operaties
- Premature optimization (complexe caching voor non-hot paths)
- Over-defensive code (try/catch rond code die niet kan falen)
- Abstract base classes met maar 1 implementatie
CLARITY:
- Onnodige nesting (>3 niveaus diep)
- Dense one-liners die readability opofferen voor beknoptheid
- Slechte variabele/functienamen (single-letter, misleidend, te generiek)
- Overbodige comments die obvious code beschrijven
- "Clever" code die moeilijk te begrijpen is
- Inconsistentie met PROJECT CONVENTIONS (hierboven) of CLAUDE.md
2. GODOT-SPECIFIEK (altijd scannen):
SIGNALS:
- Unused signals (signal declared but never emitted)
- Signal spaghetti (signals connected to signals connected to signals)
- Missing disconnect() for dynamically connected signals
- Using strings for signal names instead of signal references
SCENE TREE:
- Orphaned @onready references (node path doesn't exist in scene)
- Deep nesting in scene tree (>5 levels)
- Direct node path references (brittle: $"../../SomeNode")
- Accessing nodes before _ready()
MEMORY:
- Missing queue_free() for dynamically created nodes
- Resource leaks (preload vs load misuse)
- Circular references preventing garbage collection
- Large resources loaded but never freed
PERFORMANCE:
- _process() / _physics_process() with heavy calculations
- Unnecessary per-frame allocations (Array/Dictionary creation in _process)
- Missing set_process(false) when idle
- Redundant get_node() calls in loops
TYPED GDSCRIPT:
- Missing type hints on function parameters
- Missing return type declarations
- Untyped variables where type is obvious
- Using Variant where concrete type is known
STATE MACHINES:
- Giant match statements without state pattern
- State transitions without exit/enter callbacks
- Shared mutable state between states
3. STACK-SPECIFIEK (uit refactor-patterns):
{injected patterns from refactor-patterns.md}
4. BALANCE (NIET rapporteren als finding):
- Abstracties die meerdere keren hergebruikt worden
- Expliciete signal connections voor clarity
- Benoemde constanten zelfs als ze maar 1x gebruikt worden
- Typed variables voor readability
- Voorkeur voor explicit boven compact â meer regels is OK als het duidelijker is
5. ASSET GEZONDHEID (lichtgewicht check):
- Texturen groter dan nodig (bijv. 2048x2048 voor een kleine sprite)
- Ongecomprimeerde audio bestanden (.wav waar .ogg volstaat)
- Scenes met excessieve node counts (>50 nodes voor simpele features)
- Missing LOD op 3D meshes (indien van toepassing)
- Ongebruikte resources in scene (preload/load zonder referentie)
Rapporteer als ASSET_FINDINGS (of "Geen asset issues gevonden").
Alleen flaggen als het een concreet probleem is, niet als theoretisch risico.
6. ARCHITECTUUR overzicht:
- Welke Godot features/systems worden gebruikt
- Belangrijkste patterns (state machines, signals, autoloads, etc.)
- Scene composition patterns
Geef terug als gestructureerd overzicht:
ANALYSIS_START
FEATURE: {feature-name}
STATUS: CLEAN | HAS_FINDINGS
ARCHITECTURE:
Godot systems: {lijst van gebruikte systems}
Patterns: {lijst van architectuurpatronen}
Scene structure: {high-level scene composition}
SECURITY_FINDINGS:
- {file:line} {pattern} â {beschrijving} â Before: {code snippet}
(of "Geen security issues gevonden")
DRY_FINDINGS:
- {file:line} â {file:line} {type} â {beschrijving} â Code: {snippet}
(of "Geen DRY violations gevonden")
OVERENGINEERING_FINDINGS:
- {file:line} {type} â {beschrijving} â Code: {snippet}
(of "Geen over-engineering gevonden")
GODOT_SPECIFIC_FINDINGS:
- {file:line} {category} {pattern} â {beschrijving} â Code: {snippet}
(of "Geen Godot-specifieke issues gevonden")
CLARITY_FINDINGS:
- {file:line} {type} â {beschrijving} â Code: {snippet}
(of "Geen clarity issues gevonden")
ASSET_FINDINGS:
- {file} {type} â {beschrijving} (bijv. "texture 2048x2048 voor 32px sprite")
(of "Geen asset issues gevonden")
BALANCE_SKIPPED:
- {file:line} {type} â {reden waarom dit NIET als finding is opgenomen}
(optioneel â alleen als er items bewust gefilterd zijn)
POSITIVE_OBSERVATIONS:
- {wat al goed is in de codebase}
ANALYSIS_END
Parsing agent results:
For each completed Explore agent:
ANALYSIS_START â parse directlyANALYSIS_START visible):
ANALYSIS_START in the output fileCLEAN or HAS_FINDINGSTriage results:
Classify each feature:
CLEAN features â early-exit, skip FASE 2-4 entirely.
If ALL features are CLEAN â jump directly to FASE 5 (batch completion, no user approval needed).
Output:
PARALLEL ANALYSIS COMPLETE
| Feature | Pipeline Files | Status | Findings |
|---------|---------------|--------|----------|
| {name1} | {N} | CLEAN | 0 |
| {name2} | {M} | HAS_FINDINGS | {X} |
| ... | ... | ... | ... |
Summary: {clean_count} clean, {findings_count} with findings
{if all clean:}
â All features clean! Skipping to completion...
{if has findings:}
â Proceeding with {findings_count} feature(s) to research decision...
Todo: markeer FASE 1 â
completed, FASE 2 âin_progress.
Goal: One research decision for all affected features combined (not per-feature).
Steps:
Aggregate architecture info from all HAS_FINDINGS features:
Read architecture baseline:
.claude/research/architecture-baseline.md (if exists)Decide: is Context7 research needed?
| Signal | Research needed? |
|---|---|
| Architecture baseline + refactor-patterns cover all systems | NO |
| Findings are concrete, directly actionable | NO |
| Complex Godot system usage not in baseline (shaders, networking, etc.) | YES â research those systems |
| Advanced signal/scene patterns | YES â research Godot patterns |
| No architecture baseline exists at all | YES â research core Godot patterns |
If research NOT needed â proceed directly to FASE 3.
If research needed â spawn one Explore agent (subagent_type: Explore, thoroughness: "very thorough") to research Godot patterns in an isolated context. This keeps Context7 results out of the main session.
Determine which research domains to include based on findings:
| Domain | Include when |
|---|---|
| Godot patterns | Complex scene architecture, signal design, state machines |
| Performance | _process bottlenecks, physics optimization, draw calls |
| Resource management | Memory management, resource loading strategies |
Agent prompt â include only domains identified as needed:
Research Godot 4.x best practices for a refactoring task.
Architecture baseline: {from architecture-baseline.md, or "none"}
Aggregated analysis:
{ANALYSIS_START..ANALYSIS_END blocks from all HAS_FINDINGS features}
{If godot patterns domain needed:}
GODOT PATTERNS:
- resolve-library-id for Godot â query-docs
- Focus: scene composition, signal patterns (signals up, methods down), state machines, component pattern, typed GDScript
{If performance domain needed:}
PERFORMANCE:
- Focus: _process vs _physics_process optimization, draw call reduction, physics layer usage, object pooling
{If resource management domain needed:}
RESOURCE MANAGEMENT:
- Focus: ResourceLoader, preload vs load, custom Resources, memory management, scene instancing
Also read: skills/game-build/techniques/architecture-decisions.md for decision tree context.
RETURN FORMAT:
RESEARCH_START
Godot patterns: {3-5 bullet points: scene architecture, signals, state machines}
Performance: {3-5 bullet points: optimization patterns, bottleneck fixes}
Resource management: {3-5 bullet points: loading strategies, memory patterns}
RESEARCH_END
Only include sections for domains you were asked to research.
If uncovered patterns found â also update refactor-patterns.md:
Output:
Parse the agent's RESEARCH_START...END block. Display:
RESEARCH DECISION
| Source | Coverage |
|--------|----------|
| architecture-baseline.md | {list of documented patterns} |
| refactor-patterns.md | {list of covered anti-patterns} |
| Uncovered | {list or "none"} |
{if no research:}
Research: Skipped (existing knowledge sufficient)
{if research:}
Research: Explore agent ({domains researched})
Refactor patterns updated: {yes/no}
â Ready for combined plan.
Todo: markeer FASE 2 â
completed, FASE 3 âin_progress.
Goal: One plan combining ALL findings from ALL affected features, one user approval.
Steps:
Create ranked improvements list:
Combine all findings from all HAS_FINDINGS features:
Present improvements with before/after code:
REFACTOR PLAN ({N} features, {M} improvements)
HIGH: [X] improvements (security, memory leaks)
MED: [Y] improvements (performance, DRY, signals, scene tree)
LOW: [Z] improvements (clarity, typing, code quality)
-- {feature-1} --
1. HIGH {file}:{line} â {issue} â {fix}
Before: {code snippet}
After: {proposed change}
2. MED {file}:{line} â {issue} â {fix}
Before: {code snippet}
After: {proposed change}
-- {feature-2} --
3. MED {file}:{line} â {issue} â {fix}
...
ââââââââââââââââââ
Files to be modified: [count]
- {file1} ([N] changes) â {feature}
- {file2} ([M] changes) â {feature}
Per-feature rollback: YES (feature A succeeds, B fails â only B rolled back)
Ask for scope (1 AskUserQuestion for all features):
Use AskUserQuestion tool:
If "Per feature kiezen" â show per-feature AskUserQuestion with multiSelect:
Only approved features proceed to FASE 4. Non-selected features get CLEAN status.
The user can also type "Annuleren" via the built-in "Other" option â EXIT with "Refactor geannuleerd door gebruiker"
Todo: markeer FASE 3 â
completed, FASE 4 âin_progress.
Goal: Apply approved improvements and test, with per-feature rollback isolation.
Priority order for each feature (execute in this sequence):
Steps:
Initialize change tracking:
git rev-parse HEAD # Store as saved_hash for global rollback
For each feature with approved improvements:
a. Track files for targeted rollback:
Initialize empty lists: modified_files[feature_name] = [], created_files[feature_name] = []
b. Apply improvements using Edit tool:
modified_files[feature_name] = [list of existing files changed]created_files[feature_name] = [list of new files created]c. Run GUT test suite after this feature's changes:
Run GUT tests: godot --headless --script addons/gut/gut_cmdln.gd
All pass â mark feature as APPLIED, continue to next feature
Any fail â analyze before rollback:
| Test failure type | Action |
|---|---|
| Test expects old behavior that was intentionally improved | Update test, re-run |
| Genuine regression (broke unrelated functionality) | Rollback THIS feature only |
| Flaky or environment-dependent | Re-run once, then decide |
If test update needed:
Per-feature rollback (only this feature, not others):
git checkout -- {modified_files[feature_name]}
rm -f {created_files[feature_name]}
Mark feature as ROLLED_BACK with reason. Continue to next feature.
d. Report per feature:
â {feature-name}: {N} improvements applied
or:
â {feature-name}: rolled back ({reason})
Non-breaking rule:
Output:
IMPROVEMENTS APPLIED
| Feature | Status | Improvements | Files Modified |
|---------|--------|-------------|----------------|
| {name1} | APPLIED | {N} | {M} |
| {name2} | APPLIED | {N} | {M} |
| {name3} | ROLLED_BACK | 0 | 0 ({reason}) |
â Documenting results...
Todo: markeer FASE 4 â
completed, FASE 5 âin_progress.
Goal: Proportional documentation, single backlog update, single commit.
Write feature.json per feature (read-modify-write):
For each feature:
Read .project/features/{feature-name}/feature.json
Add refactor section:
For CLEAN features:
{
"refactor": {
"status": "CLEAN",
"improvements": {},
"decisions": [],
"positiveObservations": ["..."],
"failureAnalysis": null,
"pendingImprovements": []
}
}
For REFACTORED features:
{
"refactor": {
"status": "REFACTORED",
"improvements": {
"security": [{ "file": "...", "issue": "...", "fix": "..." }],
"performance": [],
"signals": [],
"dry": [],
"clarity": []
},
"decisions": [{ "decision": "...", "rationale": "..." }],
"positiveObservations": ["..."],
"failureAnalysis": null,
"pendingImprovements": []
}
}
For ROLLED_BACK features:
{
"refactor": {
"status": "ROLLED_BACK",
"improvements": {},
"decisions": [],
"positiveObservations": [],
"failureAnalysis": "...",
"pendingImprovements": ["..."]
}
}
Update top-level status:
"DONE", "shipped": true, "shippedAt": <ISO-date>, "shippedSha": <git-sha na auto-commit>"DONE" (refactor.status documenteert de rollback), geen shipped-veldenWrite feature.json back (do NOT overwrite other sections)
Als N > 1 features: lees alle feature.json parallel, muteer elk in memory, schrijf alle parallel terug.
Parallel sync (backlog + dashboard + conditionele context sync):
Lees parallel (skip als niet bestaat):
.project/backlog.html.project/project.json.project/project-context.jsonMuteer in memory:
Backlog (zie shared/BACKLOG.md): status blijft "DONE" voor alle features (CLEAN, REFACTORED, en ROLLED_BACK). Zet per feature het refactor veld:
f.refactor = "REFACTORED", f.shipped = true, f.shippedAt = <ISO-date>, f.shippedSha = <git-sha>, verwijder transition (als aanwezig) (rendert â badge in DONE-kolom)f.refactor = "ROLLED_BACK", verwijder transition (als aanwezig) (rendert â badge)Zet data.updated naar huidige datum.
Dashboard (zie shared/DASHBOARD.md): ongewijzigd â er is geen aparte dashboard merge in game-refactor anders dan feature status.
Learning extraction gebeurt alleen in /game-verify. Refactor-inzichten worden hier vastgelegd in feature.json.refactor â geen learnings[] append.
Context sync (conditioneel) â alleen als REFACTORED features structurele wijzigingen bevatten:
Trigger als ANY: scripts hernoemd/verplaatst, nieuwe scripts via extractie, scene structure fundamenteel gewijzigd, autoload/singleton patterns gewijzigd. Skip als: alleen interne code quality (naming, DRY, type hints, clarity), performance zonder structurele impact.
Wanneer getriggerd (in project-context.json mutatie):
context.structure â overwrite full tree met gewijzigde script pathscontext.patterns â merge gewijzigde patternscontext.updated â huidige datumarchitecture.components â update bestaande componenten (status, src, test, connects_to), voeg nieuwe toe als scenes/signals zijn hernoemd/gesplitst. Volg component-first model uit shared/DASHBOARD.md.context: {N} updates ({keys touched}) of context: no updates neededSchrijf parallel terug:
backlog.html (keep <script> tags intact)project.jsonproject-context.json (als context/architecture/learnings gewijzigd)Scoped auto-commit (only this skill's changes):
Compare current git status with baseline from FASE 0:
git status --porcelain | sort > /tmp/current-status.txt
Categorize files by comparing with .project/session/pre-skill-status.txt:
git add automaticallyIf baseline file doesn't exist, fall back to git add -A.
git commit -m "$(cat <<'EOF'
refactor(batch): {summary}
{N} features analyzed, {clean} clean, {refactored} refactored, {rolled_back} rolled back
{for each REFACTORED feature:}
- {feature}: {improvement count} improvements ({categories})
{for each CLEAN feature:}
- {feature}: clean (no changes needed)
{for each ROLLED_BACK feature:}
- {feature}: rolled back ({reason})
EOF
)"
For single-feature commits, use:
refactor({feature}): {summary}
Clean up: rm -f .project/session/pre-skill-status.txt .project/session/active-{feature-name}.json /tmp/current-status.txt
3b. Feature archivering (alleen features met feature.json, niet kleine items zonder pipeline):
Voor elke CLEAN of REFACTORED feature waarvan .project/features/{name}/feature.json bestaat:
mkdir -p .project/features/archive
mv .project/features/{name}/ .project/features/archive/{shippedAt-date}-{name}/
{shippedAt-date} = datum uit het zojuist geschreven shippedAt veld (YYYY-MM-DD formaat)Show completion:
âââââââââââââââââââââââââââââââââââââââââââ
REFACTOR COMPLETE
{N} feature(s) processed:
{for each CLEAN feature:}
â {name} â clean (no changes needed)
{for each REFACTORED feature:}
â {name} â {improvement-count} improvements applied
{for each ROLLED_BACK feature:}
â {name} â rolled back ({reason})
Refactoring complete. Features remain in DONE status.
Next steps:
1. /game-define {next-feature} â volgende feature uit backlog
2. /project-plan â backlog herzien als scope gewijzigd is
âââââââââââââââââââââââââââââââââââââââââââ
Worktree integration hint â voeg ÊÊn extra regel toe aan het completion-blok als beide voorwaarden waar zijn:
worktree-* pattern (git branch --show-current)Append:
đĄ Run /core-merge {feature-name} om te integreren naar main/develop
Todo: markeer FASE 5 â
completed.
No features found â exit: "Run /game-define and /game-build first" No test results for any feature â exit: "Run /game-verify first" Some features missing test results â remove from queue, warn, continue with rest Feature.json missing files[] â skip feature, warn: "No code files found in feature.json for {feature}"
Context7 unavailable â skip refactor-patterns generation, proceed with universal + Godot-specific patterns only Partial Context7 results â generate refactor-patterns.md with available data, note gaps
Explore agent fails for a feature â skip that feature, warn, continue with rest All Explore agents fail â exit: "Analysis failed â try again or run on a single feature" Agent output truncated â use Grep/Read to find ANALYSIS_START..ANALYSIS_END block
GUT tests fail after refactoring a feature â per-feature rollback, continue with next feature GUT not installed â ask user which test command to run Tests hang â kill process, rollback current feature
git checkout fails for feature files â report manual recovery steps:
saved_hash from FASE 4 step 1modified_files[feature_name] and created_files[feature_name]/rewind in Claude Code om terug te gaan naar een eerder punt"This skill must NEVER:
This skill must ALWAYS:
.project/project.json, and .project/project-context.json for project-specific conventions during analysis