session-rules
Skill0 starsChanged 3 months agoMITView on GitHub
Generates a RULE.md from a project's AI-session history by extracting every moment the human corrected the agent — "no, never use jwt", "always run tests first", "we use sessions not tokens". The highest-leverage context file a project can have is the one built from its own history of mistakes. Reads Claude Code, Codex, and OpenCode stores (same conventions as session-handoff), fully offline.
In this repository69 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- skills/ultimate-browsing/engine/AGENTS.mdAGENTS.md
- 3d-designSkill
- algorithmic-artSkill
- api-testerSkill
- apple-suiteSkill
- appshotSkill
- astra-initSkill
- blindspotSkill
- changelog-genSkill
- claim-auditSkill
- code-reviewSkill
- comment-checkerSkill
- context-budgetSkill
- cron-auditSkill
- css-pro-tipsSkill
- designSkill
- diff-reviewSkill
- doc-readerSkill
- domain-modelingSkill
- env-gateSkill
- ext-scaffoldSkill
- gate-graphSkill
- gh-address-commentsSkill
- gh-fix-ciSkill
- git-masterSkill
- graph-toolsSkill
- grillingSkill
- herdrSkill
- image-genSkill
- json-diffSkill
- linus-levelSkill
- log-analyzerSkill
- log-deviationSkill
- lsp-setupSkill
- merge-quizSkill
- nbj-write-clearlySkill
- net-probeSkill
- open-loopsSkill
- portfolio-auditSkill
- pro-reviewSkill
- proxmox-veSkill
- remove-ai-slopsSkill
- repo-auditSkill
- resume-auditSkill
- sec-headersSkill
- secret-gateSkill
- seo-auditSkill
- session-finderSkill
- session-handoffSkill
- skill-auditSkill
- skill-creatorSkill
- skill-decaySkill
- skill-optimizerSkill
- skill-pickerSkill
- skill-syncSkill
- social-researchSkill
- subscription-auditSkill
- sys-healthSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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 14
Every project accumulates "the agent did X wrong, we told it Y" moments.
- Distinctive: line 40
Run it after a session where you corrected the agent more than once.
- Distinctive: line 41
Read the generated RULE.md.
- Distinctive: line 42
Commit RULE.md to the repo root.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Session Rules
Every project accumulates "the agent did X wrong, we told it Y" moments. Those corrections are project law. This turns them from session chatter into a RULE.md every future session reads first.
Commands
python3 scripts/session_rules.py --cwd /path/to/project
python3 scripts/session_rules.py --cwd . --since 90 --out RULE.md
python3 scripts/session_rules.py --cwd . --jsonWhat it extracts
User turns carrying correction signals:
- "no, never do X" / "don't do that again"
- "we use Y not Z" / "we prefer X"
- "always run X first" / "you should always"
- "stop doing X" / "that's wrong"
Each rule keeps the sentence containing the correction plus the full user turn as evidence. Review the output before committing — extraction is a draft, corrections are law.
Workflow
- Run it after a session where you corrected the agent more than once.
- Read the generated RULE.md; delete false positives, sharpen wording.
- Commit RULE.md to the repo root.
- Point future agent sessions at it (AGENTS.md, system prompt, or just
@RULE.mdin the first message).
Pairs with
session-handoff (the full session briefing when switching clients),
open-loops (unresolved commitments from the same sessions).
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.

