self-learning-skills / rules
Cursor rule961 starsChanged 5 months agoMITView on GitHub
Self-learning — recognize a hard-won "golden path" during a task and persist it as a reusable Cursor rule so the next session already knows it. Applies whenever a task succeeds only after several tries, uses non-obvious tooling or commands, reveals project facts (how to reach the DB, where creds/env vars live, how to deploy, run migrations, or verify a change live), or the user says "remember this".
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 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.
- AGENTS.mdAGENTS.md
- .cursor/rules/learned/.gitkeepCursor rule
- self-learningSkill
The file
We split this self-learning.mdc into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Write a new rule at .cursor/rules/learned/<short-name>.mdc:
- Distinctive: line 53
Only write a rule when all three hold, so guesses don't get enshrined:
- Distinctive: line 60
If any is missing, leave a tentative note in project memory instead, or skip it.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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
--- description: Self-learning — recognize a hard-won "golden path" during a task and persist it as a reusable Cursor rule so the next session already knows it. Applies whenever a task succeeds only after several tries, uses non-obvious tooling or commands, reveals project facts (how to reach the DB, where creds/env vars live, how to deploy, run migrations, or verify a change live), or the user says "remember this". alwaysApply: true --- # Self-learning Make yourself self-improving: when you earn a reusable **golden path**, capture it so the next session starts knowing it instead of rediscovering it. ## Recognize the moment - A task only worked after several attempts, wrong turns, or a correction. - You found project facts you didn't know up front: where creds/env vars live, a non-obvious command, a required sequence, a gotcha that defies the obvious. - An operational workflow likely to recur — reach the dev/prod DB, deploy, run migrations, seed data, verify a change live. - The user says "remember this" / "don't make me re-explain this next time". Act on the cue immediately — **don't ask permission first**. Then tell the user what you saved and where. ## Capture it as a rule Write a new rule at `.cursor/rules/learned/<short-name>.mdc`: ```mdc --- description: <what it does AND when to use it — this is how Cursor reloads it later> # or, if path-specific instead of description-triggered: # globs: ["path/glob/**"] --- # <title> **Goal:** <the recurring task this serves> ## Steps 1. <exact command / path; keep the required order if it matters> ## Gotchas - <non-obvious fact; where a secret lives — never the value> ## What didn't work - <approach you ruled out, and why> ``` Capture the **procedure** (commands, paths, order, gotchas), not a one-off answer, plus the **failures** so next time skips the dead-ends. ## Promotion rule Only write a rule when **all three** hold, so guesses don't get enshrined: 1. **A passing check** — the path was actually verified (test passed, clean exit, green build, reproduced repro). "Seemed to work" doesn't count. 2. **A named failure pattern** — you can name the failure it avoids or diagnoses. 3. **At least one ruled-out dead-end** — an approach you tried and eliminated. If any is missing, leave a tentative note in project memory instead, or skip it. ## Rules - **Never write secret values** (tokens, passwords, connection strings, keys). Record only *where* they live (env var name, config file, secret manager). - A **one-line fact** → put it in project notes/memory, not a whole rule. - A genuine **one-off** → skip it.
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.

