| name | skills-sync |
| description | Manage and synchronize AI agent skills from local SKILL.md files and remote Git repositories to AGENTS.md. This skill should be used when users need to sync skills, add/remove skill repositories, update skill catalogs, or set up the skills infrastructure in their projects. |
Skills Sync
Overview
Sync AI agent skills from four locations into a consolidated AGENTS.md catalog. Supports both .cortex and .claude directories at project and global levels, with clear precedence rules.
Quick Start
To sync skills:
- Optionally configure repositories in
repos.txt(see locations below) - Run the sync script:
python3 .claude/skills/skills-sync/scripts/sync-skills.py
- Check AGENTS.md for updated skills catalog
Note: The script automatically detects project root by walking up the directory tree, so it works from any location.
Skill Locations (Precedence Order)
Skills are scanned from four locations. Higher precedence locations override lower ones for skills with the same name:
| Priority | Location | Type |
|---|---|---|
| 1 (highest) | $PROJECT/.cortex/skills/ |
Project |
| 2 | $PROJECT/.claude/skills/ |
Project |
| 3 | ~/.snowflake/cortex/skills/ |
Global |
| 4 (lowest) | ~/.claude/skills/ |
Global |
Project Skills
Create project-specific skills in your project directory:
$PROJECT/.cortex/skills/your-skill/SKILL.md(highest precedence)$PROJECT/.claude/skills/your-skill/SKILL.md
Global Skills
Create personal skills available across all projects:
~/.snowflake/cortex/skills/your-skill/SKILL.md~/.claude/skills/your-skill/SKILL.md
Repository Configuration
repos.txt Locations
The repos.txt file can be placed in any of the four skill directories:
$PROJECT/.cortex/skills/repos.txt(project-specific repos)$PROJECT/.claude/skills/repos.txt~/.snowflake/cortex/skills/repos.txt(global default repos)~/.claude/skills/repos.txt
All locations are checked, and repository URLs are deduplicated.
repos.txt Format
https://github.com/anthropics/skills
https://github.com/your-org/your-skills-repo
# This is a comment
- One URL per line
- Lines starting with
#are comments - Private repos require Git credentials configured
- Duplicate URLs (with/without
.gitsuffix) are automatically deduplicated
Repository Skill Extraction
Skills are extracted ONLY from these paths within repositories:
.cortex/skills/*/SKILL.md.claude/skills/*/SKILL.md
Extracted skills are placed in ~/.snowflake/cortex/skills/ with a repo prefix:
- Example:
skillsrepo →~/.snowflake/cortex/skills/skills-dbt-core/ - Example:
my-reporepo →~/.snowflake/cortex/skills/my-repo-custom-skill/
Note: Skills in other locations within repositories (like skills/ at root) are NOT extracted. This ensures only properly structured skills are synced.
Sync Process
The script:
- Migration: Detects and migrates old
.claude/skills/repositories/structure - Read repos.txt: Reads from all four locations, deduplicates URLs
- Clone repositories: Clones to temp location (
~/.snowflake/.cache/repos/) - Extract skills: Copies skill directories to
~/.snowflake/cortex/skills/with repo prefix - Scan skills: Scans all four locations with precedence rules
- Update AGENTS.md: Writes organized catalog with Project/Global sections
- Cleanup: Removes old
repositories/directories if present
Managing Repositories
Add Repository:
- Add URL to any
repos.txtfile - Run sync script
Remove Repository:
- Delete or comment out URL from
repos.txt - Run sync script
- Optionally delete extracted skills from
~/.snowflake/cortex/skills/<repo>-<skill>/
AGENTS.md Format
The script generates two sections in AGENTS.md:
### Project Skills
- [x] **[skill-name](.cortex/skills/skill-name/SKILL.md)** - description
### Global Skills
- [x] **[repo-skill-name](~/.snowflake/cortex/skills/repo-skill-name/SKILL.md)** - description
Script Requirements
- Python 3.8+
- Git installed
- Auto-installs
python-frontmatterif needed
Troubleshooting
Git not installed
Install: brew install git (macOS), apt-get install git (Linux), or download from git-scm.com
Private repository access
Configure Git credentials (HTTPS tokens or SSH keys)
Python frontmatter missing
Script auto-installs, or run: pip install python-frontmatter
SKILL.md parse errors
Verify valid YAML frontmatter with name and description fields:
---
name: my-skill
description: Brief description of what this skill does
---
AGENTS.md merge conflicts
- Never edit between markers manually
- Keep markers intact and re-run sync script
Skills not appearing
- Check that SKILL.md is in the immediate child directory (flat structure required)
- Verify the skill has valid
nameanddescriptionin frontmatter - Ensure the directory is not named
.cache,repositories, or.git
Repository skills not extracted
- Ensure skills are in
.cortex/skills/*/SKILL.mdor.claude/skills/*/SKILL.mdwithin the repo - Skills in other locations (like root
skills/folder) are intentionally ignored
Migration from Old Structure
If you have an old .claude/skills/repositories/ structure, the script automatically:
- Detects the old structure
- Migrates skills to
~/.snowflake/cortex/skills/with repo prefixes - Cleans up the old
repositories/directory
No manual intervention required.
Resources
scripts/sync-skills.py - Python sync script (standalone, auto-installs dependencies)