|
1 | 1 | --- |
2 | 2 | title: New Repo Setup Checklist |
3 | | -description: Quick checklist to wire Cursor rules and context templates into a repository. |
| 3 | +description: Wire rules, skills, slash commands, MCP server, hooks, and workspace context files into a repo for any AI coding agent (Cursor, Claude Code, Codex). |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # New Repo Setup Checklist |
7 | 7 |
|
8 | | -## Setup rules |
| 8 | +Wire this repo's rules, skills, slash commands, MCP server, hooks, and workspace context files into a new project. Agent-neutral: works with Cursor, Claude Code, and Codex. |
9 | 9 |
|
10 | | -- [ ] Add the rules (recommended: submodule + symlink): |
| 10 | +> [!TIP] |
| 11 | +> **Fast path** (if you keep this repo as a shared checkout): |
| 12 | +> |
| 13 | +> ```bash |
| 14 | +> /path/to/cursor-engineering-rules/setup-workspace.sh -S -l . |
| 15 | +> ``` |
| 16 | +> |
| 17 | +> `-S` symlinks `rules/`, `-l` writes only `tmp/tasks.md`. Use `-f` for the full context-file set. The rest of this checklist documents what the script does **and the extras (skills, commands, MCP, hooks) it does not yet automate**. |
| 18 | +
|
| 19 | +## 1. Pick your install method |
| 20 | +
|
| 21 | +| Method | When | Trade-off | |
| 22 | +|---|---|---| |
| 23 | +| **Setup script** (`setup-workspace.sh`) | Default | Fast; symlinks `rules/` and scaffolds `tmp/`. Does not wire skills, commands, MCP, or hooks yet. | |
| 24 | +| **Symlink** | Personal use across many projects | One `git pull` in the source repo updates every consumer. Symlinks don't survive zip download. | |
| 25 | +| **Copy** | Self-contained projects, version-pinned | No live updates; re-copy on each bump. | |
| 26 | +| **Submodule** | Team projects, version-controlled | Locks the version; survives zip; needs `git submodule update --remote` to bump. | |
| 27 | +
|
| 28 | +This checklist assumes symlink or submodule. Copy is one `cp -r` per directory. |
| 29 | +
|
| 30 | +## 2. Rules |
| 31 | +
|
| 32 | +Rules (`.mdc`) load globally (`alwaysApply: true`) or by file-glob match. |
11 | 33 |
|
12 | 34 | ```bash |
| 35 | +# Symlink (personal, one repo) |
| 36 | +mkdir -p .cursor |
| 37 | +ln -s /path/to/cursor-engineering-rules/rules .cursor/rules |
| 38 | +
|
| 39 | +# Submodule (team, pinned) |
13 | 40 | git submodule add https://github.com/d-padmanabhan/cursor-engineering-rules.git .cursor-rules |
14 | 41 | mkdir -p .cursor |
15 | 42 | ln -s ../.cursor-rules/rules .cursor/rules |
| 43 | +
|
| 44 | +# Verify |
| 45 | +ls -la .cursor/rules |
| 46 | +readlink .cursor/rules |
16 | 47 | ``` |
17 | 48 |
|
18 | | -- [ ] Confirm `.cursor/rules` points where you expect: |
| 49 | +**Agent-neutral alternative:** ship a single `AGENTS.md` at the repo root (Cursor + Codex honor it; Claude Code reads `CLAUDE.md` natively and is rolling out `AGENTS.md` support). Useful when you don't want a `.cursor/` directory. |
| 50 | +
|
| 51 | +## 3. Skills (Agent Skills) |
| 52 | +
|
| 53 | +Skills are multi-step playbooks: test plans, deployment runbooks, security audits, refactor guides, etc. Auto-selected via the SKILL.md `description` triggers; invoke manually as `/skill-name`. |
19 | 54 |
|
20 | 55 | ```bash |
21 | | -ls -la .cursor/rules |
22 | | -readlink .cursor/rules |
| 56 | +# Cursor |
| 57 | +ln -s /path/to/cursor-engineering-rules/skills .cursor/skills |
| 58 | +
|
| 59 | +# Claude Code |
| 60 | +mkdir -p .claude |
| 61 | +ln -s /path/to/cursor-engineering-rules/skills .claude/skills |
| 62 | +
|
| 63 | +# Codex |
| 64 | +mkdir -p .codex |
| 65 | +ln -s /path/to/cursor-engineering-rules/skills .codex/skills |
23 | 66 | ``` |
24 | 67 |
|
25 | | -## Setup workspace context files |
| 68 | +Mix per project. See the **Skills shipped in this repo** section in the parent [README.md](README.md) for the catalog. |
26 | 69 |
|
27 | | -- [ ] Create `tmp/` (workspace-local, gitignored) |
28 | | -- [ ] Create `tmp/tasks.md` (minimum) |
| 70 | +## 4. Slash commands |
| 71 | + |
| 72 | +Slash commands provide explicit workflow phase transitions (`/plan`, `/build`, `/review`, `/self-review`, `/quick-review`, etc.). |
29 | 73 |
|
30 | 74 | ```bash |
31 | | -mkdir -p tmp/pr tmp/pr_reviews tmp/agent_reports tmp/bug_reports |
32 | | -cp .cursor/rules/templates/tasks.md.template tmp/tasks.md |
| 75 | +# Copy (no upstream updates) |
| 76 | +mkdir -p .cursor/commands |
| 77 | +cp -r /path/to/cursor-engineering-rules/commands/* .cursor/commands/ |
| 78 | + |
| 79 | +# Symlink (live updates) |
| 80 | +ln -s /path/to/cursor-engineering-rules/commands .cursor/commands |
| 81 | +``` |
| 82 | + |
| 83 | +Type `/<command>` in your agent's chat to trigger. See [commands/README.md](commands/README.md) for the full catalog (~19 commands). |
| 84 | + |
| 85 | +## 5. MCP server (optional, recommended) |
| 86 | + |
| 87 | +Install if you want **on-demand rule loading** via tool calls instead of pre-loading every `.mdc`. Useful when context budget matters. |
| 88 | + |
| 89 | +```bash |
| 90 | +cd /path/to/cursor-engineering-rules/mcp/cursor-rules-mcp |
| 91 | +npm install |
| 92 | +npm run build |
| 93 | +npm link # optional: makes `cursor-rules-mcp` globally invokable |
| 94 | +``` |
| 95 | + |
| 96 | +Then configure your agent. See [mcp/cursor-rules-mcp/INSTALLATION.md](mcp/cursor-rules-mcp/INSTALLATION.md) for per-agent setup (Claude Desktop, Cursor, Claude Code, Codex). |
| 97 | + |
| 98 | +## 6. Lifecycle hooks (optional) |
| 99 | + |
| 100 | +Deterministic guardrails (block reading `.env`, gate destructive shell commands) and audit logging via Cursor's hooks API. |
| 101 | + |
| 102 | +```bash |
| 103 | +/path/to/cursor-engineering-rules/scripts/cursor-hooks-install.sh |
33 | 104 | ``` |
34 | 105 |
|
35 | | -Optional (for complex work): |
| 106 | +See [docs/HOOKS.md](docs/HOOKS.md) for what each hook does, how to disable individual checks, and how to write your own. **Cursor-specific** today; the hooks API is not yet portable across agents. |
36 | 107 |
|
37 | | -- [ ] `tmp/project-brief.md` |
38 | | -- [ ] `tmp/active-context.md` |
39 | | -- [ ] `tmp/progress.md` |
| 108 | +## 7. Workspace context files |
| 109 | + |
| 110 | +Per-task context that the workflow rules (`010-workflow.mdc`, `020-agent-audit.mdc`) consume. |
| 111 | + |
| 112 | +```bash |
| 113 | +# Minimum: a tasks file |
| 114 | +mkdir -p tmp |
| 115 | +cp .cursor/rules/templates/tasks.md.template tmp/tasks.md |
| 116 | +``` |
| 117 | + |
| 118 | +For complex multi-phase work, add the full context set: |
40 | 119 |
|
41 | 120 | ```bash |
42 | | -cp .cursor/rules/templates/project-brief.md.template tmp/project-brief.md |
| 121 | +cp .cursor/rules/templates/project-brief.md.template tmp/project-brief.md |
43 | 122 | cp .cursor/rules/templates/active-context.md.template tmp/active-context.md |
44 | | -cp .cursor/rules/templates/progress.md.template tmp/progress.md |
| 123 | +cp .cursor/rules/templates/progress.md.template tmp/progress.md |
| 124 | +``` |
| 125 | + |
| 126 | +Other available templates (use as needed): |
| 127 | + |
| 128 | +- `creative-template.md.template` - design exploration / brainstorming |
| 129 | +- `design.md.template` - formal design doc |
| 130 | +- `prd.md.template` - product requirements |
| 131 | +- `reflect-template.md.template` - post-task reflection |
| 132 | + |
| 133 | +Optional working directories some workflows expect (create only what you use): |
| 134 | + |
| 135 | +| Path | Used by | |
| 136 | +|---|---| |
| 137 | +| `tmp/pr/` | PR drafts | |
| 138 | +| `tmp/pr_reviews/` | `/self-review`, `/quick-review` output | |
| 139 | +| `tmp/agent_reports/` | `020-agent-audit.mdc` audit reports | |
| 140 | +| `tmp/bug_reports/` | bug investigation notes | |
| 141 | + |
| 142 | +```bash |
| 143 | +mkdir -p tmp/pr tmp/pr_reviews tmp/agent_reports tmp/bug_reports |
| 144 | +``` |
| 145 | + |
| 146 | +## 8. Pre-commit hooks (recommended) |
| 147 | + |
| 148 | +Mirror this repo's pre-commit stack so your consumer repo gets the same secret-scanning + lint baseline. |
| 149 | + |
| 150 | +```bash |
| 151 | +brew install pre-commit # macOS |
| 152 | +# pip install pre-commit # any platform |
| 153 | + |
| 154 | +cp /path/to/cursor-engineering-rules/.pre-commit-config.yaml .pre-commit-config.yaml |
| 155 | +pre-commit install |
| 156 | +pre-commit run --all-files # baseline run |
45 | 157 | ``` |
46 | 158 |
|
47 | | -## Git hygiene (recommended) |
| 159 | +Key hooks: `gitleaks`, `ggshield` (secret scanning), `pre-commit-hooks` (trailing whitespace, large files, private keys, mixed line endings), `markdownlint`. |
| 160 | + |
| 161 | +## 9. Git hygiene |
48 | 162 |
|
49 | 163 | - [ ] **Git Hygiene:** Add the following to `.git/info/exclude` (preferred) instead of the repo `.gitignore`: `**/tmp/`, `.terraform/`, `.terragrunt-cache/`. Do not modify the repo `.gitignore` for these entries. |
50 | 164 |
|
|
57 | 171 | ``` |
58 | 172 |
|
59 | 173 | Rationale: these are personal / per-clone workspaces and tool caches, not project-wide policy. `.git/info/exclude` keeps them out of *your* working tree without imposing the convention on every collaborator via the committed `.gitignore`. |
| 174 | + |
| 175 | +## 10. Verify |
| 176 | + |
| 177 | +End-to-end smoke test that the wiring actually works: |
| 178 | + |
| 179 | +```bash |
| 180 | +# Rules: at least one known rule is on disk |
| 181 | +ls .cursor/rules/200-python.mdc # or 210-go.mdc, 410-aws.mdc, etc. |
| 182 | + |
| 183 | +# Skills: at least one SKILL.md is discoverable |
| 184 | +ls .cursor/skills/*/SKILL.md | head -3 # expect 3+ matches |
| 185 | + |
| 186 | +# Commands: at least one command markdown is present |
| 187 | +ls .cursor/commands/*.md | head -3 # expect 3+ matches |
| 188 | + |
| 189 | +# Templates resolve through the rules symlink |
| 190 | +ls .cursor/rules/templates/ | head -5 # expect template files |
| 191 | + |
| 192 | +# Workspace exclusion is in effect (tmp/ should not appear in `git status`) |
| 193 | +mkdir -p tmp && touch tmp/x && git status --short | grep '^?? tmp' && echo "FAIL: tmp/ leaking into git" || echo "ok: tmp/ excluded" |
| 194 | +rm tmp/x |
| 195 | +``` |
| 196 | + |
| 197 | +For agent-side verification: open a known file type (`.py`, `.tf`, `.go`) and confirm the matching rule is detected in the agent's settings panel (Cursor: Settings -> Rules & Memories; Claude Code: `/rules` command). |
| 198 | + |
| 199 | +If any step fails, re-check the symlink / copy step for that artifact. |
0 commit comments