skills-ws 1.3.0 → 1.3.1

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 (2) hide show
  1. package/bin/cli.mjs +69 -8
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -260,7 +260,10 @@ async function detectTarget() {
260
260
  for (const c of candidates) {
261
261
  try { await stat(c); return c; } catch {}
262
262
  }
263
- return join(process.cwd(), "skills");
263
+ // Default: create ~/.claude/skills if nothing found
264
+ const defaultTarget = join(process.env.HOME || "~", ".claude", "skills");
265
+ await mkdir(defaultTarget, { recursive: true });
266
+ return defaultTarget;
264
267
  }
265
268
 
266
269
  // ── Main ─────────────────────────────────────────────────────
@@ -336,13 +339,71 @@ async function main() {
336
339
  return;
337
340
  }
338
341
 
339
- // Help
340
- process.stdout.write(` ${B}Usage:${R}\n\n`);
341
- process.stdout.write(` ${CYAN}npx skills-ws list${R} List all skills\n`);
342
- process.stdout.write(` ${CYAN}npx skills-ws install${R} Interactive picker\n`);
343
- process.stdout.write(` ${CYAN}npx skills-ws install <name>${R} Install specific skill(s)\n`);
344
- process.stdout.write(` ${CYAN}npx skills-ws install all${R} Install everything\n`);
345
- process.stdout.write(`\n ${DIM}${skills.length} skills | skills.ws${R}\n\n`);
342
+ // No args = interactive install (same as `install`)
343
+ if (!args[0] || args[0] === "help" || args[0] === "-h" || args[0] === "--help") {
344
+ if (args[0] === "help" || args[0] === "-h" || args[0] === "--help") {
345
+ process.stdout.write(` ${B}Usage:${R}\n\n`);
346
+ process.stdout.write(` ${CYAN}npx skills-ws${R} Interactive picker\n`);
347
+ process.stdout.write(` ${CYAN}npx skills-ws list${R} List all skills\n`);
348
+ process.stdout.write(` ${CYAN}npx skills-ws install <name>${R} Install specific skill(s)\n`);
349
+ process.stdout.write(` ${CYAN}npx skills-ws install all${R} Install everything\n`);
350
+ process.stdout.write(`\n ${DIM}${skills.length} skills | skills.ws${R}\n\n`);
351
+ return;
352
+ }
353
+
354
+ // Interactive picker
355
+ for (let i = 0; i < skills.length; i++) {
356
+ process.stdout.write(
357
+ ` ${GRAY}${String(i + 1).padStart(2)}${R} ${GREEN}${skills[i].name.padEnd(24)}${R}${DIM}${skills[i].desc.slice(0, 50)}${R}\n`
358
+ );
359
+ }
360
+ process.stdout.write(`\n ${YELLOW}Enter numbers or names (comma-separated), or 'all':${R}\n`);
361
+
362
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
363
+ const answer = await new Promise((resolve) => rl.question(` ${CYAN}> ${R}`, resolve));
364
+ rl.close();
365
+
366
+ const names = [];
367
+ if (answer.trim().toLowerCase() === "all") {
368
+ names.push(...skills.map((s) => s.name));
369
+ } else {
370
+ for (const part of answer.split(",").map((s) => s.trim()).filter(Boolean)) {
371
+ const num = parseInt(part);
372
+ if (!isNaN(num) && num >= 1 && num <= skills.length) names.push(skills[num - 1].name);
373
+ else names.push(part);
374
+ }
375
+ }
376
+
377
+ if (names.length === 0) {
378
+ process.stdout.write(` ${DIM}Nothing selected.${R}\n`);
379
+ return;
380
+ }
381
+
382
+ const target = await detectTarget();
383
+ process.stdout.write(`\n ${DIM}${target}${R}\n\n`);
384
+
385
+ let installed = 0;
386
+ for (const name of names) {
387
+ const skill = skills.find((s) => s.name === name);
388
+ if (!skill) {
389
+ process.stdout.write(` ${YELLOW}skip${R} ${name} ${DIM}(not found)${R}\n`);
390
+ continue;
391
+ }
392
+ await copyDir(skill.dir, join(target, name));
393
+ installed++;
394
+ }
395
+
396
+ await playInstallProgress(installed);
397
+ process.stdout.write("\n");
398
+
399
+ for (const name of names) {
400
+ if (skills.find((s) => s.name === name)) {
401
+ process.stdout.write(` ${GREEN}+${R} ${name}\n`);
402
+ }
403
+ }
404
+ process.stdout.write(`\n ${DIM}skills.ws${R}\n\n`);
405
+ return;
406
+ }
346
407
  }
347
408
 
348
409
  process.on("SIGINT", () => { showCursor(); process.exit(0); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skills-ws",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "69 agent skills for AI coding assistants \u2014 marketing, growth, web3, dev, design & operations. Built for OpenClaw, Claude Code, Cursor, and Codex.",
5
5
  "bin": {
6
6
  "skills-ws": "./bin/cli.mjs"