agentleFS
bordenetbordenet/superpowers-plus/.cursor/rules/invariants.mdc

superpowers-plus / rules

Cursor rule8 starsChanged 3 days agoMITView on GitHub

invariants rules

The file

We split this invariants.mdc into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 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.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After editing ANY guidance file, run: wc -l AGENTS.md .ai-guidance/*.md 2>/dev/null

    line 12
  2. Distinctive:

    If threshold exceeded: STOP → draft a diff for a human to merge.

    line 19
  3. Distinctive:

    Verify: each file ≤250 lines

    line 39
  4. Very specific:

    Recovery: If verification fails, restore from /tmp/original.md

    line 41

≈ “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
invariants.mdc
---
description: invariants rules
alwaysApply: true
---

# Critical Invariants — Always Follow

> **Load at START of every conversation.**

## Self-Management Protocol

After editing ANY guidance file, run: `wc -l AGENTS.md .ai-guidance/*.md 2>/dev/null`

| File | Limit | Action if exceeded |
|------|-------|-------------------|
| `AGENTS.md` | 250 lines | Extract to `.ai-guidance/*.md` |
| `.ai-guidance/*.md` | 250 lines | Split into sub-directory |

**If threshold exceeded:** STOP → draft a diff for a human to merge. Do not apply the diff. The size cap exists so agents do not grow the file they are reading.

## Zero Data Loss Checklist

- [ ] Snapshot captured: `cat <file> > /tmp/original.md`
- [ ] Every section accounted for in new structure
- [ ] No rules deleted (only moved/split)
- [ ] Diff shows reorganization, not deletion

## Refactoring Steps

**AGENTS.md → .ai-guidance/:**
1. Snapshot → `mkdir -p .ai-guidance` → Classify by topic
2. Extract to sub-files (≤250 lines each) → Update loading table
3. Verify: `wc -l AGENTS.md` ≤250

**Sub-file → sub-directory** (e.g., `testing.md` exceeds 250 lines):
1. `mkdir -p .ai-guidance/testing`
2. Split into topic files (`unit.md`, `integration.md`, etc.)
3. Replace original with index referencing sub-files
4. Verify: each file ≤250 lines

**Recovery:** If verification fails, restore from `/tmp/original.md`


<!-- golden-agents:generated -->

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.