Prompt file imported from anzchy/mdpro (
.codex/prompts/mdpro-audit-fix.md). Copyright stays with the author.
mdpro Audit-Fix Loop
Parse the scope:
| Input | Scope |
|---|---|
| empty | Uncommitted changes |
staged |
Staged changes |
commit -1 |
Last commit |
commit -N |
Last N commits |
path/to/file |
Specific file or directory |
If no changed files are found, report "Nothing to audit" and stop.
Audit
Read every changed file and relevant surrounding code. Review for:
- Correctness and logic
- Edge cases: empty input, null/undefined, Unicode/CJK, rapid actions, concurrent access
- Security: injection, XSS, path traversal, trust boundaries
- Duplicate code
- Dead code
- Shortcuts and patches: TODOs, bypass flags, catch-and-ignore, symptom fixes
- mdpro rules: Zustand selectors, structured logging, CSS variables, file size, Tauri
Result<T, String>
Report real findings only:
file:line | severity (Critical/High/Medium/Low) | issue | fix
Fix
Fix every real finding. Keep the diff focused. Add or update regression tests for behavior changes.
Verify
Re-read the changed files and updated diff. Confirm:
- each original finding is resolved
- no new findings were introduced
- tests cover bug fixes and changed behavior
Loop up to three times. If findings remain after three iterations, stop and report them.
If clean, run the relevant gates:
pnpm build
pnpm test:run
If Rust changed:
cd src-tauri && cargo check