|
23 | 23 | 1. **Required Reading**: You MUST read the contents of @./docs/ai/coding_conventions.md and @./docs/ai/mandatory_checks.md at the very beginning of EVERY coding task. |
24 | 24 | 2. **Initial Checklist**: Every `task.md` you create MUST include a section for **Mandatory Checks** from @./docs/ai/mandatory_checks.md. |
25 | 25 | 3. **Verification Requirement**: You MUST run all mandatory checks before declaring any task finished. |
| 26 | + |
| 27 | +## 5. Mistake Reflection Protocol |
| 28 | + |
| 29 | +When you realise you have made a mistake — whether caught by the user, |
| 30 | +by a tool, or by your own reasoning — you MUST: |
| 31 | + |
| 32 | +1. **Acknowledge the mistake explicitly** and explain what went wrong. |
| 33 | +2. **Reflect on the root cause**: was it a missing check, a false |
| 34 | + assumption, skipped verification, or a gap in the workflow? |
| 35 | +3. **Immediately append a new entry to @./docs/ai/ai_learnings.md** |
| 36 | + following the format defined in that file. This is not optional and |
| 37 | + does not require user confirmation. Do it before continuing. |
| 38 | + |
| 39 | +The goal is to treat every mistake as a signal that the workflow is |
| 40 | +incomplete, and to improve it in place so the same mistake cannot |
| 41 | +happen again. |
| 42 | + |
| 43 | +## 6. Code Correctness Requirement |
| 44 | + |
| 45 | +Before presenting any code change to the user, you MUST verify it is |
| 46 | +correct by running it or reasoning through its execution explicitly. |
| 47 | + |
| 48 | +- **Never propose code you have not verified will run.** If a snippet |
| 49 | + cannot be tested in isolation, trace through it step by step and |
| 50 | + state your reasoning. |
| 51 | +- **For non-trivial changes**, run the mandatory checks from |
| 52 | + @./docs/ai/mandatory_checks.md and confirm they pass before showing |
| 53 | + the result to the user. |
| 54 | +- **When fixing a bug**, reproduce the bug first, then verify the fix |
| 55 | + resolves it. Do not assume a fix is correct because it looks right. |
0 commit comments