Lightweight self-improvement loop for AI agents.
Your agent forgets everything between sessions. This skill gives it a learning system that actually works — one-line entries, structured dedup, severity-aware review queues, injection-safe source labels, and pre-task review. Minimal context burn, maximum learning.
bash scripts/install.sh /path/to/workspaceThen add to your agent's instructions:
## Self-Improvement
Before major tasks: `grep -i "keyword" .learnings/*.md` for relevant past issues.
After errors or corrections: log to `.learnings/` using the agent-memory-loop format.
Never auto-write to SOUL.md/AGENTS.md/TOOLS.md. Stage to .learnings/promotion-queue.md.- Log errors, corrections, and discoveries as one-line entries
- Dedup by stable ID (fallback: keyword grep)
- Review queue when recurring (
count:3+) or critical (severity:critical) - Human approves promotion to instruction files
- Pre-task review before major work — grep, name the learning, state the adjustment
- Track prevention — increment
prevented:Nwhen a learning actually changed behavior
| File | Purpose |
|---|---|
SKILL.md |
Lean runtime entrypoint |
references/logging-format.md |
Canonical line formats, optional fields, examples |
references/operating-rules.md |
Dedup, review queue, promotion model, trimming |
references/promotion-queue-format.md |
Queue entry structure and status lifecycle |
references/detail-template.md |
Optional detail-file template for complex failures |
references/design-tradeoffs.md |
Why this stays lean instead of turning into a system |
scripts/install.sh |
Set up .learnings/ in a workspace |
scripts/review.sh |
Health check — pending promotions, stale entries, stats |
assets/*.md |
Template files copied by install script |
- Review queue — no auto-promotion to instruction files; human approval required
- Source labels —
agent/user/external; external content blocked from promotion - Severity awareness —
severity:criticaltriggers review even at count:1 - Loop closure —
prevented:Ntracks whether learnings actually changed behavior - Structured dedup — stable IDs (
ERR-YYYYMMDD-NNN) instead of raw grep - Optional detail files — link to
.learnings/details/for complex failures - Staleness / expiry — optional
expires:field + periodic trimming
grep,date(any POSIX system)- No frameworks, no dependencies, no configuration
MIT — Don Zurbrick