agentleFS
HoangP8HoangP8/tokless/.cursor/rules/project-memory.mdc

tokless / rules

Cursor rule417 starsChanged 22 days agoMITView on GitHub

This rule guides recording project events and decisions in projectmem.

The file

We split this project-memory.mdc into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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. Distinctive:

    Use only the fixed event vocabulary.

    line 21
  2. Very specific:

    All writers accept location: "file:line".

    line 23
  3. Distinctive:

    Never log secrets, credentials, customer data, tokens, or large transcripts.

    line 24
  4. Very specific:

    Never edit summary.md (derived) or events.jsonl (append-only).

    line 26
  5. Distinctive:

    Before exiting: memory must reflect what actually happened.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 7,111 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
project-memory.mdc
---
description: This rule guides recording project events and decisions in projectmem.
alwaysApply: true
---
## Project Memory (projectmem)

Tools record what broke, what was tried, and what was decided, across sessions, in `.projectmem/`.

### Rules

| Event | Tool | Rule |
|-------|------|------|
| Bug found | `log_issue` | Trigger: bug, unclear behavior, hypothesis, or investigation topic. |
| Fix tried | `record_attempt` | `outcome`: `worked`, `failed`, or `partial`. One call per attempt. |
| Fix proven | `record_fix` | Needs evidence: test passes, error gone, or user confirms. Closes issue. |
| Design choice | `add_decision` | Replaces older decision: set `supersedes` to old event id — the old one retires from the summary, history is never rewritten; two disagreeing decisions corrupt trust. |
| Gotcha found | `add_note` | Prefix `gotcha:`. Shared across projects. Also use for notes and key files future contributors should read first. |

- Log as soon as a trigger fires — before any other work.
- One call per event, decisions and gotchas alike; never batch writer calls.
- Use only the fixed event vocabulary; never invent new event types.
- Log every fix, small ones too. Keep entries short and specific: file, error, test name.
- All writers accept `location: "file:line"`.
- Never log secrets, credentials, customer data, tokens, or large transcripts.
- Edit `PROJECT_MAP.md` and `plan.md` directly. Never log plans as events — a user's idea or plan belongs in `plan.md`.
- Never edit `summary.md` (derived) or `events.jsonl` (append-only). Stale detail there → record the correction with a writer tool.
- Superseding a decision? Get the old event id from `events.jsonl`, pass it as `supersedes`.
- Trust recorded memory over recall; don't re-derive answers by re-reading `summary.md` or source files.
- Before exiting: memory must reflect what actually happened.

### Examples

```
log_issue(summary: "JWT parse fails on expired token", location: "auth/middleware.go:42")
record_attempt(summary: "Moved expiry check before signature verify", outcome: "failed", issue_id: "0001")
record_fix(summary: "Use leeway comparison at boundary", issue_id: "0001")
add_decision(summary: "Use pgx pool over database/sql", supersedes: "<old event id>")
add_note(summary: "gotcha: local CI skips integration tests without TEST_DB set")
```

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.