itismyskillmarket 1.3.0 → 1.3.2

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.
Files changed (49) hide show
  1. package/.github/workflows/publish-npm.yml +59 -0
  2. package/.github/workflows/publish-skill.yml +72 -0
  3. package/5e51cb7aa8b8e60d49d86f4689f5d4d1.png +0 -0
  4. package/CHANGELOG.md +410 -0
  5. package/DEVELOPMENT.md +376 -0
  6. package/README.md +75 -6
  7. package/SKILLMARKET-GUIDE.md +288 -0
  8. package/dist/index.js +733 -212
  9. package/docs/WEEKLY-UPDATE-2026-04-23.md +43 -0
  10. package/docs/plans/2026-04-01-skillmarket-design.md +267 -0
  11. package/docs/plans/2026-04-01-skillmarket-implementation.md +1031 -0
  12. package/docs/plans/2026-04-15-cross-platform-adapter-design.md +416 -0
  13. package/docs/plans/2026-04-15-cross-platform-adapter-plan.md +833 -0
  14. package/docs/plans/2026-04-16-keyword-search-design.md +143 -0
  15. package/docs/plans/2026-04-29-weekly-update.md +57 -0
  16. package/package.json +1 -6
  17. package/skills/README.md +54 -0
  18. package/skills/test-skill/SKILL.md +25 -0
  19. package/skills/test-skill/index.js +66 -0
  20. package/skills/test-skill/metadata.json +9 -0
  21. package/skills/test-skill/package.json +19 -0
  22. package/skills/test-skill-1/SKILL.md +24 -0
  23. package/skills/test-skill-1/index.js +13 -0
  24. package/skills/test-skill-1/metadata.json +9 -0
  25. package/skills/test-skill-1/package.json +16 -0
  26. package/skills/test-skill-2/SKILL.md +25 -0
  27. package/skills/test-skill-2/index.js +13 -0
  28. package/skills/test-skill-2/metadata.json +9 -0
  29. package/skills/test-skill-2/package.json +16 -0
  30. package/src/adapters/base.ts +87 -0
  31. package/src/adapters/claude.ts +31 -0
  32. package/src/adapters/index.ts +9 -0
  33. package/src/adapters/opencode.ts +40 -0
  34. package/src/adapters/registry.ts +77 -0
  35. package/src/adapters/vscode.ts +62 -0
  36. package/src/cli.ts +189 -75
  37. package/src/commands/info.ts +4 -15
  38. package/src/commands/install.ts +93 -54
  39. package/src/commands/ls.ts +182 -17
  40. package/src/commands/npm.ts +118 -16
  41. package/src/commands/search.ts +12 -7
  42. package/src/commands/sync.ts +6 -27
  43. package/src/commands/uninstall.ts +313 -15
  44. package/src/commands/update.ts +2 -2
  45. package/src/index.ts +27 -0
  46. package/src/types.ts +35 -0
  47. package/tsconfig.json +10 -0
  48. package/tsup.config.ts +22 -0
  49. package/wanxuchen-skillmarket-1.0.1.tgz +0 -0
