Learn-skills.dev agent-symlink-init
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.
git clone https://github.com/NeverSight/learn-skills.dev
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/adonis0123/adonis-skills/agent-symlink-init" ~/.claude/skills/neversight-learn-skills-dev-agent-symlink-init && rm -rf "$T"
data/skills-md/adonis0123/adonis-skills/agent-symlink-init/SKILL.mdAgent Symlink Init
Set up or migrate a repository to the symlink-based agent-skill layout.
Outcomes
- Make
the source of truth..agents/skills - Ensure
points at the repository's.claude/skills
directory..agents/skills - Ensure
is a symlink toAGENTS.md
whenCLAUDE.md
exists.CLAUDE.md - Remove obsolete ruler or sync automation only when it is actually present.
- Keep the migration idempotent and non-destructive.
Detect Before Editing
Work only from the repository root. Require either
.git/ or package.json.
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:
Run whensymlink-init
is missing or does not point at the repository's.claude/skills
directory, or when.agents/skills
should point toAGENTS.md
but does not.CLAUDE.md
Run when a .ruler directory exists ormigrate-from-ruler
still contains ruler-related scripts orpackage.json
fragments.postinstall
Run when a sync-llm-skills.ts file exists undermigrate-from-sync
orscripts/
still containspackage.json
orskills:sync:llm
.--sync-llm
Summarize the detected modules before making destructive changes. If the migration will delete the .ruler directory or sync scripts, tell the user exactly what will be removed.
Execute symlink-init
symlink-init- Ensure
exists:.agents/skills
mkdir -p .agents/skills
- Ensure
exists:.claude
mkdir -p .claude
- If
is a regular directory or file instead of a symlink, preserve it before replacing it:.claude/skills- 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
- If
exists, ensureCLAUDE.md
points to it:AGENTS.md- If
is a regular file, back it up before replacing itAGENTS.md
- 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
migrate-from-rulerRun this module only when ruler artifacts still exist.
- Remove the .ruler directory.
- Edit
:package.json- Remove scripts whose keys clearly belong to ruler automation, such as
orruler:applyruler:check - Remove only the ruler-related fragment from
postinstall - Remove
entirely if nothing remainspostinstall
- 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
if they were ruler-generated ignores)/AGENTS.md - Do not re-add
to/AGENTS.md
— the symlink must be tracked by git.gitignore
- Remove ruler-specific ignore entries (e.g. ruler block comments,
- Do not delete
unless the user explicitly asks. The goal is to replace the automation mechanism, not to discard the current source-of-truth document.CLAUDE.md
Execute migrate-from-sync
migrate-from-syncRun this module only when legacy copy/sync automation is present.
- Remove the sync-llm-skills.ts file under
if it exists.scripts/ - Edit
:package.json- Remove
scripts["skills:sync:llm"] - Remove only the
flag from--sync-llm
if the rest of the command is still validskills:test:local - Remove sync-related fragments from
postinstall - Remove
entirely if nothing remainspostinstall
- 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
contents in place. Migrate the linkage model, not the skill payload itself..agents/skills
Editing Rules
- Make the smallest safe change set.
- Preserve unrelated
scripts.package.json - When cleaning
, remove only the obsolete command fragment and keep remaining commands in order.postinstall - 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.md
Also inspect:
for stale ruler or sync commandspackage.json
for duplicate or contradictory entries.gitignore
or equivalent to summarize the migrationgit diff --stat
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
behavior changedpostinstall