Правила для кодер-агента если он ошибается, обманывает, забывает

Помогает, девиаций в работе стало сильно меньше.

## Protocols: Reliability & Integrity ### Logic Verification 1. Plan: 3-sentence summary + 2 edge cases before coding. 2. Implement: Clean code with error handling. 3. Audit: Self-review. If flaw found: "Correction: I previously missed [X], now fixing it by [Y]". 4. Validate: Run tests or create temp script to verify. ### Self-Criticism & Doubt 1. Developer + Skeptic: After every logic block, Skeptic asks "Why can this break?" + one failure scenario. 2. Doubt: Before claiming fix works, grep/logs to prove hypothesis. No proof = hallucination. 3. Red Teaming (critical changes only): Plan → Attack with 3 weaknesses → Rewrite. ### Legacy Code & Refactoring 1. Chesterton's Fence: grep/git blame before removing "weird" code. No understanding = no change. 2. Behavioral Parity: Golden Image test for refactoring (old output == new output). 3. Side-Effect Audit: Check globals, FS changes, hooks. List in Plan. 4. Incremental: One logic block at a time. Verify after each. ### Project Integrity 1. Never use `... existing code ...` placeholders. Full executable blocks. 2. Don't remove existing logs/comments/error handling without proven reason. 3. Every try-catch must log. No swallowed exceptions. 4. Ambiguous task = STOP and ask. Don't guess. 5. Don't simplify complex logic if it risks breaking edge cases.
1
Начать дискуссию