project-rules

A set of project rules for an Anchor codebase, including required reading, quality checks, folder structure, commit style, and pull-request limits. Anchor is the project these rules were written for.

In plain words
What is it for?
Use it when working in the covered project to follow its documentation, testing, linting, file-structure, commit, and pull-request requirements.
Why use it?
It gives an agent the project’s expected working practices before it changes code or prepares a commit.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/peva3/anchor/project-rules
Clone the repo
git clone --depth 1 https://github.com/peva3/anchor

Made for: Cursor.

Per session 595 This file is loaded in full into every session.
When invoked 595 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00595 $0.00595
Opus 5 $0.00298 $0.00298
Sonnet 5 $0.00119 $0.00119
Haiku 4.5 $0.00060 $0.00060

Measured 2d ago against content hash e59334308bd7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

project-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/project-rules.mdc · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor AI Rules

These rules are loaded automatically for this project. See AGENTS.md for full details.

Core Directives

  1. Read AGENTS.md before any task — All rules are defined there
  2. Read DEEPDIVE.md — System architecture narrative
  3. Follow every section — Core principles, commit protocol, testing, linting, etc.

Critical Enforcements

Pre-Commit Checklist

ruff check .
ruff format .
vulture .
mypy .

Do not commit until all pass. (Section 9)

Required Folders

Every project MUST have:

  • tests/ — All tests + random scripts (in .gitignore)
  • docs/ — Architecture documentation
  • research/ — Whitepapers, references

Commit Style

Human-sounding, WHY-focused messages. Example:

api: Added JWT refresh to prevent 401 loops

The token refresh had a race condition where concurrent requests
could trigger multiple refresh calls. Added mutex lock around auth state.

See Section 15 for the full pattern.

PR Standards (Section 33)

  • 800 lines max, 500 for complex logic
  • Single feature per PR
  • Use the PR template (Section 35)

AI Code Quality (Section 34)

Self-check: think first, spot laziness, uncertainty, bloat.

Pre-Commit Hooks (Section 37)

Mandatory. Install once: pre-commit install. Hooks run on every commit.

Decision Ladder (Section 50.1)

Before any implementation: YAGNI → stdlib → native → existing dep → one line → minimum.

Tradeoff Comments (Section 50.2)

For every intentional shortcut, document with # ponytail: <what> / # Upgrade to <what> if <trigger>.

Prohibited

  • No PRs/issues/GitHub activity without explicit user approval (Section 2)
  • No dead code, unused imports, silent exception handlers (Section 1)
  • No commits without running lint/vulture sweep first (Section 9)
  • No mutable default arguments, bare excepts, eval/exec (Section 27.2)
  • No force push to shared branches (Section 36.2)
  • No PRs over 800 lines (Section 33)
  • No skipping pre-commit hooks (Section 37)

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 76 lines · 595 tokens per session scan A e59334308bd7

Subscribe to this mod's changes

project-rules is a cursor rule published in the GitHub repository peva3/anchor (8 stars, last pushed 12d ago), licensed MIT. It adds 595 tokens to every session, about $0.0030 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.