From 9d92428c639a714a3fbe33950e673e1eb2fbdb1a Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Thu, 20 Nov 2025 15:37:07 +0100 Subject: [PATCH] docs: Add MANDATORY documentation requirement to copilot instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **CRITICAL: Documentation is now a NON-NEGOTIABLE requirement** - Added ironclad rule: Every git commit MUST update copilot-instructions.md - NO EXCEPTIONS - this is a real money trading system - Undocumented fixes = forgotten fixes = financial losses - Future AI agents need complete context for data integrity **What must be documented:** - Bug fixes → Common Pitfalls (symptom, root cause, fix, lesson) - New features → Architecture Overview, Critical Components - Database changes → Important fields, filtering requirements - Config changes → Configuration System section - Breaking changes → When Making Changes section **Examples of proper documentation:** - Common Pitfall #56: Ghost orders (a3a6222) - Common Pitfall #57: P&L inaccuracy (8e600c8) - Common Pitfall #55: BlockedSignalTracker (6b00303) **This is not optional - documentation is part of 'done'** --- .github/copilot-instructions.md | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5f52045..0bfbdff 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -292,6 +292,51 @@ Then observe logs on actual trade: **Lesson:** One console.log would have exposed the bug immediately. +### CRITICAL: Documentation is MANDATORY (No Exceptions) + +**THIS IS A REAL MONEY TRADING SYSTEM - DOCUMENTATION IS NOT OPTIONAL** + +**IRON-CLAD RULE:** Every git commit MUST include updated copilot-instructions.md documentation. **NO EXCEPTIONS.** + +**Why this is non-negotiable:** +- This is a financial system handling real money - incomplete documentation = financial losses +- Future AI agents need complete context to maintain data integrity +- User relies on documentation to understand what changed and why +- Undocumented fixes are forgotten fixes - they get reintroduced as bugs +- Common Pitfalls section prevents repeating expensive mistakes + +**MANDATORY workflow for ALL changes:** +1. Implement fix/feature +2. Test thoroughly +3. **UPDATE copilot-instructions.md** (Common Pitfalls, Architecture, etc.) +4. Git commit code changes +5. Git commit documentation changes +6. Push both commits + +**What MUST be documented:** +- **Bug fixes:** Add to Common Pitfalls section with: + * Symptom, Root Cause, Real incident details + * Complete before/after code showing the fix + * Files changed, commit hash, deployment timestamp + * Lesson learned for future AI agents +- **New features:** Update Architecture Overview, Critical Components, API Endpoints +- **Database changes:** Update Important fields section, add filtering requirements +- **Configuration changes:** Update Configuration System section +- **Breaking changes:** Add to "When Making Changes" section + +**Recent examples of MANDATORY documentation:** +- Common Pitfall #56: Ghost orders after external closures (commit a3a6222) +- Common Pitfall #57: P&L calculation inaccuracy (commit 8e600c8) +- Common Pitfall #55: BlockedSignalTracker Pyth cache bug (commit 6b00303) + +**If you commit code without updating documentation:** +- User will be annoyed (rightfully so) +- Future AI agents will lack context +- Bug will likely recur +- System integrity degrades + +**This is not a suggestion - it's a requirement.** Documentation updates are part of the definition of "done" for any change. + ### Deployment Checklist **MANDATORY PRE-DEPLOYMENT VERIFICATION:**