itismyskillmarket 1.2.4 → 1.2.6
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 +5 -2
- package/SKILLMARKET-GUIDE.md +17 -6
- package/dist/index.js +15 -8
- package/package.json +1 -1
- package/skills/README.md +6 -4
- package/src/cli.ts +10 -1
package/README.md
CHANGED
|
@@ -17,11 +17,14 @@ npx itismyskillmarket --help
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# List available skills
|
|
20
|
+
# List available skills (with pagination)
|
|
21
21
|
skm ls
|
|
22
|
+
skm ls --page 2 # Go to page 2
|
|
23
|
+
skm ls --limit 10 # Show 10 items per page
|
|
22
24
|
|
|
23
|
-
# Show installed skills
|
|
25
|
+
# Show installed skills (with pagination)
|
|
24
26
|
skm ls --installed
|
|
27
|
+
skm ls --installed --page 2
|
|
25
28
|
|
|
26
29
|
# View skill information
|
|
27
30
|
skm info brainstorming
|
package/SKILLMARKET-GUIDE.md
CHANGED
|
@@ -207,26 +207,38 @@ jobs:
|
|
|
207
207
|
### 安装 SkillMarket CLI
|
|
208
208
|
|
|
209
209
|
```bash
|
|
210
|
-
npm install -g
|
|
210
|
+
npm install -g itismyskillmarket
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
或使用 npx(无需安装):
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
npx itismyskillmarket --help
|
|
211
217
|
```
|
|
212
218
|
|
|
213
219
|
### 基本命令
|
|
214
220
|
|
|
215
221
|
```bash
|
|
216
|
-
# 列出可用 skills
|
|
222
|
+
# 列出可用 skills(支持分页)
|
|
217
223
|
skm ls
|
|
218
224
|
|
|
225
|
+
# 分页浏览
|
|
226
|
+
skm ls --page 2 # 第 2 页
|
|
227
|
+
skm ls --limit 10 # 每页 10 个
|
|
228
|
+
|
|
219
229
|
# 查看 skill 详情
|
|
220
230
|
skm info <skill-name>
|
|
221
231
|
|
|
222
232
|
# 安装 skill
|
|
223
233
|
skm install <skill-name>
|
|
224
234
|
|
|
225
|
-
#
|
|
235
|
+
# 查看已安装(支持分页)
|
|
226
236
|
skm ls --installed
|
|
237
|
+
skm ls --installed --page 2
|
|
227
238
|
|
|
228
239
|
# 更新 skill
|
|
229
240
|
skm update <skill-name>
|
|
241
|
+
skm update --all # 更新所有
|
|
230
242
|
|
|
231
243
|
# 卸载 skill
|
|
232
244
|
skm uninstall <skill-name>
|
|
@@ -266,9 +278,8 @@ skm ls
|
|
|
266
278
|
| 版本 | 日期 | 描述 |
|
|
267
279
|
|------|------|------|
|
|
268
280
|
| 1.0.0 | 2026-04-01 | 初始版本 |
|
|
269
|
-
| 1.0
|
|
270
|
-
| 1.
|
|
271
|
-
| 1.0.3 | 2026-04-08 | 改进 ls 显示 |
|
|
281
|
+
| 1.2.0 | 2026-04-15 | 添加跨平台支持 |
|
|
282
|
+
| 1.2.4 | 2026-04-16 | 添加 `skm ls` 分页功能 |
|
|
272
283
|
|
|
273
284
|
---
|
|
274
285
|
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
+
import { readFileSync } from "fs";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import { dirname, resolve } from "path";
|
|
5
8
|
|
|
6
9
|
// src/commands/registry.ts
|
|
7
10
|
import fs2 from "fs-extra";
|
|
@@ -97,7 +100,7 @@ async function isSkillInstalled(skillId) {
|
|
|
97
100
|
import https from "https";
|
|
98
101
|
import { URL } from "url";
|
|
99
102
|
async function fetchNpmPackage(packageName) {
|
|
100
|
-
return new Promise((
|
|
103
|
+
return new Promise((resolve2, reject) => {
|
|
101
104
|
const isScoped = packageName.startsWith("@");
|
|
102
105
|
let encodedName;
|
|
103
106
|
if (isScoped) {
|
|
@@ -123,12 +126,12 @@ async function fetchNpmPackage(packageName) {
|
|
|
123
126
|
try {
|
|
124
127
|
const parsed = JSON.parse(data);
|
|
125
128
|
if (parsed.error) {
|
|
126
|
-
|
|
129
|
+
resolve2(null);
|
|
127
130
|
return;
|
|
128
131
|
}
|
|
129
|
-
|
|
132
|
+
resolve2(parsed);
|
|
130
133
|
} catch {
|
|
131
|
-
|
|
134
|
+
resolve2(null);
|
|
132
135
|
}
|
|
133
136
|
});
|
|
134
137
|
});
|
|
@@ -174,7 +177,7 @@ async function searchSkillmarketPackages(options = {}) {
|
|
|
174
177
|
const { from = 0, size = 100 } = options;
|
|
175
178
|
const packages = [];
|
|
176
179
|
let total = 0;
|
|
177
|
-
return new Promise((
|
|
180
|
+
return new Promise((resolve2, reject) => {
|
|
178
181
|
const url = new URL("https://registry.npmjs.org/-/v1/search");
|
|
179
182
|
url.searchParams.set("text", "keywords:skillmarket");
|
|
180
183
|
url.searchParams.set("size", String(size));
|
|
@@ -195,9 +198,9 @@ async function searchSkillmarketPackages(options = {}) {
|
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
200
|
}
|
|
198
|
-
|
|
201
|
+
resolve2({ packages, total });
|
|
199
202
|
} catch {
|
|
200
|
-
|
|
203
|
+
resolve2({ packages: [], total: 0 });
|
|
201
204
|
}
|
|
202
205
|
});
|
|
203
206
|
});
|
|
@@ -752,8 +755,12 @@ Uninstalling from ${validAdapters.length} platform(s)...
|
|
|
752
755
|
}
|
|
753
756
|
|
|
754
757
|
// src/cli.ts
|
|
758
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
759
|
+
var __dirname = dirname(__filename);
|
|
760
|
+
var packageJson = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf-8"));
|
|
761
|
+
var VERSION = packageJson.version;
|
|
755
762
|
var program = new Command();
|
|
756
|
-
program.name("skm").description("SkillMarket - Cross-platform skill manager for AI coding tools").version(
|
|
763
|
+
program.name("skm").description("SkillMarket - Cross-platform skill manager for AI coding tools").version(VERSION);
|
|
757
764
|
program.hook("preAction", (thisCommand) => {
|
|
758
765
|
if (thisCommand.opts().help) {
|
|
759
766
|
console.log(`
|
package/package.json
CHANGED
package/skills/README.md
CHANGED
|
@@ -8,10 +8,10 @@ This directory contains the skill packages that can be published to npm.
|
|
|
8
8
|
2. Add the required files:
|
|
9
9
|
- `package.json` - Package configuration with `skillmarket` metadata
|
|
10
10
|
- `SKILL.md` - Skill documentation
|
|
11
|
-
- `metadata.json` - Skill metadata
|
|
11
|
+
- `metadata.json` - Skill metadata (optional)
|
|
12
12
|
- `index.js` - Main entry point (OpenCode plugin)
|
|
13
13
|
|
|
14
|
-
3.
|
|
14
|
+
3. Publish via GitHub Actions or manually
|
|
15
15
|
|
|
16
16
|
## Publishing a Skill
|
|
17
17
|
|
|
@@ -42,11 +42,13 @@ npm publish --access=public
|
|
|
42
42
|
"id": "<skill-name>",
|
|
43
43
|
"displayName": "Display Name",
|
|
44
44
|
"description": "Description",
|
|
45
|
-
"platforms": ["opencode", "cursor", "vscode"]
|
|
45
|
+
"platforms": ["opencode", "cursor", "vscode", "claude", "codex", "antigravity"]
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## Current Skills
|
|
51
51
|
|
|
52
|
-
- `test-skill` - Test skill for validating the installation flow
|
|
52
|
+
- `test-skill` - Test skill for validating the installation flow
|
|
53
|
+
- `test-skill-1` - Test skill for validating uninstall and update flows
|
|
54
|
+
- `test-skill-2` - Test skill for validating multi-platform installation
|
package/src/cli.ts
CHANGED
|
@@ -29,6 +29,15 @@
|
|
|
29
29
|
|
|
30
30
|
// Commander.js - 轻量级的命令行界面框架
|
|
31
31
|
import { Command } from 'commander';
|
|
32
|
+
import { readFileSync } from 'fs';
|
|
33
|
+
import { fileURLToPath } from 'url';
|
|
34
|
+
import { dirname, resolve } from 'path';
|
|
35
|
+
|
|
36
|
+
// 获取 package.json 中的版本号
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
38
|
+
const __dirname = dirname(__filename);
|
|
39
|
+
const packageJson = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
|
40
|
+
const VERSION = packageJson.version;
|
|
32
41
|
|
|
33
42
|
// 内部模块导入
|
|
34
43
|
import { PLATFORMS } from './constants.js'; // 平台常量
|
|
@@ -65,7 +74,7 @@ const program = new Command();
|
|
|
65
74
|
program
|
|
66
75
|
.name('skm')
|
|
67
76
|
.description('SkillMarket - Cross-platform skill manager for AI coding tools')
|
|
68
|
-
.version(
|
|
77
|
+
.version(VERSION);
|
|
69
78
|
|
|
70
79
|
// -----------------------------------------------------------------------------
|
|
71
80
|
// 帮助命令 (-h, --help)
|