6 · Cursor & other IDEs
Objective — make every AI tool (Cursor, Gemini, Codex) boot from the same AGENTS.md constitution, and register the project’s MCP servers — chiefly Laravel Boost — in .mcp.json at the repo root (C6 commit).
Background
Section titled “Background”The constitution (AGENTS.md) is tool-agnostic by design — one canonical file, every other tool file is a one-line redirect. This step makes the other agents — Cursor, Gemini, Codex — boot from that same AGENTS.md, and registers the project’s MCP servers so any tool can reach them.
The rule across all of them: one canonical file (AGENTS.md), every other tool file is a one-line redirect. That’s what keeps the constitution from drifting across five tools.
1. Register the project MCP servers (.mcp.json)
Section titled “1. Register the project MCP servers (.mcp.json)”Project-scoped MCP servers live in .mcp.json at the repo root (committed at C6) so every teammate and every tool gets them. The key one for Laravel is Laravel Boost — it adds search-docs (version-specific docs), tinker, database-query, browser-logs, and more.
-
Do not enable Boost until local development installs it.
This phase happens before the extracted Laravel app is fully running, so a live
.mcp.jsonentry that callsphp artisan boost:mcpwill throw connection errors for two phases. Keep the Boost snippet disabled or parked in.mcp.json.exampleuntil local development installs the package.Terminal window composer require laravel/boost --devphp artisan boost:install# Expected: Boost installs; `boost:install` scaffolds config and guidelines- ✅
composer show laravel/boostlists the package as installed.
- ✅
-
Write
.mcp.jsononly after Boost exists.{"mcpServers": {"laravel-boost": {"command": "php","args": ["artisan", "boost:mcp"],"disabled": true}}}If your MCP client ignores
disabled, keep this exact object in.mcp.json.exampleand do not commit it as live.mcp.jsonuntilcomposer show laravel/boostpasses. After Phase 3 installs Boost, remove"disabled": true, validate JSON, and smoke-testsearch-docs.Terminal window python3 -m json.tool .mcp.json >/dev/null && git add -n .mcp.json# Expected: valid JSON; dry-run lists file only after Boost exists or the entry is disabled- ✅
.mcp.jsonis valid JSON on disk and cannot call a missing Boost package.
- ✅
2. Boot Cursor from the constitution
Section titled “2. Boot Cursor from the constitution”Cursor reads .cursor/rules/*.mdc and supports the same skills · commands · agents · hooks layers as Claude Code — keep them in sync so every tool gets the same operating system.
-
Add the always-apply boot rule as
.cursor/rules/000-boot.mdc.---description: Boot — read the constitution firstalwaysApply: true---# BootRead `AGENTS.md` at the repo root FIRST — it is the cross-tool constitution(tech stack, conventions, safety rules, read-set). Then honor `.claude/rules/`(behavioral + reference rules) and `CLAUDE.local.md` if present.Key safety rules: never edit `vendor/`; wrap vendor edits in `ZAJ:BEGIN/END`;never run destructive migrations on shared data; always double-quote `.env` values.- ✅ File saved at
.cursor/rules/000-boot.mdcwithalwaysApply: true.
- ✅ File saved at
-
Mirror Claude’s agent layers under
.cursor/(same names, same contracts — the kit ships stubs/READMEs):Terminal window mkdir -p .cursor/{skills,commands,agents}# Kit ships: .cursor/skills/README.md, commands/deploy-codecanyon.md, agents/README.md# Install full skills/agents into BOTH .claude/ and .cursor/ when ready.- ✅
.cursor/skills/,.cursor/commands/, and.cursor/agents/exist and stay in sync with.claude/.
- ✅
-
Wire Cursor hooks —
.cursor/hooks.jsoncalls the sameblock-destructive.shguard Claude uses in yolo mode:{"version": 1,"hooks": {"beforeShellExecution": [{"command": ".claude/claude-mode/hooks/block-destructive.sh","matcher": ".*"}]}}- ✅ Destructive shell patterns (e.g.
migrate:fresh,rm -rf /) are blocked in Cursor too.
- ✅ Destructive shell patterns (e.g.
-
Add the
.cursorignoreso Cursor never indexes secrets..gitignore .env.env.*!.env.example!.env.tpl*.key*.pemauth.json**/secrets/**vendor/node_modules/storage/framework/bootstrap/cache/- ✅ Opening the project in Cursor → it acknowledges the constitution / safety rules without prompting; real secrets stay out of its index, while
.env.exampleand.env.tplremain visible as safe templates.
- ✅ Opening the project in Cursor → it acknowledges the constitution / safety rules without prompting; real secrets stay out of its index, while
3. Mirror Gemini & Codex (optional thin pointers)
Section titled “3. Mirror Gemini & Codex (optional thin pointers)”These tools also converge on AGENTS.md. Keep mirrors thin — a pointer, never a copy — so the constitution can’t fork across tools.
-
Add the Gemini mirror —
GEMINI.mdat the repo root.GEMINI.md Read **AGENTS.md** first — it is the single source of truth for this project.- ✅
GEMINI.mdis a one-line redirect, not a fork of the constitution.
- ✅
-
Point Codex back at
AGENTS.md. Codex readsAGENTS.mdnatively; if you keep a.codex/note, point it back the same way.- ✅ Any
.codex/config is a pointer toAGENTS.md, not a copy.
- ✅ Any
4. Verify all tools converge
Section titled “4. Verify all tools converge”Confirm the MCP servers respond and every IDE boots from the one canonical constitution before advancing.
-
Confirm
.mcp.jsonis valid on disk — functionalsearch-docssmoke test waits until local development (Boost needs a running app).- ✅
.mcp.jsonvalidates withpython3 -m json.tool; after local dev,search-docsreturns version-specific Laravel docs.
- ✅
-
Open the project in Cursor → it acknowledges the constitution / safety rules without prompting.
- ✅ Cursor boots from
AGENTS.mdwith no manual prompting.
- ✅ Cursor boots from
-
Check every mirror is a pointer, not a fork (
GEMINI.md,.codex/).- ✅ Each mirror is a one-line redirect back to
AGENTS.md.
- ✅ Each mirror is a one-line redirect back to
5. Commit MCP + Cursor mirrors (C6)
Section titled “5. Commit MCP + Cursor mirrors (C6)”-
Stage and commit C6 from the project root.
Terminal window git branch --show-current # must be developgit add .mcp.json .cursor# Optional thin mirrors — include if you created them:git add GEMINI.md .codex 2>/dev/null || truegit commit -m "feat(ai): wire .mcp.json + Cursor/other-IDE mirrors"git log --oneline -6 # C6 atop C5…C1# Expected: C6 on develop; .mcp.json + .cursor/ tracked- ✅
git logshows C6;.mcp.jsonand.cursor/rules/000-boot.mdcare tracked.
- ✅
Checklist
Section titled “Checklist”Do not mark this step done until every box below is checked.
- 🤖 C6 committed on develop —
.mcp.jsonvalid with Laravel Boost disabled/parked until installed, or live only after Boost exists;.cursor/mirrors tracked (git logshows C6). - 🤖 Cursor boot rule in place —
.cursor/rules/000-boot.mdcwithalwaysApply: truepoints atAGENTS.md. - 🤖 Cursor layers mirrored —
.cursor/skills/,.cursor/commands/,.cursor/agents/, and.cursor/hooks.jsonstay in sync with.claude/. - 🤖
.cursorignorein place — real secrets (.env,.env.*,*.key,*.pem,auth.json,**/secrets/**) excluded from Cursor’s index; safe templates (.env.example,.env.tpl) remain visible. - 🔀 Mirrors are thin pointers —
GEMINI.md(and any.codex/note) redirect toAGENTS.md, never a copy. - 🔀 Tools converge — opening Cursor acknowledges the constitution without prompting;
search-docsreturns version-specific Laravel docs after local dev.