Cursor integration
How Cursor consumes shared workflow policy from this repository and how consuming superbuild repos materialize active rules.
Design stance
Cursor is one consumer of this repository, not the owner of policy. Canonical content lives in AGENTS.md and docs/. Files under cursor/rules/ are adapter rule sources — short, composable instructions that tell Cursor to read canonical docs before acting.
Two Cursor rule locations
| Path | Scope |
|---|---|
cursor/rules/ in this repo | Shared adapter sources shipped to all consumers |
.cursor/rules/ in this repo | Self-governance for maintainers editing superbuild-workflow |
.cursor/rules/ in consuming repos | Materialized shared adapters + local overlays |
Cursor discovers rules from the workspace root .cursor/rules/. Consuming repos therefore materialize shared adapters locally; they do not rely on Cursor reading through the submodule path unless explicitly configured.
Typical consumer setup
- Submodule mounted at
tools/ai-rules/ - Setup script (see
templates/setup-dev.template.sh) copies or symlinks:tools/ai-rules/cursor/rules/*.mdc→.cursor/rules/
- Local overlay files remain in
.cursor/rules/with distinct names (e.g.90-local-overlay.mdc) - Consumer root
AGENTS.mdpoints agents totools/ai-rules/AGENTS.md
Copy vs symlink
| Method | Pros | Cons |
|---|---|---|
| Symlink | Auto-tracks submodule content | Windows permission/developer mode quirks |
| Copy | Simple, universal | Must re-run script after submodule bump |
Teams pick one approach and document it in consumer AGENTS.md.
Shared adapter files
| File | Role |
|---|---|
00-common-superbuild.mdc | Entry: read AGENTS.md and docs before workflow/build changes |
01-cmake-conan-policy.mdc | CMake authority, Conan role, presets, cross-platform |
02-repo-layout.mdc | src/, libs/, tools/ai-rules/, local overlays |
Adapters should:
- Use frontmatter (
description,globs,alwaysApplyas appropriate) - Stay concise; link paths to
tools/ai-rules/docs/ - Not duplicate full governance text
Self-governance in this repo
When editing superbuild-workflow in this repository, Cursor loads .cursor/rules/:
00-governance.mdc10-doc-sync.mdc20-change-scope.mdc
These do not ship to consumers as mandatory copies; they govern maintainers of the canonical repo.
Agent behavior expectations
In a consuming repo, Cursor agents should:
- Respect materialized shared rules in
.cursor/rules/ - Read
tools/ai-rules/AGENTS.mdfor shared policy depth - Read consumer root
AGENTS.mdfor local exceptions - Not edit files under
tools/ai-rules/for shared policy fixes unless tasked to update the submodule upstream
Updating after submodule bump
When tools/ai-rules/cursor/rules/ changes:
- Bump submodule commit in consumer
- Re-run materialization step
- Preserve local overlay files (script should not delete
9*-local-*.mdcor similar convention) - Smoke-test that Cursor lists expected rules
Related documents
- alternative-tool-integration.md — non-Cursor tools
- repository-layout.md — where
.cursor/rules/fits - workflow.md — rollout process