Sync Skills to Agents
Thesync command installs all your skills to configured AI agent directories:
How Sync Works
- Check authentication - Verifies valid session
- Load skills - Fetches all skills from your vaults (paginated)
- Install skills - Writes each skill to agent directories
- Prune stale skills - Removes skills deleted from server
- Update install lock - Records installed skill state
Supported Agents
The CLI can sync to these AI agents:| Agent | Display Name | Default Directory |
|---|---|---|
opencode | OpenCode | ~/.config/opencode/skills |
claude-code | Claude Code | ~/.claude/skills |
codex | Codex | ~/.codex/skills |
cursor | Cursor | ~/.cursor/skills |
github-copilot | GitHub Copilot | ~/.copilot/skills |
gemini-cli | Gemini CLI | ~/.gemini/skills |
amp | Amp | ~/.config/agents/skills |
goose | Goose | ~/.config/goose/skills |
continue | Continue.dev | ~/.continue/skills |
Environment Variables
Customize agent directories with environment variables:XDG_CONFIG_HOME- Base config directory (default:~/.config)CODEX_HOME- Codex home directory (default:~/.codex)CLAUDE_CONFIG_DIR- Claude config directory (default:~/.claude)
Skill Installation Format
Each skill is installed with this structure:{vault-slug}__{skill-slug} to avoid collisions across vaults.
Install Lock
The CLI maintains an install lock at:- Which skills are installed
- Skill UUIDs for each folder
- Last sync timestamp
- Pruning - Remove skills deleted from server
- Unmanaged detection - Find manually-added skills
- Sync verification - Detect drift between server and local
Configure Agents
Choose which agents to sync to:Configuration Storage
Agent configuration is saved to:First-Time Setup
On first sync without configuration:- Interactive mode - Prompts for agent selection
- Non-interactive mode - Uses all agents by default
better-skills config.
Installing Private Skills
Private skills from personal and enterprise vaults are synced like public skills:Vault Types
- personal - Your private vault (read-write)
- enterprise - Team vaults you have access to (read-only or read-write)
- system_default - Public Better Skills library (read-only)
Access Control
The sync command:- Authenticates with your session
- Fetches only skills you have permission to access
- Installs all accessible skills to agent directories
Backup Local Skills
Create a backup of local skills before migration or updates:Backup Structure
Backup creates three directories:Work Directory
Thework/ directory contains skills ready for CLI commands:
work/ has:
SKILL.md- Original markdownresources/- All resource files.resource-ids.json- Resource UUID mapping (for validation)
Backup Flags
--source <dir>- Source directory to backup (overrides agent config)--out <dir>- Output directory (default:/tmp/better-skills-backup-{timestamp})--agent <agent>- Specific agent(s) to backup (repeatable)
Use Cases
Before migration:Validate Skills
Validate skill folder structure before creating or updating:Validation Checks
The validator verifies:- SKILL.md exists - Required markdown file
- Frontmatter - Contains
nameanddescription - Resource mentions - All
[[resource:new:path]]have matching files - Unused resources - Warns about unreferenced files
- External links - Validates
[[skill:uuid]]format
Resource Mention Validation
For[[resource:new:path]] mentions:
- Path must exist in
resources/directory - Path cannot escape resources directory (no
../) - Path must be relative
[[resource:uuid]] mentions:
- Uses
.resource-ids.jsonto distinguish internal vs external - Internal resources must exist in
resources/ - External resources are not validated locally
Exit Code
- 0 - Validation passed (warnings allowed)
- 1 - Validation failed (errors present)
Rewrite Resource Links
Convert local file paths to UUID-based resource links:What Gets Rewritten
The command rewrites:- Local file links -
[config](resources/config.json)→[[resource:new:config.json]] - Local relative paths -
./resources/setup.sh→[[resource:new:setup.sh]] - Markdown references - References to files in
resources/
Output Format
Dry Run Mode
Use Case
Prepare cloned skills for update:Limitations
The rewriter:- Only processes markdown files (
.md,.mdx) - Does not rewrite skill links (use UUIDs manually)
- Preserves external URLs unchanged
Workflow Examples
Daily Sync Workflow
Create and Publish Workflow
Clone, Edit, Update Workflow
Backup and Restore Workflow
Command Reference Summary
| Command | Description | Key Flags |
|---|---|---|
sync | Sync all skills to configured agents | None |
config | Configure target agents | None |
backup | Backup local skills to temp directory | --source <dir>, --out <dir>, --agent <agent> |
validate | Validate skill folder structure | None |
rewrite-links | Convert local paths to UUID links | --dry-run |
Troubleshooting
Sync Fails with Authentication Error
Skills Not Appearing in Agent
-
Verify agent configuration:
-
Check install lock:
-
Check agent directory:
Validation Errors
Fix validation errors before creating/updating:Stale Skills After Deletion
Re-sync to prune deleted skills:Next Steps
Skill Commands
Learn all skill management commands
Authentication
Set up authentication and sessions