agentinit / rules
Cursor rule1 starsChanged 12 days agoMITView on GitHub
Purity and determinism rules for resolver, planning, target adapters, and doctor checks
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 4,144 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 repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agentinit-vitest.mdcCursor rule
- .cursor/rules/git-commits.mdcCursor rule
- .cursor/rules/io-safety.mdcCursor rule
- .cursor/rules/registry-content.mdcCursor rule
- .cursor/rules/tests.mdcCursor rule
- commit-changesSkill
- implement-taskSkill
- new-featureSkill
- pr-summarySkill
- refactorSkill
- review-archSkill
- review-taskSkill
- write-fragmentSkill
- write-testsSkill
The file
We split this pure-modules.mdc into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
NEVER import node:fs, node:child_process, process, ui/, io/, or detect/ here.
- Distinctive: line 12
NEVER read the clock, randomness, or environment variables.
- Very specific: line 13
ALWAYS produce deterministic output: sort by order then id (fragments) or by path (file ops).
- Very specific: line 14
ALWAYS emit POSIX paths relative to the project root in FileOp.path.
- Distinctive: line 16
ALWAYS-on content goes only into AGENTS.md (PRD §5.1).
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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: Purity and determinism rules for resolver, planning, target adapters, and doctor checks
globs: src/plan/**/*.ts,src/targets/**/*.ts,src/registry/resolve.ts,src/doctor/**/*.ts
alwaysApply: false
---
# Pure Modules
These modules turn data into data. They are snapshot-tested and must produce identical output on every run and OS.
- NEVER import `node:fs`, `node:child_process`, `process`, `ui/`, `io/`, or `detect/` here. Receive everything as parameters.
- NEVER read the clock, randomness, or environment variables; pass them in if ever needed.
- ALWAYS produce deterministic output: sort by `order` then `id` (fragments) or by path (file ops); no timestamps or CLI versions in generated content; end files with exactly one `\n`.
- ALWAYS emit POSIX paths relative to the project root in `FileOp.path`.
- Target adapters are independent: NEVER import one adapter from another; shared helpers go in `src/plan/`.
- ALWAYS-on content goes only into `AGENTS.md` (PRD §5.1); agent adapters NEVER duplicate it.
- Managed-block ops carry `blockId` + inner content only; markers are added by `src/io/`.
- Serialize frontmatter exactly as each agent expects (PRD §5.3–§5.4), and round-trip test it with `yaml.parse`.
```ts
// ✅ Good: pure, data in → data out
export function cursorAdapter(ctx: TargetContext): FileOp[] { /* ... */ }
// ❌ Anti-pattern: hidden I/O in a pure module
export function cursorAdapter(ctx: TargetContext): FileOp[] {
const existing = fs.readFileSync('.cursor/rules/x.mdc', 'utf8');
/* ... */
}
```
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.

