/focused-fix
Systematically repair an entire feature or module using the 5-phase protocol. Target: $ARGUMENTS (a feature path or module name).
If $ARGUMENTS is empty, ask the user which feature/module to fix.
Protocol — Execute ALL 5 Phases IN ORDER
Phase 1: SCOPE — Map the Feature Boundary
- Identify the primary folder/files for the target feature
- Read EVERY file in that folder — understand its purpose
- Create a feature manifest:
FEATURE SCOPE:
Primary path: <path>
Entry points: [files imported by other parts of the app]
Internal files: [files only used within this feature]
Total files: N
Phase 2: TRACE — Map All Dependencies
INBOUND (what this feature imports):
- For every import statement, trace to source, verify it exists and is exported
- Check env vars, config files, DB models, API endpoints, third-party packages
OUTBOUND (what imports this feature):
- Search entire codebase for imports from this feature
- Verify consumers use correct API/interface
Output a dependency map with inbound, outbound, env vars, and config files.
Phase 3: DIAGNOSE — Find Every Issue
Run ALL diagnostic checks:
- Code: imports resolve, no circular deps, types consistent, error handling, TODO/FIXME
- Runtime: env vars set, migrations current, API shapes correct
- Tests: run ALL related tests, record failures, check coverage
- Logs: check git log for recent changes, search error logs
- Config: validate config files, check dev/prod mismatches
For each issue found:
- Confirm root cause with evidence before adding to fix list
- Assign risk: HIGH (public API, auth, >3 callers) / MED (internal with tests) / LOW (leaf module)
Output a diagnosis report with issues grouped by severity.
Phase 4: FIX — Repair Systematically
Fix in this EXACT order:
- Dependencies — broken imports, missing packages
- Types — type mismatches at boundaries
- Logic — business logic bugs
- Tests — fix or create tests for each fix
- Integration — verify end-to-end with consumers
Rules:
- Fix ONE issue at a time, run related test after each
- If a fix breaks something else → go back to DIAGNOSE
- Fix HIGH before MED before LOW
- 3-Strike Rule: If 3+ fixes create NEW issues, STOP. Tell the user the architecture may need rethinking, not patching.
Phase 5: VERIFY — Confirm Everything Works
- Run ALL tests in the feature folder
- Run ALL tests in files that import from this feature
- Run full test suite if available
- Summarize all changes made
Output a completion report with files changed, fixes applied, test results, and consumers verified.
Iron Law
NO FIXES WITHOUT COMPLETING SCOPE → TRACE → DIAGNOSE FIRST
If you haven't finished Phase 3, you cannot propose fixes.
Related Skills
engineering/focused-fix — Full SKILL.md with detailed checklists, output templates, and anti-patterns
superpowers:systematic-debugging — For individual complex bugs found during Phase 3
1---2name: focused-fix-23description: "Deep-dive feature repair — systematically fix an entire feature/module across all its files and dependencies. Usage: /focused-fix <feature-path>"4version: 1.0.05author:6 name: "Alireza Rezvani"7 github: alirezarezvani8tags: [focused, fix]9category: engineering10platforms: [macos, linux, windows]11license: MIT12metadata:13 hermes:14 related_skills: [focused, fix]15 source: https://skillmd.com/skills/nous-hermeshub/focused-fix-216 upstream: "claude-skills"17 original_author: "Alireza Rezvani"18---1920# /focused-fix2122Systematically repair an entire feature or module using the 5-phase protocol. Target: `$ARGUMENTS` (a feature path or module name).2324If `$ARGUMENTS` is empty, ask the user which feature/module to fix.2526## Protocol — Execute ALL 5 Phases IN ORDER2728### Phase 1: SCOPE — Map the Feature Boundary29301. Identify the primary folder/files for the target feature312. Read EVERY file in that folder — understand its purpose323. Create a feature manifest:3334```35FEATURE SCOPE:36 Primary path: <path>37 Entry points: [files imported by other parts of the app]38 Internal files: [files only used within this feature]39 Total files: N40```4142### Phase 2: TRACE — Map All Dependencies4344**INBOUND** (what this feature imports):45- For every import statement, trace to source, verify it exists and is exported46- Check env vars, config files, DB models, API endpoints, third-party packages4748**OUTBOUND** (what imports this feature):49- Search entire codebase for imports from this feature50- Verify consumers use correct API/interface5152Output a dependency map with inbound, outbound, env vars, and config files.5354### Phase 3: DIAGNOSE — Find Every Issue5556Run ALL diagnostic checks:5758- **Code**: imports resolve, no circular deps, types consistent, error handling, TODO/FIXME59- **Runtime**: env vars set, migrations current, API shapes correct60- **Tests**: run ALL related tests, record failures, check coverage61- **Logs**: check git log for recent changes, search error logs62- **Config**: validate config files, check dev/prod mismatches6364For each issue found:65- Confirm root cause with evidence before adding to fix list66- Assign risk: HIGH (public API, auth, >3 callers) / MED (internal with tests) / LOW (leaf module)6768Output a diagnosis report with issues grouped by severity.6970### Phase 4: FIX — Repair Systematically7172Fix in this EXACT order:731. **Dependencies** — broken imports, missing packages742. **Types** — type mismatches at boundaries753. **Logic** — business logic bugs764. **Tests** — fix or create tests for each fix775. **Integration** — verify end-to-end with consumers7879Rules:80- Fix ONE issue at a time, run related test after each81- If a fix breaks something else → go back to DIAGNOSE82- Fix HIGH before MED before LOW83- **3-Strike Rule**: If 3+ fixes create NEW issues, STOP. Tell the user the architecture may need rethinking, not patching.8485### Phase 5: VERIFY — Confirm Everything Works86871. Run ALL tests in the feature folder882. Run ALL tests in files that import from this feature893. Run full test suite if available904. Summarize all changes made9192Output a completion report with files changed, fixes applied, test results, and consumers verified.9394## Iron Law9596```97NO FIXES WITHOUT COMPLETING SCOPE → TRACE → DIAGNOSE FIRST98```99100If you haven't finished Phase 3, you cannot propose fixes.101102## Related Skills103104- `engineering/focused-fix` — Full SKILL.md with detailed checklists, output templates, and anti-patterns105- `superpowers:systematic-debugging` — For individual complex bugs found during Phase 3