claude-skills-sync-init
Claude Skills Sync Init
在目标项目中初始化 skills 同步能力时,使用本 Skill。
Overview
目标是在目标仓库自动落地以下能力:
- 生成
scripts/sync-llm-skills.ts,支持--source、--targets、--dry-run。 - 注入
scripts.skills:sync:llm命令。 - 自动确保
devDependencies.is-ci存在(缺失时自动写入)。 - 以幂等方式合并
postinstall,默认注入is-ciCI guard。 - 同步目标仅为
.claude/skills。 - 同步过程采用原子切换,避免复制失败时清空目标目录。
- 自动确保目标仓库
.gitignore包含/.claude/skills。
Execution Flow
- 收集上下文
- 确认目标仓库根目录(存在
package.json)。 - 确认源目录是否仍使用
.agents/skills(默认值)。 - 确认目标目录为
.claude/skills(默认且唯一目标)。
- 执行自动落地脚本
- 在目标仓库执行:
node /path/to/claude-skills-sync-init/scripts/bootstrap-sync-skills.mjs --project /path/to/target-repo
- 可选参数:
--script-name(默认skills:sync:llm)--script-path(默认scripts/sync-llm-skills.ts)--skip-postinstall(跳过 postinstall 注入)
--script-name仅允许字符集[A-Za-z0-9:._-]+,非法值必须失败退出。
- 运行同步命令验证
- 默认验证:
pnpm run skills:sync:llm -- --dry-run
- 显式指定目标(可选):
pnpm run skills:sync:llm -- --targets=claude
- 输出变更摘要
- 列出新增/更新文件:
scripts/sync-llm-skills.tspackage.json.gitignore
- 说明
is-ci依赖处理结果(新增或已存在)。 - 说明 postinstall 合并结果(新建、追加、或已存在跳过),并标注 CI guard 是否生效。
- 说明
.gitignore的/.claude/skills忽略规则处理结果(新增或已存在)。 - 附上验证命令与执行结果。
Resources
- 自动落地脚本:
scripts/bootstrap-sync-skills.mjs - 同步脚本模板:
assets/templates/sync-llm-skills.ts - 集成检查清单:
references/integration-checklist.md
Guardrails
- 仅在目标仓库根目录执行(必须可读写
package.json)。 - 保持幂等:重复执行不得重复注入命令或 postinstall 片段。
- 不覆盖已有 postinstall 逻辑,只做追加合并。
- 源目录不存在时必须失败并返回非零退出码。
- postinstall 去重必须做完整命令/完整脚本调用匹配,不能使用宽松子串匹配。
- 同步实现必须优先复制到临时目录,再切换目标目录,并在失败时尝试回滚。
- 若目标仓库缺少
is-ci,必须自动写入devDependencies.is-ci,再注入 CI guard 命令。
More from adonis0123/adonis-skills
staged-changes-review
Checklist-driven review of staged Git changes with deterministic rule scanning and semantic analysis. Use when the user wants to review staged changes, check for errors before commit, or validate code quality before committing.
25ruler-rules-init
Migrate and bootstrap Ruler-based AI rules across repositories with English-first templates, preset-based project detection, and safe, idempotent setup. Use when creating or standardizing `.ruler/*` files, generating `AGENTS.md`/`CLAUDE.md`, wiring `ruler:apply` into `package.json`, adding generated-file ignores in `.gitignore`, and designing `applyTo` scoping patterns such as `**` and `web/**`.
18discuss-before-plan
Enforces 'decide then plan' discipline - the pre-planning decision gate. Use when the user asks for a plan or starts a change while key decisions are unresolved: architecture tradeoffs, data flow, public interfaces, unclear requirements, multi-module scope, or roughly 5+ files affected. Also triggers when the user explicitly wants to discuss, compare options, or review architecture before committing. Core job: reduce incorrect-execution cost by confirming decisions before producing executable plans.
17staged-review-validator
Validate staged-changes-review findings with evidence-based verdicts and minimal-fix guidance. Use when you need to confirm whether each reported issue is valid and actionable.
14tailwindcss-next-init
Initialize Tailwind CSS v4 and Iconify for Next.js App Router projects with script-driven templates. Use when you need a fast setup or migration with consistent style-entry conventions.
12weekly-report
Generate structured weekly reports from Git commit history across one or multiple repositories. Use when you need concise, project-grouped progress summaries for status reporting.
11