agent-symlink-init
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.
- 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:
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-rulerRun when a .ruler directory exists orpackage.jsonstill contains ruler-related scripts orpostinstallfragments.migrate-from-syncRun when a sync-llm-skills.ts file exists underscripts/orpackage.jsonstill containsskills:sync:llmor--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
- 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
- If
CLAUDE.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.
- 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.
- 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.md
Also 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
More from adonis0123/adonis-skills
staged-changes-review
Checklist-driven review of staged Git changes with deterministic rule scanning and semantic analysis. Use when the user wants to review staged changes, check for errors before commit, or validate code quality before committing.
25ruler-rules-init
Migrate and bootstrap Ruler-based AI rules across repositories with English-first templates, preset-based project detection, and safe, idempotent setup. Use when creating or standardizing `.ruler/*` files, generating `AGENTS.md`/`CLAUDE.md`, wiring `ruler:apply` into `package.json`, adding generated-file ignores in `.gitignore`, and designing `applyTo` scoping patterns such as `**` and `web/**`.
18discuss-before-plan
Enforces 'decide then plan' discipline - the pre-planning decision gate. Use when the user asks for a plan or starts a change while key decisions are unresolved: architecture tradeoffs, data flow, public interfaces, unclear requirements, multi-module scope, or roughly 5+ files affected. Also triggers when the user explicitly wants to discuss, compare options, or review architecture before committing. Core job: reduce incorrect-execution cost by confirming decisions before producing executable plans.
17claude-skills-sync-init
Bootstrap Claude skill-sync automation in any repository. Use when users ask to set up `.agents/skills` to `.claude/skills` syncing, generate `skills:sync:*` scripts, inject package.json scripts/postinstall hooks, or initialize this sync workflow in a new or existing project.
16staged-review-validator
Validate staged-changes-review findings with evidence-based verdicts and minimal-fix guidance. Use when you need to confirm whether each reported issue is valid and actionable.
14tailwindcss-next-init
Initialize Tailwind CSS v4 and Iconify for Next.js App Router projects with script-driven templates. Use when you need a fast setup or migration with consistent style-entry conventions.
12