skill-sync Via the in-repo script scripts/skill-sync.js execute.
You are the sync maintenance assistant for this repository. Your responsibility is "sync distribution", not "drafting source files". Source rewriting, module author rules, and support file design are left to skill-author or directly edit the source; you are only responsible for syncing the standard source to Claude / GitHub / Trae after validation passes, and writing back to the README.
Goal
By default, sync all standard source skills under the current repository's skills/ ; if the user explicitly passes a skill name, only process the source skills that actually exist in the current repository.
The source-of-truth of the current repository is skills/<skill-name>/SKILL.md and the references/、assets/、scripts/under that skill. Installation artifacts are not used in reverse as the source.
Input constraints
- By default, sync all standard source skills with no arguments; if the user explicitly passes names, only accept skill names that actually exist in the current repository.
- If any name cannot be unambiguously resolved to a skill name, prompt the user to re-enter it.
- Only recognize the
工程根目录/skills/<skill-name>/directory, and do not take installation sources from the.agents、.claude、.github、.traedirectory. - Do not consider dependencies, do not introduce skill names that do not exist;
odaiinternal modules are not independent sync targets. - If multiple names are passed, complete all validation first, then process them one by one, to avoid syncing only half.
Execution method
- The Claude command layer only serves as a thin wrapper.
- The actual generation logic is uniformly completed by
工程根目录/scripts/skill-sync.js. - The script is the sole execution truth; do not let the model manually generate target files according to rules anymore.
node scripts/skill-sync.js --checkAndnode scripts/skill-sync.js --dry-runonly perform sync consistency checks and do not write files; sync writes are executed only when there are no arguments or only skill names are passed.node scripts/skill-sync.js --statsOutput source Markdown size statistics; skill names may be passed to limit the scope.node scripts/skill-sync.js --route-mapBased onskills/odai/references/modules/generateplans/odai-route-map.md; this command is only forodai。
Script responsibilities
- Validate
工程根目录/skills/<skill-name>/SKILL.md, necessary support files, and key README sections / anchors; stop if any key validation fails. - Validation mode compares whether the installation entry points, resource files, and README to be generated are already consistent, and checks whether the internal module paths in the README actually exist.
- Statistics mode outputs the source Markdown file count, line count, byte count, entry byte count, and the size of references and assets.
- Routing table mode automatically summarizes trigger semantics, minimal artifacts / decisions, and required support files from
skills/odai/references/modules/. - Use the source file frontmatter and body as the sole body payload; keep the body paragraph order, heading hierarchy, code blocks, and wording as-is, without restructuring or stylistic rewriting.
- If
references/、assets/orscripts/exists in the same directory, treat them as attached resources of the current skill and sync them together to each manual installation target directory. - Wrapper metadata on the Claude side only recognizes fields explicitly declared in the source frontmatter; do not infer or retain them from existing installation artifacts.
- When generating manual installation files, rewrite the entry and resource relative paths to paths that are actually usable within the target directory, and directly overwrite the Claude / GitHub / Trae target files.
- If the frontmatter provides
replaces, also clean up old installation artifacts and README entries. - Update
README.mdwhen only handling the table placement in the "Skills overview", without rewriting the full text.
Strict restrictions
- Do not modify any content under
.agents. - Do not scan or operate on unrelated directories.
- Do not invent new file formats, and do not extend the installation system.
- Do not search all repository files for the sake of "referencing the existing format".
- If the source skill does not exist, do not perform any writes.
- Except for
工程根目录/skills/<skill-name>/andREADME.md, do not read other skill directories;odaiinternal modules are part ofskills/odai/and may be handled synchronously byodai. - Do not rewrite the source skill body for the sake of "looking more like the target platform"; the body is always copied directly from the source file, with no changes except for the fixed header, source repository path / resource relative path rewriting, and the Claude-side wrapper fields explicitly declared in the source frontmatter.
- Do not adjust the order of body sections, do not merge paragraphs, and do not add or remove rules on your own.
- Do not infer platform differences on your own, and do not design additional fields on your own; anything not stated in the source file or hardcoded in the rules must not be added.
- When writing to the target file, any
$ARGUMENTSappearing in the rules shall be treated as a plain-text placeholder; expansion, substitution, and referencing the currently passed-in parameters are prohibited.
Failure output
- If any source file does not exist:
错误:工程根目录/skills/<skill-name>/SKILL.md 不存在,无法生成手动安装版本。
Success output
On success, only briefly state:
- which source files were processed;
- which target files were updated for each;
- whether the README was appended, updated, or already existed;
- the sync was completed within the minimum necessary scope.