Setup Cursor Copies
Setup foundation cursor rules and commands in .cursor/ (run setup script).
Get the complete skill folder, including its scripts and reference files.
·
This page is available to readers but is excluded from the public index, because it does not yet meet the evaluation standard.
When to use this skill
Use Setup Cursor Copies when an AI agent needs a reusable SKILL.md workflow for this job: Setup foundation cursor rules and commands in .cursor/ (run setup script).
When not to use it
Skip Setup Cursor Copies when the task is outside the productivity category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/setup-cursor-copies # Save SKILL.md to ~/.claude/skills/setup-cursor-copies/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/setup-cursor-copies/SKILL.md. For a shared project, commit the folder at .claude/skills/setup-cursor-copies/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Setup Cursor Copies skill for this task: Submodule: Run after git submodule update (or any setup); symlinks keep .cursor/ in sync automatically. Confirm any required inputs or files before making changes.
What supports this recommendation?
71/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 71/100
- Practical detail
- 80/100
- Source evidence
- 56/100
- Source signals
- 72/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# Setup Foundation Cursor Copies
Sets up foundation cursor rules and commands in `.cursor/`. **When foundation is a git submodule**, creates **symlinks** (stays in sync with `git submodule update`). Otherwise creates **independent copies**.
## Command
``` setup_cursor_copies ```
or
``` setup cursor copies ```
## Purpose
This command runs the foundation setup script (`foundation/scripts/setup_cursor_copies.sh`) which:
1. **If foundation is a git submodule:** Delegates to `setup_cursor_rules.sh` and creates **symlinks** from foundation to `.cursor/` (single source of truth; updates apply with `git submodule update`). 2. **Otherwise:** Creates **independent copies** of foundation rules/commands in `.cursor/`. 3. Uses original filenames (no prefix). 4. Removes existing foundation files before creating new ones. 5. Preserves any non-foundation files (custom rules/commands).
**When run from the foundation repository itself**, it also automatically runs the setup script in peer repositories (located at `../*`) that include this foundation repo via symlink.
## When to Use
- **Submodule:** Run after `git submodule update` (or any setup); symlinks keep `.cursor/` in sync automatically. - **Copy mode (foundation not a submodule):** When you want independent copies, need to customize rules, symlinks are not suitable, or you version-control your own copies. Re-run after foundation updates to refresh.
## Submodule vs copy behavior
**When foundation is a git submodule** (this command delegates to `setup_cursor_rules`): - Creates symlinks to foundation (single source of truth) - Updates automatically when foundation changes (`git submodule update`) - Cannot customize foundation rules without breaking the link
**When foundation is a symlink or copy** (this command uses copy mode): - Creates independent file copies - Uses original filenames (no prefix) - Does NOT update automatically when foundation changes - Can be customized per repository - Must re-run script to get foundation updates
## Execution Instructions
### Step 1: Verify Foundation Directory
**Check if foundation exists:**
- Look for `foundation/` directory in repo root - If not found, check `../foundation/` (parent directory) - If still not found, error: "Foundation directory not found. Please ensure foundation is installed."
### Step 2: Run Copy Script in Current Repository
**Execute the script:**
```bash ./foundation/scripts/setup_cursor_copies.sh ```
**Or if foundation is in parent directory:**
```bash ../foundation/scripts/setup_cursor_copies.sh ```
### Step 3: Run Copy Script in Peer Repositories (If in Foundation Repo)
**If running from the foundation repository itself** (detected by presence of `agent_instructions/cursor_skills/` directory):
1. **Get current repository absolute path:** ```bash CURRENT_REPO=$(pwd -P) ```
2. **Find peer repositories in parent directory:** ```bash PARENT_DIR=$(dirname "$CURRENT_REPO") for peer_repo in "$PARENT_DIR"/*; do # Skip if not a directory or if it's the current repo if [ ! -d "$peer_repo" ] || [ "$peer_repo" = "$CURRENT_REPO" ]; then continue fi # Check if peer repo has foundation/ symlink pointing to this repo if [ -L "$peer_repo/foundation" ]; then SYMLINK_TARGET=$(readlink -f "$peer_repo/foundation" 2>/dev/null || readlink "$peer_repo/foundation") if [ "$SYMLINK_TARGET" = "$CURRENT_REPO" ]; then echo "Found peer repo with foundation symlink: $(basename "$peer_repo")" # Run copy script in peer repo using absolute path (cd "$peer_repo" && "$CURRENT_REPO/scripts/setup_cursor_copies.sh" || echo "Failed to run in $(basename "$peer_repo")") fi fi done ```
**Behavior:** - Only runs in peer repos if executing from foundation repo itself - Detects peer repos by checking `../*` directories - Verifies each peer repo has `foundation/` symlink pointing to current repo - Runs copy script in each matching peer repo - Continues even if one peer repo fails
**Expected output (when peer repos found):** ``` [INFO] ✅ Cursor rules setup complete! ... [INFO] Detected foundation repository - checking for peer repos... [INFO] Found peer repo with foundation symlink: my-project [INFO] Running copy setup script in my-project... [INFO] Foundation is a git submodule; using symlinks (setup_cursor_rules)... (or copy mode) ... [INFO] ✅ Cursor rules setup complete! [INFO] ✓ Successfully updated my-project
[INFO] Updated 1 peer repo(s) ```
### Step 4: Verify Results
**Check output:**
- **Submodule:** Script reports "Foundation is a git submodule; using symlinks", then rules **linked**. Check `.cursor/rules/` for symlinks; `.cursor/skills/` is populated from foundation skills. - **Copy mode:** Script reports rules and skills **copied**. Check `.cursor/rules/` and `.cursor/skills/` for regular files (not symlinks).
**Expected output (submodule):**
``` [INFO] Foundation is a git submodule; using symlinks (setup_cursor_rules)... [INFO] Setting up cursor rules and commands... [INFO] Creating symlinks for generic cursor rules... ✓ Linked security.mdc -> security.mdc ... [INFO] ✅ Cursor rules setup complete! [INFO] Foundation rules linked: X [INFO] Foundation commands linked: Y ```
**Expected output (copy mode):**
``` [INFO] Setting up cursor rules and commands (copy mode)... [INFO] Copying generic cursor rules... ✓ Copied security.mdc ... [INFO] ✅ Cursor rules setup complete! [INFO] Rules copied: X [INFO] Commands copied: Y ```
## What Gets Created
**When foundation is a submodule (symlinks):** - `.cursor/rules/` contains **symlinks** to `foundation/agent_instructions/cursor_rules/`. `.cursor/skills/` is populated from `foundation/agent_instructions/cursor_skills/` (skills replace legacy commands). Updates to foundation apply when you re-run setup.
**When foundation is not a submodule (copies):** - `.cursor/rules/` and `.cursor/skills/` contain **independent copies** of foundation rules and skills (e.g. `security.mdc`, `worktree_env.mdc`, and full skill workflows). Re-run to refresh after foundation updates.
**Note:** Repository rules from `docs/` are handled per `setup_cursor_rules` (symlinks when submodule) or copied in copy mode. Source files in `docs/` remain the source of truth.
## Behavior
**Filenames:** - Foundation rules/commands use original filenames (no prefix), e.g. `security.mdc` remains `security.mdc`.
**Submodule (symlinks):** Removes existing foundation files (symlinks or copies), then creates symlinks. Repo rules from `docs/` are symlinked; any existing file at the target path (symlink or regular file) is removed and replaced with the symlink to the source.
**Copy mode:** Removes existing foundation files, then creates copies. Repo rules from `docs/` are copied.
**Existing Files:** If a target already exists (symlink or regular file), it is removed and replaced with the symlink (or copy in copy mode). Source in `docs/` or foundation is the single source of truth.
**Existing Foundation Files:** Removed first (prefixed and unprefixed), then new symlinks or copies created. Ensures output matches current foundation.
**Copy mode only:** Files are independent; foundation changes do not apply until you re-run. You can customize copies.
## Error Handling
### Foundation Directory Not Found
**Error:** ``` [ERROR] Foundation directory not found. Please run from repository root or ensure foundation is installed. ```
**Solution:** - Ensure you're in repository root - Verify foundation is installed (as submodule or symlink) - Check if foundation is in parent directory
### Cursor Rules Directory Not Found
**Error:** ``` [ERROR] Cursor rules directory not found: foundation/agent_instructions/cursor_rules ```
**Solution:** - Verify foundation submodule is initialized: `git submodule update --init` - Check that foundation has cursor rules directory
### Cursor Skills Directory (optional)
Foundation workflows are in `foundation/agent_instructions/cursor_skills/`. If present, setup copies them to `.cursor/skills/`. If the directory is missing, setup still succeeds (rules only).
## Related Documents
- `foundation/scripts/setup_cursor_copies.sh` - Entry script (delegates to symlink or copy logic) - `foundation/scripts/setup_cursor_rules.sh` - Symlink implementation (used when foundation is submodule) - `foundation/agent_instructions/README.md` - Cursor rules and commands documentation - `foundation/README.md` - Foundation overview and installation
## Notes
- **Submodule → symlinks**: Foundation as git submodule yields symlinks; updates apply with `git submodule update`. - **Otherwise → copies**: Symlink or copy foundation yields independent copies; re-run to refresh. - **Original filenames**: Foundation rules/commands use original filenames (no prefix). - **Repository rules**: From `docs/`; symlinked or copied per mode. Source in `docs/` remains source of truth. - **When run from foundation repo**: Propagates to peer repos in `../*` that have `foundation/` symlink to this repo.
Intended uses
- Submodule: Run after git submodule update (or any setup); symlinks keep .cursor/ in sync automatically.
- Copy mode (foundation not a submodule): When you want independent copies, need to customize rules, symlinks are not suitable, or you version-control your own copies. Re-run after foundation updates to refresh.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.