cursor-handbook
girijashankarj · girijashankarj/cursor-handbook
This open-source rules engine gives Cursor IDE permanent memory of your standards, enforcing consistent code quality across projects and teams.
Open-source rules engine for Cursor IDE — 110 rules, agents, skills, commands that give AI permanent memory of your standards. Demo: 30%+ token savings, blocks hardcoded secrets, type-check instead of 100K-token test runs, consistent code across team.
Preview
What you can do with it
- Ensure all generated code adheres to a company's specific style guide and best practices.
- Automatically block AI from introducing hardcoded secrets into the codebase.
- Enforce architectural patterns or specific library usages across all AI-generated code.
Safety check
Usable, but read the notes first.
- ●Installer downloads a remote script and pipes it to the shell.
README.md
Automated scan of the repo files. Always review code you run.
From the README
cursor-handbook
The open-source rules engine for Cursor IDE — 110 rules, agents, and skills that turn your AI into a senior engineer who follows your standards, knows your codebase, and never wastes a token.
Stop teaching your AI the same things every session. cursor-handbook gives Cursor permanent memory of your standards, security policies, and workflows — across every project, every team member, every prompt.
If cursor-handbook helps you, consider giving it a ⭐ — it helps others discover it.
Table of Contents
Ways to use cursor-handbook
Pick the option that fits your workflow:
| Option | Best for |
|---|---|
| 1. Clone & copy | Use the full rules engine in your repo. Clone this repo, copy the .cursor folder into your project, then edit project.json and tailor rules/agents/skills to your stack. |
| 2. Add from GitHub (Cursor UI) | Use rules, skills, or agents without cloning. In Cursor IDE go to Settings → Rules / Skills / Agents, click Add new → Add from GitHub, and paste this repo’s clone URL. Add only what you need. |
| 3. Fork & customize | Maintain your own version. Fork this repo, adapt the .cursor files for your team or product, then use that fork across your projects or share it internally. |
| 4. Pick and choose | Use individual components. Download only the production-ready, generic rules, skills, agents, commands, or hooks you need from this repo and drop them into your existing .cursor setup. |
Improvements welcome. If you want to add or improve rules, skills, hooks, agents, or commands, see CONTRIBUTING.md and open an issue or PR.
Forking? Replace
girijashankarjwith your GitHub org/username in badges, clone URLs,scripts/setup-cursor.sh,.github/CODEOWNERS, and docs before pushing.
The Problem
Every time you open Cursor IDE, your AI assistant starts from zero. It doesn't know your:
- Code conventions and architecture patterns
- Security policies (and happily hardcodes your API keys)
- Testing thresholds (and runs the full 100K-token test suite when you just wanted a type check)
- Handler patterns, naming conventions, or folder structure
You end up repeating yourself, burning tokens, and fixing the same mistakes. cursor-handbook fixes this permanently.
Before vs After
| Before cursor-handbook | After cursor-handbook |
|---|---|
| AI hardcodes API keys | Security rules block it |
| AI runs full test suite (~100K tokens) | Uses type-check (~10K) or single-file tests |
| You repeat conventions every session | Rules remember them — always on |
| Inconsistent code across team | One rules engine, one standard |
| No guardrails on expensive ops | Hooks warn or block dangerous commands |
Who is this for?
| Audience | Benefit |
|---|---|
| Solo developers | Consistent AI behavior without repeating yourself every session |
| Teams | Shared standards; everyone gets the same guardrails and conventions |
| Enterprises | Security, compliance, and token efficiency built in from day one |
How It Works
graph TB
subgraph INPUT ["Your Prompt"]
A[Developer types a prompt in Cursor]
end
subgraph HOOKS_PRE ["Pre-Processing Hooks"]
B[context-enrichment.shInjects project context]
C[shell-guard.shBlocks dangerous commands]
end
subgraph ENGINE ["cursor-handbook Engine"]
D[29 RulesAlways-applied standards]
E[34 AgentsSpecialized AI assistants]
F[21 SkillsStep-by-step workflows]
G[14 CommandsQuick actions]
end
subgraph CONFIG ["Project Settings"]
H[project.jsonYour project settings]
end
subgraph HOOKS_POST ["Post-Processing Hooks"]
I[post-edit-check.shValidates changes]
J[auto-format.shFormats code]
K[coverage-check.shVerifies thresholds]
end
subgraph OUTPUT ["AI Response"]
L[Code that follows YOUR standardswith 30%+ fewer tokens]
end
A --> B --> C --> D
D --> E & F & G
H -.->|configures| D & E & F & G
E & F & G --> I --> J --> K --> L
style INPUT fill:#1a1a2e,stroke:#e94560,color:#fff
style HOOKS_PRE fill:#16213e,stroke:#0f3460,color:#fff
style ENGINE fill:#0f3460,stroke:#533483,color:#fff
style CONFIG fill:#533483,stroke:#e94560,color:#fff
style HOOKS_POST fill:#16213e,stroke:#0f3460,color:#fff
style OUTPUT fill:#1a1a2e,stroke:#00d2ff,color:#fff
What's Inside
%%{init: {'theme': 'neutral'}}%%
mindmap
root((cursor-handbook110 Components))
Rules — 29
Architecture — 3
Backend — 6
Frontend — 4
Security — 3
Database — 3
Cloud — 3
Testing — 3
DevOps — 3
Core — 1
Agents — 34
Architecture — 3
Backend — 7
Frontend — 4
Testing — 4
Database — 2
Security — 3
Cloud — 3
DevOps — 3
Business — 2
AI/ML — 1
Docs — 1
Platform — 1
Skills — 21
Backend — 4
Frontend — 2
Testing — 2
Database — 3
Cloud — 3
DevOps — 4
Docs — 3
Commands — 14
Hooks — 12
Templates — 9
| Layer | Count | What It Does | How It's Triggered |
|---|---|---|---|
| Rules | 29 | Enforces coding standards on every AI interaction | Automatically — always on |
| Agents | 34 | Specialized assistants for complex tasks | On demand — `/age |