setup_cursor_copies
Skill38 starsChanged 2 months agoMITView on GitHub
Setup Foundation Cursor Copies
In this repository101 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/autonomous_execution.mdcCursor rule
- .cursor/rules/cursor_rules_editing.mdcCursor rule
- .cursor/rules/cursor_rules_sync.mdcCursor rule
- .cursor/rules/cursor_rules_sync_requirement.mdcCursor rule
- site_pages/llms.txtllms.txt
- advisorySkill
- analyzeSkill
- auditSkill
- commitSkill
- create-planSkill
- create_planSkill
- create-prototypeSkill
- create_prototypeSkill
- create_prSkill
- create-releaseSkill
- create_releaseSkill
- create-ruleSkill
- create_ruleSkill
- debugSkill
- draft-illustrationSkill
- draft_illustrationSkill
- endSkill
- evaluate_positioningSkill
- final-reviewSkill
- final_reviewSkill
- fix-feature-bugSkill
- fix_feature_bugSkill
- learnSkill
- manage-error-debuggingSkill
- manage_error_debuggingSkill
- neversight_learn_skills.dev_obviously_awesomeSkill
- process_issuesSkill
- process_prsSkill
- publish-planSkill
- publish_planSkill
- publishSkill
- pullSkill
- pushSkill
- recover_sqlite_databaseSkill
- releaseSkill
- report-errorSkill
- report_errorSkill
- reportSkill
- reviewSkill
- run-feature-workflowSkill
- run_feature_workflowSkill
- setup-commandsSkill
- setup_commandsSkill
- setup-cursor-copiesSkill
- store-neotomaSkill
- store_neotomaSkill
- sync-env-from-1passwordSkill
- sync_env_from_1passwordSkill
- analyzeSkill
- auditSkill
- commitSkill
- create-planSkill
- create-prototypeSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Submodule: Run after git submodule update (or any setup).
- Distinctive: line 40
Copy mode (foundation not a submodule): When you want independent copies, need to customize rules, symlinks are not suitable, or you …
- Distinctive: line 52
Does NOT update automatically when foundation changes
- Distinctive: line 54
Must re-run script to get foundation updates
- Very specific: line 62
Look for foundation/ directory in repo root
- Very specific: line 63
If not found, check ../foundation/ (parent directory)
- Distinctive: line 64
If still not found, error: "Foundation directory not found.
- Distinctive: line 111
Only runs in peer repos if executing from foundation repo itself
- Very specific: line 183
Existing Files: If a target already exists (symlink or regular file), it is removed and replaced with the symlink (or copy in copy mode).
- Distinctive: line 199
Ensure you're in repository root
- Distinctive: line 200
Verify foundation is installed (as submodule or symlink)
- Distinctive: line 201
Check if foundation is in parent directory
- Distinctive: line 211
Verify foundation submodule is initialized: git submodule update --init
- Distinctive: line 212
Check that foundation has cursor rules directory
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
<!-- Source: .cursor/skills/setup-cursor-copies/SKILL.md -->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_copiesor
setup cursor copiesPurpose
This command runs the foundation setup script (foundation/scriptsscripts/setup_claude_instructions.sh.sh) which:
- If foundation is a git submodule: Delegates to
setup_cursor_rules.shand creates symlinks from foundation to.cursor/(single source of truth; updates apply withgit submodule update). - Otherwise: Creates independent copies of foundation rules/commands in
.cursor/. - Uses original filenames (no prefix).
- Removes existing foundation files before creating new ones.
- 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:
./foundation/scriptsscripts/setup_claude_instructions.sh.shOr if foundation is in parent directory:
../foundation/scriptsscripts/setup_claude_instructions.sh.shStep 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):
- Get current repository absolute path:
CURRENT_REPO=$(pwd -P) - Find peer repositories in parent directory:
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/scriptsscripts/setup_claude_instructions.sh.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
.claude/rules/for symlinks;.cursor/skills/is populated from foundation skills. - Copy mode: Script reports rules and skills copied. Check
.claude/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: YExpected 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: YWhat Gets Created
When foundation is a submodule (symlinks):
.claude/rules/contains symlinks tofoundation/agent_instructions/cursor_rules/..cursor/skills/is populated fromfoundation/agent_instructions/cursor_skills/(skills replace legacy commands). Updates to foundation apply when you re-run setup.
When foundation is not a submodule (copies):
.claude/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.mdcremainssecurity.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_rulesSolution:
- 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/scriptsscripts/setup_claude_instructions.sh.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 documentationfoundation/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 indocs/remains source of truth. - When run from foundation repo: Propagates to peer repos in
../*that havefoundation/symlink to this repo.
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.

