add-skill 1.0.8 → 1.0.9
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/dist/index.js +63 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -347,10 +347,48 @@ function getInstallPath(skillName, agentType, options = {}) {
|
|
|
347
347
|
return join4(targetBase, skillName);
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
+
// src/telemetry.ts
|
|
351
|
+
var TELEMETRY_URL = "https://add-skill.vercel.sh/t";
|
|
352
|
+
var sessionId = null;
|
|
353
|
+
var cliVersion = null;
|
|
354
|
+
function getSessionId() {
|
|
355
|
+
if (!sessionId) {
|
|
356
|
+
sessionId = Math.random().toString(36).substring(2, 10);
|
|
357
|
+
}
|
|
358
|
+
return sessionId;
|
|
359
|
+
}
|
|
360
|
+
function isCI() {
|
|
361
|
+
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
|
+
}
|
|
363
|
+
function isEnabled() {
|
|
364
|
+
return !process.env.DISABLE_TELEMETRY && !process.env.DO_NOT_TRACK;
|
|
365
|
+
}
|
|
366
|
+
function setVersion(version2) {
|
|
367
|
+
cliVersion = version2;
|
|
368
|
+
}
|
|
369
|
+
function track(data) {
|
|
370
|
+
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));
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
350
388
|
// package.json
|
|
351
389
|
var package_default = {
|
|
352
390
|
name: "add-skill",
|
|
353
|
-
version: "1.0.
|
|
391
|
+
version: "1.0.9",
|
|
354
392
|
description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
355
393
|
type: "module",
|
|
356
394
|
bin: {
|
|
@@ -405,6 +443,7 @@ var package_default = {
|
|
|
405
443
|
|
|
406
444
|
// src/index.ts
|
|
407
445
|
var version = package_default.version;
|
|
446
|
+
setVersion(version);
|
|
408
447
|
program.name("add-skill").description("Install skills onto coding agents (OpenCode, Claude Code, Codex, Cursor, Antigravity)").version(version).argument("<source>", "Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global", "Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>", "Specify agents to install to (opencode, claude-code, codex, cursor)").option("-s, --skill <skills...>", "Specify skill names to install (skip selection prompt)").option("-l, --list", "List available skills in the repository without installing").option("-y, --yes", "Skip confirmation prompts").action(async (source, options) => {
|
|
409
448
|
await main(source, options);
|
|
410
449
|
});
|
|
@@ -412,6 +451,12 @@ program.parse();
|
|
|
412
451
|
async function main(source, options) {
|
|
413
452
|
console.log();
|
|
414
453
|
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
|
+
});
|
|
415
460
|
let tempDir = null;
|
|
416
461
|
try {
|
|
417
462
|
const spinner2 = p.spinner();
|
|
@@ -425,11 +470,13 @@ async function main(source, options) {
|
|
|
425
470
|
const skills = await discoverSkills(tempDir, parsed.subpath);
|
|
426
471
|
if (skills.length === 0) {
|
|
427
472
|
spinner2.stop(chalk.red("No skills found"));
|
|
473
|
+
track({ event: "error", error: "no_skills_found" });
|
|
428
474
|
p.outro(chalk.red("No valid skills found. Skills require a SKILL.md with name and description."));
|
|
429
475
|
await cleanup(tempDir);
|
|
430
476
|
process.exit(1);
|
|
431
477
|
}
|
|
432
478
|
spinner2.stop(`Found ${chalk.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
479
|
+
track({ event: "skills_discovered", skills_found: skills.length });
|
|
433
480
|
if (options.list) {
|
|
434
481
|
console.log();
|
|
435
482
|
p.log.step(chalk.bold("Available Skills"));
|
|
@@ -479,6 +526,7 @@ async function main(source, options) {
|
|
|
479
526
|
required: true
|
|
480
527
|
});
|
|
481
528
|
if (p.isCancel(selected)) {
|
|
529
|
+
track({ event: "cancelled" });
|
|
482
530
|
p.cancel("Installation cancelled");
|
|
483
531
|
await cleanup(tempDir);
|
|
484
532
|
process.exit(0);
|
|
@@ -516,6 +564,7 @@ async function main(source, options) {
|
|
|
516
564
|
required: true
|
|
517
565
|
});
|
|
518
566
|
if (p.isCancel(selected)) {
|
|
567
|
+
track({ event: "cancelled" });
|
|
519
568
|
p.cancel("Installation cancelled");
|
|
520
569
|
await cleanup(tempDir);
|
|
521
570
|
process.exit(0);
|
|
@@ -543,6 +592,7 @@ async function main(source, options) {
|
|
|
543
592
|
initialValues: installedAgents
|
|
544
593
|
});
|
|
545
594
|
if (p.isCancel(selected)) {
|
|
595
|
+
track({ event: "cancelled" });
|
|
546
596
|
p.cancel("Installation cancelled");
|
|
547
597
|
await cleanup(tempDir);
|
|
548
598
|
process.exit(0);
|
|
@@ -560,6 +610,7 @@ async function main(source, options) {
|
|
|
560
610
|
]
|
|
561
611
|
});
|
|
562
612
|
if (p.isCancel(scope)) {
|
|
613
|
+
track({ event: "cancelled" });
|
|
563
614
|
p.cancel("Installation cancelled");
|
|
564
615
|
await cleanup(tempDir);
|
|
565
616
|
process.exit(0);
|
|
@@ -581,6 +632,7 @@ async function main(source, options) {
|
|
|
581
632
|
if (!options.yes) {
|
|
582
633
|
const confirmed = await p.confirm({ message: "Proceed with installation?" });
|
|
583
634
|
if (p.isCancel(confirmed) || !confirmed) {
|
|
635
|
+
track({ event: "cancelled" });
|
|
584
636
|
p.cancel("Installation cancelled");
|
|
585
637
|
await cleanup(tempDir);
|
|
586
638
|
process.exit(0);
|
|
@@ -602,6 +654,14 @@ async function main(source, options) {
|
|
|
602
654
|
console.log();
|
|
603
655
|
const successful = results.filter((r) => r.success);
|
|
604
656
|
const failed = results.filter((r) => !r.success);
|
|
657
|
+
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
|
|
664
|
+
});
|
|
605
665
|
if (successful.length > 0) {
|
|
606
666
|
p.log.success(chalk.green(`Successfully installed ${successful.length} skill${successful.length !== 1 ? "s" : ""}`));
|
|
607
667
|
for (const r of successful) {
|
|
@@ -620,6 +680,8 @@ async function main(source, options) {
|
|
|
620
680
|
console.log();
|
|
621
681
|
p.outro(chalk.green("Done!"));
|
|
622
682
|
} 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 });
|
|
623
685
|
p.log.error(error instanceof Error ? error.message : "Unknown error occurred");
|
|
624
686
|
p.outro(chalk.red("Installation failed"));
|
|
625
687
|
process.exit(1);
|