@@ -0,0 +1,416 @@
1
+ # Cross-Platform Skill Adapter Design
2
+
3
+ **Date**: 2026-04-15
4
+ **Author**: wxc2004
5
+ **Status**: Approved
6
+
7
+ ## 1. Overview
8
+
9
+ ### 1.1 Problem Statement
10
+
11
+ SkillMarket currently installs skills to a local `~/.skillmarket/` directory with platform-specific symlinks. Users need a unified way to install skills directly into their AI coding tool platforms (OpenCode, Claude Code, VSCode) with a single command.
12
+
13
+ ### 1.2 Goals
14
+
15
+ 1. Provide a simple `skm install <skill>` command for end users
16
+ 2. Automatically detect installed platforms and install skills appropriately
17
+ 3. Support explicit platform targeting via `--platform` flag
18
+ 4. Follow Agent Skills open standard across all platforms
19
+ 5. Allow users to discover and install skills from a central marketplace (npm)
20
+
21
+ ### 1.3 Success Criteria
22
+
23
+ - [ ] User can install a skill to all detected platforms with one command
24
+ - [ ] User can specify `--platform opencode|claude|vscode` to install to specific platform
25
+ - [ ] Already installed skills are skipped (idempotent)
26
+ - [ ] Skills follow the Agent Skills standard (SKILL.md with YAML frontmatter)
27
+ - [ ] Works on Windows, macOS, and Linux
28
+
29
+ ---
30
+
31
+ ## 2. Platform Analysis
32
+
33
+ ### 2.1 OpenCode
34
+
35
+ | Property | Value |
36
+ |----------|-------|
37
+ | Skill Directory | `~/.config/opencode/skills/<name>/` |
38
+ | File Required | `SKILL.md` with YAML frontmatter |
39
+ | Detection | Check `OPENCODE` environment variable |
40
+ | Config | `~/.config/opencode/opencode.json` |
41
+
42
+ **Skill Structure:**
43
+ ```
44
+ ~/.config/opencode/skills/<skill-name>/
45
+ └── SKILL.md
46
+ ```
47
+
48
+ ### 2.2 Claude Code
49
+
50
+ | Property | Value |
51
+ |----------|-------|
52
+ | Skill Directory | `~/.claude/skills/<name>/` |
53
+ | File Required | `SKILL.md` with YAML frontmatter |
54
+ | Detection | Check `CLAUDE_CODE` environment variable or `~/.claude/` exists |
55
+ | Official Market | `claude plugin install` command |
56
+
57
+ **Skill Structure:**
58
+ ```
59
+ ~/.claude/skills/<skill-name>/
60
+ └── SKILL.md
61
+ ```
62
+
63
+ ### 2.3 VSCode (GitHub Copilot Agent Skills)
64
+
65
+ | Property | Value |
66
+ |----------|-------|
67
+ | Skill Directory | `~/.copilot/skills/<name>/` |
68
+ | File Required | `SKILL.md` with YAML frontmatter |
69
+ | Detection | Check `~/.copilot/skills/` or `VSCODE` environment variable |
70
+ | Alternative | `~/.claude/skills/` (cross-compatible) |
71
+
72
+ **Skill Structure:**
73
+ ```
74
+ ~/.copilot/skills/<skill-name>/
75
+ └── SKILL.md
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 3. Architecture Design
81
+
82
+ ### 3.1 Directory Structure
83
+
84
+ ```
85
+ ~/.skillmarket/ # Local skill cache (existing)
86
+ ├── skills/
87
+ │ └── <skill-id>/
88
+ │ └── <version>/
89
+ │ ├── SKILL.md
90
+ │ └── metadata.json
91
+ └── cache/
92
+
93
+ ~/.config/opencode/skills/ # OpenCode platform link
94
+ └── <skill-id>/
95
+ └── SKILL.md
96
+
97
+ ~/.claude/skills/ # Claude Code platform link
98
+ └── <skill-id>/
99
+ └── SKILL.md
100
+
101
+ ~/.copilot/skills/ # VSCode platform link
102
+ └── <skill-id>/
103
+ └── SKILL.md
104
+ ```
105
+
106
+ ### 3.2 Module Design
107
+
108
+ #### 3.2.1 Platform Detection Module
109
+
110
+ **File**: `src/utils/platform-detect.ts`
111
+
112
+ ```typescript
113
+ interface Platform {
114
+ id: 'opencode' | 'claude' | 'vscode';
115
+ name: string;
116
+ skillDir: string;
117
+ detect: () => boolean;
118
+ }
119
+ ```
120
+
121
+ **Detection Logic:**
122
+ 1. Check environment variables first
123
+ 2. Fall back to directory existence checks
124
+ 3. Support user override via config
125
+
126
+ #### 3.2.2 Platform Adapter Module
127
+
128
+ **File**: `src/adapters/`
129
+
130
+ ```
131
+ src/adapters/
132
+ ├── base.ts # Abstract base adapter
133
+ ├── opencode.ts # OpenCode specific implementation
134
+ ├── claude.ts # Claude Code specific implementation
135
+ └── vscode.ts # VSCode specific implementation
136
+ ```
137
+
138
+ **Adapter Interface:**
139
+ ```typescript
140
+ interface PlatformAdapter {
141
+ readonly id: string;
142
+ readonly name: string;
143
+ readonly skillDir: string;
144
+
145
+ isInstalled(): Promise<boolean>;
146
+ isInstalled(skillId: string): Promise<boolean>;
147
+ install(skillId: string, skillDir: string): Promise<void>;
148
+ uninstall(skillId: string): Promise<void>;
149
+ listInstalled(): Promise<string[]>;
150
+ }
151
+ ```
152
+
153
+ #### 3.2.3 Install Command Enhancement
154
+
155
+ **File**: `src/commands/install.ts` (modify)
156
+
157
+ **New Behavior:**
158
+ 1. Parse `--platform` flag (optional)
159
+ 2. If no flag, detect all available platforms
160
+ 3. For each platform:
161
+ - Check if already installed (skip if yes)
162
+ - Copy/link skill from cache to platform directory
163
+ 4. Display installation summary
164
+
165
+ **CLI Usage:**
166
+ ```bash
167
+ # Install to all detected platforms
168
+ skm install brainstorming
169
+
170
+ # Install to specific platform
171
+ skm install brainstorming --platform opencode
172
+
173
+ # Install to multiple platforms
174
+ skm install brainstorming --platform opencode,claude
175
+
176
+ # List all platforms
177
+ skm platforms
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 4. Implementation Details
183
+
184
+ ### 4.1 Platform Detection Logic
185
+
186
+ ```typescript
187
+ function detectPlatforms(): Platform[] {
188
+ const platforms: Platform[] = [];
189
+
190
+ if (process.env.OPENCODE || exists(OPENCODE_SKILL_DIR)) {
191
+ platforms.push(opencodeAdapter);
192
+ }
193
+
194
+ if (process.env.CLAUDE_CODE || exists(CLAUDE_SKILL_DIR)) {
195
+ platforms.push(claudeAdapter);
196
+ }
197
+
198
+ if (exists(VSCODE_SKILL_DIR)) {
199
+ platforms.push(vscodeAdapter);
200
+ }
201
+
202
+ return platforms;
203
+ }
204
+ ```
205
+
206
+ ### 4.2 Installation Flow
207
+
208
+ ```
209
+ skm install <skill-id>
210
+
211
+ ├── Parse args (skillId, --platform)
212
+
213
+ ├── Determine target platforms
214
+ │ ├── --platform flag → use specified
215
+ │ └── no flag → detect all available
216
+
217
+ ├── Download skill from npm (if not cached)
218
+
219
+ ├── For each target platform:
220
+ │ ├── Check if already installed
221
+ │ ├── If not: copy SKILL.md to platform dir
222
+ │ └── If yes: skip (show "already installed")
223
+
224
+ └── Display summary
225
+ ```
226
+
227
+ ### 4.3 File Operations
228
+
229
+ **Copy Strategy:**
230
+ - Source: `~/.skillmarket/skills/<skill-id>/latest/SKILL.md`
231
+ - Target: `<platform-skill-dir>/<skill-id>/SKILL.md`
232
+ - Use `fs.copy()` for cross-platform compatibility
233
+ - Create parent directories as needed
234
+
235
+ **Windows Symlink Note:**
236
+ - Use `junction` type for Windows compatibility
237
+ - Fall back to copy if symlink fails
238
+
239
+ ---
240
+
241
+ ## 5. CLI Interface
242
+
243
+ ### 5.1 Install Command
244
+
245
+ ```bash
246
+ skm install <skill-id> [options]
247
+
248
+ Options:
249
+ --platform <platforms> Target platforms (comma-separated)
250
+ --force Overwrite if already installed
251
+ --version <version> Specific version to install
252
+
253
+ Examples:
254
+ skm install brainstorming # Install to all platforms
255
+ skm install brainstorming --platform opencode # OpenCode only
256
+ skm install brainstorming --platform claude,vscode
257
+ skm install brainstorming@1.0.0 # Specific version
258
+ ```
259
+
260
+ ### 5.2 Platforms Command (new)
261
+
262
+ ```bash
263
+ skm platforms [options]
264
+
265
+ Options:
266
+ --installed Show only platforms with skills installed
267
+ --available Show only platforms detected as available
268
+
269
+ Output:
270
+ OpenCode ✅ installed (5 skills)
271
+ Claude ✅ installed (3 skills)
272
+ VSCode ⚠️ available (no skills installed)
273
+ ```
274
+
275
+ ### 5.3 Uninstall Command
276
+
277
+ ```bash
278
+ skm uninstall <skill-id> [options]
279
+
280
+ Options:
281
+ --platform <platforms> Target platforms (default: all)
282
+ ```
283
+
284
+ ---
285
+
286
+ ## 6. Error Handling
287
+
288
+ ### 6.1 Error Cases
289
+
290
+ | Error | Handling |
291
+ |-------|----------|
292
+ | Platform directory not writable | Show error with `sudo` hint |
293
+ | Skill not found in registry | Show available skills |
294
+ | Network error (npm) | Retry 3 times, then show error |
295
+ | Partial install failure | Continue with other platforms, report failures |
296
+
297
+ ### 6.2 User Feedback
298
+
299
+ ```
300
+ Installing brainstorming to platforms...
301
+
302
+ OpenCode ⚠️ Already installed (use --force to overwrite)
303
+ Claude ✅ Installed successfully
304
+ VSCode ✅ Installed successfully
305
+
306
+ Summary: 2 installed, 1 skipped, 0 failed
307
+ ```
308
+
309
+ ---
310
+
311
+ ## 7. Configuration
312
+
313
+ ### 7.1 User Config File
314
+
315
+ **File**: `~/.skillmarket/config.json`
316
+
317
+ ```json
318
+ {
319
+ "defaultPlatforms": ["opencode", "claude", "vscode"],
320
+ "installStrategy": "all",
321
+ "autoUpdate": true
322
+ }
323
+ ```
324
+
325
+ ### 7.2 Per-Skill Config
326
+
327
+ Skills can specify compatible platforms in `metadata.json`:
328
+
329
+ ```json
330
+ {
331
+ "name": "brainstorming",
332
+ "version": "1.0.0",
333
+ "platforms": ["opencode", "claude", "vscode"]
334
+ }
335
+ ```
336
+
337
+ ---
338
+
339
+ ## 8. Testing Strategy
340
+
341
+ ### 8.1 Unit Tests
342
+
343
+ - Platform detection
344
+ - Adapter implementations
345
+ - CLI argument parsing
346
+
347
+ ### 8.2 Integration Tests
348
+
349
+ - Full install/uninstall cycle
350
+ - Platform-specific behaviors
351
+ - Cross-platform scenarios
352
+
353
+ ### 8.3 Manual Testing
354
+
355
+ - Test on Windows, macOS, Linux
356
+ - Test with each platform running
357
+
358
+ ---
359
+
360
+ ## 9. Migration Plan
361
+
362
+ ### 9.1 Backward Compatibility
363
+
364
+ - Existing `skm sync` command continues to work
365
+ - New `--platform` flag is additive
366
+ - No breaking changes to existing behavior
367
+
368
+ ### 9.2 Deprecation Path
369
+
370
+ - Phase 1: New install command with platform support
371
+ - Phase 2: `sync` command delegates to new implementation
372
+ - Phase 3: (optional) Deprecate `sync` in favor of direct install
373
+
374
+ ---
375
+
376
+ ## 10. Future Considerations
377
+
378
+ ### 10.1 Platform Marketplace Integration
379
+
380
+ - Claude Code: Submit to Anthropic plugin marketplace
381
+ - VSCode: Create VSCode extension for easy discovery
382
+ - OpenCode: Integrate with oh-my-opencode plugin system
383
+
384
+ ### 10.2 Advanced Features
385
+
386
+ - `skm update --all` with platform awareness
387
+ - Platform-specific skill variants
388
+ - Skill dependency resolution
389
+
390
+ ---
391
+
392
+ ## Appendix A: Reference Links
393
+
394
+ - [OpenCode Skills Documentation](https://opencode.ai/docs/skills/)
395
+ - [Claude Code Plugins Reference](https://docs.anthropic.com/en/docs/claude-code/plugins-reference)
396
+ - [VSCode Agent Skills](https://code.visualstudio.com/docs/copilot/customization/agent-skills)
397
+ - [Agent Skills Open Standard](https://github.com/model-context-protocol/specs)
398
+
399
+ ---
400
+
401
+ ## Appendix B: SKILL.md Format
402
+
403
+ All skills must follow this format:
404
+
405
+ ```markdown
406
+ ---
407
+ name: skill-name
408
+ description: Brief description for agent selection
409
+ license: MIT
410
+ compatibility: opencode,claude,vscode
411
+ ---
412
+
413
+ # Skill Name
414
+
415
+ Detailed instructions...
416
+ ```