add-skill-kit 1.0.0 → 1.0.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.
- package/README.md +11 -11
- package/bin/lib/commands/install.js +101 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
`add-skill-kit` is a CLI tool for managing **Agent Skills**—immutable, verifiable intelligence artifacts that extend your AI agent's capabilities. Think of it as `npm` for AI agents.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
npx add-skill-kit agentskillkit/agent-skills
|
|
32
|
+
npx -y add-skill-kit agentskillkit/agent-skills
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Skills are **data, not code**. They won't execute on your system—they're read by your agent to enhance its behavior.
|
|
@@ -48,8 +48,8 @@ pnpm add -g add-skill-kit
|
|
|
48
48
|
# Using Yarn
|
|
49
49
|
yarn global add add-skill-kit
|
|
50
50
|
|
|
51
|
-
# Or run directly with npx
|
|
52
|
-
npx add-skill-kit <command>
|
|
51
|
+
# Or run directly with npx (use -y to skip install prompt)
|
|
52
|
+
npx -y add-skill-kit <command>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
> **Requirements:** Node.js 18.0.0 or later
|
|
@@ -61,7 +61,7 @@ npx add-skill-kit <command>
|
|
|
61
61
|
### 1. Initialize your workspace
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
npx add-skill-kit init
|
|
64
|
+
npx -y add-skill-kit init
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
This creates the `.agent/skills` directory structure in your project.
|
|
@@ -72,25 +72,25 @@ Install from GitHub with optional version pinning:
|
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
74
|
# Latest version
|
|
75
|
-
npx add-skill-kit agentskillkit/agent-skills
|
|
75
|
+
npx -y add-skill-kit agentskillkit/agent-skills
|
|
76
76
|
|
|
77
77
|
# Specific skill
|
|
78
|
-
npx add-skill-kit agentskillkit/agent-skills#react-patterns
|
|
78
|
+
npx -y add-skill-kit agentskillkit/agent-skills#react-patterns
|
|
79
79
|
|
|
80
80
|
# Specific version
|
|
81
|
-
npx add-skill-kit agentskillkit/agent-skills#react-patterns@v1.0.0
|
|
81
|
+
npx -y add-skill-kit agentskillkit/agent-skills#react-patterns@v1.0.0
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
### 3. List installed skills
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
npx add-skill-kit list
|
|
87
|
+
npx -y add-skill-kit list
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
### 4. Validate compliance
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
npx add-skill-kit validate
|
|
93
|
+
npx -y add-skill-kit validate
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
---
|
|
@@ -135,10 +135,10 @@ Pin exact versions for reproducible builds across your team:
|
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
137
|
# Generate lockfile
|
|
138
|
-
npx add-skill-kit lock
|
|
138
|
+
npx -y add-skill-kit lock
|
|
139
139
|
|
|
140
140
|
# Install from lockfile
|
|
141
|
-
npx add-skill-kit install --locked
|
|
141
|
+
npx -y add-skill-kit install --locked
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
### Security by Design
|
|
@@ -53,22 +53,50 @@ export async function run(spec) {
|
|
|
53
53
|
|
|
54
54
|
s.stop("Repository cloned");
|
|
55
55
|
|
|
56
|
-
// Find skills in repo
|
|
56
|
+
// Find skills in repo - check multiple possible locations
|
|
57
57
|
const skillsInRepo = [];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
|
|
59
|
+
// Possible skill locations (in order of priority)
|
|
60
|
+
const possibleSkillDirs = [
|
|
61
|
+
path.join(tmp, ".agent", "skills"), // Standard location
|
|
62
|
+
path.join(tmp, "skills"), // Alternative location
|
|
63
|
+
tmp // Root level (legacy)
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
let skillsDir = null;
|
|
67
|
+
for (const dir of possibleSkillDirs) {
|
|
68
|
+
if (fs.existsSync(dir) && fs.statSync(dir).isDirectory()) {
|
|
69
|
+
// Check if this directory contains skill folders
|
|
70
|
+
const entries = fs.readdirSync(dir);
|
|
71
|
+
for (const e of entries) {
|
|
72
|
+
const sp = path.join(dir, e);
|
|
73
|
+
if (fs.statSync(sp).isDirectory() && fs.existsSync(path.join(sp, "SKILL.md"))) {
|
|
74
|
+
skillsDir = dir;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (skillsDir) break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (skillsDir) {
|
|
83
|
+
for (const e of fs.readdirSync(skillsDir)) {
|
|
84
|
+
const sp = path.join(skillsDir, e);
|
|
85
|
+
if (fs.statSync(sp).isDirectory() && fs.existsSync(path.join(sp, "SKILL.md"))) {
|
|
86
|
+
const m = parseSkillMdFrontmatter(path.join(sp, "SKILL.md"));
|
|
87
|
+
skillsInRepo.push({
|
|
88
|
+
title: e + (m.description ? c.dim(` (${m.description.substring(0, 40)}...)`) : ""),
|
|
89
|
+
value: e,
|
|
90
|
+
selected: singleSkill ? e === singleSkill : true,
|
|
91
|
+
_path: sp // Store actual path for later use
|
|
92
|
+
});
|
|
93
|
+
}
|
|
67
94
|
}
|
|
68
95
|
}
|
|
69
96
|
|
|
70
97
|
if (skillsInRepo.length === 0) {
|
|
71
98
|
step(c.yellow("No valid skills found"), S.diamond, "yellow");
|
|
99
|
+
step(c.dim("Expected skills in .agent/skills/ or skills/ directory"), S.branch, "gray");
|
|
72
100
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
73
101
|
return;
|
|
74
102
|
}
|
|
@@ -255,8 +283,11 @@ export async function run(spec) {
|
|
|
255
283
|
stepLine();
|
|
256
284
|
fs.mkdirSync(targetScope, { recursive: true });
|
|
257
285
|
|
|
286
|
+
// Create a map for skill paths
|
|
287
|
+
const skillPathMap = Object.fromEntries(skillsInRepo.map(s => [s.value, s._path]));
|
|
288
|
+
|
|
258
289
|
for (const sn of selectedSkills) {
|
|
259
|
-
const src = path.join(tmp, sn);
|
|
290
|
+
const src = skillPathMap[sn] || path.join(skillsDir || tmp, sn);
|
|
260
291
|
const dest = path.join(targetScope, sn);
|
|
261
292
|
|
|
262
293
|
await installSkill(src, dest, installMethod, {
|
|
@@ -266,6 +297,44 @@ export async function run(spec) {
|
|
|
266
297
|
});
|
|
267
298
|
}
|
|
268
299
|
|
|
300
|
+
// Install workflows if they exist
|
|
301
|
+
const workflowsDir = path.join(tmp, ".agent", "workflows");
|
|
302
|
+
const targetWorkflowsDir = path.join(WORKSPACE, "..", "workflows");
|
|
303
|
+
let workflowsInstalled = 0;
|
|
304
|
+
|
|
305
|
+
if (fs.existsSync(workflowsDir)) {
|
|
306
|
+
stepLine();
|
|
307
|
+
const ws = spinner();
|
|
308
|
+
ws.start("Installing workflows");
|
|
309
|
+
|
|
310
|
+
fs.mkdirSync(targetWorkflowsDir, { recursive: true });
|
|
311
|
+
const workflows = fs.readdirSync(workflowsDir).filter(f => f.endsWith(".md"));
|
|
312
|
+
|
|
313
|
+
for (const wf of workflows) {
|
|
314
|
+
const src = path.join(workflowsDir, wf);
|
|
315
|
+
const dest = path.join(targetWorkflowsDir, wf);
|
|
316
|
+
|
|
317
|
+
if (!fs.existsSync(dest)) {
|
|
318
|
+
fs.copyFileSync(src, dest);
|
|
319
|
+
workflowsInstalled++;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
ws.stop(`Installed ${workflowsInstalled} workflows`);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Install GEMINI.md if it exists
|
|
327
|
+
const geminiSrc = path.join(tmp, ".agent", "GEMINI.md");
|
|
328
|
+
const geminiDest = path.join(WORKSPACE, "..", "GEMINI.md");
|
|
329
|
+
let geminiInstalled = false;
|
|
330
|
+
|
|
331
|
+
if (fs.existsSync(geminiSrc) && !fs.existsSync(geminiDest)) {
|
|
332
|
+
stepLine();
|
|
333
|
+
fs.copyFileSync(geminiSrc, geminiDest);
|
|
334
|
+
step("Installed GEMINI.md (Agent Rules)");
|
|
335
|
+
geminiInstalled = true;
|
|
336
|
+
}
|
|
337
|
+
|
|
269
338
|
// Installation complete step
|
|
270
339
|
stepLine();
|
|
271
340
|
step("Installation complete");
|
|
@@ -275,17 +344,33 @@ export async function run(spec) {
|
|
|
275
344
|
console.log(`${c.gray(S.branch)}`); // Extra spacing line
|
|
276
345
|
|
|
277
346
|
let successContent = "";
|
|
347
|
+
|
|
348
|
+
// Skills summary
|
|
278
349
|
for (const sn of selectedSkills) {
|
|
279
|
-
const mockPath =
|
|
280
|
-
successContent += `${c.cyan("✓")} ${c.dim(mockPath)}\n`;
|
|
281
|
-
|
|
350
|
+
const mockPath = `.agent/skills/${sn}`;
|
|
351
|
+
successContent += `${c.cyan("✓")} ${c.dim(mockPath)}\n`;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Workflows summary
|
|
355
|
+
if (workflowsInstalled > 0) {
|
|
356
|
+
successContent += `${c.cyan("✓")} ${c.dim(`.agent/workflows/ (${workflowsInstalled} files)`)}\n`;
|
|
282
357
|
}
|
|
283
358
|
|
|
359
|
+
// GEMINI.md summary
|
|
360
|
+
if (geminiInstalled) {
|
|
361
|
+
successContent += `${c.cyan("✓")} ${c.dim(".agent/GEMINI.md (Agent Rules)")}\n`;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Build title
|
|
365
|
+
const parts = [`${selectedSkills.length} skills`];
|
|
366
|
+
if (workflowsInstalled > 0) parts.push(`${workflowsInstalled} workflows`);
|
|
367
|
+
if (geminiInstalled) parts.push("GEMINI.md");
|
|
368
|
+
|
|
284
369
|
console.log(boxen(successContent.trim(), {
|
|
285
370
|
padding: 1,
|
|
286
|
-
borderColor: "cyan",
|
|
371
|
+
borderColor: "cyan",
|
|
287
372
|
borderStyle: "round",
|
|
288
|
-
title: c.cyan(`Installed ${
|
|
373
|
+
title: c.cyan(`Installed ${parts.join(", ")}`),
|
|
289
374
|
titleAlignment: "left"
|
|
290
375
|
}).split("\n").map(l => `${c.gray(S.branch)} ${l}`).join("\n"));
|
|
291
376
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-skill-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Enterprise-grade Agent Skill Manager with Antigravity Skills support, Progressive Disclosure detection, and semantic routing validation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "agentskillkit <agentskillkit@gmail.com>",
|