自定义 Skill 生命周期管理器 — 基于 git + symlink 管理 AI coding agent skills
Project description
sync-skills
自定义 Skill 生命周期管理器 -- 通过 git + symlink 管理你的 AI Skills。
Custom Skill Lifecycle Manager -- manage your AI skills via git + symlink.
sync-skills v1.0 采用双类型架构:外部 Skill(由 npx skills 管理)和自定义 Skill(由 sync-skills 通过 git + symlink 管理)。sync-skills 只负责用户自建的 Skill,不触碰外部 Skill。
为什么需要它 / Why
AI 编码工具(Claude Code、Codex CLI、Gemini CLI 等)都有自己的 skills 目录。社区通过 npx skills 安装的外部 Skill 各工具自动管理,但用户自建的 Skill 缺少统一的管理方式:
:/ 自己写的 skill 分散在各个工具目录里
:/ 换台电脑,自定义 skill 全丢了
:/ 想版本管理,但工具目录是平铺的,不适合直接 git 管理
sync-skills 的做法 -- git + symlink 双类型架构:
~/Skills/skills/ <-- 自定义 Skill 仓库(git 仓库,唯一真实来源)
├── english-buddy/
│ └── SKILL.md
└── git-commit/
└── SKILL.md
~/.agents/skills/ <-- 统一 Skill 目录(所有 Agent 的读取入口)
├── docx/ <-- 外部 Skill(真实文件,由 npx skills 管理)
├── english-buddy/ --> ~/Skills/skills/english-buddy/ (symlink)
└── git-commit/ --> ~/Skills/skills/git-commit/ (symlink)
~/.claude/skills/xxx --> ~/.agents/skills/xxx (Agent Skill 目录 symlink)
- 外部 Skill(如 docx)由
npx skills管理,sync-skills 不触碰 - 自定义 Skill 存放在
~/Skills/git 仓库中,通过 symlink 关联到统一 Skill 目录 - 统一 Skill 目录
~/.agents/skills/是所有 Agent 的统一读取入口 - 版本控制 -- 自定义 Skill 全部在 git 仓库中,天然支持版本管理、多设备同步
- 零拷贝 -- symlink 不占额外空间,修改即刻生效
AI Agent 友好 / Agent-Friendly Design
sync-skills 专为 AI 编码工具设计,支持两种 Agent 集成方式:
内置 Skill
项目附带一个 skills/sync-skills/SKILL.md,可作为 skill 安装到任意 AI 编码工具中。安装后,Agent 可以根据自然语言直接操作:
用户: "同步一下 skills" --> Agent 执行: sync-skills push -y
用户: "拉取远程更新" --> Agent 执行: sync-skills pull -y
用户: "新建一个 skill" --> Agent 执行: sync-skills add my-skill
用户: "看看有什么 skill" --> Agent 执行: sync-skills list
用户: "查一下 code-review" --> Agent 执行: sync-skills info code-review
Agent 友好的 CLI
--help输出结构化英文文本,包含完整示例,便于 Agent 解析-y跳过交互确认:Agent 无法操作 stdin,-y确保非阻塞执行list/search/info:结构化输出,便于 Agent 查询 skill 状态status:显示 git 状态 + skill 管理状态,便于 Agent 全面了解
快速开始 / Quick Start
安装 / Install
# 推荐:通过 PyPI 安装
uv tool install sync-skills
# 或从源码安装
git clone https://github.com/LuShan123888/sync-skills.git
cd sync-skills
pip install -e .
要求 Python >= 3.11
初始化 / Init
sync-skills init # 初始化 ~/Skills/ 仓库,迁移已有自定义 Skill,建立 symlink
配置文件保存在 ~/.config/sync-skills/config.toml,也可以手动编辑。
使用 / Usage
# 初始化 / Initialize
sync-skills init
# 纳入管理 / Link a wild skill into management
sync-skills link my-skill # 将 Agent 目录中的野生 skill 纳入管理
sync-skills link # 列出所有可收养的野生 skill
# 提交并推送(展示完整 git 命令) / Git commit + push (shows full git commands)
sync-skills push
# 拉取远程更新(展示完整 git 命令) / Git pull (shows full git commands)
sync-skills pull
# 验证/修复 symlink + 检测断链/缺失/孤儿 / Verify/repair + detect anomalies
sync-skills fix
# 列出自定义 Skill / List custom skills
sync-skills list
# 查看 git 状态 + skill 管理状态 / Show git status and skill management state
sync-skills status
# 搜索 / Search
sync-skills search "review"
# 查看详情(含外部/自定义分类)/ Show details (with external/custom classification)
sync-skills info skill-name
# 创建新 Skill(手动创建骨架)/ Create a new custom skill (from template)
sync-skills add my-skill
# 删除 Skill(彻底删除)/ Remove a custom skill permanently
sync-skills remove my-skill
# 卸载 Skill(还原文件)/ Uninstall a custom skill (restore files)
sync-skills uninstall my-skill
# 卸载所有自定义 Skill / Uninstall all custom skills
sync-skills uninstall -y
架构 / Architecture
双类型 Skill 架构
| 类型 | 来源 | 存储方式 | 管理工具 |
|---|---|---|---|
| 外部 Skill | npx skills install |
真实文件在 ~/.agents/skills/ |
npx skills |
| 自定义 Skill | 用户创建 | git 仓库 ~/Skills/skills/ |
sync-skills |
目录结构
~/Skills/ # 自定义 Skill 仓库(git 仓库,唯一真实存储)
├── skills/
│ ├── english-buddy/
│ │ └── SKILL.md
│ └── git-commit/
│ └── SKILL.md
└── .git/
~/.agents/skills/ # 统一 Skill 目录(所有 Agent 的读取入口)
├── docx/ # 外部 Skill(真实文件)
├── english-buddy/ # --> ~/Skills/skills/english-buddy/ (symlink)
└── git-commit/ # --> ~/Skills/skills/git-commit/ (symlink)
~/.claude/skills/ # Agent Skill 目录
├── docx/ # --> ~/.agents/skills/docx/
├── english-buddy/ # --> ~/.agents/skills/english-buddy/
└── git-commit/ # --> ~/.agents/skills/git-commit/
工作流 / Workflow
- init -- 初始化
~/Skills/git 仓库,扫描现有自定义 Skill 并迁移,建立 symlink 链路 - link -- 将 Agent 目录中已有的野生 Skill 纳入管理(复制到 git 仓库 + 创建 symlink)
- push -- 展示完整 git 命令(
git add/commit/push)+ 用户确认后执行 - pull -- 展示完整 git 命令(
git pull --rebase)+ 用户确认后执行 + 重建 symlink + 检测异常 - fix -- 验证所有 symlink 是否完整,自动修复断裂链接,检测断链/缺失/孤儿 skill
- list -- 列出所有自定义 Skill
- status -- 显示 git 状态 + skill 管理状态(已管理/孤儿/外部)+ 断链检测
- search -- 全文搜索自定义 Skill
- info -- 显示 Skill 详情(含外部/自定义分类)
- add -- 在
~/Skills/skills/中创建 Skill 骨架,建立 symlink(手动创建时使用) - remove -- 彻底删除 Skill(git 仓库中的文件 + 所有 symlink)
- uninstall -- 卸载 Skill(还原文件到统一 Skill 目录,保留数据)
对比其他方案 / Comparison
vs 软链接(手动 Symlinks)
| 手动 Symlink | sync-skills v1.0 | |
|---|---|---|
| 版本控制 | 无,换设备就丢失 | git 仓库,天然支持版本管理和多设备同步 |
| 新建 Skill | 手动创建目录、写文件、建 N 条链接 | sync-skills add 一条命令完成 |
| 删除 Skill | 手动删文件、清除断链 | sync-skills remove 自动清理 |
| 卸载 Skill | 手动还原文件、删除链接 | sync-skills uninstall 还原文件到统一 Skill 目录 |
| 多设备同步 | 不支持 | push / pull 一键同步 |
| 维护成本 | 每次变更手动操作 | 自动化,零维护 |
vs v0.6 复制模式
| v0.6 复制模式 | v1.0 git + symlink | |
|---|---|---|
| 存储 | 复制 N 份真实文件 | symlink,零拷贝 |
| 版本管理 | 不支持 | git 原生支持 |
| 一致性 | 依赖同步执行 | symlink 保证实时一致 |
| 外部 Skill | 可能被覆盖 | 自动识别,不触碰 |
| 磁盘占用 | N 倍(N = 工具数) | 1 倍 |
参数 / Options
v1.0 命令
| 命令 | 说明 |
|---|---|
sync-skills init |
初始化 ~/Skills/ 仓库,迁移已有 Skill |
sync-skills link [name] |
纳入野生 Skill(省略 name 则列出可收养的 Skill,-y 跳过确认) |
sync-skills push [-m MSG] |
git commit + push(展示完整 git 命令,确认后执行) |
sync-skills pull |
git pull(展示完整 git 命令,确认后执行)+ 重建 symlinks |
sync-skills fix |
验证/修复 symlink + 检测断链/缺失/孤儿 skill |
sync-skills list [--tags TAG] |
列出所有自定义 Skill |
sync-skills status |
显示 git 状态 + skill 管理状态 + 断链检测 |
sync-skills search <query> |
搜索自定义 Skill |
sync-skills info <name> |
显示 Skill 详情(含外部/自定义分类) |
sync-skills add <name> |
创建新的自定义 Skill(手动创建骨架,-d/-t 参数) |
sync-skills remove <name> |
彻底删除自定义 Skill(-y 跳过确认) |
sync-skills uninstall [name] |
卸载自定义 Skill,还原文件(省略 name 则卸载全部,-y 跳过确认) |
通用选项
| 参数 | 说明 |
|---|---|
-y, --yes |
跳过交互确认 |
--config PATH |
配置文件路径(默认 ~/.config/sync-skills/config.toml) |
遗留命令(--copy 模式)
| 命令 | 说明 |
|---|---|
sync-skills --copy |
v0.6 双向复制同步 |
sync-skills --copy --force |
v0.6 强制同步 |
sync-skills --copy --delete <name> |
v0.6 删除 Skill |
sync-skills --copy --dry-run |
v0.6 预览模式 |
默认目录 / Default Directories
| 角色 | 路径 |
|---|---|
| 自定义 Skill 仓库 | ~/Skills |
| 统一 Skill 目录 | ~/.agents/skills |
| Claude Code | ~/.claude/skills |
| Codex CLI | ~/.codex/skills |
| Gemini CLI | ~/.gemini/skills |
配置文件 / Config
配置文件保存在 ~/.config/sync-skills/config.toml:
repo = "~/Skills"
agents_dir = "~/.agents/skills"
[external]
global_lock = "~/.agents/.skill-lock.json"
local_lock = "~/skills-lock.json"
repo-- 自定义 Skill 的 git 仓库路径agents_dir-- 统一 Skill 目录路径external.global_lock-- 外部 Skill 的全局锁文件(npx skills 使用)external.local_lock-- 外部 Skill 的本地锁文件
安全机制 / Safety
- 外部 Skill 隔离 -- 通过 lock 文件自动识别外部 Skill,所有 symlink 操作跳过外部 Skill,永不触碰
- Git 命令预览 --
push和pull执行前展示完整 git 命令,用户确认后才执行 - 操作前后验证 --
add/remove/uninstall后自动验证状态;pull前检查状态,有异常则警告 - Symlink 验证 --
fix检查所有 symlink,修复断裂链接 - 断链检测 --
fix和status自动检测远程删除导致的断链 symlink,提示用户清理 - 缺失检测 --
fix自动检测缺少统一 Skill 目录 symlink 的自定义 skill,提示用户创建 - 孤儿检测 --
fix自动检测未被管理的孤儿 skill,提示用户纳入管理 - Git 保障 -- 所有自定义 Skill 变更都经过 git 版本控制,可随时回滚
- 存量仓库保护 --
init时检查 git 状态,有未提交更改或落后远程时停下来让用户处理 - 隐藏目录过滤 -- 自动跳过
.system/等隐藏目录
开发 / Development
uv run pytest tests/ -v # 运行测试(186 个用例)
License
MIT
sync-skills
Custom Skill Lifecycle Manager -- manage your AI skills via git + symlink.
sync-skills v1.0 uses a two-type architecture: External Skills (managed by npx skills) and Custom Skills (managed by sync-skills via git + symlink). sync-skills only manages user-created skills and never touches external skills.
Why
AI coding agents (Claude Code, Codex CLI, Gemini CLI, etc.) each maintain their own skills directory. Community skills installed via npx skills are managed by the tooling, but user-created skills lack a unified management solution:
- Scattered -- Custom skills are spread across tool directories with no central management
- No version control -- Switch machines and your custom skills are gone
- No organization -- Flat tool directories aren't suitable for direct git management
sync-skills solves this with git + symlink:
~/Skills/skills/ <-- Custom Skill repo (git repo, single source of truth)
├── english-buddy/
│ └── SKILL.md
└── git-commit/
└── SKILL.md
~/.agents/skills/ <-- Unified Skill directory (all agents read from here)
├── docx/ <-- External skill (real file, managed by npx skills)
├── english-buddy/ --> ~/Skills/skills/english-buddy/ (symlink)
└── git-commit/ --> ~/Skills/skills/git-commit/ (symlink)
~/.claude/skills/xxx --> ~/.agents/skills/xxx (Agent Skill directory symlinks)
- External skills (e.g., docx) are managed by
npx skills-- sync-skills leaves them alone - Custom skills live in the
~/Skills/git repo, linked into the unified Skill directory via symlinks - Unified Skill directory
~/.agents/skills/is the unified read entry point for all agents - Version control -- All custom skills are in a git repo, naturally supporting versioning and multi-device sync
- Zero-copy -- Symlinks take no extra space; changes take effect immediately
Agent-Friendly Design
Built-in Skill
The project ships with skills/sync-skills/SKILL.md that can be installed as a skill in any AI coding tool. Once installed, agents can operate sync-skills via natural language:
User: "sync skills" --> Agent runs: sync-skills push -y
User: "pull remote updates" --> Agent runs: sync-skills pull -y
User: "create a new skill" --> Agent runs: sync-skills add my-skill
User: "show me the skills" --> Agent runs: sync-skills list
User: "check code-review" --> Agent runs: sync-skills info code-review
Agent-Friendly CLI
--helpoutputs structured English text with full examples, easy for agents to parse-yskips interactive confirmation: agents can't interact with stdin,-yensures non-blocking executionlist/search/info: structured output for agents to query skill statusstatus: shows git status + skill management state for comprehensive understanding
Quick Start
# Recommended: install from PyPI
uv tool install sync-skills
# Or install from source
git clone https://github.com/LuShan123888/sync-skills.git
cd sync-skills
pip install -e .
Requires Python >= 3.11.
sync-skills init # Initialize ~/Skills/ repo, migrate existing skills, create symlinks
Usage
# Initialize
sync-skills init
# Link a wild skill into management
sync-skills link my-skill # Link an existing skill from agent directory
sync-skills link # List all wild skills available for adoption
# Git commit + push (shows full git commands before confirming)
sync-skills push
# Git pull (shows full git commands before confirming) + rebuild symlinks
sync-skills pull
# Verify/repair + detect broken/missing/orphan skills
sync-skills fix
# List custom skills
sync-skills list
# Show git status + skill management state
sync-skills status
# Search
sync-skills search "review"
# Show details (with external/custom classification)
sync-skills info skill-name
# Create a new custom skill (from template)
sync-skills add my-skill
# Remove a custom skill permanently
sync-skills remove my-skill
# Uninstall a custom skill (restore files to unified directory)
sync-skills uninstall my-skill
# Uninstall all custom skills
sync-skills uninstall -y
Architecture
Two-Type Skill Architecture
| Type | Source | Storage | Manager |
|---|---|---|---|
| External | npx skills install |
Real files in ~/.agents/skills/ |
npx skills |
| Custom | User-created | Git repo ~/Skills/skills/ |
sync-skills |
Workflow
- init -- Initialize
~/Skills/git repo, scan and migrate existing custom skills, create symlink chains - link -- Link an existing wild skill from agent directories into management (copy to git repo + create symlinks)
- push -- Show full git commands (
git add/commit/push) + confirm + execute - pull -- Show full git command (
git pull --rebase) + confirm + execute + rebuild symlinks + detect issues - fix -- Verify all symlinks, auto-repair broken links, detect broken/missing/orphan skills
- list -- List all custom skills
- status -- Show git status + skill management state (managed/orphan/external) + broken symlink detection
- search -- Full-text search custom skills
- info -- Show skill details (with external/custom classification)
- add -- Create skill skeleton in
~/Skills/skills/, create symlinks (for manual creation) - remove -- Permanently delete skill (files in git repo + all symlinks)
- uninstall -- Uninstall skill (restore files to unified Skill directory, preserve data)
Comparison
vs Manual Symlinks
| Manual Symlinks | sync-skills v1.0 | |
|---|---|---|
| Version control | None; lost on device switch | Git repo; natural versioning and multi-device sync |
| New skill | Manual: create dir, write file, create N symlinks | sync-skills add does it all |
| Deletion | Manual: delete files, clean broken links | sync-skills remove auto-cleans |
| Uninstall | Manual: restore files, delete links | sync-skills uninstall restores to unified directory |
| Multi-device sync | Not supported | push / pull one command |
| Maintenance | Manual for every change | Automated, zero maintenance |
vs v0.6 Copy Mode
| v0.6 Copy Mode | v1.0 git + symlink | |
|---|---|---|
| Storage | N copies of real files | Symlinks, zero-copy |
| Version control | Not supported | Native git support |
| Consistency | Depends on sync execution | Symlinks guarantee real-time consistency |
| External skills | May be overwritten | Auto-detected, never touched |
| Disk usage | N times (N = number of tools) | 1 time |
Options
v1.0 Commands
| Command | Description |
|---|---|
sync-skills init |
Initialize ~/Skills/ repo, migrate existing skills |
sync-skills link [name] |
Link a wild skill into management (omit name to list, -y to skip confirmation) |
sync-skills push [-m MSG] |
Git commit + push (shows full git commands, confirm before executing) |
sync-skills pull |
Git pull (shows full git command, confirm before executing) + rebuild symlinks |
sync-skills fix |
Verify/repair symlinks + detect broken/missing/orphan skills |
sync-skills list [--tags TAG] |
List all custom skills |
sync-skills status |
Show git status + skill management state + broken link detection |
sync-skills search <query> |
Search custom skills |
sync-skills info <name> |
Show skill details (with external/custom classification) |
sync-skills add <name> |
Create a new custom skill (from template, -d/-t flags) |
sync-skills remove <name> |
Permanently remove a custom skill (-y to skip confirmation) |
sync-skills uninstall [name] |
Uninstall custom skill, restore files (omit name to uninstall all, -y to skip confirmation) |
General Options
| Flag | Description |
|---|---|
-y, --yes |
Skip confirmation |
--config PATH |
Config file path (default: ~/.config/sync-skills/config.toml) |
Legacy Commands (--copy mode)
| Command | Description |
|---|---|
sync-skills --copy |
v0.6 bidirectional copy sync |
sync-skills --copy --force |
v0.6 force sync |
sync-skills --copy --delete <name> |
v0.6 delete skill |
sync-skills --copy --dry-run |
v0.6 preview mode |
Default Directories
| Role | Path |
|---|---|
| Custom Skill repo | ~/Skills |
| Unified Skill directory | ~/.agents/skills |
| Claude Code | ~/.claude/skills |
| Codex CLI | ~/.codex/skills |
| Gemini CLI | ~/.gemini/skills |
Config
Config file at ~/.config/sync-skills/config.toml:
repo = "~/Skills"
agents_dir = "~/.agents/skills"
[external]
global_lock = "~/.agents/.skill-lock.json"
local_lock = "~/skills-lock.json"
repo-- Git repo path for custom skillsagents_dir-- Unified Skill directory pathexternal.global_lock-- Global lock file for external skills (used by npx skills)external.local_lock-- Local lock file for external skills
Safety
- External skill isolation -- Auto-detects external skills via lock files, all symlink operations skip them, never touches or overwrites
- Git command preview --
pushandpullshow full git commands before executing, user confirms first - Pre/post-operation verification -- Auto-verify state after
add/remove/uninstall; check state beforepull - Symlink verification --
fixchecks all symlinks, repairs broken links - Broken link detection --
fixandstatusdetect broken symlinks caused by remote deletions, prompt user to clean up - Missing link detection --
fixdetects custom skills missing unified Skill directory symlinks, prompt user to create - Orphan detection --
fixdetects unmanaged orphan skills, prompt user to adopt - Git safety net -- All custom skill changes go through git version control, rollback anytime
- Existing repo protection --
initchecks git status, stops if there are uncommitted changes or behind remote - Hidden directory filtering -- Automatically skips
.system/etc.
Development
uv run pytest tests/ -v # 186 test cases
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sync_skills-0.5.20260412.2.tar.gz.
File metadata
- Download URL: sync_skills-0.5.20260412.2.tar.gz
- Upload date:
- Size: 91.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
855c44f40cbc37ff62fb35c5f1c6c8e297e4b045cc032fdddea8d70c4483b4a8
|
|
| MD5 |
1e4bdf952de087430ad7413f32dc087d
|
|
| BLAKE2b-256 |
e143ae868b1ffce9f8fe29fe9df0377d7b712ddf9aed78b218504d423fede7d4
|
Provenance
The following attestation bundles were made for sync_skills-0.5.20260412.2.tar.gz:
Publisher:
publish.yml on LuShan123888/sync-skills
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sync_skills-0.5.20260412.2.tar.gz -
Subject digest:
855c44f40cbc37ff62fb35c5f1c6c8e297e4b045cc032fdddea8d70c4483b4a8 - Sigstore transparency entry: 1280894360
- Sigstore integration time:
-
Permalink:
LuShan123888/sync-skills@052d785f3866be6a8423d9df9b2a9bb0fda895b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LuShan123888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@052d785f3866be6a8423d9df9b2a9bb0fda895b9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sync_skills-0.5.20260412.2-py3-none-any.whl.
File metadata
- Download URL: sync_skills-0.5.20260412.2-py3-none-any.whl
- Upload date:
- Size: 48.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c22d6fe3f8881f4eaeb7962fae3865fc0eb893a9fbe4d177876b2d62629c96bb
|
|
| MD5 |
a4c35ac9207e947a5ce971e943768752
|
|
| BLAKE2b-256 |
65ad94a5de6326543f2f2eaba9182db4bece3955f3d2e10f739f46e14b54fe84
|
Provenance
The following attestation bundles were made for sync_skills-0.5.20260412.2-py3-none-any.whl:
Publisher:
publish.yml on LuShan123888/sync-skills
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sync_skills-0.5.20260412.2-py3-none-any.whl -
Subject digest:
c22d6fe3f8881f4eaeb7962fae3865fc0eb893a9fbe4d177876b2d62629c96bb - Sigstore transparency entry: 1280894364
- Sigstore integration time:
-
Permalink:
LuShan123888/sync-skills@052d785f3866be6a8423d9df9b2a9bb0fda895b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LuShan123888
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@052d785f3866be6a8423d9df9b2a9bb0fda895b9 -
Trigger Event:
push
-
Statement type: