4.0 KiB
4.0 KiB
LEARNINGS.md - Rules from Mistakes
"Every mistake the agent makes should become a one-line rule." — Ramya
This file contains distilled rules from mistakes and lessons learned. Read this before starting tasks.
General Rules
- Always check task status before working — Update to 'in-progress' in Gantt Board before starting
- Never claim code is pushed without checking git status — Always verify with
git statusandgit log - Verify API endpoints work before marking complete — Test with curl or browser, don't assume
- Confirm user's timezone before scheduling — CST (America/Chicago) is default, but always verify
- Don't read full MEMORY.md in group chats — SECURITY RISK: Contains personal context
Git & Commit Rules
- Switch git identity based on project owner — OpenClaw projects vs User projects have different authors
- Check current identity before committing — Run
git config user.name && git config user.email - Use 'trash' > 'rm' — Recoverable beats gone forever
- Never push to main without review — Use branches for significant changes
Task Management Rules
- Write to disk after EVERY task — Log to memory/YYYY-MM-DD.md before saying "done"
- If mistake made → append to LEARNINGS.md — Document root cause and prevention
- Update task status to 'review' when complete — Don't leave tasks in 'in-progress'
- Check Gantt Board before saying tasks are done — Verify data appears correctly
Memory & Context Rules
- Run
/context detailregularly — Check for token bloat monthly - Write discipline > Read discipline — Information exists ≠ Agent uses it
- Daily logs = raw append-only — MEMORY.md = curated (updated during heartbeats only)
- Don't let MEMORY.md become a dumping ground — Move reference docs to docs/ folder
- Plant marker before testing retrieval — Use specific test phrases to verify memory works
Development Rules
- All web apps must be responsive — Mobile-first, no exceptions (320px → 1440px)
- Use w-[95vw] max-w-lg for dialogs — Never fixed widths
- Stack forms on mobile — flex-col mobile, sm:flex-row desktop
- Test 320px, 768px, 1440px before "done" — Verify responsive breakpoints
- Check browser console for errors — Don't ignore warnings
Tool Usage Rules
- Check TOOLS.md for credentials first — Don't ask for URLs/keys that are already documented
- Use skills when available — Don't reinvent the wheel
- Ask before destructive operations — When in doubt, ask
Communication Rules
- React like a human in group chats — Use emoji reactions to acknowledge without interrupting
- Quality > Quantity — Don't respond to every message
- One reaction per message max — Pick the best fit
- Know when to speak — Only respond when adding genuine value
Project-Specific Rules
Gantt Board
- Use correct Supabase URL — https://qnatchrjlpehiijwtreh.supabase.co
- Verify task appears in UI before marking done — Don't trust API response alone
Mission Control
- Phases build on each other — Don't skip foundational phases
- Document architecture decisions — Write to BRAIN.md for complex choices
Daily Digest
- Generate at consistent time — Morning generation preferred
- Include source links — Every summary needs attribution
Emergency Recovery
If session crashes or context is lost:
- Read memory/YYYY-MM-DD.md for today's work
- Check BRAIN.md for active projects and decisions
- Review LEARNINGS.md for relevant rules
- Look at HEARTBEAT.md for pending checks
How to Add New Rules
When you make a mistake:
- Document what went wrong
- Identify root cause
- Write prevention rule here (one line)
- Add to appropriate section above
Format:
## [Category] Rules
[N]. **[Rule name]** — [Specific prevention action]
Last Updated: 2026-02-22 Next Review: During heartbeat check