SuperAPI AI Directory

sync-local-global-agents-skills

Agents & models

View repository

Updated 10-16 04:41

About this skill

Local Global Agent Skills Synchronizer

This skill is used to take the skills globally installed by the Vercel skills CLI (~/.agents/skills) as the single source of truth and batch-sync them to the skills directories of other local agent platforms on the machine.

Trigger Boundaries

Valid triggers include:

  • skills add ... -g has succeeded, and the user requests to continue syncing to local platforms.
  • The user explicitly requests to sync the global ~/.agents/skills to WorkBuddy, QoderWork, Kimi Work, CodeBuddy, and Qoder.
  • After a new platform has completed directory semantics and link capability verification, synchronization needs to be performed.
  • The target skills link is invalid, was accidentally deleted, or points to the wrong location and needs to be rebuilt.

When the user provides a complete skills add command that has not yet been executed, do not run this synchronizer ahead of the original command; first execute or confirm the original command according to the user's intent, and only after it fails should you branch based on the error.

Use Cases

Use this skill when encountering the following situations:

  • Skills have been globally installed/updated using skills add ... -g , and need to be synced to local agent platforms such as WorkBuddy, QoderWork, Kimi Work, CodeBuddy, and Qoder
  • A new local agent platform has been added, and existing skills need to be distributed to it
  • A platform's skills directory was accidentally deleted or its link is invalid and needs to be rebuilt

Core Responsibilities

  1. Single source of truth: always read from ~/.agents/skills , and do not maintain a second copy
  2. Directory-level symbolic links: replace the target platform's skills directory with a symbolic link pointing to the source directory
  3. Idempotent execution: repeated runs will not create duplicate links
  4. Safe backup: automatically back up to skills.bak.<timestamp>-<uuid>
  5. Invalid link repair: automatically delete and rebuild symbolic links that point to the wrong location

Supported Platforms

The platform registry is maintained in src/platforms.ts . Adding a platform requires modifying that file and upgrading the skill version.

Platform Target Directory
WorkBuddy ~/.workbuddy/skills
QoderWork ~/.qoderworkcn/skills
Kimi Work ~/AppData/Roaming/kimi-desktop/daimon-share/daimon/skills
CodeBuddy ~/.codebuddy/skills
Qoder ~/.qoder/skills

Usage

Main Script (Recommended)

In the skill installation directory (for example, ~/.agents/skills/sync-local-global-agents-skills/), run:

# 使用 tsx 运行
tsx scripts/sync.ts

# 只查看计划,不修改文件系统
tsx scripts/sync.ts --dry-run

# 指定自定义源目录
tsx scripts/sync.ts --source <custom-skills-root>

# 不备份直接替换
tsx scripts/sync.ts --no-backup

Fallback Script

The fallback is only used as a degraded path when the main sync script is unavailable, Node/TypeScript is unavailable, permissions are insufficient, symbolic link capability fails, or the sync script has already failed; it is not the default path before skills add .

When degraded execution is needed, you can use the fallback script in the same directory:

# Windows PowerShell
fallback/sync.ps1
# WSL / macOS / Linux
fallback/sync.sh

Symbolic Link Strategy

  • Windows: prefer creating a native directory symbolic link (in the formlrwxrwxrwx / MSYS=winsymlinks:native ), and automatically fall back to junction
  • Linux/macOS: use a standard ln -s directory soft link

Sync Behavior

  1. Target directory does not exist → create a directory-level symbolic link
  2. Target directory is already the correct link → skip
  3. Target directory is a real directory → back up and replace with a link
  4. Target directory is a wrong symlink → replace directly (no backup)
  5. Target path is a regular file → delete then create symlink

Memorix Skills Refresh

This version has integrated the memorix internal skills refresh capability. When running sync.ts , it will automatically first refresh the latest internal skills from the memorix official repository (GitHub raw) to ~/.agents/skills/, and then sync them to each agent platform.

Parameter Description
--skip-memorix-refresh Skip the memorix refresh step
--force-memorix-refresh Force overwrite existing memorix skills
--memorix-source <github|local|cli|auto> Source strategy (default: auto)
--memorix-agent <agent> agent source (default: cursor)

Standalone refresh script:scripts/fetch-memorix-skills.ts(supports --dry-run、--force parameters).

Related files

  • scripts/sync.ts — CLI entry point
  • src/sync.ts — core sync logic
  • src/platforms.ts — platform registry
  • fallback/sync.ps1 — Windows PowerShell fallback
  • fallback/sync.sh — Bash fallback