add-skill-kit 3.2.1 → 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.
|
@@ -130,15 +130,20 @@ export async function run(spec) {
|
|
|
130
130
|
if (skillsDir) {
|
|
131
131
|
for (const e of fs.readdirSync(skillsDir)) {
|
|
132
132
|
const sp = path.join(skillsDir, e);
|
|
133
|
-
if (fs.statSync(sp).isDirectory()
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
if (fs.statSync(sp).isDirectory()) {
|
|
134
|
+
// Check if this directory has SKILL.md (top-level skill only)
|
|
135
|
+
if (fs.existsSync(path.join(sp, "SKILL.md"))) {
|
|
136
|
+
const m = parseSkillMdFrontmatter(path.join(sp, "SKILL.md"));
|
|
137
|
+
skillsInRepo.push({
|
|
138
|
+
title: e, // Only show folder name
|
|
139
|
+
value: e,
|
|
140
|
+
description: m.description || "",
|
|
141
|
+
selected: singleSkill ? e === singleSkill : true,
|
|
142
|
+
_path: sp
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// NOTE: Sub-folders are NOT counted as separate skills
|
|
146
|
+
// They are part of the parent skill (e.g. game-development/2d-games)
|
|
142
147
|
}
|
|
143
148
|
}
|
|
144
149
|
}
|
|
@@ -168,19 +173,45 @@ export async function run(spec) {
|
|
|
168
173
|
stepLine();
|
|
169
174
|
step(`Auto-selected: ${c.cyan(singleSkill)}`);
|
|
170
175
|
} else {
|
|
171
|
-
//
|
|
176
|
+
// FAANG-Grade Categories (8 balanced categories)
|
|
177
|
+
// NOTE: Order matters! Specialized categories FIRST, Core is fallback
|
|
172
178
|
const CATEGORY_KEYWORDS = {
|
|
173
|
-
|
|
174
|
-
"🎨 Frontend & UI": [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
|
|
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"
|
|
203
|
+
],
|
|
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
|
+
]
|
|
184
215
|
};
|
|
185
216
|
|
|
186
217
|
function categorizeSkill(skillName) {
|
|
@@ -190,12 +221,18 @@ export async function run(spec) {
|
|
|
190
221
|
return category;
|
|
191
222
|
}
|
|
192
223
|
}
|
|
193
|
-
return "
|
|
224
|
+
return "⚙️ Backend & Core"; // Default fallback (no "Other" category)
|
|
194
225
|
}
|
|
195
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
|
+
|
|
196
233
|
// Group skills by category
|
|
197
234
|
const grouped = {};
|
|
198
|
-
for (const skill of
|
|
235
|
+
for (const skill of selectableSkills) {
|
|
199
236
|
const cat = categorizeSkill(skill.value);
|
|
200
237
|
if (!grouped[cat]) grouped[cat] = [];
|
|
201
238
|
grouped[cat].push(skill);
|
|
@@ -232,13 +269,22 @@ export async function run(spec) {
|
|
|
232
269
|
|
|
233
270
|
// Get all skills from selected categories
|
|
234
271
|
selectedSkills = selectedCategories.flatMap(cat => grouped[cat].map(s => s.value));
|
|
235
|
-
}
|
|
236
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
|
+
}
|
|
237
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));
|
|
238
281
|
|
|
239
282
|
stepLine();
|
|
240
283
|
step("Select skills to install");
|
|
241
|
-
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
|
+
}
|
|
242
288
|
|
|
243
289
|
// --- Detect installed agents ---
|
|
244
290
|
stepLine();
|
|
@@ -459,7 +505,7 @@ export async function run(spec) {
|
|
|
459
505
|
archInstalled = true;
|
|
460
506
|
}
|
|
461
507
|
|
|
462
|
-
// Install knowledge if it exists
|
|
508
|
+
// Install knowledge if it exists (required for Agent CLI)
|
|
463
509
|
const knowledgeDir = path.join(baseAgentDir, "knowledge");
|
|
464
510
|
const targetKnowledgeDir = path.join(WORKSPACE, "..", "knowledge");
|
|
465
511
|
let knowledgeInstalled = false;
|
|
@@ -468,6 +514,13 @@ export async function run(spec) {
|
|
|
468
514
|
fs.cpSync(knowledgeDir, targetKnowledgeDir, { recursive: true });
|
|
469
515
|
step("Installed knowledge/");
|
|
470
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;
|
|
471
524
|
}
|
|
472
525
|
|
|
473
526
|
// Install rules if they exist
|
package/bin/lib/ui.js
CHANGED
|
@@ -12,12 +12,11 @@ export { intro, outro, multiselect, select, confirm, isCancel, cancel, text };
|
|
|
12
12
|
|
|
13
13
|
// --- ASCII Art Banner ---
|
|
14
14
|
const PIKAKIT_BANNER = `
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
|
|
15
|
+
____ _ _ _ ___ _
|
|
16
|
+
| _ \\(_) | ____ _| |/ (_) |_
|
|
17
|
+
| |_) | | |/ / _\` | ' /| | __|
|
|
18
|
+
| __/| | < (_| | . \\| | |_
|
|
19
|
+
|_| |_|_|\\_\\__,_|_|\\_\\_|\\__|
|
|
21
20
|
`;
|
|
22
21
|
|
|
23
22
|
// Custom gradient: white → gray (like vercel style)
|
|
@@ -167,11 +166,18 @@ export function box(message, options = {}) {
|
|
|
167
166
|
* @param {string} [status] - Optional status text
|
|
168
167
|
*/
|
|
169
168
|
export function brandedIntro(version, status = "") {
|
|
170
|
-
//
|
|
171
|
-
|
|
169
|
+
// Split banner and filter to get content lines only
|
|
170
|
+
const bannerLines = PIKAKIT_BANNER.split('\n').filter(line => line.trim() !== '');
|
|
172
171
|
|
|
173
|
-
//
|
|
174
|
-
|
|
172
|
+
// Print all lines except the last with gradient
|
|
173
|
+
for (let i = 0; i < bannerLines.length - 1; i++) {
|
|
174
|
+
console.log(pikaGradient(bannerLines[i]));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Last line: gradient ASCII + dim version (aligned at bottom)
|
|
178
|
+
const lastLine = bannerLines[bannerLines.length - 1];
|
|
179
|
+
console.log(pikaGradient(lastLine) + ` ${c.dim(`v${version}`)}`);
|
|
180
|
+
console.log(''); // Empty line after banner
|
|
175
181
|
|
|
176
182
|
if (status) {
|
|
177
183
|
console.log(`${c.dim(status)}`);
|
|
@@ -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"
|