Skip to main content
This command is experimental and may change in future versions. The API and behavior are not yet stable.

Usage

Description

The experimental_sync command crawls your node_modules directory to discover skills bundled with npm packages, then installs them to agent directories. This is useful for:
  • Teams sharing skills via npm packages
  • Monorepos with skill packages
  • Automatic skill setup from package.json dependencies
Skills are installed as project-scoped symlinks and tracked in a local lock file (skills-lock.json) to avoid redundant reinstalls.

How It Works

1

Scan node_modules

Recursively searches node_modules for SKILL.md files in:
  • Package root: node_modules/pkg/SKILL.md
  • skills/ directory: node_modules/pkg/skills/*/SKILL.md
  • .agents/skills/: node_modules/pkg/.agents/skills/*/SKILL.md
  • Scoped packages: node_modules/@org/pkg/...
Discovers all skills across all installed packages.
2

Check Local Lock

Reads skills-lock.json to see which skills are already installed and up to date.Computes a hash of each discovered skill folder and compares with the lock file:
  • Match: Skill is up to date (skipped)
  • Different: Skill needs installation/update
3

Select Agents

Prompts to select which agents to install to (unless -y flag is used).Universal agents (.agents/skills/) are always included.
4

Install Skills

Creates symlinks from agent directories to the canonical copy in .agents/skills/.Updates skills-lock.json with new hashes.

Options

string[]
Specify which agents to install to. Accepts multiple agent names or '*' for all agents.Examples:
  • -a claude-code -a cursor
  • --agent '*' (all agents)
Default: Detects installed agents or prompts interactively
boolean
Skip confirmation prompts. Automatically proceeds with sync.Default: false
boolean
Force reinstall of all skills, even if they’re already up to date.Default: false

Examples

Package Structure

To include skills in your npm package, use one of these structures:
Single skill at package root:
The skill name comes from the SKILL.md frontmatter.

Output Example

Local Lock File

The sync command uses skills-lock.json (project-scoped) to track installed skills:
Key differences from global lock file:
  • Location: Project root (committed with your project)
  • Scope: Project-scoped skills only
  • Hash: Computed from local files (not GitHub tree SHA)
  • Purpose: Avoid redundant syncs when node_modules hasn’t changed

Workflow Integration

In package.json

Add sync to your setup scripts:
This automatically syncs skills after:
  • npm install
  • npm ci
  • Fresh clones

In Monorepos

For monorepos with multiple packages containing skills:
Run sync from the root:

Sync vs Add

Comparison with the add command: When to use sync:
  • Skills are in package.json dependencies
  • Automated setup for new team members
  • CI/CD environments
  • Monorepo skill packages
When to use add:
  • Installing from GitHub repos
  • Global skills for personal use
  • One-off skill installations
  • Testing skills before packaging

Force Mode

The --force flag reinstalls all skills, ignoring the lock file:
Use when:
  • Lock file is corrupted
  • Skills were manually deleted
  • Testing skill changes during development
  • Resetting to clean state
Note: This is slower as it reinstalls everything.

Troubleshooting

Message: No SKILL.md files found in node_modulesCauses:
  • No packages with skills installed
  • Skills not in standard locations
  • node_modules missing (run npm install)
Check:
Message: All skills are up to dateCause: Lock file matches current node_modules stateForce reinstall if needed:
Symptom: Git conflicts in skills-lock.jsonCause: Multiple team members syncing different skillsSolution: