Prompt file imported from helalifaker/budfin (
.codex/prompts/fix.all.md). Copyright stays with the author.
Parse the argument:
- If a quoted string is provided (e.g.,
"enrollment POST returns 500"): treat as a symptom for root cause analysis - If
--lint,--types,--tests,--security, or--precisionflag is present: run ONLY that single fixer (escape hatch) - If no argument: run all fixers in sequence
Escape-Hatch Mode (single flag)
If a --[fixer] flag was passed, run ONLY that fixer and its final verification:
| Flag | Fixer | Verification |
|---|---|---|
--lint |
/fix:lint workflow |
pnpm lint returns 0 |
--types |
/fix:types workflow |
pnpm typecheck returns 0 |
--tests |
/fix:tests workflow |
pnpm test passes |
--security |
/fix:security workflow |
security-reviewer PASS |
--precision |
/fix:precision workflow |
financial-precision-reviewer PASS |
After the single fixer completes, run final verification and output a one-line summary. Stop.
Full Mode (no flag or symptom only)
Step 0 -- Debug (only if symptom provided)
If a symptom argument was provided (e.g., "enrollment POST returns 500"):
Run the fix:debug workflow first to identify and fix the root cause before running all fixers.
Step 1 -- Fix Lint
Run the fix:lint workflow:
pnpm eslint . --fixpnpm prettier --write .pnpm markdownlint --fix "**/*.md" --ignore node_modules --ignore .git- Second pass to confirm zero errors
- Manual fixes for remaining unfixable errors
Record results: ESLint: N fixed, Prettier: N fixed, Markdown: N fixed
Must complete with zero remaining errors before proceeding.
Step 2 -- Fix Types
Run the fix:types workflow:
pnpm typecheck-- capture all errors- Group by category (implicit any, Prisma 6 breaking changes, missing imports, etc.)
- Apply targeted fixes by category
- Re-run until
pnpm typecheckreturns zero errors
Record results: TypeScript: N errors fixed
Must complete with zero type errors before proceeding.
Step 3 -- Fix Tests
Run the fix:tests workflow:
pnpm test-- capture all failures- Diagnose each failure type (assertion, import, mock, isolation, infrastructure)
- Fix implementation (never weaken tests)
- Re-run until all tests pass
pnpm test --coverage-- confirm >= 80% for new files
Record results: Tests: N failures fixed, coverage: [summary]
Must complete with all tests passing before proceeding.
Step 4 -- Fix Security
Run the fix:security workflow:
- Use Agent to launch
security-revieweron changed files - Fix all BLOCKING findings (JWT, RBAC, SQL injection, audit log)
- Fix all WARNING findings
- Re-run until
VERDICT: PASS
Record results: Security: N blockers fixed, N warnings fixed
Step 5 -- Fix Precision
Run the fix:precision workflow:
- Use Agent to launch
financial-precision-revieweron changed files - Fix all BLOCKING violations (TC-001 native arithmetic, JSON serialization, Uint8Array)
- Fix all WARNING violations (rounding consistency)
- Re-run until
VERDICT: PASS pnpm test-- confirm no regressions from precision fixes
Record results: Precision: N violations fixed
Step 6 -- Final Verification
pnpm test && pnpm typecheck && echo "ALL CLEAN"
Must show ALL CLEAN before this command is complete.
If any failure:
- Do not report as complete
- Re-run the specific fixer for the failing area
- Repeat until ALL CLEAN
Step 7 -- Summary Report
Output:
/fix:all complete.
+--------------+----------------------------------+
| Fixer | Result |
+--------------+----------------------------------+
| /fix:lint | N issues fixed, 0 remaining |
| /fix:types | N errors fixed, 0 remaining |
| /fix:tests | N failures fixed, N/N passing |
| /fix:security| N blockers, N warnings fixed |
| /fix:precision| N violations fixed |
+--------------+----------------------------------+
Final: pnpm test -- ALL PASSING
pnpm typecheck -- CLEAN
Status: READY FOR REVIEW
