reskill 0.1.0
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/LICENSE +21 -0
- package/README.md +199 -0
- package/dist/cli/commands/index.d.ts +9 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/info.d.ts +7 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/init.d.ts +7 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/install.d.ts +11 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/link.d.ts +5 -0
- package/dist/cli/commands/link.d.ts.map +1 -0
- package/dist/cli/commands/list.d.ts +7 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/outdated.d.ts +7 -0
- package/dist/cli/commands/outdated.d.ts.map +1 -0
- package/dist/cli/commands/uninstall.d.ts +7 -0
- package/dist/cli/commands/uninstall.d.ts.map +1 -0
- package/dist/cli/commands/update.d.ts +7 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +1293 -0
- package/dist/core/cache-manager.d.ts +80 -0
- package/dist/core/cache-manager.d.ts.map +1 -0
- package/dist/core/config-loader.d.ts +76 -0
- package/dist/core/config-loader.d.ts.map +1 -0
- package/dist/core/git-resolver.d.ts +73 -0
- package/dist/core/git-resolver.d.ts.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/lock-manager.d.ts +75 -0
- package/dist/core/lock-manager.d.ts.map +1 -0
- package/dist/core/skill-manager.d.ts +98 -0
- package/dist/core/skill-manager.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1033 -0
- package/dist/types/index.d.ts +213 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/fs.d.ts +86 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/git.d.ts +112 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +43 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kanyun-ai-infra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# reskill
|
|
2
|
+
|
|
3
|
+
**AI Skills Package Manager** - Git-based skills management for AI agents
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/reskill)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## 概述
|
|
9
|
+
|
|
10
|
+
reskill 是一个基于 Git 的 AI Skills 包管理系统,类似 npm/Go modules 的架构,实现 AI Skills 的版本化管理、共享和复用。
|
|
11
|
+
|
|
12
|
+
## 特性
|
|
13
|
+
|
|
14
|
+
- 🚀 **Git 即 Registry** - 无需额外服务,git 仓库就是 skill 存储源
|
|
15
|
+
- 📦 **声明式配置** - skills.json 清晰表达项目依赖
|
|
16
|
+
- 🔒 **版本锁定** - 支持精确版本、范围版本、latest
|
|
17
|
+
- 🔗 **本地开发** - 支持 link 本地 skill 进行开发调试
|
|
18
|
+
- ⚡ **全局缓存** - 避免重复下载,加速安装
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 全局安装
|
|
24
|
+
npm install -g reskill
|
|
25
|
+
|
|
26
|
+
# 或使用 npx
|
|
27
|
+
npx reskill <command>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 快速开始
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# 1. 初始化项目
|
|
34
|
+
reskill init
|
|
35
|
+
|
|
36
|
+
# 2. 安装 skill
|
|
37
|
+
reskill install github:user/my-skill@v1.0.0
|
|
38
|
+
|
|
39
|
+
# 3. 列出已安装的 skills
|
|
40
|
+
reskill list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 命令
|
|
44
|
+
|
|
45
|
+
### 初始化
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
reskill init # 创建 skills.json
|
|
49
|
+
reskill init --name my-project # 指定项目名称
|
|
50
|
+
reskill init --registry gitlab # 使用 gitlab 作为默认 registry
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 安装
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
reskill install # 安装 skills.json 中的所有 skills
|
|
57
|
+
reskill install <skill> # 安装单个 skill
|
|
58
|
+
reskill install github:user/skill@v1.0.0 # 安装指定版本
|
|
59
|
+
reskill install user/skill@latest # 安装最新版本
|
|
60
|
+
reskill install user/skill@^1.0.0 # 安装 semver 范围
|
|
61
|
+
reskill install --force # 强制重新安装
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 管理
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
reskill list # 列出已安装 skills
|
|
68
|
+
reskill list --json # JSON 格式输出
|
|
69
|
+
reskill info <skill> # 查看 skill 详情
|
|
70
|
+
reskill update # 更新所有 skills
|
|
71
|
+
reskill update <skill> # 更新单个 skill
|
|
72
|
+
reskill outdated # 检查过期 skills
|
|
73
|
+
reskill uninstall <skill> # 卸载 skill
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 开发
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
reskill link <path> # 链接本地 skill(开发用)
|
|
80
|
+
reskill link <path> --name xxx # 链接并指定名称
|
|
81
|
+
reskill unlink <skill> # 取消链接
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 配置文件
|
|
85
|
+
|
|
86
|
+
### skills.json
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"name": "my-project",
|
|
91
|
+
"skills": {
|
|
92
|
+
"planning": "github:user/planning-skill@v1.0.0",
|
|
93
|
+
"code-review": "gitlab:team/code-review@latest"
|
|
94
|
+
},
|
|
95
|
+
"defaults": {
|
|
96
|
+
"registry": "github",
|
|
97
|
+
"installDir": ".skills"
|
|
98
|
+
},
|
|
99
|
+
"registries": {
|
|
100
|
+
"internal": "https://gitlab.company.com"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 版本规范
|
|
106
|
+
|
|
107
|
+
| 格式 | 示例 | 说明 |
|
|
108
|
+
|-----|------|------|
|
|
109
|
+
| 精确版本 | `@v1.0.0` | 锁定到指定 tag |
|
|
110
|
+
| 最新版本 | `@latest` | 获取最新 tag |
|
|
111
|
+
| 范围版本 | `@^2.0.0` | semver 兼容(>=2.0.0 <3.0.0) |
|
|
112
|
+
| 分支 | `@branch:develop` | 指定分支 |
|
|
113
|
+
| Commit | `@commit:abc1234` | 指定 commit hash |
|
|
114
|
+
|
|
115
|
+
### 仓库引用格式
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
完整格式: <registry>:<owner>/<repo>@<version>
|
|
119
|
+
简写格式: <owner>/<repo>@<version> (使用默认 registry)
|
|
120
|
+
|
|
121
|
+
示例:
|
|
122
|
+
github:user/skill@v1.0.0
|
|
123
|
+
gitlab:group/skill@latest
|
|
124
|
+
gitlab.company.com:team/skill@v1.0.0
|
|
125
|
+
user/skill@v1.0.0 → 使用 defaults.registry
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 目录结构
|
|
129
|
+
|
|
130
|
+
安装后的项目结构:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
my-project/
|
|
134
|
+
├── skills.json # 依赖声明
|
|
135
|
+
├── skills.lock # 版本锁定
|
|
136
|
+
└── .skills/ # 安装目录
|
|
137
|
+
├── planning/
|
|
138
|
+
│ ├── skill.json
|
|
139
|
+
│ └── SKILL.md
|
|
140
|
+
└── code-review/
|
|
141
|
+
├── skill.json
|
|
142
|
+
└── SKILL.md
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Skill 仓库结构
|
|
146
|
+
|
|
147
|
+
每个 Skill 仓库应遵循以下结构:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
my-skill/
|
|
151
|
+
├── skill.json # 元数据(必需)
|
|
152
|
+
├── SKILL.md # 主入口文档(必需)
|
|
153
|
+
├── README.md # 仓库说明
|
|
154
|
+
└── templates/ # 模板文件(可选)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### skill.json
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"name": "my-skill",
|
|
162
|
+
"version": "1.0.0",
|
|
163
|
+
"description": "A skill for ...",
|
|
164
|
+
"author": "Your Name",
|
|
165
|
+
"license": "MIT",
|
|
166
|
+
"entry": "SKILL.md",
|
|
167
|
+
"keywords": ["ai", "skill"]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## 环境变量
|
|
172
|
+
|
|
173
|
+
| 变量 | 说明 | 默认值 |
|
|
174
|
+
|-----|------|-------|
|
|
175
|
+
| `SKPM_CACHE_DIR` | 全局缓存目录 | `~/.reskill-cache` |
|
|
176
|
+
| `DEBUG` | 启用调试日志 | - |
|
|
177
|
+
|
|
178
|
+
## 开发
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# 安装依赖
|
|
182
|
+
pnpm install
|
|
183
|
+
|
|
184
|
+
# 开发模式
|
|
185
|
+
pnpm dev
|
|
186
|
+
|
|
187
|
+
# 构建
|
|
188
|
+
pnpm build
|
|
189
|
+
|
|
190
|
+
# 运行测试
|
|
191
|
+
pnpm test
|
|
192
|
+
|
|
193
|
+
# 类型检查
|
|
194
|
+
pnpm typecheck
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { initCommand } from './init.js';
|
|
2
|
+
export { installCommand } from './install.js';
|
|
3
|
+
export { listCommand } from './list.js';
|
|
4
|
+
export { infoCommand } from './info.js';
|
|
5
|
+
export { updateCommand } from './update.js';
|
|
6
|
+
export { outdatedCommand } from './outdated.js';
|
|
7
|
+
export { uninstallCommand } from './uninstall.js';
|
|
8
|
+
export { linkCommand, unlinkCommand } from './link.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,WAAW,SAmDpB,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,WAAW,SAgCpB,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* install 命令 - 安装 skill
|
|
4
|
+
*
|
|
5
|
+
* 支持两种安装模式:
|
|
6
|
+
* - 项目安装 (默认): 安装到 .skills/ 目录,更新 skills.json 和 skills.lock
|
|
7
|
+
* - 全局安装 (-g): 安装到 ~/.claude/skills/,不更新配置文件
|
|
8
|
+
*/
|
|
9
|
+
export declare const installCommand: Command;
|
|
10
|
+
export default installCommand;
|
|
11
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,SAoEvB,CAAC;AAEL,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCpC,eAAO,MAAM,WAAW,SAAU,CAAC;AACnC,eAAO,MAAM,aAAa,SAAY,CAAC;AACvC,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,eAAO,MAAM,WAAW,SAmCpB,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outdated.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/outdated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC;;GAEG;AACH,eAAO,MAAM,eAAe,SA6DxB,CAAC;AAEL,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAezB,CAAC;AAEL,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC;;GAEG;AACH,eAAO,MAAM,aAAa,SAiCtB,CAAC;AAEL,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|