Skip to content

Commit 74726d3

Browse files
CopilotOhYee
andauthored
feat: add sync-skills command for ai tool skill dirs
Signed-off-by: GitHub <noreply@github.com> Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
1 parent 09c0ec0 commit 74726d3

10 files changed

Lines changed: 639 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ Multi-document YAMLs (`---` separated) let you deploy many agents in one call.
185185
| `sandbox` | `sb` | Sandboxes + files, processes, contexts, templates, browser | [en](./docs/en/sandbox.md) · [zh](./docs/zh/sandbox.md) |
186186
| `tool` | | MCP and FunctionCall tools | [en](./docs/en/tool.md) · [zh](./docs/zh/tool.md) |
187187
| `skill` | | Platform skill packages + local execution | [en](./docs/en/skill.md) · [zh](./docs/zh/skill.md) |
188+
| `sync-skills` | | Sync platform skills to Claude Code/Codex local skills directories | [en](./docs/en/sync-skills.md) · [zh](./docs/zh/sync-skills.md) |
188189
| `super-agent` | `sa` | Quickstart / CRUD / declarative / conversation | [en](./docs/en/super-agent.md) · [zh](./docs/zh/super-agent.md) |
189190
190191
## Documentation

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ ar sa invoke my-helper -m "帮我规划今天的事情" --text-only
181181
| `sandbox` | `sb` | 沙箱 + 文件、进程、上下文、模板、浏览器 | [en](./docs/en/sandbox.md) · [zh](./docs/zh/sandbox.md) |
182182
| `tool` | | MCP 与 FunctionCall 工具 | [en](./docs/en/tool.md) · [zh](./docs/zh/tool.md) |
183183
| `skill` | | 平台技能包 + 本地执行 | [en](./docs/en/skill.md) · [zh](./docs/zh/skill.md) |
184+
| `sync-skills` | | 将平台 skills 同步到 Claude Code/Codex 本地技能目录 | [en](./docs/en/sync-skills.md) · [zh](./docs/zh/sync-skills.md) |
184185
| `super-agent` | `sa` | 一键拉起 / CRUD / 声明式 / 会话管理 | [en](./docs/en/super-agent.md) · [zh](./docs/zh/super-agent.md) |
185186
186187
## 文档

docs/en/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,5 @@ Errors are written to stderr as JSON:
197197
| `sandbox` | `sb` | Sandboxes plus file, process, context, template and browser sub-groups | [sandbox.md](./sandbox.md) |
198198
| `tool` | | MCP and FunctionCall tools + sub-tool invocation | [tool.md](./tool.md) |
199199
| `skill` | | Platform skill packages + local scan/load/exec | [skill.md](./skill.md) |
200+
| `sync-skills` | | Sync platform skills to Claude Code/Codex skill directories | [sync-skills.md](./sync-skills.md) |
200201
| `super-agent` | `sa` | Quickstart REPL, declarative deploy, CRUD, conversations | [super-agent.md](./super-agent.md) |

