Managing Project Fixes
When given a broken or incomplete project:
- Run the debugger/test suite to surface all errors.
- Attempt to fix code, config, and dependencies directly.
- Re-run tests. Repeat up to 3 total attempts.
- If still failing after 3 attempts (or errors can't be diagnosed), rebuild the project from scratch.
- Keep monitoring and assisting until the project runs fully, with nothing missing.
Progress:
- Step 1: Scan the project — read code, config files, dependency manifests (package.json, requirements.txt, etc.)
- Step 2: Run the debugger/terminal tests to capture concrete errors (stack traces, failed builds, missing modules)
- Step 3: Diagnose root cause — code bug, config mismatch, missing/broken dependency, or structural issue
- Step 4: Apply fix directly to code/config; install or correct dependencies as needed
- Step 5: Re-run full test/build cycle via terminal to confirm the fix works
- Step 6: If test fails, go to Step 3 (count this as attempt N)
- Step 7: After 3 failed attempts, OR if errors are too unclear/unstable to diagnose reliably → discard and rebuild project from scratch (clean structure, re-add dependencies, re-implement features)
- Step 8: After rebuild, run full test cycle again
- Step 9: Continue monitoring — re-check for regressions, missing pieces, or new errors until project is fully functional
- Step 10: Final verification pass — confirm no missing libraries, no broken config, no unhandled errors
Rebuild decision rule: 3 strikes = rebuild. Track attempt count explicitly per project/module, not globally. If after inspection the issues are clearly superficial (typo, one wrong import), fixing takes priority over counting toward the 3-strike limit — only count a "strike" when a genuine fix-then-test cycle was attempted and failed.
Example 1:
Input: A Node.js project fails to start — Cannot find module 'express'.
Output: Diagnose as missing dependency → run install command → re-run start script → confirm server boots → mark attempt successful (no strike needed, this is a one-shot fix).
Example 2: Input: A Python project throws different, inconsistent errors each test run (import errors, then syntax errors, then config errors) across 3 fix attempts. Output: After 3rd failed cycle, declare project unstable → scaffold a fresh project structure → reinstall clean dependencies → reimplement core logic → run full test suite → report final working state.
Example 3: Input: A project has a broken config file causing silent failures with no clear error message. Output: Attempt static inspection of config schema → compare against expected format → if still unclear after inspection, run project in verbose/debug mode via terminal → if root cause still unresolved after 3 tries, rebuild config and surrounding setup from scratch.
- Always get a concrete error (via debugger/terminal) before attempting a fix — never guess blindly.
- Fix the smallest root cause first (dependency/config) before touching broader code logic.
- Verify every fix with an actual re-run, not just code review.
- Document what was changed each cycle so the 3-attempt count is meaningful and traceable.
- When rebuilding, preserve any working/salvageable parts (e.g., valid business logic) rather than discarding everything blindly.
- Keep monitoring after things "pass" — one green test run doesn't guarantee full stability.
- Don't count a strike for trivial fixes (typo, missing semicolon) — reserve the 3-strike rule for genuine unresolved failures.
- Don't rebuild prematurely before actually running diagnostics — always attempt real fixes first.
- Don't stop at "it compiles" — confirm runtime behavior and full test coverage before declaring success.
- Don't ignore dependency/version mismatches as a root cause — check library versions before assuming it's a logic bug.
- Don't silently abandon a project — always report what was fixed, what was rebuilt, and why.