Skip to content

Commit c678115

Browse files
committed
docs: update GEMINI setup
1 parent 6b56511 commit c678115

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

GEMINI.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,33 @@
2323
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.
2424
2. **Initial Checklist**: Every `task.md` you create MUST include a section for **Mandatory Checks** from @./docs/ai/mandatory_checks.md.
2525
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.

docs/ai/ai_learnings.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
> [!NOTE] for Users:
2+
> This document is meant to be read by an AI assistant (Gemini) in order to
3+
> learn from its mistakes and improve its behavior on this project. Use
4+
> it's findings to improve GEMINI.md setup.
5+
6+
# AI Learnings
7+
8+
A living record of mistakes made during this project and the rules
9+
derived from them. Every entry must follow the format below.
10+
11+
---
12+
13+
## Entry format
14+
15+
**Mistake**: What went wrong.
16+
**Root cause**: Why it happened.
17+
**Rule**: The concrete rule added to prevent recurrence.
18+
19+
---

0 commit comments

Comments
 (0)