test-repo/learnings/LEARNINGS.md

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

  1. Always check task status before working — Update to 'in-progress' in Gantt Board before starting
  2. Never claim code is pushed without checking git status — Always verify with git status and git log
  3. Verify API endpoints work before marking complete — Test with curl or browser, don't assume
  4. Confirm user's timezone before scheduling — CST (America/Chicago) is default, but always verify
  5. Don't read full MEMORY.md in group chats — SECURITY RISK: Contains personal context

Git & Commit Rules

  1. Switch git identity based on project owner — OpenClaw projects vs User projects have different authors
  2. Check current identity before committing — Run git config user.name && git config user.email
  3. Use 'trash' > 'rm' — Recoverable beats gone forever
  4. Never push to main without review — Use branches for significant changes

Task Management Rules

  1. Write to disk after EVERY task — Log to memory/YYYY-MM-DD.md before saying "done"
  2. If mistake made → append to LEARNINGS.md — Document root cause and prevention
  3. Update task status to 'review' when complete — Don't leave tasks in 'in-progress'
  4. Check Gantt Board before saying tasks are done — Verify data appears correctly

Memory & Context Rules

  1. Run /context detail regularly — Check for token bloat monthly
  2. Write discipline > Read discipline — Information exists ≠ Agent uses it
  3. Daily logs = raw append-only — MEMORY.md = curated (updated during heartbeats only)
  4. Don't let MEMORY.md become a dumping ground — Move reference docs to docs/ folder
  5. Plant marker before testing retrieval — Use specific test phrases to verify memory works

Development Rules

  1. All web apps must be responsive — Mobile-first, no exceptions (320px → 1440px)
  2. Use w-[95vw] max-w-lg for dialogs — Never fixed widths
  3. Stack forms on mobile — flex-col mobile, sm:flex-row desktop
  4. Test 320px, 768px, 1440px before "done" — Verify responsive breakpoints
  5. Check browser console for errors — Don't ignore warnings

Tool Usage Rules

  1. Check TOOLS.md for credentials first — Don't ask for URLs/keys that are already documented
  2. Use skills when available — Don't reinvent the wheel
  3. Ask before destructive operations — When in doubt, ask

Communication Rules

  1. React like a human in group chats — Use emoji reactions to acknowledge without interrupting
  2. Quality > Quantity — Don't respond to every message
  3. One reaction per message max — Pick the best fit
  4. Know when to speak — Only respond when adding genuine value

Project-Specific Rules

Gantt Board

  1. Use correct Supabase URLhttps://qnatchrjlpehiijwtreh.supabase.co
  2. Verify task appears in UI before marking done — Don't trust API response alone

Mission Control

  1. Phases build on each other — Don't skip foundational phases
  2. Document architecture decisions — Write to BRAIN.md for complex choices

Daily Digest

  1. Generate at consistent time — Morning generation preferred
  2. Include source links — Every summary needs attribution

Emergency Recovery

If session crashes or context is lost:

  1. Read memory/YYYY-MM-DD.md for today's work
  2. Check BRAIN.md for active projects and decisions
  3. Review LEARNINGS.md for relevant rules
  4. Look at HEARTBEAT.md for pending checks

How to Add New Rules

When you make a mistake:

  1. Document what went wrong
  2. Identify root cause
  3. Write prevention rule here (one line)
  4. Add to appropriate section above

Format:

## [Category] Rules

[N]. **[Rule name]** — [Specific prevention action]

Last Updated: 2026-02-22 Next Review: During heartbeat check