Skip to content

chore: mirror .claude/skills into .agents/skills via cross-platform links#240

Open
zicjin wants to merge 1 commit into
mainfrom
chore/agents-skills-symlinks
Open

chore: mirror .claude/skills into .agents/skills via cross-platform links#240
zicjin wants to merge 1 commit into
mainfrom
chore/agents-skills-symlinks

Conversation

@zicjin

@zicjin zicjin commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

What

For all skill directories in .claude/skills/, generate matching links in .agents/skills/ so non-Claude-Code agent tooling sees the same skills without duplicating any files.

Why a script instead of committed symlinks

A symlink committed from macOS checks out as a broken text file on Windows unless the dev enabled git symlinks + Developer Mode/admin — so committed symlinks don't satisfy "support both Windows and Mac." A small Node script is the reliable cross-platform mechanism.

Changes

  • scripts/link-agent-skills.mjs (new) — generates the links:
    • macOS/Linux: relative symlinks (e.g. ../../.claude/skills/spot-check)
    • Windows: directory junctions (no admin / Developer Mode required; a Windows dir symlink would need elevation, a junction does not)
    • Idempotent, self-healing: refreshes existing links, prunes stale ones, and never deletes a real (non-link) directory.
  • package.json — adds pnpm link:skills.
  • .gitignore — ignores the generated links (derived artifacts); keeps .gitkeep.
  • .agents/skills/.gitkeep (new) — tracks the directory while links stay local.

Usage

After clone, or whenever skills are added/removed:

pnpm link:skills   # or: node scripts/link-agent-skills.mjs

Verification

  • ✓ 36 skill symlinks in .agents/skills/
  • .agents/skills/spot-check/SKILL.md reads correctly through the link.
  • git check-ignore confirms the links are ignored; a dry-run git add .agents/ stages only .gitkeep.

🤖 Generated with Claude Code

…inks

Add scripts/link-agent-skills.mjs to generate links from .claude/skills/
into .agents/skills/ so non-Claude-Code agent tooling sees the same skills
without duplicating files.

- macOS/Linux: relative symlinks; Windows: directory junctions (no admin
  needed). Idempotent, prunes stale links, never deletes real dirs.
- Generated links are git-ignored (derived artifacts); .gitkeep tracks the
  dir. Regenerate with `pnpm link:skills`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zicjin zicjin temporarily deployed to staging-lite June 6, 2026 13:42 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant