agentleFS
qivora-labsqivora-labs/agentinit/.cursor/rules/pure-modules.mdc

agentinit / rules

Cursor rule1 starsChanged 12 days agoMITView on GitHub

Purity and determinism rules for resolver, planning, target adapters, and doctor checks

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
  1. Very specific:

    NEVER import node:fs, node:child_process, process, ui/, io/, or detect/ here.

    line 11
  2. Distinctive:

    NEVER read the clock, randomness, or environment variables.

    line 12
  3. Very specific:

    ALWAYS produce deterministic output: sort by order then id (fragments) or by path (file ops).

    line 13
  4. Very specific:

    ALWAYS emit POSIX paths relative to the project root in FileOp.path.

    line 14
  5. Distinctive:

    ALWAYS-on content goes only into AGENTS.md (PRD §5.1).

    line 16

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
pure-modules.mdc
---
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');
  /* ... */
}
```

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.