skill-linker 3.0.8 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -52
- package/package.json +3 -4
- package/src/cli.js +42 -30
- package/src/commands/install.js +178 -322
- package/src/commands/list.js +131 -54
- package/src/utils/agents.js +83 -58
- package/src/utils/git.js +68 -64
package/README.md
CHANGED
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
一個現代化的 CLI 工具,用於將 AI Agent Skills 快速連結(Symlink)到各種 AI Agent 的專案或全域目錄中。
|
|
8
8
|
|
|
9
9
|
## ✨ 功能特色
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- **模糊搜尋 (Fuzzy Search)**:在選擇 Repository 時,直接輸入文字即可即時過濾清單。
|
|
14
|
-
- **智慧偵測**:自動偵測系統中已安裝的 Agent,並在選單中預設勾選。
|
|
11
|
+
- **CLI 優先設計**:專為 AI Agent 打造的命令列介面,無需互動問答。
|
|
12
|
+
- **自動化流程**:支援自動 Clone、安裝、覆寫。
|
|
15
13
|
- **多 Agent 支援**:支援 Claude Code, GitHub Copilot, Antigravity, Cursor, Windsurf, OpenCode, Gemini CLI 等。
|
|
16
14
|
- **雙重範圍 (Scope)**:可選擇安裝到當前 `專案目錄 (Project)` 或 `全域目錄 (Global)`。
|
|
17
15
|
- **自動 Clone**:支援從 GitHub Clone 並自動處理 Multi-skill Repos。
|
|
@@ -22,20 +20,14 @@
|
|
|
22
20
|
### 方式 1:使用 npx (推薦)
|
|
23
21
|
|
|
24
22
|
```bash
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
npx skill-linker
|
|
23
|
+
# 安裝技能(需要 --skill 或 --from)
|
|
24
|
+
npx /app/workspace/projects/skill-linker install --skill <路徑> --agent opencode --scope both --yes
|
|
25
|
+
npx skill-linker install --from https://github.com/anthropics/skills --agent claude --scope both
|
|
28
26
|
|
|
29
|
-
#
|
|
27
|
+
# 列出已安裝的 Repos
|
|
30
28
|
npx skill-linker list
|
|
31
|
-
|
|
32
|
-
npx skill-linker -
|
|
33
|
-
|
|
34
|
-
# 直接從 GitHub Clone 並安裝 (跳過來源選擇)
|
|
35
|
-
npx skill-linker --from https://github.com/user/my-skill
|
|
36
|
-
|
|
37
|
-
# 指定本地路徑 (如果是自己 clone 下來的指定目錄)
|
|
38
|
-
npx skill-linker /path/to/my-skill
|
|
29
|
+
npx skill-linker list --repo skill-name
|
|
30
|
+
npx skill-linker list --repo skill-name --json
|
|
39
31
|
```
|
|
40
32
|
|
|
41
33
|
### 方式 2:本地開發/安裝
|
|
@@ -50,43 +42,67 @@ npm link # 之後可直接使用 skill-linker 指令
|
|
|
50
42
|
## 🛠️ 命令說明
|
|
51
43
|
|
|
52
44
|
```
|
|
53
|
-
Usage: skill-linker [
|
|
45
|
+
Usage: skill-linker [command]
|
|
54
46
|
|
|
55
|
-
|
|
47
|
+
CLI to link AI Agent Skills to various agents
|
|
56
48
|
|
|
57
|
-
|
|
58
|
-
skill
|
|
49
|
+
Commands:
|
|
50
|
+
install Install a skill to specified agents
|
|
51
|
+
list List available skills in library
|
|
59
52
|
|
|
60
53
|
Options:
|
|
61
|
-
-V, --version
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
-V, --version 顯示版本號
|
|
55
|
+
-h, --help 顯示說明
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### install 命令
|
|
65
59
|
|
|
66
|
-
Commands:
|
|
67
|
-
list 列出庫中所有可用的 Repos 與其 Skills
|
|
68
60
|
```
|
|
61
|
+
Usage: skill-linker install --skill <path>
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
Options:
|
|
64
|
+
--skill <path> 指定本地 Skill 目錄路徑(必需)
|
|
65
|
+
--from <github-url> 從 GitHub Clone 後再進行連結
|
|
66
|
+
-a, --agent <names> 指定 Agent 名稱(opencode, claude, cursor 等)
|
|
67
|
+
-s, --scope <scope> 範圍:project, global, both(預設 both)
|
|
68
|
+
-y, --yes 自動覆寫已存在的連結
|
|
69
|
+
```
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
範例:
|
|
73
72
|
|
|
74
73
|
```bash
|
|
75
|
-
|
|
74
|
+
# 指定路徑安裝到 opencode
|
|
75
|
+
npx skill-linker install --skill /path/to/skill --agent opencode
|
|
76
|
+
|
|
77
|
+
# 從 GitHub Clone 並安裝到多個 Agents
|
|
78
|
+
npx skill-linker install --from https://github.com/anthropics/skills --agent claude cursor --scope both
|
|
79
|
+
|
|
80
|
+
# 安裝到所有已偵測到的 Agents
|
|
81
|
+
npx skill-linker install --skill /path/to/skill --scope both --yes
|
|
76
82
|
```
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
npx skill-linker -l
|
|
84
|
+
### list 命令
|
|
85
|
+
|
|
81
86
|
```
|
|
87
|
+
Usage: skill-linker list [options]
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
Options:
|
|
90
|
+
-r, --repo <name> 指定 Repository 名稱
|
|
91
|
+
--json JSON 輸出格式
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
範例:
|
|
85
95
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
```bash
|
|
97
|
+
# 列出所有 Repos
|
|
98
|
+
npx skill-linker list
|
|
99
|
+
|
|
100
|
+
# 列出特定 Repo 的 Skills
|
|
101
|
+
npx skill-linker list --repo skill-name
|
|
102
|
+
|
|
103
|
+
# JSON 輸出
|
|
104
|
+
npx skill-linker list --repo skill-name --json
|
|
105
|
+
```
|
|
90
106
|
|
|
91
107
|
## 📂 Skill Library 管理
|
|
92
108
|
|
|
@@ -102,35 +118,41 @@ npx skill-linker -l
|
|
|
102
118
|
|
|
103
119
|
## 🛠️ 支援的 Agent 與路徑
|
|
104
120
|
|
|
105
|
-
| 平台 / 工具
|
|
106
|
-
|
|
107
|
-
| **Claude Code**
|
|
108
|
-
| **GitHub Copilot**
|
|
109
|
-
| **Google Antigravity** | `.agent/skills/`
|
|
110
|
-
| **Cursor**
|
|
111
|
-
| **OpenCode**
|
|
112
|
-
| **OpenAI Codex**
|
|
113
|
-
| **Gemini CLI**
|
|
114
|
-
| **Windsurf**
|
|
121
|
+
| 平台 / 工具 | 專案目錄 | 全域目錄 |
|
|
122
|
+
| ---------------------- | ------------------- | ------------------------------- |
|
|
123
|
+
| **Claude Code** | `.claude/skills/` | `~/.claude/skills/` |
|
|
124
|
+
| **GitHub Copilot** | `.github/skills/` | `~/.copilot/skills/` |
|
|
125
|
+
| **Google Antigravity** | `.agent/skills/` | `~/.gemini/antigravity/skills/` |
|
|
126
|
+
| **Cursor** | `.cursor/skills/` | `~/.cursor/skills/` |
|
|
127
|
+
| **OpenCode** | `.opencode/skills/` | `~/.config/opencode/skills/` |
|
|
128
|
+
| **OpenAI Codex** | `.codex/skills/` | `~/.codex/skills/` |
|
|
129
|
+
| **Gemini CLI** | `.gemini/skills/` | `~/.gemini/skills/` |
|
|
130
|
+
| **Windsurf** | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
|
|
115
131
|
|
|
116
132
|
## 📦 推薦的 Public Skill Repos
|
|
117
133
|
|
|
118
134
|
### Claude 官方 Skills (pdf, docx, pptx, xlsx...)
|
|
135
|
+
|
|
119
136
|
[anthropics/skills](https://github.com/anthropics/skills)
|
|
137
|
+
|
|
120
138
|
```bash
|
|
121
|
-
npx skill-linker --from https://github.com/anthropics/skills
|
|
139
|
+
npx skill-linker install --from https://github.com/anthropics/skills --agent claude
|
|
122
140
|
```
|
|
123
141
|
|
|
124
142
|
### moltbot 的 AI Agent Skills (來自 clawdhub.com)
|
|
143
|
+
|
|
125
144
|
[moltbot/skills](https://github.com/moltbot/skills)
|
|
145
|
+
|
|
126
146
|
```bash
|
|
127
|
-
npx skill-linker --from https://github.com/moltbot/skills
|
|
147
|
+
npx skill-linker install --from https://github.com/moltbot/skills --agent opencode
|
|
128
148
|
```
|
|
129
149
|
|
|
130
150
|
### 精選的 AI Skills 工具箱
|
|
151
|
+
|
|
131
152
|
[obra/superpowers](https://github.com/obra/superpowers)
|
|
153
|
+
|
|
132
154
|
```bash
|
|
133
|
-
npx skill-linker --from https://github.com/obra/superpowers
|
|
155
|
+
npx skill-linker install --from https://github.com/obra/superpowers --agent claude cursor
|
|
134
156
|
```
|
|
135
157
|
|
|
136
158
|
## ⚠️ 注意事項
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skill-linker",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.4",
|
|
4
|
+
"description": "CLI to link AI Agent Skills to various agents (Claude, Copilot, Antigravity, Cursor, etc.)",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"skill-linker": "bin/cli.js"
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"chalk": "^4.1.2",
|
|
30
30
|
"commander": "^12.0.0",
|
|
31
|
-
"execa": "^5.1.1"
|
|
32
|
-
"prompts": "^2.4.2"
|
|
31
|
+
"execa": "^5.1.1"
|
|
33
32
|
},
|
|
34
33
|
"repository": {
|
|
35
34
|
"type": "git",
|
package/src/cli.js
CHANGED
|
@@ -1,45 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const { program } = require(
|
|
4
|
-
const chalk = require(
|
|
5
|
-
const install = require(
|
|
6
|
-
const list = require(
|
|
3
|
+
const { program } = require("commander");
|
|
4
|
+
const chalk = require("chalk");
|
|
5
|
+
const install = require("./commands/install");
|
|
6
|
+
const list = require("./commands/list");
|
|
7
7
|
|
|
8
8
|
// Package info
|
|
9
|
-
const packageJson = require(
|
|
9
|
+
const packageJson = require("../package.json");
|
|
10
10
|
|
|
11
11
|
program
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
.name("skill-linker")
|
|
13
|
+
.description(
|
|
14
|
+
"CLI to link AI Agent Skills to various agents (Claude, Copilot, Antigravity, Cursor, etc.)",
|
|
15
|
+
)
|
|
16
|
+
.version(packageJson.version);
|
|
15
17
|
|
|
16
|
-
//
|
|
18
|
+
// Install command
|
|
17
19
|
program
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
.command("install")
|
|
21
|
+
.description("Install a skill to specified agents")
|
|
22
|
+
.requiredOption(
|
|
23
|
+
"--skill <path>",
|
|
24
|
+
"Path to skill directory or --from clone URL",
|
|
25
|
+
)
|
|
26
|
+
.option("--from <github-url>", "Clone skill from GitHub URL first, then link")
|
|
27
|
+
.option(
|
|
28
|
+
"-a, --agent <names...>",
|
|
29
|
+
"Agent names to install to (opencode, claude, cursor, etc.)",
|
|
30
|
+
)
|
|
31
|
+
.option("-s, --scope <scope>", "Scope: project, global, or both")
|
|
32
|
+
.option("-y, --yes", "Skip confirmation prompts")
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
await install({
|
|
35
|
+
skill: options.skill,
|
|
36
|
+
from: options.from,
|
|
37
|
+
agents: options.agent,
|
|
38
|
+
scope: options.scope,
|
|
39
|
+
yes: options.yes || false,
|
|
33
40
|
});
|
|
41
|
+
});
|
|
34
42
|
|
|
35
|
-
//
|
|
43
|
+
// List command
|
|
36
44
|
program
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
.command("list")
|
|
46
|
+
.description("List available skills in library")
|
|
47
|
+
.option("-r, --repo <name>", "Repository name to list skills from")
|
|
48
|
+
.option("--json", "Output as JSON")
|
|
49
|
+
.action(async (options) => {
|
|
50
|
+
await list({
|
|
51
|
+
repo: options.repo,
|
|
52
|
+
json: options.json || false,
|
|
41
53
|
});
|
|
54
|
+
});
|
|
42
55
|
|
|
43
56
|
// Parse command line arguments
|
|
44
57
|
program.parse(process.argv);
|
|
45
|
-
|