itismyskillmarket 1.3.4 → 1.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,93 @@
1
+ # SkillMarket v1.3.6 更新日志
2
+
3
+ **日期**: 2026-05-07
4
+ **版本**: 1.3.6
5
+
6
+ ---
7
+
8
+ ## 🎉 新功能:skm sync <skill-name> 同步 Skill 到最新版本
9
+
10
+ ### 功能说明
11
+
12
+ 新增 `skm sync <skill-name>` 命令,一键将指定 skill 同步到 npm 最新版本,并强制安装到所有已检测平台。
13
+
14
+ ### 使用方法
15
+
16
+ ```bash
17
+ # 同步 brainstorming 到最新版本(安装到所有平台)
18
+ skm sync brainstorming
19
+ ```
20
+
21
+ ### 执行流程
22
+
23
+ 1. 从 npm 获取最新版本信息
24
+ 2. 强制安装到所有已检测平台(`--force` 模式)
25
+ 3. 更新注册表记录
26
+
27
+ ### 输出示例
28
+
29
+ ```
30
+ Syncing brainstorming to latest version...
31
+ Latest version: 1.2.0
32
+ Installing to 3 platform(s)...
33
+
34
+ OpenCode ✅ Installed successfully
35
+ Claude Code ✅ Installed successfully
36
+ VSCode ✅ Installed successfully
37
+
38
+ 📊 Summary: 3 installed, 0 skipped, 0 failed
39
+
40
+ ✅ brainstorming synced to v1.2.0
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 🐛 Bug 修复:skm platforms 显示所有平台
46
+
47
+ ### 问题
48
+
49
+ `skm platforms` 命令只显示 OpenCode、Claude Code、VSCode,不显示 OpenClaw 和 Hermes Agent。
50
+
51
+ ### 原因
52
+
53
+ `src/cli.ts` 中 `platforms` 命令使用硬编码平台列表,未使用已注册的适配器系统。
54
+
55
+ ### 修复
56
+
57
+ 改用 `getAllAdapters()` 动态获取所有已注册平台,新增平台无需修改 cli.ts。
58
+
59
+ ### 修复后输出
60
+
61
+ ```
62
+ 📍 Available Platforms:
63
+
64
+ OpenCode ✅ Available (1 skills installed)
65
+ Claude Code ✅ Available (0 skills installed)
66
+ VSCode ✅ Available (0 skills installed)
67
+ OpenClaw ✅ Available (0 skills installed)
68
+ Hermes Agent ✅ Available (0 skills installed)
69
+ ```
70
+
71
+ ---
72
+
73
+ ## 📦 完整版本历史
74
+
75
+ | 版本 | 日期 | 描述 |
76
+ |------|------|------|
77
+ | 1.3.6 | 2026-05-07 | skm sync <skill-name> + platforms bug fix |
78
+ | 1.3.5 | 2026-05-07 | Fix platforms display |
79
+ | 1.3.4 | 2026-05-06 | OpenClaw/Hermes adapter support |
80
+ | 1.3.3 | 2026-04-30 | GitHub 第三方库支持 |
81
+
82
+ ---
83
+
84
+ ## 贡献者
85
+
86
+ - wxc2004 (wanxuchen)
87
+ - Sisyphus Agent
88
+
89
+ ---
90
+
1
91
  # SkillMarket v1.3.3 更新日志
2
92
 
3
93
  **日期**: 2026-04-30
package/dist/index.js CHANGED
@@ -692,6 +692,9 @@ async function detectPlatforms() {
692
692
  }
693
693
  return available;
694
694
  }
695
+ function getAllAdapters() {
696
+ return Array.from(adapters.values());
697
+ }
695
698
  function getAdapterByPlatform(platform) {
696
699
  const idMap = {
697
700
  opencode: "opencode",
@@ -861,6 +864,22 @@ async function syncPlatformLinks() {
861
864
  }
862
865
  console.log("\n\u2705 Sync complete!");
863
866
  }
867
+ async function syncSkill(skillId) {
868
+ console.log(`Syncing ${skillId} to latest version...`);
869
+ const pkgInfo = await fetchSkillPackage(skillId);
870
+ if (!pkgInfo) {
871
+ throw new Error(`Package ${skillId} not found on npm`);
872
+ }
873
+ const latestVersion = pkgInfo["dist-tags"]?.latest;
874
+ if (!latestVersion) {
875
+ throw new Error(`No latest version found for ${skillId}`);
876
+ }
877
+ console.log(`Latest version: ${latestVersion}`);
878
+ console.log("Installing to all detected platforms...\n");
879
+ await installSkill(skillId, latestVersion, { force: true });
880
+ console.log(`
881
+ \u2705 ${skillId} synced to v${latestVersion}`);
882
+ }
864
883
 
865
884
  // src/commands/update.ts
866
885
  async function updateSkill(skillId) {
@@ -1498,9 +1517,13 @@ updateCmd.argument("[skill]", "Skill ID to update (optional, updates all if not
1498
1517
  process.exit(1);
1499
1518
  }
1500
1519
  });
1501
- program.command("sync").description("Synchronize platform links").action(async () => {
1520
+ program.command("sync [skill]").description("Synchronize platform links or sync skill to latest version").action(async (skill) => {
1502
1521
  try {
1503
- await syncPlatformLinks();
1522
+ if (skill) {
1523
+ await syncSkill(skill);
1524
+ } else {
1525
+ await syncPlatformLinks();
1526
+ }
1504
1527
  } catch (err) {
1505
1528
  console.error("Sync failed:", err);
1506
1529
  process.exit(1);
@@ -1510,19 +1533,15 @@ var platformsCmd = program.command("platforms").description("Show available plat
1510
1533
  platformsCmd.action(async () => {
1511
1534
  try {
1512
1535
  const available = await detectPlatforms();
1536
+ const allAdapters = getAllAdapters();
1513
1537
  console.log("\n\u{1F4CD} Available Platforms:\n");
1514
- const allPlatforms = [
1515
- { name: "OpenCode", adapter: new OpenCodeAdapter() },
1516
- { name: "Claude Code", adapter: new ClaudeAdapter() },
1517
- { name: "VSCode", adapter: new VSCodeAdapter() }
1518
- ];
1519
- for (const { name, adapter } of allPlatforms) {
1538
+ for (const adapter of allAdapters) {
1520
1539
  const isAvailable = available.find((a) => a.id === adapter.id);
1521
1540
  const installed = await adapter.listInstalled();
1522
1541
  if (isAvailable) {
1523
- console.log(`${name.padEnd(12)} \u2705 Available (${installed.length} skills installed)`);
1542
+ console.log(`${adapter.name.padEnd(15)} \u2705 Available (${installed.length} skills installed)`);
1524
1543
  } else {
1525
- console.log(`${name.padEnd(12)} \u274C Not detected`);
1544
+ console.log(`${adapter.name.padEnd(15)} \u274C Not detected`);
1526
1545
  }
1527
1546
  }
1528
1547
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itismyskillmarket",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Cross-platform skill manager for AI coding tools",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -45,11 +45,11 @@ import { listSkills } from './commands/ls.js'; // 列表命令
45
45
  import { searchSkills } from './commands/search.js'; // 搜索命令
46
46
  import { showSkillInfo } from './commands/info.js'; // 信息命令
47
47
  import { installSkill } from './commands/install.js'; // 安装命令
48
- import { syncPlatformLinks } from './commands/sync.js'; // 同步命令
48
+ import { syncPlatformLinks, syncSkill } from './commands/sync.js'; // 同步命令
49
49
  import { updateSkill } from './commands/update.js'; // 更新命令
50
50
  import { uninstallSkill, uninstallAll } from './commands/uninstall.js'; // 卸载命令
51
51
  import { installFromGitHub, parseGitHubUrl } from './commands/github-install.js'; // GitHub 安装
52
- import { detectPlatforms, getAllAdapters, OpenCodeAdapter, ClaudeAdapter, VSCodeAdapter } from './adapters/index.js'; // 平台适配器
52
+ import { detectPlatforms, getAllAdapters } from './adapters/index.js'; // 平台适配器
53
53
 
54
54
  // -----------------------------------------------------------------------------
55
55
  // 创建命令程序实例
@@ -379,22 +379,31 @@ updateCmd
379
379
  });
380
380
 
381
381
  // -----------------------------------------------------------------------------
382
- // 同步命令 (skm sync)
382
+ // 同步命令 (skm sync [skill-name])
383
383
  // -----------------------------------------------------------------------------
384
384
 
385
385
  /**
386
386
  * 同步命令
387
387
  *
388
- * 同步各平台的软链接,使 skills 可以被不同平台访问
388
+ * - skm sync: 同步各平台的软链接
389
+ * - skm sync <skill-name>: 同步指定 skill 到最新版本
389
390
  *
390
- * 用法: skm sync
391
+ * 用法:
392
+ * skm sync
393
+ * skm sync brainstorming
391
394
  */
392
395
  program
393
- .command('sync')
394
- .description('Synchronize platform links')
395
- .action(async () => {
396
+ .command('sync [skill]')
397
+ .description('Synchronize platform links or sync skill to latest version')
398
+ .action(async (skill) => {
396
399
  try {
397
- await syncPlatformLinks();
400
+ if (skill) {
401
+ // 同步指定 skill 到最新版本
402
+ await syncSkill(skill);
403
+ } else {
404
+ // 同步平台软链接
405
+ await syncPlatformLinks();
406
+ }
398
407
  } catch (err) {
399
408
  console.error('Sync failed:', err);
400
409
  process.exit(1);
@@ -417,23 +426,18 @@ platformsCmd
417
426
  .action(async () => {
418
427
  try {
419
428
  const available = await detectPlatforms();
429
+ const allAdapters = getAllAdapters();
420
430
 
421
431
  console.log('\n📍 Available Platforms:\n');
422
432
 
423
- const allPlatforms = [
424
- { name: 'OpenCode', adapter: new OpenCodeAdapter() },
425
- { name: 'Claude Code', adapter: new ClaudeAdapter() },
426
- { name: 'VSCode', adapter: new VSCodeAdapter() },
427
- ];
428
-
429
- for (const { name, adapter } of allPlatforms) {
433
+ for (const adapter of allAdapters) {
430
434
  const isAvailable = available.find(a => a.id === adapter.id);
431
435
  const installed = await adapter.listInstalled();
432
436
 
433
437
  if (isAvailable) {
434
- console.log(`${name.padEnd(12)} ✅ Available (${installed.length} skills installed)`);
438
+ console.log(`${adapter.name.padEnd(15)} ✅ Available (${installed.length} skills installed)`);
435
439
  } else {
436
- console.log(`${name.padEnd(12)} ❌ Not detected`);
440
+ console.log(`${adapter.name.padEnd(15)} ❌ Not detected`);
437
441
  }
438
442
  }
439
443
 
@@ -3,12 +3,18 @@
3
3
  * SkillMarket 同步命令模块
4
4
  * =============================================================================
5
5
  *
6
- * 本模块实现 `skm sync` 命令,用于同步平台软链接。
6
+ * 本模块实现 `skm sync` 命令,用于:
7
+ * - `skm sync`:同步平台软链接
8
+ * - `skm sync <skill-name>`:同步指定 skill 到最新版本
7
9
  *
8
- * 同步流程:
10
+ * 同步流程 (skm sync):
9
11
  * 1. 遍历所有支持的平台
10
12
  * 2. 对每个已安装的 skill,创建平台特定的软链接
11
13
  *
14
+ * 同步流程 (skm sync <skill-name>):
15
+ * 1. 从 npm 获取最新版本
16
+ * 2. 强制安装到所有已检测平台
17
+ *
12
18
  * 软链接结构:
13
19
  * ~/.skillmarket/
14
20
  * ├── skills/ # 实际 skill 文件
@@ -42,11 +48,13 @@ import {
42
48
  } from '../utils/dirs.js';
43
49
 
44
50
  import { loadRegistry } from './registry.js';
51
+ import { installSkill } from './install.js';
52
+ import { fetchSkillPackage } from './npm.js';
45
53
 
46
54
  import { PLATFORMS, LATEST_LINK } from '../constants.js';
47
55
 
48
56
  // -----------------------------------------------------------------------------
49
- // 同步函数
57
+ // 同步平台链接函数
50
58
  // -----------------------------------------------------------------------------
51
59
 
52
60
  /**
@@ -135,3 +143,54 @@ export async function syncPlatformLinks(): Promise<void> {
135
143
 
136
144
  console.log('\n✅ Sync complete!');
137
145
  }
146
+
147
+ // -----------------------------------------------------------------------------
148
+ // 同步 Skill 到最新版本
149
+ // -----------------------------------------------------------------------------
150
+
151
+ /**
152
+ * 同步指定 skill 到最新版本
153
+ *
154
+ * 从 npm 获取最新版本,并强制安装到所有已检测平台。
155
+ * 确保 skill 在所有平台都是最新版本。
156
+ *
157
+ * @param {string} skillId - Skill 标识符
158
+ * @returns {Promise<void>}
159
+ *
160
+ * @example
161
+ * // 同步 brainstorming 到最新版本
162
+ * await syncSkill('brainstorming');
163
+ */
164
+ export async function syncSkill(skillId: string): Promise<void> {
165
+ // ==========================================================================
166
+ // 步骤 1: 获取 npm 最新版本信息
167
+ // ==========================================================================
168
+
169
+ console.log(`Syncing ${skillId} to latest version...`);
170
+
171
+ const pkgInfo = await fetchSkillPackage(skillId);
172
+ if (!pkgInfo) {
173
+ throw new Error(`Package ${skillId} not found on npm`);
174
+ }
175
+
176
+ const latestVersion = pkgInfo['dist-tags']?.latest;
177
+ if (!latestVersion) {
178
+ throw new Error(`No latest version found for ${skillId}`);
179
+ }
180
+
181
+ // ==========================================================================
182
+ // 步骤 2: 强制安装到所有已检测平台
183
+ // ==========================================================================
184
+
185
+ console.log(`Latest version: ${latestVersion}`);
186
+ console.log('Installing to all detected platforms...\n');
187
+
188
+ // 使用 force: true 确保安装到所有平台(即使已安装)
189
+ await installSkill(skillId, latestVersion, { force: true });
190
+
191
+ // ==========================================================================
192
+ // 完成
193
+ // ==========================================================================
194
+
195
+ console.log(`\n✅ ${skillId} synced to v${latestVersion}`);
196
+ }