Agent skill
update-skills
Sync skills between projects - bidirectional copy with version detection and clean mode. TRIGGER when: user wants to sync skills ("update skills from X", "sync skills", "pull skills from framework", "push skills to project"), or wants complete directory replacement ("clean sync", "reset skills"). DO NOT TRIGGER when: user wants to update pillars/rules/workflow (use respective update-* skills), or just wants to read skill docs.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/update-skills-aifuun-u-safe
SKILL.md
Update Skills - Skills Synchronization
Sync skill files between projects bidirectionally with smart version detection and conflict handling.
Overview
This skill synchronizes skills (.claude/skills/) between projects:
What it does:
- Scans source and target projects for skills
- Compares skills to detect new/updated/conflicted versions
- Shows detailed diff preview with line counts
- Syncs skills with confirmation
- Supports selective skill filtering
- Creates backups before overwriting
- Reports what was synced
Why it's needed: Skills evolve across projects. Framework updates need to propagate, and project innovations should flow back. This skill automates bidirectional skill sync with version conflict detection and backup protection.
When to use:
- Monthly framework upgrades
- Promoting project skills to framework
- Cross-project skill sharing
- Initial project setup
Workflow
Step 1: Create Todo List
Initialize sync tracking using TaskCreate:
Task #1: Validate source and target paths
Task #2: Scan skills in both projects (blocked by #1)
Task #3: Compare and detect versions (blocked by #2)
Task #4: Show diff preview (blocked by #3)
Task #5: Execute sync with confirmation (blocked by #4)
Task #6: Report sync results (blocked by #5)
After creating tasks, proceed with sync execution.
Sync Modes
1. Pull Skills (--from)
Pull skills from source project to current project:
/update-skills --from ~/dev/ai-dev
/update-skills --from ~/dev/ai-dev --dry-run
/update-skills --from ~/dev/ai-dev --skills adr,status,review
What happens:
- Scan source:
<source>/.claude/skills/ - Scan current:
.claude/skills/ - Compare modification times and sizes
- Detect: NEW, NEWER, OLDER, CONFLICT, SAME
- Show analysis table
- Confirm and copy updated skills
2. Push Skills (--to)
Push skills from current project to target project:
/update-skills --to ~/projects/my-app
/update-skills --to ~/projects/my-app --dry-run
/update-skills --to ~/projects/my-app --skills create-issues,start-issue,finish-issue
What happens:
- Scan current project skills
- Scan target project skills
- Compare versions
- Show what will be pushed
- Confirm and copy to target
3. Dry Run Mode (--dry-run)
Preview changes without applying:
/update-skills --from ~/dev/ai-dev --dry-run
Output:
- Shows analysis table with versions
- Reports what would be synced
- No confirmation required
- No actual changes made
4. Selective Sync (--skills)
Sync only specific skills:
/update-skills --from ~/dev/ai-dev --skills adr,status
/update-skills --to ~/projects/my-app --skills custom-deploy,custom-test
Skill selection:
- Comma-separated list
- Only syncs specified skills
- Ignores others
5. Smart Filter (--filter-config) - NEW
Apply intelligent filtering based on tech stack configuration:
# Used by /update-framework meta-skill
/update-skills --from ~/dev/ai-dev --filter-config <target>/.claude/framework-config.json
What it does:
- Reads filter config from
.claude/framework-config.json - Applies exclude list for skills not relevant to tech stack
- Shows filter summary in analysis
Filter Configuration Format:
{
"filterConfig": {
"skills": {
"include": ["*"], // Usually sync all skills
"exclude": [] // Rarely exclude skills
}
}
}
Filter Logic:
For each skill directory:
1. Check if skill name in exclude list
โ Skip if excluded
2. Apply normal NEW/NEWER/SAME logic
Example - Minimal Project:
Without filter: 16 skills synced With filter (exclude deployment skills): ~14 skills synced
๐ Smart Filter Active
โญ๏ธ Excluding: deploy-prod (deployment skill)
โญ๏ธ Excluding: hotfix (deployment skill)
Result: 14 skills synced (2 excluded)
Note:
- Skills are usually synced completely (no filtering)
- Filtering mainly used for specialized deployment skills
- Typically called by
/update-frameworkmeta-skill
6. Clean Mode (--clean) - NEW in v2.3.0
IMPORTANT: Destructive operation with complete directory replacement.
Complete clean slate - delete entire target .claude/skills directory and replace with source:
# Execute full replacement
/update-skills --from ~/dev/ai-dev --clean
/update-skills --to ~/projects/my-app --clean
What it does:
- Deletes target directory completely
- Copies all skills from source
- Reports results
Use Cases:
- Version conflicts too complex to resolve manually
- Target skills corrupted or inconsistent
- Force align target to source state
- Clean up residual skills after major version upgrade
Example Output:
๐๏ธ Deleting .claude/skills (34 skills)
๐ Copying from ~/dev/ai-dev/.claude/skills (22 skills)
โ
Clean sync complete: 22 skills synced
Mutual Exclusion Rules:
| Parameter Combination | Behavior | Valid? |
|---|---|---|
--from --clean |
Clean current, copy from source | โ Valid |
--to --clean |
Clean target, copy from current | โ Valid |
--clean --skills |
ERROR | โ Mutually exclusive |
--clean --filter-config |
ERROR | โ Mutually exclusive |
Error handling:
$ /update-skills --from ~/dev/ai-dev --clean --skills adr,status
โ Error: --clean and --skills are mutually exclusive
--clean performs full directory replacement
When NOT to use:
- โ Normal version updates โ Use standard sync (--from/--to)
- โ Selective skill updates โ Use --skills flag
- โ Regular maintenance โ Use smart filter (--filter-config)
When to use:
- โ Severe version conflicts (manual resolution too complex)
- โ Corrupted target skills directory
- โ Force reset to framework state
- โ Major version migration cleanup
Recovery: If you need to restore after clean sync, use git:
# Restore deleted files
git restore .claude/skills/
# Or check changes
git status
git diff
Version Detection (v2.0.0+)
Method: Semantic version comparison from YAML frontmatter
Comparison algorithm:
def parse_yaml_version(file_path):
"""ไป SKILL.md ็ YAML frontmatter ๆๅ version ๅญๆฎต
Returns:
str: ็ๆฌๅท (ๅฆ "1.1.0") ๆ None
"""
import re
with open(file_path, 'r') as f:
# ่ฏปๅ YAML frontmatter (---...--- ไน้ด)
lines = []
in_yaml = False
for line in f:
if line.strip() == '---':
if not in_yaml:
in_yaml = True
continue
else:
break # ็ปๆ YAML ๅ
if in_yaml:
lines.append(line)
# ๆฅๆพ version: "x.y.z"
for line in lines:
if line.startswith('version:'):
# ๆๅๅผๅทๅ
็็ๆฌๅท
match = re.search(r'version:\s*"([^"]+)"', line)
if match:
return match.group(1)
return None
def compare_semver(v1: str, v2: str) -> int:
"""่ฏญไนๅ็ๆฌๆฏ่พ
Args:
v1: ็ๆฌๅท 1 (ๅฆ "2.1.0")
v2: ็ๆฌๅท 2 (ๅฆ "2.0.0")
Returns:
int: 1 if v1 > v2, -1 if v1 < v2, 0 if equal
"""
parts1 = [int(x) for x in v1.split('.')]
parts2 = [int(x) for x in v2.split('.')]
for p1, p2 in zip(parts1, parts2):
if p1 > p2:
return 1
elif p1 < p2:
return -1
return 0
def content_differs(source_path, target_path):
"""ๆฃๆฅไธคไธชๆไปถๅ
ๅฎนๆฏๅฆไธๅ๏ผๅฟฝ็ฅ็ฉบ็ฝๅๆณจ้๏ผ
Returns:
bool: True if content differs
"""
def normalize(path):
# ่ฏปๅๆไปถ๏ผ็งป้ค YAML frontmatter ๅ็ฉบ็ฝ่ก
with open(path, 'r') as f:
lines = f.readlines()
# ่ทณ่ฟ YAML frontmatter
in_yaml = False
content_lines = []
for line in lines:
if line.strip() == '---':
if not in_yaml:
in_yaml = True
continue
else:
in_yaml = False
continue
if not in_yaml and line.strip():
content_lines.append(line.strip())
return '\n'.join(content_lines)
return normalize(source_path) != normalize(target_path)
def compare_skill_versions(source_skill, target_skill):
"""ๆฏ่พไธคไธช skill ็็ๆฌ
Returns:
str: "NEW", "NEWER", "OLDER", "SAME", "CONFLICT"
"""
import os
source_path = f"{source_skills_dir}/{source_skill}/SKILL.md"
target_path = f"{target_skills_dir}/{target_skill}/SKILL.md"
# 1. Target ไธๅญๅจ โ NEW
if not os.path.exists(target_path):
return "NEW"
# 2. ่งฃๆ YAML version ๅญๆฎต
source_version = parse_yaml_version(source_path)
target_version = parse_yaml_version(target_path)
# 3. ๅๅๅ
ผๅฎน๏ผไปปไธ็ผบๅฐ version โ fallback to legacy
if not source_version or not target_version:
return compare_legacy(source_path, target_path)
# 4. ่ฏญไนๅ็ๆฌๆฏ่พ
cmp = compare_semver(source_version, target_version)
if cmp > 0:
return "NEWER" # Source version higher
elif cmp < 0:
return "OLDER" # Source version lower
else:
# 5. ็ๆฌ็ธๅ๏ผๆฃๆฅๅ
ๅฎน
if content_differs(source_path, target_path):
return "CONFLICT" # Same version, different content
else:
return "SAME"
def compare_legacy(source_path, target_path):
"""Legacy ๆฏ่พๆนๆณ๏ผๆถ้ด + ่กๆฐ๏ผ- ๅๅๅ
ผๅฎน"""
import os
# ๅๆ็ stat -f %m ๅ wc -l ้ป่พ
source_time = os.path.getmtime(source_path)
target_time = os.path.getmtime(target_path)
if source_time > target_time:
return "NEWER"
elif source_time < target_time:
return "OLDER"
else:
# ๆถ้ด็ธๅ๏ผๆฏ่พ่กๆฐ
source_lines = len(open(source_path).readlines())
target_lines = len(open(target_path).readlines())
if source_lines != target_lines:
return "CONFLICT"
else:
return "SAME"
Process:
- Parse
version: "x.y.z"from SKILL.md YAML frontmatter - Compare using semantic versioning rules:
- Major: Breaking changes (2.0.0 > 1.9.0)
- Minor: New features (1.1.0 > 1.0.0)
- Patch: Bug fixes (1.0.1 > 1.0.0)
- Detect conflicts: Same version, different content
- Fallback: If no version field, use legacy (time + size)
Status meanings:
- NEW - Skill doesn't exist in target (safe to copy)
- NEWER - Source version > target version (2.1.0 > 2.0.0, recommend update)
- OLDER - Source version < target version (warn before overwrite)
- SAME - Versions and content identical (skip)
- CONFLICT - Same version but content differs (manual review needed)
Legacy fallback (for skills without version field):
- Compare modification time (
stat -f %m) - If time same, compare file size (
wc -l)
Analysis Output
๐ Analysis:
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Skill โ Status โ Action โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ adr โ NEWER โ Update (v1.1.0 โ v1.2.0) โ
โ create-issues โ NEW โ Add (v1.0.0) โ
โ start-issue โ NEWER โ Update (v2.1.0 โ v2.2.0) โ
โ finish-issue โ NEW โ Add (v1.0.0) โ
โ status โ SAME โ Skip (both v1.0.0) โ
โ review โ OLDER โ Skip (v1.0.0 < v1.1.0) โ
โ work-issue โ CONFLICTโ Manual review needed โ
โ โ โ (both v3.0.0, content diff) โ
โ (15 others) โ SAME โ Skip โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary:
- New skills: 2 (create-issues, finish-issue)
- Updated skills: 2 (adr, start-issue)
- Unchanged: 15
- Skipped (older): 1 (review)
- Conflicts: 1 (work-issue - requires manual resolution)
- Total to sync: 4 skills
Conflict Handling
OLDER Source (Warning)
โ ๏ธ Warning: Source skill is OLDER than target
Skill: status
Source: 2026-03-01 (220 lines)
Target: 2026-03-04 (223 lines)
Options:
1. Skip (recommended) - Keep newer version
2. Overwrite - Replace with older version
3. Diff - Show differences
Choice (1/2/3):
CONFLICT Detection (Version Mismatch)
โ Conflict detected
Skill: work-issue
Source version: v3.0.0
Target version: v3.0.0
Content differs: Yes
โ ๏ธ Issue: Version numbers match but content differs
This usually means:
- Both sides modified same version
- Forgot to bump version after changes
- Divergent development
Recommended action:
1. Review changes: diff source/SKILL.md target/SKILL.md
2. Merge manually or choose one version
3. Update version number after merge (v3.0.1 or v3.1.0)
Options:
1. Skip - Keep current version (no sync)
2. Show diff - Compare line by line
3. Overwrite - Use source version (requires confirmation)
4. Manual merge - Open both files in editor
Choice (1/2/3/4):
Why conflicts occur:
- Both source and target modified same version
- Version number not bumped after content changes
- Parallel development without coordination
Resolution steps:
- Review both versions (option 2: show diff)
- Choose merge strategy:
- Manual merge: Combine both changes
- Accept source: Use newer implementation
- Accept target: Keep current version
- Bump version number (v3.0.0 โ v3.0.1 or v3.1.0)
- Re-run sync to verify
Backup Strategy
Automatic backup before overwrite (incremental mode only):
Before updating any skill:
โ
Creating backup: .claude/skills/adr.backup-2026-03-06/
โ
Backed up: adr/SKILL.md
โ
Backed up: adr/LICENSE.txt
Now updating adr...
โ
Updated: adr (408 โ 443 lines)
Rollback available: .claude/skills/adr.backup-2026-03-06/
Backup cleanup:
- Automatic after 7 days
- Or manual:
rm -rf .claude/skills/*.backup-*
Note on --clean mode:
--cleanmode does NOT create backups- Relies on git version control for recovery
- Use
git restore .claude/skills/to recover if needed
What Gets Synced
.claude/skills/
โโโ README.md โ
Synced (skills system guide)
โโโ WORKFLOW_PATTERNS.md โ
Synced (workflow requirements)
โโโ PYTHON_GUIDE.md โ
Synced (development guide)
โโโ _shared/ โ
Synced (shared utilities)
โ โโโ *.py
โ โโโ tests/
โโโ skill-name/
โ โโโ SKILL.md โ
Synced (entire directory)
โ โโโ LICENSE.txt โ
Synced
โ โโโ scripts/ โ
Synced (if exists)
โ โโโ references/ โ
Synced (if exists)
โ โโโ assets/ โ
Synced (if exists)
โโโ another-skill/
โโโ ... โ
Synced
.claude/
โโโ settings.json โ Not synced (project-specific)
โโโ MEMORY.md โ Not synced (project-specific)
โโโ plans/ โ Not synced (project-specific)
Note:
- Entire skill directories are synced, not just SKILL.md
- Root-level documentation (README, WORKFLOW_PATTERNS, PYTHON_GUIDE) is synced to preserve framework knowledge
- Shared utilities and tests are synced for cross-skill compatibility
Usage Examples
Example 1: Framework Upgrade
User says:
"update skills from the framework"
What happens:
- Pull from ~/dev/ai-dev
- Scan both projects
- Show: 4 skills to update
- Confirm and sync
- Report: "Updated 4 skills"
Time: ~30 seconds
Example 2: Selective Update
User says:
"pull only the adr and status skills"
What happens:
/update-skills --from ~/dev/ai-dev --skills adr,status- Compare only those 2 skills
- Show: 1 updated (adr), 1 same (status)
- Sync adr only
- Report: "Updated adr skill"
Time: ~20 seconds
Example 3: Promote to Framework
User says:
"push my custom skills to the framework"
What happens:
/update-skills --to ~/dev/ai-dev --skills custom-deploy,custom-test- Compare custom skills
- Show: 2 NEW skills
- Confirm and push
- Report: "Pushed 2 skills to framework"
Time: ~25 seconds
Safety Features
Pre-flight checks:
- โ Source/target paths exist
- โ Source has .claude/skills/ directory
- โ User confirmation before changes
- โ Dry-run preview available
Version protection:
- Warns when overwriting newer target
- Detects conflicts (same time, different content)
- Shows line count differences
- Provides diff option
Backup protection:
- Automatic backup before overwrite
- Timestamped backup directories
- Easy rollback
Error Handling
Invalid Source/Target
โ Error: Project not found
Path: ../nonexistent
Expected: ../nonexistent/.claude/skills/
Please check:
1. Path is correct
2. Project has .claude/skills/ directory
3. You have read permissions
No Skills to Update
โ
All skills are up to date!
No new or updated skills found in source.
Current project has all latest versions.
Permission Issues
โ Error: Permission denied
Cannot write to: ../buffer/.claude/skills/
Please check:
1. You have write permissions
2. Directory is not read-only
3. No other process is locking the directory
Best Practices
- Always dry-run first: Test with
--dry-runbefore applying changes - Selective updates: Use
--skillsflag to update only specific skills - Framework as source of truth: Projects pull from framework, framework pulls innovations from projects
- Document custom skills: Ensure complete YAML frontmatter, 200+ lines docs, examples, no hardcoded paths, LICENSE.txt
Integration
With other update- skills:*
# Complete framework update
/update-pillars --from ~/dev/ai-dev # 1. Pillars
/update-rules --from ~/dev/ai-dev # 2. Rules
/update-workflow --from ~/dev/ai-dev # 3. Workflow
/update-skills --from ~/dev/ai-dev # 4. Skills
# Or use meta-skill
/update-framework --from ~/dev/ai-dev # All-in-one
Common workflow:
Framework upgrade โ Pull Skills โ Test locally โ Commit
Skill development โ Polish โ Push to framework โ Share
Task Management
After each sync step, update progress:
Paths validated โ Update Task #1
Skills scanned โ Update Task #2
Versions compared โ Update Task #3
Diff shown โ Update Task #4
Sync executed โ Update Task #5
Results reported โ Update Task #6
Provides real-time visibility of sync progress.
Final Verification
Before declaring sync complete, verify:
- [ ] All 6 sync tasks completed
- [ ] Source and target paths valid
- [ ] Skills compared successfully
- [ ] User confirmed changes
- [ ] Directories copied correctly
- [ ] Backups created (if overwritten)
- [ ] Sync summary displayed
Missing items indicate incomplete sync.
Workflow Skills Requirements
This is a workflow skill and must follow the standard pattern:
- TaskCreate at start - Create todo list for progress tracking
- TaskUpdate during execution - Mark tasks in_progress โ completed
- Verification checklist - Final validation before completion
See: WORKFLOW_PATTERNS.md for complete implementation guide
Related Skills
- /update-framework - Sync entire framework (calls this skill)
- /update-pillars - Sync Pillars
- /update-rules - Sync rules
- /update-workflow - Sync workflow docs
Version: 2.4.0 Last Updated: 2026-03-14 Changelog:
- v2.4.0 (2026-03-14): Simplify --clean mode documentation (Issue #256)
- v2.3.0 (2026-03-13): Add --clean parameter for complete directory replacement (Issue #210)
- v2.0.0 (2026-03-10): Upgrade to semantic version comparison (Issue #214)
- v1.0.0 (Initial): Created update-skills skill (Issue #70)
Pattern: Tool-Reference (guides sync process) Compliance: ADR-001 Section 4 โ
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?