agent-rsi
Installation
SKILL.md
Agent RSI (retrospective → self-improvement)
Goal: each mistake happens at most twice. The first time it is recorded. The second time it becomes a rule that every agent loads.
Keep it small. A retrospective that takes longer than the task is waste. For a clean, routine task, step 1 is enough.
Where things go
The workspace is the directory the session started in: the one holding the top-level AGENTS.md for this work. Its agent-docs/ directory holds the ledger and shared lessons. If agent-docs/ does not exist, create it from templates/agent-docs-README.md and templates/ledger.md.
| Artifact | Location | When |
|---|---|---|
| Regression unit / integration test | The affected repo, next to the code, in the same PR as the fix | Every bug that reached a commit, review, CI, or production |
| ADR | <repo>/docs/adr/NNNN-<slug>.md |
A design choice that someone would later question or undo |
| Postmortem | <repo>/docs/postmortems/YYYY-MM-DD-<slug>.md if repo-specific; agent-docs/postmortems/ if cross-repo or about agent process |
Failure that reached CI, a reviewer, the user, or production; or cost more than ~30 min |
| Shared lesson | agent-docs/lessons/<topic>.md |
Knowledge another agent in another repo of this workspace would also need |
| Counter | agent-docs/ledger.md |
Every failure, and every proven method |
| Rule | See "Rule scope" below | Ledger count reaches 2, or a method proved itself twice |