docs/en/sync-skills.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
**English** | [简体中文](../zh/sync-skills.md)
2+
3+
# ar sync-skills
4+
5+
Sync platform Skills to local AI tool skill directories (Claude Code or Codex).
6+
7+
```
8+
ar sync-skills [tool] [scope] [options]
9+
```
10+
11+
## Options
12+
13+
| Flag | Type | Required | Default | Description |
14+
|------|------|----------|---------|-------------|
15+
| `--claude-code` | flag | yes* | | Sync to Claude Code skill directory. |
16+
| `--codex` | flag | yes* | | Sync to Codex skill directory. |
17+
| `--user` | flag | yes** | | Sync to user-level directory. |
18+
| `--project` | flag | yes** | | Sync to project-level directory. |
19+
| `--workspace` | multi | no | all | Workspace filter, repeatable. |
20+
| `--delete-unmanaged` | flag | no | false | Delete local skills outside selected workspace scope (with confirmation). |
21+
| `-y`, `--yes` | flag | no | false | Skip confirmation prompts. |
22+
23+
\* Exactly one of `--claude-code` or `--codex` is required.
24+
\** Exactly one of `--user` or `--project` is required.
25+
26+
## Behavior
27+
28+
- By default, all platform skills are selected (unless `--workspace` is provided).
29+
- Before downloading/updating skills, the CLI asks for confirmation.
30+
- Sync checks local metadata and only downloads skills that are missing or outdated.
31+
- When `--delete-unmanaged` is enabled, local skill directories not in the selected
32+
managed scope can be removed after confirmation.
33+
34+
## Examples
35+
36+
```bash
37+
# Sync skills from workspace abc + def into user-level Claude Code skills
38+
ar sync-skills --claude-code --user --workspace abc --workspace def
39+
40+
# Sync skills from workspace abc into project-level Codex skills
41+
ar sync-skills --codex --project --workspace abc
42+
43+
# Sync all skills and also remove unmanaged local skills
44+
ar sync-skills --claude-code --project --delete-unmanaged
45+
```

docs/zh/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,5 @@ ar sandbox exec "$SANDBOX" --code "print('hello')"
193193
| `sandbox` | `sb` | 沙箱以及 file / process / context / template / browser 子组 | [sandbox.md](./sandbox.md) |
194194
| `tool` | | MCP 与 FunctionCall 工具 + 子工具调用 | [tool.md](./tool.md) |
195195
| `skill` | | 平台侧技能包 + 本地 scan / load / exec | [skill.md](./skill.md) |
196+
| `sync-skills` | | 把平台 skills 同步到 Claude Code/Codex 本地技能目录 | [sync-skills.md](./sync-skills.md) |
196197
| `super-agent` | `sa` | 一键拉起 REPL、声明式部署、CRUD、会话管理 | [super-agent.md](./super-agent.md) |

docs/zh/sync-skills.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[English](../en/sync-skills.md) | **简体中文**
2+
3+
# ar sync-skills
4+
5+
把平台上的 Skill 同步到本地 AI 工具技能目录(Claude Code 或 Codex)。
6+
7+
```
8+
ar sync-skills [tool] [scope] [options]
9+
```
10+
11+
## 参数
12+
13+
| Flag | 类型 | 必填 | 默认 | 说明 |
14+
|------|------|------|------|------|
15+
| `--claude-code` | flag |* | | 同步到 Claude Code 技能目录。 |
16+
| `--codex` | flag |* | | 同步到 Codex 技能目录。 |
17+
| `--user` | flag |** | | 同步到用户级目录。 |
18+
| `--project` | flag |** | | 同步到项目级目录。 |
19+
| `--workspace` | multi || 全部 | 工作空间过滤,可重复。 |
20+
| `--delete-unmanaged` | flag || false | 删除不在所选管控范围内的本地技能目录(需确认)。 |
21+
| `-y``--yes` | flag || false | 跳过确认提示。 |
22+
23+
\* `--claude-code``--codex` 二选一。
24+
\** `--user``--project` 二选一。
25+
26+
## 行为说明
27+
28+
- 默认同步全部平台 Skill(除非传入 `--workspace`)。
29+
- 在下载/更新 Skill 前会先进行用户确认。
30+
- 同步会检查本地元数据,仅下载缺失或有更新的 Skill。
31+
- 开启 `--delete-unmanaged` 时,会在确认后删除不在当前管控范围内的本地 Skill 目录。
32+
33+
## 示例
34+
35+
```bash
36+
# 将 workspace abc + def 的 skills 同步到用户级 Claude Code 目录
37+
ar sync-skills --claude-code --user --workspace abc --workspace def
38+
39+
# 将 workspace abc 的 skills 同步到项目级 Codex 目录
40+
ar sync-skills --codex --project --workspace abc
41+
42+
# 同步全部 skills,并删除不在管控范围内的本地 skills
43+
ar sync-skills --claude-code --project --delete-unmanaged
44+
```

0 commit comments

Comments
 (0)