self-learning-skills
AGENTS.md961 starsChanged 5 months agoMITView on GitHub
This file makes any coding agent self-improving: recognize a hard-won "golden path" during a task and persist it so the next session starts already knowing it, instead of rediscovering how to reach the DB, where the creds live, how to deploy, or how to verify a change live. It works with any agent that reads a standing instructions file (Codex, Zed, Aider, Gemini CLI, …). Richer, tool-native installs exist too — a Claude Code skill (skills/self-learning/SKILL.md) and a Cursor rule…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- .cursor/rules/learned/.gitkeepCursor rule
- .cursor/rules/self-learning.mdcCursor rule
- self-learningSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 1 is common, 2 are distinctive, and 0 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Only promote a session to a durable entry when all three hold:
- Distinctive: line 54
If any is missing, it isn't durable yet — leave a tentative note (marked unverified) or skip it.
- Common: line 72
What didn't work: Keep secrets out — point to where they live.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Self-learning (for AI coding agents)
This file makes any coding agent self-improving: recognize a hard-won "golden path" during a task and persist it so the next session starts already knowing it, instead of rediscovering how to reach the DB, where the creds live, how to deploy, or how to verify a change live.
It works with any agent that reads a standing instructions file (Codex, Zed,
Aider, Gemini CLI, …). Richer, tool-native installs exist too — a Claude Code
skill (skills/self-learning/SKILL.md) and a Cursor rule
(.cursor/rules/self-learning.mdc); see the README. This file is the portable,
lowest-common-denominator version.
The loop
1. Recognize the moment. Any one of these is a cue:
- a task only worked after several attempts, wrong turns, or a correction;
- you discovered project facts you didn't know up front — where creds/env vars live, a non-obvious command, a required sequence, a gotcha;
- an operational workflow likely to recur (reach the dev/prod DB, deploy, run migrations, seed data, verify live, tail the right logs);
- the user says "remember this" / "don't make me re-explain this next time".
Act on the cue immediately — don't ask permission first. Capture it, then tell the user what you saved and where. They can always edit or delete it.
2. Capture it where your tool auto-loads knowledge next session:
- Claude Code / any Agent Skills client → a new
skills/<name>/SKILL.md - Cursor → a new
.cursor/rules/learned/<name>.mdc - Otherwise → append a dated entry under Learned below, or to your project's notes/memory file.
Capture the procedure (commands, paths, the required order, gotchas) — not a one-off answer — and the failures too: the approaches you ruled out and why, so next time skips the dead-ends.
3. Reuse. Next session the persisted entry loads automatically (by skill/rule description, or because this file is always read) and you start from the golden path.
Promotion rule
A saved entry is authoritative — future sessions trust it without re-deriving it. Only promote a session to a durable entry when all three hold:
- A passing check — the path was actually verified (a test passed, the command exited clean, the repro reproduced, the build went green). Record it. "Seemed to work" doesn't count.
- A named failure pattern — you can name the failure it avoids or diagnoses, not a vague "sometimes it breaks".
- At least one ruled-out dead-end — a concrete approach you tried and eliminated, with the reason.
If any is missing, it isn't durable yet — leave a tentative note (marked unverified) or skip it. This keeps confident guesses out.
Rules
- Never write secret values — no tokens, passwords, connection strings, or API keys. Record only where a secret lives (env var name, config/selector, secret manager). Reproducing a secret into a shared file leaks it.
- A one-line fact or correction → put it in lightweight notes/memory, not a whole rule or skill.
- A genuine one-off unlikely to recur → skip it.
- Capture procedures, not answers — teach how to approach the class of problem, so it generalizes next time.
Learned
<!-- When no richer mechanism is available, append dated golden-path entries here.
Format: ### YYYY-MM-DD — <title> / **Goal**, **Steps**, **Gotchas**,
**What didn't work**. Keep secrets out — point to where they live. -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

