add-skill 1.0.9 → 1.0.10

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/dist/index.js +21 -42
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -349,14 +349,7 @@ function getInstallPath(skillName, agentType, options = {}) {
349
349
 
350
350
  // src/telemetry.ts
351
351
  var TELEMETRY_URL = "https://add-skill.vercel.sh/t";
352
- var sessionId = null;
353
352
  var cliVersion = null;
354
- function getSessionId() {
355
- if (!sessionId) {
356
- sessionId = Math.random().toString(36).substring(2, 10);
357
- }
358
- return sessionId;
359
- }
360
353
  function isCI() {
361
354
  return !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.CIRCLECI || process.env.TRAVIS || process.env.BUILDKITE || process.env.JENKINS_URL || process.env.TEAMCITY_VERSION);
362
355
  }
@@ -368,27 +361,29 @@ function setVersion(version2) {
368
361
  }
369
362
  function track(data) {
370
363
  if (!isEnabled()) return;
371
- const params = new URLSearchParams();
372
- params.set("sid", getSessionId());
373
- if (cliVersion) {
374
- params.set("v", cliVersion);
375
- }
376
- if (isCI()) {
377
- params.set("ci", "1");
378
- }
379
- for (const [key, value] of Object.entries(data)) {
380
- if (value !== void 0 && value !== null) {
381
- params.set(key, String(value));
364
+ try {
365
+ const params = new URLSearchParams();
366
+ if (cliVersion) {
367
+ params.set("v", cliVersion);
382
368
  }
369
+ if (isCI()) {
370
+ params.set("ci", "1");
371
+ }
372
+ for (const [key, value] of Object.entries(data)) {
373
+ if (value !== void 0 && value !== null) {
374
+ params.set(key, String(value));
375
+ }
376
+ }
377
+ fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {
378
+ });
379
+ } catch {
383
380
  }
384
- fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {
385
- });
386
381
  }
387
382
 
388
383
  // package.json
389
384
  var package_default = {
390
385
  name: "add-skill",
391
- version: "1.0.9",
386
+ version: "1.0.10",
392
387
  description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
393
388
  type: "module",
394
389
  bin: {
@@ -451,12 +446,6 @@ program.parse();
451
446
  async function main(source, options) {
452
447
  console.log();
453
448
  p.intro(chalk.bgCyan.black(" add-skill "));
454
- track({
455
- event: "run",
456
- source,
457
- ...options.global && { global: "1" },
458
- ...options.list && { list: "1" }
459
- });
460
449
  let tempDir = null;
461
450
  try {
462
451
  const spinner2 = p.spinner();
@@ -470,13 +459,11 @@ async function main(source, options) {
470
459
  const skills = await discoverSkills(tempDir, parsed.subpath);
471
460
  if (skills.length === 0) {
472
461
  spinner2.stop(chalk.red("No skills found"));
473
- track({ event: "error", error: "no_skills_found" });
474
462
  p.outro(chalk.red("No valid skills found. Skills require a SKILL.md with name and description."));
475
463
  await cleanup(tempDir);
476
464
  process.exit(1);
477
465
  }
478
466
  spinner2.stop(`Found ${chalk.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
479
- track({ event: "skills_discovered", skills_found: skills.length });
480
467
  if (options.list) {
481
468
  console.log();
482
469
  p.log.step(chalk.bold("Available Skills"));
@@ -526,7 +513,6 @@ async function main(source, options) {
526
513
  required: true
527
514
  });
528
515
  if (p.isCancel(selected)) {
529
- track({ event: "cancelled" });
530
516
  p.cancel("Installation cancelled");
531
517
  await cleanup(tempDir);
532
518
  process.exit(0);
@@ -564,7 +550,6 @@ async function main(source, options) {
564
550
  required: true
565
551
  });
566
552
  if (p.isCancel(selected)) {
567
- track({ event: "cancelled" });
568
553
  p.cancel("Installation cancelled");
569
554
  await cleanup(tempDir);
570
555
  process.exit(0);
@@ -592,7 +577,6 @@ async function main(source, options) {
592
577
  initialValues: installedAgents
593
578
  });
594
579
  if (p.isCancel(selected)) {
595
- track({ event: "cancelled" });
596
580
  p.cancel("Installation cancelled");
597
581
  await cleanup(tempDir);
598
582
  process.exit(0);
@@ -610,7 +594,6 @@ async function main(source, options) {
610
594
  ]
611
595
  });
612
596
  if (p.isCancel(scope)) {
613
- track({ event: "cancelled" });
614
597
  p.cancel("Installation cancelled");
615
598
  await cleanup(tempDir);
616
599
  process.exit(0);
@@ -632,7 +615,6 @@ async function main(source, options) {
632
615
  if (!options.yes) {
633
616
  const confirmed = await p.confirm({ message: "Proceed with installation?" });
634
617
  if (p.isCancel(confirmed) || !confirmed) {
635
- track({ event: "cancelled" });
636
618
  p.cancel("Installation cancelled");
637
619
  await cleanup(tempDir);
638
620
  process.exit(0);
@@ -655,12 +637,11 @@ async function main(source, options) {
655
637
  const successful = results.filter((r) => r.success);
656
638
  const failed = results.filter((r) => !r.success);
657
639
  track({
658
- event: "install_complete",
659
- skills_selected: selectedSkills.map((s) => s.name).join(","),
660
- agents_selected: targetAgents.join(","),
661
- ...installGlobally && { global: "1" },
662
- success: successful.length,
663
- failed: failed.length
640
+ event: "install",
641
+ source,
642
+ skills: selectedSkills.map((s) => s.name).join(","),
643
+ agents: targetAgents.join(","),
644
+ ...installGlobally && { global: "1" }
664
645
  });
665
646
  if (successful.length > 0) {
666
647
  p.log.success(chalk.green(`Successfully installed ${successful.length} skill${successful.length !== 1 ? "s" : ""}`));
@@ -680,8 +661,6 @@ async function main(source, options) {
680
661
  console.log();
681
662
  p.outro(chalk.green("Done!"));
682
663
  } catch (error) {
683
- const errorType = error instanceof Error ? error.message.includes("clone") ? "clone_failed" : error.message.includes("permission") ? "permission_denied" : "unknown" : "unknown";
684
- track({ event: "error", error: errorType });
685
664
  p.log.error(error instanceof Error ? error.message : "Unknown error occurred");
686
665
  p.outro(chalk.red("Installation failed"));
687
666
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-skill",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
5
5
  "type": "module",
6
6
  "bin": {