add-skill-kit 3.2.2 → 3.2.3
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.
|
@@ -131,7 +131,7 @@ export async function run(spec) {
|
|
|
131
131
|
for (const e of fs.readdirSync(skillsDir)) {
|
|
132
132
|
const sp = path.join(skillsDir, e);
|
|
133
133
|
if (fs.statSync(sp).isDirectory()) {
|
|
134
|
-
// Check if this directory has SKILL.md (top-level skill)
|
|
134
|
+
// Check if this directory has SKILL.md (top-level skill only)
|
|
135
135
|
if (fs.existsSync(path.join(sp, "SKILL.md"))) {
|
|
136
136
|
const m = parseSkillMdFrontmatter(path.join(sp, "SKILL.md"));
|
|
137
137
|
skillsInRepo.push({
|
|
@@ -142,22 +142,8 @@ export async function run(spec) {
|
|
|
142
142
|
_path: sp
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
//
|
|
147
|
-
for (const sub of fs.readdirSync(sp)) {
|
|
148
|
-
const subPath = path.join(sp, sub);
|
|
149
|
-
if (fs.statSync(subPath).isDirectory() && fs.existsSync(path.join(subPath, "SKILL.md"))) {
|
|
150
|
-
const m = parseSkillMdFrontmatter(path.join(subPath, "SKILL.md"));
|
|
151
|
-
const skillName = `${e}/${sub}`; // e.g. "game-development/2d-games"
|
|
152
|
-
skillsInRepo.push({
|
|
153
|
-
title: skillName,
|
|
154
|
-
value: skillName,
|
|
155
|
-
description: m.description || "",
|
|
156
|
-
selected: singleSkill ? skillName === singleSkill : true,
|
|
157
|
-
_path: subPath
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
145
|
+
// NOTE: Sub-folders are NOT counted as separate skills
|
|
146
|
+
// They are part of the parent skill (e.g. game-development/2d-games)
|
|
161
147
|
}
|
|
162
148
|
}
|
|
163
149
|
}
|
|
@@ -187,31 +173,45 @@ export async function run(spec) {
|
|
|
187
173
|
stepLine();
|
|
188
174
|
step(`Auto-selected: ${c.cyan(singleSkill)}`);
|
|
189
175
|
} else {
|
|
190
|
-
//
|
|
191
|
-
// NOTE: Order matters!
|
|
176
|
+
// FAANG-Grade Categories (8 balanced categories)
|
|
177
|
+
// NOTE: Order matters! Specialized categories FIRST, Core is fallback
|
|
192
178
|
const CATEGORY_KEYWORDS = {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
"
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
179
|
+
// Specialized domains
|
|
180
|
+
"🎨 Frontend & UI": [
|
|
181
|
+
"frontend", "nextjs", "tailwind", "css", "ui", "ux", "visual",
|
|
182
|
+
"studio", "web-core", "design-system", "react-architect", "react"
|
|
183
|
+
],
|
|
184
|
+
"🎮 Game Development": [
|
|
185
|
+
"game", "development", "engine", "unity", "unreal", "godot", "phaser"
|
|
186
|
+
],
|
|
187
|
+
"📱 Mobile": [
|
|
188
|
+
"mobile", "first", "developer", "react-native", "flutter",
|
|
189
|
+
"ios", "android", "swift", "kotlin"
|
|
190
|
+
],
|
|
191
|
+
"🔒 Security & DevOps": [
|
|
192
|
+
"security", "vulnerability", "offensive", "scanner", "red-team", "governance",
|
|
193
|
+
"cicd", "pipeline", "gitops", "docker", "deploy", "server-ops"
|
|
194
|
+
],
|
|
195
|
+
// Technical domains
|
|
196
|
+
"🧪 Testing & Quality": [
|
|
197
|
+
"test", "testing", "tdd", "e2e", "debug", "quality", "review",
|
|
198
|
+
"lint", "validate", "automation", "problem", "checker"
|
|
199
|
+
],
|
|
200
|
+
"🤖 AI & Agents": [
|
|
201
|
+
"agent", "pattern", "auto-learn", "execution", "self-evolution",
|
|
202
|
+
"lifecycle", "skill-forge", "intelligent", "routing"
|
|
210
203
|
],
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
204
|
+
"📚 Docs & Planning": [
|
|
205
|
+
"doc", "template", "plan", "project", "idea", "brainstorm",
|
|
206
|
+
"geo", "seo", "i18n", "writing"
|
|
207
|
+
],
|
|
208
|
+
// Fallback (core backend/infra)
|
|
209
|
+
"⚙️ Backend & Core": [
|
|
210
|
+
"backend", "api", "nodejs", "python", "server", "database",
|
|
211
|
+
"prisma", "mcp", "data", "architect", "scaffold", "system",
|
|
212
|
+
"typescript", "shell", "bash", "powershell", "git", "code-craft",
|
|
213
|
+
"code-constitution", "observability", "perf", "state", "rollback"
|
|
214
|
+
]
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
function categorizeSkill(skillName) {
|
|
@@ -221,12 +221,18 @@ export async function run(spec) {
|
|
|
221
221
|
return category;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
return "⚙️ Backend &
|
|
224
|
+
return "⚙️ Backend & Core"; // Default fallback (no "Other" category)
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
// REQUIRED SKILLS - Always installed, not shown in selection
|
|
228
|
+
const REQUIRED_SKILLS = ["auto-learner"];
|
|
229
|
+
|
|
230
|
+
// Filter out required skills from selection list
|
|
231
|
+
const selectableSkills = skillsInRepo.filter(s => !REQUIRED_SKILLS.includes(s.value));
|
|
232
|
+
|
|
227
233
|
// Group skills by category
|
|
228
234
|
const grouped = {};
|
|
229
|
-
for (const skill of
|
|
235
|
+
for (const skill of selectableSkills) {
|
|
230
236
|
const cat = categorizeSkill(skill.value);
|
|
231
237
|
if (!grouped[cat]) grouped[cat] = [];
|
|
232
238
|
grouped[cat].push(skill);
|
|
@@ -263,13 +269,22 @@ export async function run(spec) {
|
|
|
263
269
|
|
|
264
270
|
// Get all skills from selected categories
|
|
265
271
|
selectedSkills = selectedCategories.flatMap(cat => grouped[cat].map(s => s.value));
|
|
266
|
-
}
|
|
267
272
|
|
|
273
|
+
// Add required system skills
|
|
274
|
+
const requiredInRepo = skillsInRepo.filter(s => REQUIRED_SKILLS.includes(s.value)).map(s => s.value);
|
|
275
|
+
selectedSkills = [...new Set([...selectedSkills, ...requiredInRepo])];
|
|
276
|
+
}
|
|
268
277
|
|
|
278
|
+
// Check for required skills and show info
|
|
279
|
+
const CORE_REQUIRED = ["auto-learner"];
|
|
280
|
+
const installedRequired = selectedSkills.filter(s => CORE_REQUIRED.includes(s));
|
|
269
281
|
|
|
270
282
|
stepLine();
|
|
271
283
|
step("Select skills to install");
|
|
272
|
-
console.log(`${c.gray(S.branch)} ${c.dim(selectedSkills.join(", "))}`);
|
|
284
|
+
console.log(`${c.gray(S.branch)} ${c.dim(selectedSkills.filter(s => !CORE_REQUIRED.includes(s)).join(", "))}`);
|
|
285
|
+
if (installedRequired.length > 0) {
|
|
286
|
+
console.log(`${c.gray(S.branch)} ${c.cyan("+ System required:")} ${c.green(installedRequired.join(", "))}`);
|
|
287
|
+
}
|
|
273
288
|
|
|
274
289
|
// --- Detect installed agents ---
|
|
275
290
|
stepLine();
|
|
@@ -490,7 +505,7 @@ export async function run(spec) {
|
|
|
490
505
|
archInstalled = true;
|
|
491
506
|
}
|
|
492
507
|
|
|
493
|
-
// Install knowledge if it exists
|
|
508
|
+
// Install knowledge if it exists (required for Agent CLI)
|
|
494
509
|
const knowledgeDir = path.join(baseAgentDir, "knowledge");
|
|
495
510
|
const targetKnowledgeDir = path.join(WORKSPACE, "..", "knowledge");
|
|
496
511
|
let knowledgeInstalled = false;
|
|
@@ -499,6 +514,13 @@ export async function run(spec) {
|
|
|
499
514
|
fs.cpSync(knowledgeDir, targetKnowledgeDir, { recursive: true });
|
|
500
515
|
step("Installed knowledge/");
|
|
501
516
|
knowledgeInstalled = true;
|
|
517
|
+
} else if (!fs.existsSync(targetKnowledgeDir)) {
|
|
518
|
+
// Create empty knowledge folder for Agent CLI
|
|
519
|
+
fs.mkdirSync(targetKnowledgeDir, { recursive: true });
|
|
520
|
+
// Create minimal structure for Agent CLI
|
|
521
|
+
fs.writeFileSync(path.join(targetKnowledgeDir, "lessons-learned.yaml"), "# Lessons learned by AI Agent\nlessons: []\n");
|
|
522
|
+
step("Created knowledge/ (Agent CLI ready)");
|
|
523
|
+
knowledgeInstalled = true;
|
|
502
524
|
}
|
|
503
525
|
|
|
504
526
|
// Install rules if they exist
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Agent Skill Kit CLI
|
|
2
|
+
|
|
3
|
+
The intelligent CLI engine for Agent Skill Kit, featuring:
|
|
4
|
+
- **Routing Engine**: Semantic routing validation
|
|
5
|
+
- **Audit System**: Skill usage auditing and metrics
|
|
6
|
+
- **Interactive Mode**: Smart interactive agent interface
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
This package is typically managed by the `add-skill-kit` installer.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Global install (managed by installer)
|
|
14
|
+
npm install -g @agentskillskit/cli
|
|
15
|
+
|
|
16
|
+
# Usage
|
|
17
|
+
agent
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Documentation
|
|
21
|
+
See the main [Agent Skill Kit](https://github.com/agentskillskit/agent-skills) repository.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Smart Agent CLI - ESM Version (Production-Ready)
|
|
4
|
+
*
|
|
5
|
+
* The main interface for humans to interact with the Smart Agent Skills system.
|
|
6
|
+
*
|
|
7
|
+
* Commands:
|
|
8
|
+
* learn Add new lessons to memory
|
|
9
|
+
* recall Check files against memory
|
|
10
|
+
* audit Full compliance audit
|
|
11
|
+
* watch Real-time file monitoring
|
|
12
|
+
* stats Knowledge base statistics
|
|
13
|
+
* install-hooks Install git pre-commit hook
|
|
14
|
+
* lint-learn Auto-learn from ESLint output
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { spawn } from "child_process";
|
|
18
|
+
import path from "path";
|
|
19
|
+
import { fileURLToPath } from "url";
|
|
20
|
+
import { VERSION } from "../lib/config.js";
|
|
21
|
+
|
|
22
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
const ARGS = process.argv.slice(2);
|
|
24
|
+
const COMMAND = ARGS[0];
|
|
25
|
+
const SCRIPTS_DIR = path.join(__dirname, "..", "lib");
|
|
26
|
+
const HOOKS_DIR = path.join(SCRIPTS_DIR, "hooks");
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Run a script with given arguments
|
|
30
|
+
* @param {string} script - Script filename (relative to lib/)
|
|
31
|
+
* @param {string[]} args - Arguments to pass
|
|
32
|
+
* @param {string} baseDir - Base directory for script
|
|
33
|
+
*/
|
|
34
|
+
function run(script, args = [], baseDir = SCRIPTS_DIR) {
|
|
35
|
+
const scriptPath = path.join(baseDir, script);
|
|
36
|
+
const child = spawn("node", [scriptPath, ...args], {
|
|
37
|
+
stdio: "inherit",
|
|
38
|
+
shell: true
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
child.on("close", (code) => {
|
|
42
|
+
process.exit(code || 0);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on("error", (err) => {
|
|
46
|
+
console.error(`❌ Failed to run ${script}:`, err.message);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function printHelp() {
|
|
52
|
+
console.log(`
|
|
53
|
+
🤖 Agent Skill Kit CLI v${VERSION}
|
|
54
|
+
|
|
55
|
+
Usage: ag-smart <command> [options]
|
|
56
|
+
|
|
57
|
+
${"─".repeat(50)}
|
|
58
|
+
|
|
59
|
+
📚 CORE COMMANDS:
|
|
60
|
+
|
|
61
|
+
learn Teach a new lesson to the memory
|
|
62
|
+
ag-smart learn --add --pattern "var " --message "Use let/const"
|
|
63
|
+
ag-smart learn --list
|
|
64
|
+
ag-smart learn --remove LEARN-001
|
|
65
|
+
|
|
66
|
+
recall Check file(s) against learned patterns
|
|
67
|
+
ag-smart recall src/app.js
|
|
68
|
+
ag-smart recall ./src
|
|
69
|
+
|
|
70
|
+
audit Run full compliance audit
|
|
71
|
+
ag-smart audit [directory]
|
|
72
|
+
|
|
73
|
+
${"─".repeat(50)}
|
|
74
|
+
|
|
75
|
+
🚀 PRODUCTION FEATURES:
|
|
76
|
+
|
|
77
|
+
watch Real-time file monitoring
|
|
78
|
+
ag-smart watch [directory]
|
|
79
|
+
|
|
80
|
+
stats Knowledge base statistics
|
|
81
|
+
ag-smart stats
|
|
82
|
+
|
|
83
|
+
install-hooks Install git pre-commit hook
|
|
84
|
+
ag-smart install-hooks
|
|
85
|
+
ag-smart install-hooks --remove
|
|
86
|
+
|
|
87
|
+
lint-learn Auto-learn from ESLint JSON output
|
|
88
|
+
npx eslint . --format json | ag-smart lint-learn
|
|
89
|
+
|
|
90
|
+
fix 🆕 Auto-fix violations
|
|
91
|
+
ag-smart fix <file|dir> [--mode safe|aggressive]
|
|
92
|
+
|
|
93
|
+
sync-skills 🆕 Sync hot patterns to SKILL.md
|
|
94
|
+
ag-smart sync-skills
|
|
95
|
+
|
|
96
|
+
${"─".repeat(50)}
|
|
97
|
+
|
|
98
|
+
📖 HELP:
|
|
99
|
+
|
|
100
|
+
help, --help Show this help message
|
|
101
|
+
--version Show version number
|
|
102
|
+
|
|
103
|
+
💡 Docs: https://github.com/agentskillkit/agent-skills
|
|
104
|
+
`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Command routing
|
|
108
|
+
switch (COMMAND) {
|
|
109
|
+
// Core commands (v2 versions)
|
|
110
|
+
case "learn":
|
|
111
|
+
run("learn.js", ARGS.slice(1));
|
|
112
|
+
break;
|
|
113
|
+
case "recall":
|
|
114
|
+
run("recall.js", ARGS.slice(1));
|
|
115
|
+
break;
|
|
116
|
+
case "audit":
|
|
117
|
+
run("audit.js", ARGS.slice(1));
|
|
118
|
+
break;
|
|
119
|
+
|
|
120
|
+
// Production features
|
|
121
|
+
case "watch":
|
|
122
|
+
run("watcher.js", ARGS.slice(1));
|
|
123
|
+
break;
|
|
124
|
+
case "stats":
|
|
125
|
+
run("stats.js", ARGS.slice(1));
|
|
126
|
+
break;
|
|
127
|
+
case "install-hooks":
|
|
128
|
+
run("install-hooks.js", ARGS.slice(1), HOOKS_DIR);
|
|
129
|
+
break;
|
|
130
|
+
case "lint-learn":
|
|
131
|
+
run("lint-learn.js", ARGS.slice(1), HOOKS_DIR);
|
|
132
|
+
break;
|
|
133
|
+
case "fix":
|
|
134
|
+
run("fix.js", ARGS.slice(1));
|
|
135
|
+
break;
|
|
136
|
+
case "sync-skills":
|
|
137
|
+
run("skill-learn.js", ARGS.slice(1));
|
|
138
|
+
break;
|
|
139
|
+
|
|
140
|
+
// Meta
|
|
141
|
+
case "--version":
|
|
142
|
+
case "-v":
|
|
143
|
+
console.log(VERSION);
|
|
144
|
+
break;
|
|
145
|
+
case "help":
|
|
146
|
+
case "--help":
|
|
147
|
+
case "-h":
|
|
148
|
+
printHelp();
|
|
149
|
+
break;
|
|
150
|
+
case undefined:
|
|
151
|
+
// No command = show interactive Clack menu
|
|
152
|
+
import("../lib/ui/index.js").then(m => m.showMainMenu()).catch(console.error);
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
console.log(`❌ Unknown command: ${COMMAND}`);
|
|
156
|
+
console.log(" Run 'ag-smart help' for available commands.\n");
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "add-skill-kit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
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>",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"bin": {
|
|
17
|
-
"kit": "./bin/cli.js"
|
|
17
|
+
"kit": "./bin/cli.js",
|
|
18
|
+
"agent": "./node_modules/agentskillskit-cli/bin/ag-smart.js"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"bin/",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
54
|
"@clack/prompts": "^0.9.1",
|
|
55
|
+
"agentskillskit-cli": "^3.2.0",
|
|
54
56
|
"boxen": "^8.0.1",
|
|
55
57
|
"chalk": "^5.4.1",
|
|
56
58
|
"gradient-string": "^2.0.2",
|
|
@@ -59,7 +61,6 @@
|
|
|
59
61
|
"prompts": "^2.4.2"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
|
-
"agentskillskit-cli": "^3.2.0",
|
|
63
64
|
"eslint": "^8.57.0",
|
|
64
65
|
"prettier": "^3.2.5",
|
|
65
66
|
"vitest": "^1.6.0"
|