symlink-manager
Symlink Manager — Cross-Platform Skill
The Core Problem
Git symlinks break across platforms because:
| Issue | macOS/Linux | Windows |
|---|---|---|
| Git setting | core.symlinks=true (default) |
core.symlinks=false (default, unless Dev Mode enabled) |
| Link type | ln -s symlink |
NTFS symlink or Junction Point |
| Permissions | Any user | Requires Developer Mode or admin elevation |
| Git behaviour | Stores as symlink object | Stores as plain text file containing the target path |
When core.symlinks=false, Git checks out a symlink as a plain text file whose contents are the target path. When you then git pull on the other machine, that text file arrives instead of a real link — silent, no error.
Workflow
Step 1 — Diagnose the environment
Run the diagnosis script first. It checks:
- OS and Python version
git config core.symlinks(local + global)- Whether Developer Mode is active (Windows)
- Whether the script is running as admin (Windows)
- Existing symlinks vs broken links vs text-file stand-ins in the repo
python scripts/symlink_manager.py diagnose
Step 2 — Fix Git config
On Windows (needs Developer Mode enabled first, or run as admin):
git config core.symlinks true
git rm --cached -r . # unstage everything
git reset --hard # re-checkout with symlinks honoured
On macOS / Linux (usually already correct):
git config --get core.symlinks # should say "true"
Add a .gitattributes line to lock symlinks in the repo:
* text=auto
*.symlink -text
Step 3 — Create symlinks with the script
Always use scripts/symlink_manager.py rather than raw os.symlink() because it:
- Detects OS and chooses the right link strategy
- Falls back to NTFS Junction Points on Windows when symlinks are unavailable
- Writes a
symlinks.jsonmanifest so links can be re-created after agit reset --hard - Validates targets exist before linking
- Optionally commits the manifest to the repo
# Create a single symlink
python scripts/symlink_manager.py create --src configs/shared.cfg --dst app/shared.cfg
# Re-create ALL links from the manifest
python scripts/symlink_manager.py restore
# Audit: list broken or missing links
python scripts/symlink_manager.py audit
# Full diagnosis of the environment
python scripts/symlink_manager.py diagnose
Step 4 — Commit the manifest
Commit symlinks.json to the repo. On a fresh checkout (or after a git pull breaks links on Windows), any developer runs:
python scripts/symlink_manager.py restore
…and all links are recreated correctly for their platform.
Windows-Specific Notes
- Developer Mode (Settings → System → For Developers) allows unprivileged symlink creation. Recommend enabling this for all devs on the team.
- Without Developer Mode, the script falls back to Junction Points for directories and hardlinks for files. This covers 90% of use-cases but junctions only work within the same volume.
- Running the script as Administrator bypasses the Developer Mode requirement entirely.
- Set
git config --global core.symlinks trueafter enabling Developer Mode.
macOS/Linux Notes
- Symlinks always work. The main risk is accidentally committing with
core.symlinks=falseinherited from a shared config. - Run
git config --list --show-origin | grep symlinksto see where the setting comes from.
Reference Files
references/troubleshooting.md— Common error messages and fixesscripts/symlink_manager.py— The cross-platform Python script
Read references/troubleshooting.md when the user reports specific error messages.
Output Conventions
- Always show the user the diagnose output before making changes
- When creating links, print a table: Source → Target, Type (symlink/junction/hardlink), Status ✓/✗
- When restoring from manifest, report counts: X created, Y skipped (already exist), Z failed
- On failure, always print the OS error and the recommended fix
More from richfrem/agent-plugins-skills
markdown-to-msword-converter
Converts Markdown files to one MS Word document per file using plugin-local scripts. V2 includes L5 Delegated Constraint Verification for strict binary artifact linting.
52excel-to-csv
>
32zip-bundling
Create technical ZIP bundles of code, design, and documentation for external review or context sharing. Use when you need to package multiple project files into a portable `.zip` archive instead of a single Markdown file.
29learning-loop
(Industry standard: Loop Agent / Single Agent) Primary Use Case: Self-contained research, content generation, and exploration where no inner delegation is required. Self-directed research and knowledge capture loop. Use when: starting a session (Orientation), performing research (Synthesis), or closing a session (Seal, Persist, Retrospective). Ensures knowledge survives across isolated agent sessions.
26ollama-launch
Start and verify the local Ollama LLM server. Use when Ollama is needed for RLM distillation, seal snapshots, embeddings, or any local LLM inference — and it's not already running. Checks if Ollama is running, starts it if not, and verifies the health endpoint.
26spec-kitty-checklist
A standard Spec-Kitty workflow routine.
26