add-skill 1.0.7 → 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/README.md +10 -10
- package/dist/index.js +181 -30
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Install agent skills onto your coding agents from any git repository.
|
|
4
4
|
|
|
5
|
-
Supports [OpenCode](https://opencode.ai), [Claude Code](https://claude.ai/code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com), and [
|
|
5
|
+
Supports [OpenCode](https://opencode.ai), [Claude Code](https://claude.ai/code), [Codex](https://developers.openai.com/codex), [Cursor](https://cursor.com), and [Antigravity](https://antigravity.google).
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
@@ -47,7 +47,7 @@ npx add-skill git@github.com:vercel-labs/agent-skills.git
|
|
|
47
47
|
| Option | Description |
|
|
48
48
|
|--------|-------------|
|
|
49
49
|
| `-g, --global` | Install to user directory instead of project |
|
|
50
|
-
| `-a, --agent <agents...>` | Target specific agents: `opencode`, `claude-code`, `codex`, `cursor`, `
|
|
50
|
+
| `-a, --agent <agents...>` | Target specific agents: `opencode`, `claude-code`, `codex`, `cursor`, `antigravity` |
|
|
51
51
|
| `-s, --skill <skills...>` | Install specific skills by name |
|
|
52
52
|
| `-l, --list` | List available skills without installing |
|
|
53
53
|
| `-y, --yes` | Skip all confirmation prompts |
|
|
@@ -87,7 +87,7 @@ Installed in your current working directory. Commit these to share with your tea
|
|
|
87
87
|
| Claude Code | `.claude/skills/<name>/` |
|
|
88
88
|
| Codex | `.codex/skills/<name>/` |
|
|
89
89
|
| Cursor | `.cursor/skills/<name>/` |
|
|
90
|
-
|
|
|
90
|
+
| Antigravity | `.agent/skills/<name>/` |
|
|
91
91
|
|
|
92
92
|
### Global (`--global`)
|
|
93
93
|
|
|
@@ -99,7 +99,7 @@ Installed in your home directory. Available across all projects.
|
|
|
99
99
|
| Claude Code | `~/.claude/skills/<name>/` |
|
|
100
100
|
| Codex | `~/.codex/skills/<name>/` |
|
|
101
101
|
| Cursor | `~/.cursor/skills/<name>/` |
|
|
102
|
-
|
|
|
102
|
+
| Antigravity | `~/.gemini/antigravity/skills/<name>/` |
|
|
103
103
|
|
|
104
104
|
## Agent Detection
|
|
105
105
|
|
|
@@ -147,7 +147,7 @@ The CLI searches for skills in these locations within a repository:
|
|
|
147
147
|
- `.claude/skills/`
|
|
148
148
|
- `.opencode/skill/`
|
|
149
149
|
- `.cursor/skills/`
|
|
150
|
-
- `.
|
|
150
|
+
- `.agent/skills/`
|
|
151
151
|
|
|
152
152
|
If no skills are found in standard locations, a recursive search is performed.
|
|
153
153
|
|
|
@@ -155,8 +155,8 @@ If no skills are found in standard locations, a recursive search is performed.
|
|
|
155
155
|
|
|
156
156
|
Skills are generally compatible across agents since they follow a shared [Agent Skills specification](https://agentskills.io). However, some features may be agent-specific:
|
|
157
157
|
|
|
158
|
-
| Feature | OpenCode | Claude Code | Codex | Cursor |
|
|
159
|
-
|
|
158
|
+
| Feature | OpenCode | Claude Code | Codex | Cursor | Antigravity |
|
|
159
|
+
|---------|----------|-------------|-------|--------|-------------|
|
|
160
160
|
| Basic skills | Yes | Yes | Yes | Yes | Yes |
|
|
161
161
|
| `allowed-tools` | Yes | Yes | Yes | Yes | Yes |
|
|
162
162
|
| `context: fork` | No | Yes | No | No | No |
|
|
@@ -182,11 +182,11 @@ Ensure you have write access to the target directory.
|
|
|
182
182
|
|
|
183
183
|
- [Vercel Agent Skills Repository](https://github.com/vercel-labs/agent-skills)
|
|
184
184
|
- [Agent Skills Specification](https://agentskills.io)
|
|
185
|
-
- [OpenCode Skills Documentation](https://opencode.ai/docs/skills
|
|
185
|
+
- [OpenCode Skills Documentation](https://opencode.ai/docs/skills)
|
|
186
186
|
- [Claude Code Skills Documentation](https://code.claude.com/docs/en/skills)
|
|
187
|
-
- [Codex Skills Documentation](https://developers.openai.com/codex/skills
|
|
187
|
+
- [Codex Skills Documentation](https://developers.openai.com/codex/skills)
|
|
188
188
|
- [Cursor Skills Documentation](https://cursor.com/docs/context/skills)
|
|
189
|
-
- [
|
|
189
|
+
- [Antigravity Skills Documentation](https://antigravity.google/docs/skills)
|
|
190
190
|
|
|
191
191
|
## License
|
|
192
192
|
|
package/dist/index.js
CHANGED
|
@@ -145,7 +145,11 @@ async function discoverSkills(basePath, subpath) {
|
|
|
145
145
|
join2(searchPath, ".claude/skills"),
|
|
146
146
|
join2(searchPath, ".opencode/skill"),
|
|
147
147
|
join2(searchPath, ".cursor/skills"),
|
|
148
|
-
join2(searchPath, ".
|
|
148
|
+
join2(searchPath, ".agents/skills"),
|
|
149
|
+
join2(searchPath, ".kilocode/skills"),
|
|
150
|
+
join2(searchPath, ".roo/skills"),
|
|
151
|
+
join2(searchPath, ".goose/skills"),
|
|
152
|
+
join2(searchPath, ".agent/skills")
|
|
149
153
|
];
|
|
150
154
|
for (const dir of prioritySearchDirs) {
|
|
151
155
|
try {
|
|
@@ -227,13 +231,49 @@ var agents = {
|
|
|
227
231
|
return existsSync(join3(home, ".cursor"));
|
|
228
232
|
}
|
|
229
233
|
},
|
|
230
|
-
|
|
231
|
-
name: "
|
|
232
|
-
displayName: "
|
|
233
|
-
skillsDir: ".
|
|
234
|
-
globalSkillsDir: join3(home, ".
|
|
234
|
+
amp: {
|
|
235
|
+
name: "amp",
|
|
236
|
+
displayName: "Amp",
|
|
237
|
+
skillsDir: ".agents/skills",
|
|
238
|
+
globalSkillsDir: join3(home, ".config/agents/skills"),
|
|
235
239
|
detectInstalled: async () => {
|
|
236
|
-
return existsSync(join3(home, ".
|
|
240
|
+
return existsSync(join3(home, ".config/amp"));
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
kilo: {
|
|
244
|
+
name: "kilo",
|
|
245
|
+
displayName: "Kilo Code",
|
|
246
|
+
skillsDir: ".kilocode/skills",
|
|
247
|
+
globalSkillsDir: join3(home, ".kilocode/skills"),
|
|
248
|
+
detectInstalled: async () => {
|
|
249
|
+
return existsSync(join3(home, ".kilocode"));
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
roo: {
|
|
253
|
+
name: "roo",
|
|
254
|
+
displayName: "Roo Code",
|
|
255
|
+
skillsDir: ".roo/skills",
|
|
256
|
+
globalSkillsDir: join3(home, ".roo/skills"),
|
|
257
|
+
detectInstalled: async () => {
|
|
258
|
+
return existsSync(join3(home, ".roo"));
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
goose: {
|
|
262
|
+
name: "goose",
|
|
263
|
+
displayName: "Goose",
|
|
264
|
+
skillsDir: ".goose/skills",
|
|
265
|
+
globalSkillsDir: join3(home, ".config/goose/skills"),
|
|
266
|
+
detectInstalled: async () => {
|
|
267
|
+
return existsSync(join3(home, ".config/goose"));
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
antigravity: {
|
|
271
|
+
name: "antigravity",
|
|
272
|
+
displayName: "Antigravity",
|
|
273
|
+
skillsDir: ".agent/skills",
|
|
274
|
+
globalSkillsDir: join3(home, ".gemini/antigravity/skills"),
|
|
275
|
+
detectInstalled: async () => {
|
|
276
|
+
return existsSync(join3(process.cwd(), ".agent")) || existsSync(join3(home, ".gemini/antigravity"));
|
|
237
277
|
}
|
|
238
278
|
}
|
|
239
279
|
};
|
|
@@ -265,10 +305,22 @@ async function installSkillForAgent(skill, agentType, options = {}) {
|
|
|
265
305
|
};
|
|
266
306
|
}
|
|
267
307
|
}
|
|
308
|
+
var EXCLUDE_FILES = /* @__PURE__ */ new Set([
|
|
309
|
+
"README.md",
|
|
310
|
+
"metadata.json"
|
|
311
|
+
]);
|
|
312
|
+
var isExcluded = (name) => {
|
|
313
|
+
if (EXCLUDE_FILES.has(name)) return true;
|
|
314
|
+
if (name.startsWith("_")) return true;
|
|
315
|
+
return false;
|
|
316
|
+
};
|
|
268
317
|
async function copyDirectory(src, dest) {
|
|
269
318
|
await mkdir(dest, { recursive: true });
|
|
270
319
|
const entries = await readdir2(src, { withFileTypes: true });
|
|
271
320
|
for (const entry of entries) {
|
|
321
|
+
if (isExcluded(entry.name)) {
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
272
324
|
const srcPath = join4(src, entry.name);
|
|
273
325
|
const destPath = join4(dest, entry.name);
|
|
274
326
|
if (entry.isDirectory()) {
|
|
@@ -295,34 +347,116 @@ function getInstallPath(skillName, agentType, options = {}) {
|
|
|
295
347
|
return join4(targetBase, skillName);
|
|
296
348
|
}
|
|
297
349
|
|
|
298
|
-
// src/
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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));
|
|
319
382
|
}
|
|
320
383
|
}
|
|
384
|
+
fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// package.json
|
|
389
|
+
var package_default = {
|
|
390
|
+
name: "add-skill",
|
|
391
|
+
version: "1.0.9",
|
|
392
|
+
description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
393
|
+
type: "module",
|
|
394
|
+
bin: {
|
|
395
|
+
"add-skill": "./dist/index.js"
|
|
396
|
+
},
|
|
397
|
+
files: [
|
|
398
|
+
"dist",
|
|
399
|
+
"README.md"
|
|
400
|
+
],
|
|
401
|
+
scripts: {
|
|
402
|
+
build: "tsup src/index.ts --format esm --dts --clean",
|
|
403
|
+
dev: "tsx src/index.ts",
|
|
404
|
+
prepublishOnly: "npm run build"
|
|
405
|
+
},
|
|
406
|
+
keywords: [
|
|
407
|
+
"cli",
|
|
408
|
+
"skills",
|
|
409
|
+
"opencode",
|
|
410
|
+
"claude-code",
|
|
411
|
+
"codex",
|
|
412
|
+
"cursor",
|
|
413
|
+
"antigravity",
|
|
414
|
+
"ai-agents"
|
|
415
|
+
],
|
|
416
|
+
repository: {
|
|
417
|
+
type: "git",
|
|
418
|
+
url: "git+https://github.com/vercel-labs/add-skill.git"
|
|
419
|
+
},
|
|
420
|
+
homepage: "https://github.com/vercel-labs/add-skill#readme",
|
|
421
|
+
bugs: {
|
|
422
|
+
url: "https://github.com/vercel-labs/add-skill/issues"
|
|
423
|
+
},
|
|
424
|
+
author: "",
|
|
425
|
+
license: "MIT",
|
|
426
|
+
dependencies: {
|
|
427
|
+
"@clack/prompts": "^0.9.1",
|
|
428
|
+
chalk: "^5.4.1",
|
|
429
|
+
commander: "^13.1.0",
|
|
430
|
+
"gray-matter": "^4.0.3",
|
|
431
|
+
"simple-git": "^3.27.0"
|
|
432
|
+
},
|
|
433
|
+
devDependencies: {
|
|
434
|
+
"@types/node": "^22.10.0",
|
|
435
|
+
tsup: "^8.3.5",
|
|
436
|
+
tsx: "^4.19.2",
|
|
437
|
+
typescript: "^5.7.2"
|
|
438
|
+
},
|
|
439
|
+
engines: {
|
|
440
|
+
node: ">=18"
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
// src/index.ts
|
|
445
|
+
var version = package_default.version;
|
|
446
|
+
setVersion(version);
|
|
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) => {
|
|
448
|
+
await main(source, options);
|
|
321
449
|
});
|
|
322
450
|
program.parse();
|
|
323
451
|
async function main(source, options) {
|
|
324
452
|
console.log();
|
|
325
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
|
+
});
|
|
326
460
|
let tempDir = null;
|
|
327
461
|
try {
|
|
328
462
|
const spinner2 = p.spinner();
|
|
@@ -336,11 +470,13 @@ async function main(source, options) {
|
|
|
336
470
|
const skills = await discoverSkills(tempDir, parsed.subpath);
|
|
337
471
|
if (skills.length === 0) {
|
|
338
472
|
spinner2.stop(chalk.red("No skills found"));
|
|
473
|
+
track({ event: "error", error: "no_skills_found" });
|
|
339
474
|
p.outro(chalk.red("No valid skills found. Skills require a SKILL.md with name and description."));
|
|
340
475
|
await cleanup(tempDir);
|
|
341
476
|
process.exit(1);
|
|
342
477
|
}
|
|
343
478
|
spinner2.stop(`Found ${chalk.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
|
|
479
|
+
track({ event: "skills_discovered", skills_found: skills.length });
|
|
344
480
|
if (options.list) {
|
|
345
481
|
console.log();
|
|
346
482
|
p.log.step(chalk.bold("Available Skills"));
|
|
@@ -390,6 +526,7 @@ async function main(source, options) {
|
|
|
390
526
|
required: true
|
|
391
527
|
});
|
|
392
528
|
if (p.isCancel(selected)) {
|
|
529
|
+
track({ event: "cancelled" });
|
|
393
530
|
p.cancel("Installation cancelled");
|
|
394
531
|
await cleanup(tempDir);
|
|
395
532
|
process.exit(0);
|
|
@@ -398,7 +535,7 @@ async function main(source, options) {
|
|
|
398
535
|
}
|
|
399
536
|
let targetAgents;
|
|
400
537
|
if (options.agent && options.agent.length > 0) {
|
|
401
|
-
const validAgents = ["opencode", "claude-code", "codex", "cursor", "
|
|
538
|
+
const validAgents = ["opencode", "claude-code", "codex", "cursor", "antigravity"];
|
|
402
539
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
403
540
|
if (invalidAgents.length > 0) {
|
|
404
541
|
p.log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
@@ -413,7 +550,7 @@ async function main(source, options) {
|
|
|
413
550
|
spinner2.stop(`Detected ${installedAgents.length} agent${installedAgents.length !== 1 ? "s" : ""}`);
|
|
414
551
|
if (installedAgents.length === 0) {
|
|
415
552
|
if (options.yes) {
|
|
416
|
-
targetAgents = ["opencode", "claude-code", "codex", "cursor", "
|
|
553
|
+
targetAgents = ["opencode", "claude-code", "codex", "cursor", "antigravity"];
|
|
417
554
|
p.log.info("Installing to all agents (none detected)");
|
|
418
555
|
} else {
|
|
419
556
|
p.log.warn("No coding agents detected. You can still install skills.");
|
|
@@ -427,6 +564,7 @@ async function main(source, options) {
|
|
|
427
564
|
required: true
|
|
428
565
|
});
|
|
429
566
|
if (p.isCancel(selected)) {
|
|
567
|
+
track({ event: "cancelled" });
|
|
430
568
|
p.cancel("Installation cancelled");
|
|
431
569
|
await cleanup(tempDir);
|
|
432
570
|
process.exit(0);
|
|
@@ -454,6 +592,7 @@ async function main(source, options) {
|
|
|
454
592
|
initialValues: installedAgents
|
|
455
593
|
});
|
|
456
594
|
if (p.isCancel(selected)) {
|
|
595
|
+
track({ event: "cancelled" });
|
|
457
596
|
p.cancel("Installation cancelled");
|
|
458
597
|
await cleanup(tempDir);
|
|
459
598
|
process.exit(0);
|
|
@@ -471,6 +610,7 @@ async function main(source, options) {
|
|
|
471
610
|
]
|
|
472
611
|
});
|
|
473
612
|
if (p.isCancel(scope)) {
|
|
613
|
+
track({ event: "cancelled" });
|
|
474
614
|
p.cancel("Installation cancelled");
|
|
475
615
|
await cleanup(tempDir);
|
|
476
616
|
process.exit(0);
|
|
@@ -492,6 +632,7 @@ async function main(source, options) {
|
|
|
492
632
|
if (!options.yes) {
|
|
493
633
|
const confirmed = await p.confirm({ message: "Proceed with installation?" });
|
|
494
634
|
if (p.isCancel(confirmed) || !confirmed) {
|
|
635
|
+
track({ event: "cancelled" });
|
|
495
636
|
p.cancel("Installation cancelled");
|
|
496
637
|
await cleanup(tempDir);
|
|
497
638
|
process.exit(0);
|
|
@@ -513,6 +654,14 @@ async function main(source, options) {
|
|
|
513
654
|
console.log();
|
|
514
655
|
const successful = results.filter((r) => r.success);
|
|
515
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
|
+
});
|
|
516
665
|
if (successful.length > 0) {
|
|
517
666
|
p.log.success(chalk.green(`Successfully installed ${successful.length} skill${successful.length !== 1 ? "s" : ""}`));
|
|
518
667
|
for (const r of successful) {
|
|
@@ -531,6 +680,8 @@ async function main(source, options) {
|
|
|
531
680
|
console.log();
|
|
532
681
|
p.outro(chalk.green("Done!"));
|
|
533
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 });
|
|
534
685
|
p.log.error(error instanceof Error ? error.message : "Unknown error occurred");
|
|
535
686
|
p.outro(chalk.red("Installation failed"));
|
|
536
687
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-skill",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"add-skill": "./dist/index.js"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"claude-code",
|
|
23
23
|
"codex",
|
|
24
24
|
"cursor",
|
|
25
|
-
"
|
|
25
|
+
"antigravity",
|
|
26
26
|
"ai-agents"
|
|
27
27
|
],
|
|
28
28
|
"repository": {
|