一键导入
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Appliquer les règles de développement et la mémoire technique durable de gba_translator/Pokémon Unbound. Utiliser pour toute tâche dans ce dépôt, notamment avant de planifier, modifier, tester, déboguer ou relire le pipeline ROM, les traductions FR/IT/DE, l'encodage CFRU, les patchs binaires, l'émulateur mGBA ou le workflow Git.
Use when fixing any bug or patch script in gba_translator — before closing the ticket, verify the fix does not break (or silently already affects) the other registered languages (FR/IT/DE/Indie). Covers deciding whether a change is shared or per-language, which test paths and rebuild targets to run, and how to check a base-ROM quirk against every language.
Use when building or rebuilding the French ROM of Pokémon Unbound end-to-end — from a translation_ready.json through make build-fr, the post-build patch chain, and validation.
Use before any new feature, pipeline change, or architectural decision — explores intent and design before implementation
Review a diff against project rules and acceptance criteria before merging
Use when implementing any feature or bugfix, before writing implementation code
| name | systematic-debugging |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes |
| when_to_use | Any bug, failing test, encoding error, pointer corruption, or unexpected ROM output |
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
Project rule: 100% test pass rate required. Any failure demands root cause investigation, not a skip.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes.
You MUST complete each phase before proceeding to the next.
BEFORE attempting ANY fix:
Read Error Messages Carefully
Reproduce Consistently
pytest tests/unit/test_<module>.py::test_name -v -s
Check Recent Changes
git diff HEAD~1
git log --oneline -5
Gather Evidence in Multi-Layer Pipeline
The gba_translator pipeline layers: ROM → Pointer → Decoder → Injector → Validator → IPS patch
For each layer, log what enters and exits:
# Print raw bytes before decode
print(f"raw bytes: {data.hex()}")
# Print decoded text
print(f"decoded: {repr(text)}")
# Print re-encoded bytes
print(f"re-encoded: {encoded.hex()}")
Identify exactly WHICH layer corrupts the data.
Trace Data Flow
Find Working Examples
spanishrom.gba) as ground truthsrc/text/charmap_data.py for the mappingIdentify Differences
pytest tests/ after each changeIf 3+ fixes failed: Question the architecture, not the individual fix.
Create Failing Test First (see test-driven-development skill)
def test_specific_bug_reproduction():
# Exact reproduction of the failure
result = encoder.decode(bytes([0xFA, 0x01])) # control code edge case
assert result == expected_output
Implement Single Fix — address root cause only, no bundled refactoring
Verify Fix
pytest tests/ -v # ALL tests must pass — 100% required
If Fix Doesn't Work — STOP, return to Phase 1 with new evidence
| Symptom | Likely Root Cause | Where to Look |
|---|---|---|
| Wrong character displayed | Charmap mismatch | src/text/charmap_data.py |
| String truncated | 0xFF terminator missing | src/text/encoder.py |
| Garbage after text | Pointer not updated | src/inject/repointer.py |
| Crash on injection | Free space overrun | src/inject/space_manager.py |
| Control code ignored | FC/FD/F8/F9 multi-byte not handled | src/text/charmap_data.py |
| IPS patch wrong | Binary diff error | src/pipeline/ |
ALL of these mean: STOP. Return to Phase 1.
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, gather hex evidence | Understand WHAT and WHY |
| 2. Pattern | Compare working vs broken, check charmap | Identify differences |
| 3. Hypothesis | Form theory, test minimally, one change | Confirmed or new hypothesis |
| 4. Implementation | Write failing test, fix root cause, verify | All tests pass (100%) |