agent-symlink-init
Skill4 starsChanged 6 days agoMITView on GitHub
Initialize or migrate agent-skill symlinks in any repository. Use when a project needs `.claude/skills` linked to `.agents/skills`, `AGENTS.md` linked to `CLAUDE.md`, migration away from `.ruler`-based AI rules, or removal of legacy `sync-llm-skills` copy/sync setups. Trigger on requests about Claude/Codex skill symlinks, AGENTS/CLAUDE symlinks, `.claude/skills` setup, replacing copied skill folders with symlinks, or cleaning old ruler/sync automation.
In this repository43 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- agent-symlink-initSkill
- code-inspector-initSkill
- commitSkill
- copywritingSkill
- css-tailwind-stylingSkill
- lingui-best-practicesSkill
- lingui-workflowSkill
- repo-skill-creatorSkill
- weekly-reportSkill
- agent-dispatchSkill
- agentic-review-handoffSkill
- agent-practice-auditSkill
- architecture-hardening-loopSkill
- ardot-mcpSkill
- branch-creatorSkill
- chrome-dev-mcpSkill
- code-inspector-initSkill
- code-plugin-architectureSkill
- commit-pushSkill
- commitSkill
- decision-first-technical-writingSkill
- design-systemSkill
- desktop-agent-activitySkill
- dev-environment-roi-auditSkill
- disk-tidySkill
- figma-mcpSkill
- file-tidySkill
- goal-gateSkill
- grill-autopilotSkill
- kimi-computer-useSkill
- lingui-workflowSkill
- local-web-surfaceSkill
- open-code-review-loopSkill
- prompt-studioSkill
- review-prompt-composerSkill
- task-completion-loopSkill
- uxc-facadeSkill
- web-performance-auditSkill
- weekly-reportSkill
- workflow-gateSkill
- worktree-tidySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 13 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Ensure .claude/skills points at the repository's .agents/skills directory.
- Distinctive: line 16
Ensure AGENTS.md is a symlink to CLAUDE.md when CLAUDE.md exists.
- Distinctive: line 17
Remove obsolete ruler or sync automation only when it is actually present and the user explicitly requested that migration.
- Distinctive: line 18
Keep the migration idempotent and non-destructive.
- Very specific: line 40
Run when .claude/skills is missing or does not point at the repository's .agents/skills directory, or when AGENTS.md should point to …
- Very specific: line 48
If the user explicitly names only one link, narrow symlink-init to that link.
- Very specific: line 64
If .claude/skills is a regular directory or file instead of a symlink, preserve it before replacing it:
- Distinctive: line 65
Prefer a backup named .claude/skills.bak
- Distinctive: line 66
If that backup path already exists, choose a timestamped backup name
- Distinctive: line 67
Create or refresh the symlink:
- Distinctive: line 74
If AGENTS.md is a regular file, back it up before replacing it
- Very specific: line 82
Remove any associated comments (e.g.
- Distinctive: line 83
Do not add new ignore entries for the symlinks.
- Distinctive: line 87
Run this module only when ruler artifacts still exist and the user requested ruler migration/removal.
- Distinctive: line 89
Remove the .ruler directory.
- Very specific: line 91
Remove scripts whose keys clearly belong to ruler automation, such as ruler:apply or ruler:check
- Very specific: line 92
Remove only the ruler-related fragment from postinstall
- Very specific: line 93
Remove postinstall entirely if nothing remains
- Very specific: line 95
Remove ruler-specific ignore entries (e.g.
- Very specific: line 96
Do not re-add /AGENTS.md to .gitignore — the symlink must be tracked by git
- Distinctive: line 97
Do not delete CLAUDE.md unless the user explicitly asks.
- Very specific: line 101
Run this module only when legacy copy/sync automation is present and the user requested sync migration/removal.
- Very specific: line 103
Remove the sync-llm-skills.ts file under scripts/ if it exists.
- Very specific: line 106
Remove only the --sync-llm flag from skills:test:local if the rest of the command is still valid
- Very specific: line 107
Remove sync-related fragments from postinstall
- Very specific: line 110
Remove the .claude/skills ignore entry and any associated comments — the symlink must be tracked by git, not ignored
- Very specific: line 112
Leave .agents/skills contents in place.
- Very specific: line 118
When cleaning postinstall, remove only the obsolete command fragment and keep remaining commands in order.
- Distinctive: line 120
If the repository already matches the target layout, report that no migration is needed instead of rewriting files.
- Distinctive: line 124
Run lightweight checks after editing:
≈ “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
Agent Symlink Init
Set up or migrate a repository to the symlink-based agent-skill layout.
Outcomes
- Make
.agents/skillsthe source of truth. - Ensure
.claude/skillspoints at the repository's.agents/skillsdirectory. - Ensure
AGENTS.mdis a symlink toCLAUDE.mdwhenCLAUDE.mdexists. - Remove obsolete ruler or sync automation only when it is actually present and the user explicitly requested that migration.
- Keep the migration idempotent and non-destructive.
Detect Before Editing
Confirm the requested repository or project root before editing. For a Git repository, use git rev-parse --show-toplevel and work from that root within the authorized scope. Do not require .git to be a directory: worktrees and separate Git directories use a .git file. A package.json alone does not prove a Git root.
For a non-Git project, use the root explicitly identified by the user; if it is unclear, ask for the target directory. Perform only the requested filesystem setup and report that Git tracking checks are unavailable.
Inspect these paths first:
.agents/skills.claude/skillsCLAUDE.mdAGENTS.md- the .ruler directory
- the sync-llm-skills.ts script under the scripts directory
package.json.gitignore
Classify the work into these modules:
symlink-initRun when.claude/skillsis missing or does not point at the repository's.agents/skillsdirectory, or whenAGENTS.mdshould point toCLAUDE.mdbut does not.migrate-from-rulerOffer when a .ruler directory exists orpackage.jsonstill contains ruler-related scripts orpostinstallfragments. Run only when the user's request includes migrating/removing ruler.migrate-from-syncOffer when legacy copy-based sync automation exists. A--sync-llmflag alone is not proof: inspect the referenced script/function. If it only ensures.claude/skills -> .agents/skills, it already implements the target symlink model and must remain.
Detection identifies candidates; it does not authorize every module. Run symlink-init alone when that is all the user requested. Before deleting .ruler, sync scripts, or package scripts, require a request that clearly authorizes that migration and name the exact removal set. Preserve or back up untracked/otherwise hard-to-recover content before replacement or deletion.
If the user explicitly names only one link, narrow symlink-init to that link. For example, “only initialize .claude/skills” must not create or replace AGENTS.md; report the other link as an optional follow-up instead.
Execute symlink-init
- Ensure
.agents/skillsexists:
mkdir -p .agents/skills- Ensure
.claudeexists:
mkdir -p .claude- If
.claude/skillsis a regular directory or file instead of a symlink, preserve it before replacing it:- Prefer a backup named .claude/skills.bak
- If that backup path already exists, choose a timestamped backup name
- Create or refresh the symlink:
ln -sfn ../.agents/skills .claude/skills- Unless the user narrowed the request to
.claude/skillsonly, ifCLAUDE.mdexists, ensureAGENTS.mdpoints to it:- If
AGENTS.mdis a regular file, back it up before replacing it
- If
ln -sfn CLAUDE.md AGENTS.md- Update
.gitignore:- Remove any .claude/skills and AGENTS.md ignore entries if they exist. These symlinks must be tracked by git so that collaborators get them on clone.
- Remove any associated comments (e.g.
# Agent skills (symlinked),# START Ruler Generated Files). - Do not add new ignore entries for the symlinks.
Execute migrate-from-ruler
Run this module only when ruler artifacts still exist and the user requested ruler migration/removal.
- Remove the .ruler directory.
- Edit
package.json:- Remove scripts whose keys clearly belong to ruler automation, such as
ruler:applyorruler:check - Remove only the ruler-related fragment from
postinstall - Remove
postinstallentirely if nothing remains
- Remove scripts whose keys clearly belong to ruler automation, such as
- Edit
.gitignore:- Remove ruler-specific ignore entries (e.g. ruler block comments,
/CLAUDE.md,/AGENTS.mdif they were ruler-generated ignores) - Do not re-add
/AGENTS.mdto.gitignore— the symlink must be tracked by git
- Remove ruler-specific ignore entries (e.g. ruler block comments,
- Do not delete
CLAUDE.mdunless the user explicitly asks. The goal is to replace the automation mechanism, not to discard the current source-of-truth document.
Execute migrate-from-sync
Run this module only when legacy copy/sync automation is present and the user requested sync migration/removal. Do not run it against a current symlink helper merely because its CLI flag is named --sync-llm.
- Remove the sync-llm-skills.ts file under
scripts/if it exists. - Edit
package.json:- Remove
scripts["skills:sync:llm"] - Remove only the
--sync-llmflag fromskills:test:localif the rest of the command is still valid - Remove sync-related fragments from
postinstall - Remove
postinstallentirely if nothing remains
- Remove
- Edit
.gitignore:- Remove the .claude/skills ignore entry and any associated comments — the symlink must be tracked by git, not ignored
- The old ignore was for copy-based sync artifacts; symlinks should be committed
- Leave
.agents/skillscontents in place. Migrate the linkage model, not the skill payload itself.
Editing Rules
- Make the smallest safe change set.
- Preserve unrelated
package.jsonscripts. - When cleaning
postinstall, remove only the obsolete command fragment and keep remaining commands in order. - Skip modules whose signals are absent.
- If the repository already matches the target layout, report that no migration is needed instead of rewriting files.
Verify
Run lightweight checks after editing:
test -L .claude/skills && readlink .claude/skills
test -f CLAUDE.md && test -L AGENTS.md && readlink AGENTS.mdAlso inspect:
package.jsonfor stale ruler or sync commands.gitignorefor duplicate or contradictory entriesgit diff --stator equivalent to summarize the migration
Report Back
Return:
- Which modules ran
- Which files were created, updated, backed up, or removed
- Verification results
- Any follow-up action the user should consider, such as reinstalling dependencies if
postinstallbehavior changed
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.

