peva3/anchor
Anchor — the production-grade AGENTS.md template for AI coding agents. 51 sections of battle-tested rules. Keep your age
Actual rules from this repo
Path in source repo: .cursor/rules/project-rules.mdc · format: mdc
# 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
```bash
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)
## Validation
Before marking complete:
- [ ] Tests pass
- [ ] No vulture findings
- [ ] Type check clean
- [ ] DEEPDIVE.md updated if needed
- [ ] Human commit message
- [ ] PR under 800 lines
- [ ] Pre-commit hooks passed
- [ ] AI anti-pattern self-check passed
- [ ] Decision ladder applied
- [ ] Tradeoff comments for shortcuts
Why this is listed
This repository appears on Cursor Rules Live because it matches the tracker's GitHub Search criteria (cursor-rules) and was active in the recent indexing window. The tracker refreshes every 15 minutes, so the metadata above reflects the state at the most recent index pass. If the data here looks stale, the source repository may have been archived or moved out of the tracked topic; the next cron tick will reconcile.