monorepo-agent-setup
Skill18 starsChanged 2 months agoApache-2.0View on GitHub
USE WHEN: editing Cursor/Claude agent config, rules, hooks, skills, MCP, subagents, slash commands, or dual-tree sync; or when asking how Claude vs Cursor instructions are laid out in this monorepo. DO NOT USE WHEN: implementing app features, Workers, or frontend UI unless the task is specifically about agent tooling.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- .cursor/rules/backend/hono-gateway.mdcCursor rule
- .cursor/rules/backend/ports.mdcCursor rule
- .cursor/rules/backend/service-bindings.mdcCursor rule
- .cursor/rules/backend/workers-cache.mdcCursor rule
- .cursor/rules/backend/workers-config.mdcCursor rule
- .cursor/rules/contracts/contracts.mdcCursor rule
- .cursor/rules/core/agent-instructions.mdcCursor rule
- .cursor/rules/core/boundaries.mdcCursor rule
- .cursor/rules/core/guardrails.mdcCursor rule
- .cursor/rules/core/turborepo.mdcCursor rule
- .cursor/rules/core/worktrees.mdcCursor rule
- .cursor/rules/frontend/react.mdcCursor rule
- .cursor/rules/frontend/tailwind.mdcCursor rule
- .cursor/rules/frontend/tanstack-query.mdcCursor rule
- .cursor/rules/frontend/tanstack-router.mdcCursor rule
- .cursor/rules/frontend/vite-config.mdcCursor rule
- .cursor/rules/ops/cd.mdcCursor rule
- .cursor/rules/ops/changesets.mdcCursor rule
- .cursor/rules/ops/ci.mdcCursor rule
- .cursor/rules/ops/previews.mdcCursor rule
- .cursor/rules/ops/quality-report.mdcCursor rule
- .cursor/rules/ops/release.mdcCursor rule
- .cursor/rules/quality/code-style.mdcCursor rule
- .cursor/rules/quality/comments.mdcCursor rule
- .cursor/rules/quality/knip.mdcCursor rule
- .cursor/rules/quality/lint-config.mdcCursor rule
- .cursor/rules/quality/markdown-style.mdcCursor rule
- .cursor/rules/quality/naming.mdcCursor rule
- .cursor/rules/quality/simplicity.mdcCursor rule
- .cursor/rules/quality/testing.mdcCursor rule
- .cursor/rules/quality/typescript-config.mdcCursor rule
- .cursor/rules/tests/front-react.mdcCursor rule
- .cursor/rules/tests/hono-workers.mdcCursor rule
- cfSkill
- changesetSkill
- front-vitestSkill
- git-commitSkill
- honoSkill
- playwright-cliSkill
- pnpmSkill
- react-doctorSkill
- reviewSkill
- review-stackSkill
- run-appSkill
- security-auditSkill
- skills-updateSkill
- tanstack-configSkill
- tanstack-devtoolsSkill
- tanstack-querySkill
- tanstack-routerSkill
- turborepoSkill
- ui-ux-design-best-practicesSkill
- vercel-react-best-practicesSkill
- workers-best-practicesSkill
- skills-updateSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Put instructions in the layer that matches how often agents need them.
- Distinctive: line 43
Do not duplicate path-scoped or linter detail in root AGENTS.md.
- Distinctive: line 47
When changing agent setup, keep both tools in sync:
- Very specific: line 54
MCP: keep .mcp.json and .cursor/mcp.json server lists aligned (type: "http" on HTTP servers).
- Very specific: line 55
Nested guides: update AGENTS.md; keep CLAUDE.md as @AGENTS.md + Claude-only bullets.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Monorepo agent setup
Canonical layout and sync policy for Cursor and Claude Code in this repo.
Memory layout
| Layer | Claude Code | Cursor |
| Global instructions | CLAUDE.md (@AGENTS.md) | AGENTS.md |
| Path-scoped rules | .claude/rules/ (*.md) | .cursor/rules/ (*.mdc) |
| Hooks wiring | .claude/settings.json | .cursor/hooks.json |
| Hook scripts | hooks/ (shared) | hooks/ (shared) |
| Subagents | .claude/agents/ | .cursor/agents/ |
| Domain reviews | /review under .agents/skills/review/ (symlink) - protocol in SKILL.md, reviewer contract in reviewer.md, one file per domain in domains/<id>.md | Same |
| Stack reviews | /review-stack under .agents/skills/review-stack/ (symlink) - protocol in SKILL.md, one companion per dependency in deps/<dep>.md | Same |
| Deep skills | Symlinks → .agents/skills/ | .agents/skills/ (source of truth) |
| Nested app guides | CLAUDE.md per app/package | AGENTS.md per app/package |
- Claude: nested
CLAUDE.mdloads on demand; debug withtail -f hooks/logs/instructions-loaded.log. - Cursor: nested
AGENTS.mdby directory;.mdcrules attach viaglobs/alwaysApply. Debug: Customize → Hooks. - Rule folders (
core,frontend,backend,contracts,quality,tests,ops) organize only; scoping is frontmatter (pathsvsglobs/alwaysApply).
See hooks/AGENTS.md for hook authoring.
Content taxonomy (what belongs where)
Put instructions in the layer that matches how often agents need them. Path-scoped rules save context; alwaysApply / rules without paths cost the same as root AGENTS.md.
| Layer | Put here | Examples |
Root AGENTS.md | Always-on project map for almost every task | Overview, worker prefixes, where-to-put, essential pnpm scripts, architecture decision bullets, pointers |
Path-scoped rules (mirrored .cursor / .claude) | Only when editing matching files | Ports / inspectorPort / strictPort, Worker secrets (bindings.secret()), contract workflow, oxlint style, TSConfig presets |
Nested app/package AGENTS.md | Package-local workflows | apps/front-app, worker-api, dtos-common |
| Skills | Deep / on-demand procedures | monorepo-agent-setup, turborepo, hono, review skills |
README.md | Human-facing docs | Architecture diagram, onboarding, scaffold checklist, human-only /review and /review-stack usage |
Do not duplicate path-scoped or linter detail in root AGENTS.md. Prefer a one-line pointer to the owning rule, skill, or README.
Sync policy
When changing agent setup, keep both tools in sync:
- Rules: edit both
.cursor/rules/<cat>/<name>.mdcand.claude/rules/<cat>/<name>.md(remap frontmatter: Cursordescription/globs/alwaysApply↔ Claudepaths). The agent-facing contract (loading, placement, density, twin rules) is rulecore/agent-instructions, which loads whenever a rule, agent, orAGENTS.mdis read. - Agents: edit both
.cursor/agents/<name>.mdand.claude/agents/<name>.md(keep product-native keys:model,tools,readonly,color). - Hooks: edit scripts only under
hooks/; update both.cursor/hooks.jsonand.claude/settings.jsonwhen wiring changes. - Skills: install/update under
.agents/skills/+skills-lock.json(when present). Claude entries are symlinks into.agents/skills/(except Cursor-onlyskills-update). Project-owned skills (pnpm,ui-ux-design-best-practices,monorepo-agent-setup,front-vitest,run-app,cf,changeset,review,review-stack) live once under.agents/skills/. - Review skills: two skills with the same shape - a protocol in
SKILL.md, one reference file per unit whose frontmatter is the registry, one parallel subagent per selected unit, verification in the main thread, one reply withC/I/O/VIDs (/reviewaddsHfor hardening) answered byfix/accept. Both run from the main thread (nocontext: fork, because they fan out), write no files, and setdisable-model-invocation: true: only a human can run them, so they cannot be preloaded into a subagentskills:field - reviewers get file paths instead./reviewchecks our code and design by domain:review/domains/<id>.md(id,summary,model, optionalapplies_when; body Ground truth, Scope, Probe, Axes, Critical when, Overlaps, Accepted, optional Extra output), the shared contractreview/reviewer.md(finding definition, evidence bar, severity, return block), run by the read-onlyreviewersubagent./review-stackchecks third-party tools against their current docs:review-stack/deps/<dep>.md(id,summary,families,packages,paths), withreview-stack/scripts/preflight.mjsresolving selectors (includingchanged) and printing the version snapshot; it mandates ground-truth retrieval (documentation MCP collector → official domains → changelogs) and cites a source per finding. To cover a new domain or tool, add one file; never a new skill directory or table row. Thetestsandsimplicitydomains are the audit halves of rulesquality/testingandquality/simplicity, and thesecuritydomain reads the vendoredsecurity-auditcompanions by path (never edits them).pnpmalso setsdisable-model-invocation: true;front-viteststays model-invocable because the thintests/front-reactrule points at it. - MCP: keep
.mcp.jsonand.cursor/mcp.jsonserver lists aligned (type: "http"on HTTP servers). - Nested guides: update
AGENTS.md; keepCLAUDE.mdas@AGENTS.md+ Claude-only bullets.
Agent guides (apps / packages)
| Focus | Guide |
| pnpm workspaces | .agents/skills/pnpm/SKILL.md |
| React SPA | apps/front-app/AGENTS.md |
| HTTP gateway | apps/worker-api/AGENTS.md |
| Zod DTOs | packages/dtos-common/AGENTS.md |
| Shared value sets | packages/enums-common/AGENTS.md |
| Shared Hono middleware | packages/hono-middleware/AGENTS.md |
| TS presets | packages/typescript-config/AGENTS.md |
| Agent hooks | hooks/AGENTS.md |
Inventory (quick)
- Rules: mirrored basenames (
core/guardrails,quality/comments, andquality/simplicityalways-on);tests/holds hono-workers + front-react (DOM/RTL depth in skillfront-vitest), while the general Vitest toolchain and the test value bar live inquality/testing;ops/holdsci,cd,previews,release, andchangesets(writing them; the procedure is skillchangeset). Nodrizzle-ormrule until a DB-owning worker lands. - Subagents:
explorer,planner,verifier,bundle-analyzer,docs-researcher,reviewer. - Skills: mirrored basenames plus the
/reviewdomain review (one file per domain) and the/review-stackstack review (one companion per dependency), see Review skills above; deep skills (react-doctor,turborepo,workers-best-practices, TanStack family) and the project skillcfare consulted as context by their matching companion. - Cursor hooks:
beforeShellExecution(git guards,failClosed),afterFileEdit(format/lint),sessionStart. - Claude hooks: PreToolUse Bash (same git guards), PostToolUse Edit|Write (format/lint), InstructionsLoaded.
- MCP: documentation MCP servers registered in
.mcp.json(currentlycontext7- a library-docs collector - andcloudflare-docs). Keep the Cursor Cloudflare plugin disabled unless you need account-scoped bindings/builds/observability MCP (those trigger OAuth login); do not double-register a documentation collector via plugin.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

