@skillkit/cli 1.12.0 → 1.14.0
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.d.ts +34 -1
- package/dist/index.js +1096 -407
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1045,6 +1045,529 @@ This skill should NOT:
|
|
|
1045
1045
|
}
|
|
1046
1046
|
});
|
|
1047
1047
|
|
|
1048
|
+
// src/commands/generate.ts
|
|
1049
|
+
var generate_exports = {};
|
|
1050
|
+
__export(generate_exports, {
|
|
1051
|
+
GenerateCommand: () => GenerateCommand
|
|
1052
|
+
});
|
|
1053
|
+
import { Command as Command35, Option as Option34 } from "clipanion";
|
|
1054
|
+
import { resolve as resolve16 } from "path";
|
|
1055
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "fs";
|
|
1056
|
+
import {
|
|
1057
|
+
SkillWizard,
|
|
1058
|
+
detectProviders,
|
|
1059
|
+
getProviderModels,
|
|
1060
|
+
SkillComposer
|
|
1061
|
+
} from "@skillkit/core";
|
|
1062
|
+
function getTrustGradeColor(grade) {
|
|
1063
|
+
switch (grade) {
|
|
1064
|
+
case "trusted":
|
|
1065
|
+
return colors.success;
|
|
1066
|
+
case "review":
|
|
1067
|
+
return colors.warning;
|
|
1068
|
+
default:
|
|
1069
|
+
return colors.error;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
function getCompatGradeColor(grade) {
|
|
1073
|
+
switch (grade) {
|
|
1074
|
+
case "A":
|
|
1075
|
+
case "B":
|
|
1076
|
+
return colors.success;
|
|
1077
|
+
case "C":
|
|
1078
|
+
return colors.warning;
|
|
1079
|
+
default:
|
|
1080
|
+
return colors.error;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
var GenerateCommand;
|
|
1084
|
+
var init_generate = __esm({
|
|
1085
|
+
"src/commands/generate.ts"() {
|
|
1086
|
+
"use strict";
|
|
1087
|
+
init_prompts();
|
|
1088
|
+
init_theme();
|
|
1089
|
+
GenerateCommand = class extends Command35 {
|
|
1090
|
+
static paths = [["generate"], ["gen"]];
|
|
1091
|
+
static usage = Command35.Usage({
|
|
1092
|
+
description: "Smart AI-powered skill generation wizard",
|
|
1093
|
+
details: `
|
|
1094
|
+
Generate skills using AI with multi-source context gathering:
|
|
1095
|
+
|
|
1096
|
+
- Documentation (Context7)
|
|
1097
|
+
- Local codebase patterns
|
|
1098
|
+
- Marketplace skills (15,000+)
|
|
1099
|
+
- Memory observations and learnings
|
|
1100
|
+
|
|
1101
|
+
Supports multiple LLM providers: Claude, GPT-4, Gemini, Ollama, OpenRouter
|
|
1102
|
+
`,
|
|
1103
|
+
examples: [
|
|
1104
|
+
["Interactive wizard", "$0 generate"],
|
|
1105
|
+
["Use specific provider", "$0 generate --provider openai"],
|
|
1106
|
+
["Compose from existing skills", '$0 generate --compose "testing patterns for vitest"'],
|
|
1107
|
+
["Target specific agents", "$0 generate --agents claude-code,cursor"],
|
|
1108
|
+
["Skip memory context", "$0 generate --no-memory"]
|
|
1109
|
+
]
|
|
1110
|
+
});
|
|
1111
|
+
provider = Option34.String("--provider,-p", {
|
|
1112
|
+
description: "LLM provider: anthropic, openai, google, ollama, openrouter"
|
|
1113
|
+
});
|
|
1114
|
+
model = Option34.String("--model,-m", {
|
|
1115
|
+
description: "Specific model to use (e.g., gpt-4o, gemini-2.0-flash)"
|
|
1116
|
+
});
|
|
1117
|
+
compose = Option34.String("--compose,-c", {
|
|
1118
|
+
description: "Natural language search to find skills to compose"
|
|
1119
|
+
});
|
|
1120
|
+
agents = Option34.String("--agents,-a", {
|
|
1121
|
+
description: "Target agents (comma-separated)"
|
|
1122
|
+
});
|
|
1123
|
+
noMemory = Option34.Boolean("--no-memory", false, {
|
|
1124
|
+
description: "Skip memory context"
|
|
1125
|
+
});
|
|
1126
|
+
contextSources = Option34.String("--context-sources", {
|
|
1127
|
+
description: "Context sources (comma-separated): docs,codebase,skills,memory"
|
|
1128
|
+
});
|
|
1129
|
+
output = Option34.String("--output,-o", {
|
|
1130
|
+
description: "Output directory for generated skill"
|
|
1131
|
+
});
|
|
1132
|
+
json = Option34.Boolean("--json,-j", false, {
|
|
1133
|
+
description: "Output in JSON format"
|
|
1134
|
+
});
|
|
1135
|
+
async execute() {
|
|
1136
|
+
if (this.json) {
|
|
1137
|
+
return this.executeNonInteractive();
|
|
1138
|
+
}
|
|
1139
|
+
intro2("SkillKit Smart Generate");
|
|
1140
|
+
const providerResult = await this.selectProvider();
|
|
1141
|
+
if (isCancel2(providerResult)) {
|
|
1142
|
+
cancel2("Operation cancelled");
|
|
1143
|
+
return 1;
|
|
1144
|
+
}
|
|
1145
|
+
const wizard = new SkillWizard({
|
|
1146
|
+
projectPath: process.cwd(),
|
|
1147
|
+
options: {
|
|
1148
|
+
provider: providerResult.name,
|
|
1149
|
+
model: providerResult.model
|
|
1150
|
+
},
|
|
1151
|
+
events: {
|
|
1152
|
+
onProgress: (message) => log2(colors.muted(message))
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
const expertiseResult = await this.stepExpertise(wizard);
|
|
1156
|
+
if (!expertiseResult) return 1;
|
|
1157
|
+
const sourcesResult = await this.stepContextSources(wizard);
|
|
1158
|
+
if (!sourcesResult) return 1;
|
|
1159
|
+
const compositionResult = await this.stepComposition(wizard);
|
|
1160
|
+
if (!compositionResult) return 1;
|
|
1161
|
+
const clarificationResult = await this.stepClarification(wizard);
|
|
1162
|
+
if (!clarificationResult) return 1;
|
|
1163
|
+
const reviewResult = await this.stepReview(wizard);
|
|
1164
|
+
if (!reviewResult) return 1;
|
|
1165
|
+
const installResult = await this.stepInstall(wizard);
|
|
1166
|
+
if (!installResult) return 1;
|
|
1167
|
+
outro2("Skill generated and installed successfully!");
|
|
1168
|
+
return 0;
|
|
1169
|
+
}
|
|
1170
|
+
async executeNonInteractive() {
|
|
1171
|
+
console.error("Non-interactive mode requires --expertise flag (not implemented yet)");
|
|
1172
|
+
return 1;
|
|
1173
|
+
}
|
|
1174
|
+
async selectProvider() {
|
|
1175
|
+
if (this.provider) {
|
|
1176
|
+
return {
|
|
1177
|
+
name: this.provider,
|
|
1178
|
+
model: this.model || ""
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
const detected = detectProviders();
|
|
1182
|
+
const configured = detected.filter((p) => p.configured && p.provider !== "mock");
|
|
1183
|
+
if (configured.length === 0) {
|
|
1184
|
+
warn("No LLM provider configured");
|
|
1185
|
+
note2(
|
|
1186
|
+
`Set one of these environment variables:
|
|
1187
|
+
ANTHROPIC_API_KEY - Claude (Anthropic)
|
|
1188
|
+
OPENAI_API_KEY - GPT-4 (OpenAI)
|
|
1189
|
+
GOOGLE_AI_KEY - Gemini (Google)
|
|
1190
|
+
OPENROUTER_API_KEY - OpenRouter (100+ models)
|
|
1191
|
+
|
|
1192
|
+
Or use Ollama for local models (no API key needed)`,
|
|
1193
|
+
"Provider Setup"
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
const options = configured.map((p) => ({
|
|
1197
|
+
value: p.provider,
|
|
1198
|
+
label: p.displayName,
|
|
1199
|
+
hint: p.envVar ? `via ${p.envVar}` : void 0
|
|
1200
|
+
}));
|
|
1201
|
+
if (options.length === 0) {
|
|
1202
|
+
options.push({
|
|
1203
|
+
value: "ollama",
|
|
1204
|
+
label: "Ollama (Local)",
|
|
1205
|
+
hint: "No API key needed"
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
const selected = await select2({
|
|
1209
|
+
message: "Select LLM provider",
|
|
1210
|
+
options
|
|
1211
|
+
});
|
|
1212
|
+
if (isCancel2(selected)) {
|
|
1213
|
+
return selected;
|
|
1214
|
+
}
|
|
1215
|
+
const models = getProviderModels(selected);
|
|
1216
|
+
if (models.length > 1 && !this.model) {
|
|
1217
|
+
const modelOptions = models.map((m) => ({
|
|
1218
|
+
value: m,
|
|
1219
|
+
label: m
|
|
1220
|
+
}));
|
|
1221
|
+
const selectedModel = await select2({
|
|
1222
|
+
message: "Select model",
|
|
1223
|
+
options: modelOptions,
|
|
1224
|
+
initialValue: models[0]
|
|
1225
|
+
});
|
|
1226
|
+
if (isCancel2(selectedModel)) {
|
|
1227
|
+
return selectedModel;
|
|
1228
|
+
}
|
|
1229
|
+
return { name: selected, model: selectedModel };
|
|
1230
|
+
}
|
|
1231
|
+
return { name: selected, model: this.model || models[0] || "" };
|
|
1232
|
+
}
|
|
1233
|
+
async stepExpertise(wizard) {
|
|
1234
|
+
this.showStepHeader("expertise", "Describe Your Expertise");
|
|
1235
|
+
const expertise = await text2({
|
|
1236
|
+
message: "What should this skill help with?",
|
|
1237
|
+
placeholder: "e.g., Write comprehensive unit tests using vitest",
|
|
1238
|
+
validate: (value) => {
|
|
1239
|
+
if (value.length < 10) {
|
|
1240
|
+
return "Please provide more detail (at least 10 characters)";
|
|
1241
|
+
}
|
|
1242
|
+
return void 0;
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
if (isCancel2(expertise)) {
|
|
1246
|
+
cancel2("Operation cancelled");
|
|
1247
|
+
return false;
|
|
1248
|
+
}
|
|
1249
|
+
const result = await wizard.setExpertise(expertise);
|
|
1250
|
+
if (!result.success) {
|
|
1251
|
+
error(result.error || "Failed to set expertise");
|
|
1252
|
+
return false;
|
|
1253
|
+
}
|
|
1254
|
+
return true;
|
|
1255
|
+
}
|
|
1256
|
+
async stepContextSources(wizard) {
|
|
1257
|
+
this.showStepHeader("context-sources", "Context Sources");
|
|
1258
|
+
if (this.contextSources) {
|
|
1259
|
+
const sourceNames = this.contextSources.split(",").map((s) => s.trim());
|
|
1260
|
+
const sources2 = [
|
|
1261
|
+
{ name: "docs", enabled: sourceNames.includes("docs"), weight: 1 },
|
|
1262
|
+
{ name: "codebase", enabled: sourceNames.includes("codebase"), weight: 0.9 },
|
|
1263
|
+
{ name: "skills", enabled: sourceNames.includes("skills"), weight: 0.8 },
|
|
1264
|
+
{ name: "memory", enabled: sourceNames.includes("memory") && !this.noMemory, weight: 0.7 }
|
|
1265
|
+
];
|
|
1266
|
+
const result2 = await wizard.setContextSources(sources2);
|
|
1267
|
+
if (!result2.success) {
|
|
1268
|
+
error(result2.error || "Failed to gather context");
|
|
1269
|
+
return false;
|
|
1270
|
+
}
|
|
1271
|
+
return true;
|
|
1272
|
+
}
|
|
1273
|
+
const sourceOptions = [
|
|
1274
|
+
{ value: "docs", label: "Documentation (Context7)", hint: "Library docs & guides" },
|
|
1275
|
+
{ value: "codebase", label: "Codebase (local)", hint: "Project patterns & configs" },
|
|
1276
|
+
{ value: "skills", label: "Marketplace Skills", hint: "15,000+ skills" },
|
|
1277
|
+
{ value: "memory", label: "Memory & Learnings", hint: "Your corrections & patterns" }
|
|
1278
|
+
];
|
|
1279
|
+
const selectedSources = await groupMultiselect2({
|
|
1280
|
+
message: "Select context sources",
|
|
1281
|
+
options: {
|
|
1282
|
+
"Context Sources": sourceOptions
|
|
1283
|
+
},
|
|
1284
|
+
required: true
|
|
1285
|
+
});
|
|
1286
|
+
if (isCancel2(selectedSources)) {
|
|
1287
|
+
cancel2("Operation cancelled");
|
|
1288
|
+
return false;
|
|
1289
|
+
}
|
|
1290
|
+
const sources = [
|
|
1291
|
+
{ name: "docs", enabled: selectedSources.includes("docs"), weight: 1 },
|
|
1292
|
+
{ name: "codebase", enabled: selectedSources.includes("codebase"), weight: 0.9 },
|
|
1293
|
+
{ name: "skills", enabled: selectedSources.includes("skills"), weight: 0.8 },
|
|
1294
|
+
{ name: "memory", enabled: selectedSources.includes("memory") && !this.noMemory, weight: 0.7 }
|
|
1295
|
+
];
|
|
1296
|
+
const spinner3 = spinner2();
|
|
1297
|
+
spinner3.start("Gathering context...");
|
|
1298
|
+
const result = await wizard.setContextSources(sources);
|
|
1299
|
+
if (!result.success) {
|
|
1300
|
+
spinner3.stop("Context gathering failed");
|
|
1301
|
+
error(result.error || "Failed to gather context");
|
|
1302
|
+
return false;
|
|
1303
|
+
}
|
|
1304
|
+
const state = wizard.getState();
|
|
1305
|
+
spinner3.stop(`Gathered ${state.gatheredContext.length} context chunks`);
|
|
1306
|
+
const sourceSummary = sources.filter((s) => s.enabled).map((s) => {
|
|
1307
|
+
const chunks = state.gatheredContext.filter((c) => c.source === s.name);
|
|
1308
|
+
return ` ${colors.success(symbols.success)} ${s.name}: ${chunks.length} chunks`;
|
|
1309
|
+
}).join("\n");
|
|
1310
|
+
note2(sourceSummary, "Context Summary");
|
|
1311
|
+
return true;
|
|
1312
|
+
}
|
|
1313
|
+
async stepComposition(wizard) {
|
|
1314
|
+
this.showStepHeader("composition", "Compose from Skills (optional)");
|
|
1315
|
+
const searchQuery = this.compose;
|
|
1316
|
+
if (!searchQuery) {
|
|
1317
|
+
const wantCompose = await confirm2({
|
|
1318
|
+
message: "Search marketplace skills to compose from?",
|
|
1319
|
+
initialValue: false
|
|
1320
|
+
});
|
|
1321
|
+
if (isCancel2(wantCompose)) {
|
|
1322
|
+
cancel2("Operation cancelled");
|
|
1323
|
+
return false;
|
|
1324
|
+
}
|
|
1325
|
+
if (!wantCompose) {
|
|
1326
|
+
await wizard.selectSkillsForComposition([]);
|
|
1327
|
+
return true;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
const query = searchQuery || await text2({
|
|
1331
|
+
message: "Search for skills to compose",
|
|
1332
|
+
placeholder: "e.g., testing patterns for vitest"
|
|
1333
|
+
});
|
|
1334
|
+
if (isCancel2(query)) {
|
|
1335
|
+
cancel2("Operation cancelled");
|
|
1336
|
+
return false;
|
|
1337
|
+
}
|
|
1338
|
+
const spinner3 = spinner2();
|
|
1339
|
+
spinner3.start("Searching marketplace...");
|
|
1340
|
+
const composer = new SkillComposer();
|
|
1341
|
+
const foundSkills = await composer.findComposable(query, 10);
|
|
1342
|
+
spinner3.stop(`Found ${foundSkills.length} relevant skills`);
|
|
1343
|
+
if (foundSkills.length === 0) {
|
|
1344
|
+
warn("No matching skills found");
|
|
1345
|
+
await wizard.selectSkillsForComposition([]);
|
|
1346
|
+
return true;
|
|
1347
|
+
}
|
|
1348
|
+
const skillOptions = foundSkills.map((skill) => ({
|
|
1349
|
+
name: skill.name,
|
|
1350
|
+
description: skill.description,
|
|
1351
|
+
score: Math.round(skill.trustScore * 10),
|
|
1352
|
+
source: skill.source
|
|
1353
|
+
}));
|
|
1354
|
+
const selectedSkills = await skillMultiselect({
|
|
1355
|
+
message: "Select skills to compose from",
|
|
1356
|
+
skills: skillOptions,
|
|
1357
|
+
required: false
|
|
1358
|
+
});
|
|
1359
|
+
if (isCancel2(selectedSkills)) {
|
|
1360
|
+
cancel2("Operation cancelled");
|
|
1361
|
+
return false;
|
|
1362
|
+
}
|
|
1363
|
+
const selected = foundSkills.filter((s) => selectedSkills.includes(s.name));
|
|
1364
|
+
await wizard.selectSkillsForComposition(selected);
|
|
1365
|
+
return true;
|
|
1366
|
+
}
|
|
1367
|
+
async stepClarification(wizard) {
|
|
1368
|
+
this.showStepHeader("clarification", "Clarification Questions");
|
|
1369
|
+
const result = await wizard.answerClarifications([]);
|
|
1370
|
+
if (!result.success) {
|
|
1371
|
+
error(result.error || "Failed to generate questions");
|
|
1372
|
+
return false;
|
|
1373
|
+
}
|
|
1374
|
+
const state = wizard.getState();
|
|
1375
|
+
const questions = state.generatedQuestions;
|
|
1376
|
+
if (questions.length === 0) {
|
|
1377
|
+
log2(colors.muted("No clarification questions needed"));
|
|
1378
|
+
return true;
|
|
1379
|
+
}
|
|
1380
|
+
const answers = [];
|
|
1381
|
+
for (const question of questions) {
|
|
1382
|
+
let answer;
|
|
1383
|
+
if (question.type === "select" && question.options) {
|
|
1384
|
+
answer = await select2({
|
|
1385
|
+
message: question.question,
|
|
1386
|
+
options: question.options.map((opt) => ({
|
|
1387
|
+
value: opt,
|
|
1388
|
+
label: opt
|
|
1389
|
+
}))
|
|
1390
|
+
});
|
|
1391
|
+
} else if (question.type === "multiselect" && question.options) {
|
|
1392
|
+
answer = await groupMultiselect2({
|
|
1393
|
+
message: question.question,
|
|
1394
|
+
options: {
|
|
1395
|
+
Options: question.options.map((opt) => ({
|
|
1396
|
+
value: opt,
|
|
1397
|
+
label: opt
|
|
1398
|
+
}))
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
} else if (question.type === "confirm") {
|
|
1402
|
+
answer = await confirm2({
|
|
1403
|
+
message: question.question
|
|
1404
|
+
});
|
|
1405
|
+
} else {
|
|
1406
|
+
answer = await text2({
|
|
1407
|
+
message: question.question,
|
|
1408
|
+
placeholder: question.context
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
if (isCancel2(answer)) {
|
|
1412
|
+
cancel2("Operation cancelled");
|
|
1413
|
+
return false;
|
|
1414
|
+
}
|
|
1415
|
+
answers.push({
|
|
1416
|
+
questionId: question.id,
|
|
1417
|
+
answer
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
const finalResult = await wizard.answerClarifications(answers);
|
|
1421
|
+
return finalResult.success;
|
|
1422
|
+
}
|
|
1423
|
+
async stepReview(wizard) {
|
|
1424
|
+
this.showStepHeader("review", "Review Generated Skill");
|
|
1425
|
+
const spinner3 = spinner2();
|
|
1426
|
+
spinner3.start("Generating skill...");
|
|
1427
|
+
const result = await wizard.generateSkill();
|
|
1428
|
+
if (!result.success) {
|
|
1429
|
+
spinner3.stop("Generation failed");
|
|
1430
|
+
error(result.error || "Failed to generate skill");
|
|
1431
|
+
return false;
|
|
1432
|
+
}
|
|
1433
|
+
spinner3.stop("Skill generated");
|
|
1434
|
+
const state = wizard.getState();
|
|
1435
|
+
const skill = state.generatedSkill;
|
|
1436
|
+
const trustScore = state.trustScore;
|
|
1437
|
+
const compatibility = state.compatibilityMatrix;
|
|
1438
|
+
note2(
|
|
1439
|
+
`Name: ${colors.bold(skill.name)}
|
|
1440
|
+
Description: ${skill.description}
|
|
1441
|
+
Tags: ${skill.tags.join(", ")}
|
|
1442
|
+
Confidence: ${Math.round(skill.confidence * 100)}%
|
|
1443
|
+
Tokens: ~${skill.estimatedTokens}`,
|
|
1444
|
+
"Generated Skill"
|
|
1445
|
+
);
|
|
1446
|
+
const trustBar = progressBar(trustScore.score, 10, 10);
|
|
1447
|
+
const trustColor = getTrustGradeColor(trustScore.grade);
|
|
1448
|
+
note2(
|
|
1449
|
+
`Score: ${trustColor(`${trustScore.score.toFixed(1)}/10`)} ${colors.dim(trustBar)}
|
|
1450
|
+
Grade: ${trustColor(trustScore.grade.toUpperCase())}
|
|
1451
|
+
${trustScore.warnings.length > 0 ? `
|
|
1452
|
+
Warnings:
|
|
1453
|
+
${trustScore.warnings.map((w) => ` ${colors.warning(symbols.warning)} ${w}`).join("\n")}` : ""}`,
|
|
1454
|
+
"Trust Score"
|
|
1455
|
+
);
|
|
1456
|
+
const topAgents = Object.entries(compatibility).sort(([, a], [, b]) => b.score - a.score).slice(0, 5);
|
|
1457
|
+
const compatLines = topAgents.map(([agentId, score]) => {
|
|
1458
|
+
const bar = progressBar(score.score, 10, 10);
|
|
1459
|
+
const color = getCompatGradeColor(score.grade);
|
|
1460
|
+
return ` ${formatAgent(agentId)}: ${color(`${score.score.toFixed(1)}/10`)} ${colors.dim(bar)}`;
|
|
1461
|
+
});
|
|
1462
|
+
note2(compatLines.join("\n"), "Agent Compatibility");
|
|
1463
|
+
const action = await select2({
|
|
1464
|
+
message: "What would you like to do?",
|
|
1465
|
+
options: [
|
|
1466
|
+
{ value: "approve", label: "Approve and continue", hint: "Install to agents" },
|
|
1467
|
+
{ value: "view", label: "View full content" },
|
|
1468
|
+
{ value: "regenerate", label: "Regenerate", hint: "Try again with same inputs" }
|
|
1469
|
+
]
|
|
1470
|
+
});
|
|
1471
|
+
if (isCancel2(action)) {
|
|
1472
|
+
cancel2("Operation cancelled");
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1475
|
+
if (action === "view") {
|
|
1476
|
+
console.log("\n" + colors.dim("\u2500".repeat(60)));
|
|
1477
|
+
console.log(skill.content);
|
|
1478
|
+
console.log(colors.dim("\u2500".repeat(60)) + "\n");
|
|
1479
|
+
const afterView = await select2({
|
|
1480
|
+
message: "Continue?",
|
|
1481
|
+
options: [
|
|
1482
|
+
{ value: "approve", label: "Approve and install" },
|
|
1483
|
+
{ value: "regenerate", label: "Regenerate" }
|
|
1484
|
+
]
|
|
1485
|
+
});
|
|
1486
|
+
if (isCancel2(afterView)) {
|
|
1487
|
+
cancel2("Operation cancelled");
|
|
1488
|
+
return false;
|
|
1489
|
+
}
|
|
1490
|
+
if (afterView === "regenerate") {
|
|
1491
|
+
return this.stepReview(wizard);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
if (action === "regenerate") {
|
|
1495
|
+
return this.stepReview(wizard);
|
|
1496
|
+
}
|
|
1497
|
+
const approveResult = await wizard.approveSkill();
|
|
1498
|
+
return approveResult.success;
|
|
1499
|
+
}
|
|
1500
|
+
async stepInstall(wizard) {
|
|
1501
|
+
this.showStepHeader("install", "Install to Agents");
|
|
1502
|
+
const state = wizard.getState();
|
|
1503
|
+
let targetAgents;
|
|
1504
|
+
if (this.agents) {
|
|
1505
|
+
targetAgents = this.agents.split(",").map((a) => a.trim());
|
|
1506
|
+
} else {
|
|
1507
|
+
const agentOptions = [
|
|
1508
|
+
"claude-code",
|
|
1509
|
+
"cursor",
|
|
1510
|
+
"codex",
|
|
1511
|
+
"gemini-cli",
|
|
1512
|
+
"opencode",
|
|
1513
|
+
"github-copilot",
|
|
1514
|
+
"windsurf",
|
|
1515
|
+
"cline",
|
|
1516
|
+
"roo",
|
|
1517
|
+
"universal"
|
|
1518
|
+
];
|
|
1519
|
+
const selected = await agentMultiselect({
|
|
1520
|
+
message: "Select target agents",
|
|
1521
|
+
agents: agentOptions,
|
|
1522
|
+
initialValues: ["claude-code"],
|
|
1523
|
+
required: true
|
|
1524
|
+
});
|
|
1525
|
+
if (isCancel2(selected)) {
|
|
1526
|
+
cancel2("Operation cancelled");
|
|
1527
|
+
return false;
|
|
1528
|
+
}
|
|
1529
|
+
targetAgents = selected;
|
|
1530
|
+
}
|
|
1531
|
+
const spinner3 = spinner2();
|
|
1532
|
+
spinner3.start("Installing with agent-specific optimizations...");
|
|
1533
|
+
const result = await wizard.installToAgents(targetAgents);
|
|
1534
|
+
if (!result.success) {
|
|
1535
|
+
spinner3.stop("Installation failed");
|
|
1536
|
+
error(result.error || "Failed to install skill");
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
spinner3.stop("Installation complete");
|
|
1540
|
+
const installState = wizard.getState();
|
|
1541
|
+
const successCount = installState.installResults.filter((r) => r.success).length;
|
|
1542
|
+
const resultLines = installState.installResults.map((r) => {
|
|
1543
|
+
const icon = r.success ? colors.success(symbols.success) : colors.error(symbols.error);
|
|
1544
|
+
const agent = formatAgent(r.agentId);
|
|
1545
|
+
const changes = r.changes.length > 0 ? colors.dim(` (${r.changes.join(", ")})`) : "";
|
|
1546
|
+
return ` ${icon} ${agent}${changes}`;
|
|
1547
|
+
});
|
|
1548
|
+
note2(resultLines.join("\n"), `Installed to ${successCount} agents`);
|
|
1549
|
+
if (this.output) {
|
|
1550
|
+
const outputDir = resolve16(this.output);
|
|
1551
|
+
if (!existsSync17(outputDir)) {
|
|
1552
|
+
mkdirSync8(outputDir, { recursive: true });
|
|
1553
|
+
}
|
|
1554
|
+
const skillPath = resolve16(outputDir, "SKILL.md");
|
|
1555
|
+
writeFileSync8(skillPath, state.generatedSkill.content, "utf-8");
|
|
1556
|
+
success(`Saved to: ${skillPath}`);
|
|
1557
|
+
}
|
|
1558
|
+
return true;
|
|
1559
|
+
}
|
|
1560
|
+
showStepHeader(step2, title) {
|
|
1561
|
+
const stepOrder = ["expertise", "context-sources", "composition", "clarification", "review", "install"];
|
|
1562
|
+
const current = stepOrder.indexOf(step2) + 1;
|
|
1563
|
+
const total = stepOrder.length;
|
|
1564
|
+
console.log();
|
|
1565
|
+
log2(`${colors.dim(`Step ${current}/${total}:`)} ${colors.bold(title)}`);
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1048
1571
|
// src/commands/list.ts
|
|
1049
1572
|
init_helpers();
|
|
1050
1573
|
init_onboarding();
|
|
@@ -5384,7 +5907,10 @@ import {
|
|
|
5384
5907
|
initializeMemoryDirectory,
|
|
5385
5908
|
getMemoryStatus,
|
|
5386
5909
|
createMemoryCompressor,
|
|
5387
|
-
createMemoryInjector
|
|
5910
|
+
createMemoryInjector,
|
|
5911
|
+
createClaudeMdUpdater,
|
|
5912
|
+
syncGlobalClaudeMd,
|
|
5913
|
+
createProgressiveDisclosureManager
|
|
5388
5914
|
} from "@skillkit/core";
|
|
5389
5915
|
var MemoryCommand = class extends Command26 {
|
|
5390
5916
|
static paths = [["memory"], ["mem"]];
|
|
@@ -5395,17 +5921,19 @@ var MemoryCommand = class extends Command26 {
|
|
|
5395
5921
|
captured from coding sessions across all AI agents.
|
|
5396
5922
|
|
|
5397
5923
|
Subcommands:
|
|
5398
|
-
- status:
|
|
5399
|
-
- search:
|
|
5400
|
-
- list:
|
|
5401
|
-
- show:
|
|
5402
|
-
- compress:
|
|
5403
|
-
- export:
|
|
5404
|
-
- import:
|
|
5405
|
-
- clear:
|
|
5406
|
-
- add:
|
|
5407
|
-
- rate:
|
|
5408
|
-
-
|
|
5924
|
+
- status: Show current memory status
|
|
5925
|
+
- search: Search memories by query
|
|
5926
|
+
- list: List all learnings
|
|
5927
|
+
- show: Show a specific learning
|
|
5928
|
+
- compress: Compress observations into learnings
|
|
5929
|
+
- export: Export a learning as a skill
|
|
5930
|
+
- import: Import memories from another project
|
|
5931
|
+
- clear: Clear session observations
|
|
5932
|
+
- add: Manually add a learning
|
|
5933
|
+
- rate: Rate a learning's effectiveness
|
|
5934
|
+
- sync-claude: Sync learnings to CLAUDE.md
|
|
5935
|
+
- index: Show memory index (progressive disclosure)
|
|
5936
|
+
- config: Configure memory settings
|
|
5409
5937
|
`,
|
|
5410
5938
|
examples: [
|
|
5411
5939
|
["Show memory status", "$0 memory status"],
|
|
@@ -5418,7 +5946,9 @@ var MemoryCommand = class extends Command26 {
|
|
|
5418
5946
|
["Export as skill", "$0 memory export <id> --name my-skill"],
|
|
5419
5947
|
["Clear session", "$0 memory clear"],
|
|
5420
5948
|
["Add manual learning", '$0 memory add --title "..." --content "..."'],
|
|
5421
|
-
["Rate effectiveness", "$0 memory rate <id> 85"]
|
|
5949
|
+
["Rate effectiveness", "$0 memory rate <id> 85"],
|
|
5950
|
+
["Sync to CLAUDE.md", "$0 memory sync-claude"],
|
|
5951
|
+
["Show memory index", "$0 memory index"]
|
|
5422
5952
|
]
|
|
5423
5953
|
});
|
|
5424
5954
|
// Subcommand (status, search, list, show, compress, export, import, clear, add, rate, config)
|
|
@@ -5500,9 +6030,13 @@ var MemoryCommand = class extends Command26 {
|
|
|
5500
6030
|
return this.rateLearning();
|
|
5501
6031
|
case "config":
|
|
5502
6032
|
return this.showConfig();
|
|
6033
|
+
case "sync-claude":
|
|
6034
|
+
return this.syncClaudeMd();
|
|
6035
|
+
case "index":
|
|
6036
|
+
return this.showIndex();
|
|
5503
6037
|
default:
|
|
5504
6038
|
console.error(chalk18.red(`Unknown action: ${action}`));
|
|
5505
|
-
console.log(chalk18.gray("Available actions: status, search, list, show, compress, export, import, clear, add, rate, config"));
|
|
6039
|
+
console.log(chalk18.gray("Available actions: status, search, list, show, compress, export, import, clear, add, rate, sync-claude, index, config"));
|
|
5506
6040
|
return 1;
|
|
5507
6041
|
}
|
|
5508
6042
|
}
|
|
@@ -5790,12 +6324,12 @@ ${learning.title}
|
|
|
5790
6324
|
}
|
|
5791
6325
|
const outputPath = this.output || `.skillkit/exports/${skillName}/SKILL.md`;
|
|
5792
6326
|
const { dirname: dirname7 } = await import("path");
|
|
5793
|
-
const { existsSync:
|
|
6327
|
+
const { existsSync: existsSync24, mkdirSync: mkdirSync12, writeFileSync: writeFileSync13 } = await import("fs");
|
|
5794
6328
|
const outputDir = dirname7(outputPath);
|
|
5795
|
-
if (!
|
|
5796
|
-
|
|
6329
|
+
if (!existsSync24(outputDir)) {
|
|
6330
|
+
mkdirSync12(outputDir, { recursive: true });
|
|
5797
6331
|
}
|
|
5798
|
-
|
|
6332
|
+
writeFileSync13(outputPath, skillContent, "utf-8");
|
|
5799
6333
|
console.log(chalk18.green(`\u2713 Exported learning as skill: ${skillName}`));
|
|
5800
6334
|
console.log(chalk18.gray(` Path: ${outputPath}`));
|
|
5801
6335
|
return 0;
|
|
@@ -5810,10 +6344,10 @@ ${learning.title}
|
|
|
5810
6344
|
console.log(chalk18.gray("Usage: skillkit memory import --input <path>"));
|
|
5811
6345
|
return 1;
|
|
5812
6346
|
}
|
|
5813
|
-
const { existsSync:
|
|
5814
|
-
const { resolve:
|
|
5815
|
-
const fullPath =
|
|
5816
|
-
if (!
|
|
6347
|
+
const { existsSync: existsSync24, readFileSync: readFileSync12 } = await import("fs");
|
|
6348
|
+
const { resolve: resolve24 } = await import("path");
|
|
6349
|
+
const fullPath = resolve24(inputPath);
|
|
6350
|
+
if (!existsSync24(fullPath)) {
|
|
5817
6351
|
console.error(chalk18.red(`File not found: ${fullPath}`));
|
|
5818
6352
|
return 1;
|
|
5819
6353
|
}
|
|
@@ -5981,6 +6515,117 @@ ${learning.title}
|
|
|
5981
6515
|
console.log();
|
|
5982
6516
|
return 0;
|
|
5983
6517
|
}
|
|
6518
|
+
/**
|
|
6519
|
+
* Sync learnings to CLAUDE.md
|
|
6520
|
+
*/
|
|
6521
|
+
async syncClaudeMd() {
|
|
6522
|
+
const projectPath = process.cwd();
|
|
6523
|
+
if (this.global) {
|
|
6524
|
+
if (this.dryRun) {
|
|
6525
|
+
console.log(chalk18.gray("(Dry run - previewing global CLAUDE.md sync)\n"));
|
|
6526
|
+
}
|
|
6527
|
+
const result2 = this.dryRun ? { updated: false, path: "~/.claude/CLAUDE.md", learningsAdded: 0, learningSummaries: [], previousLearnings: 0 } : syncGlobalClaudeMd({ minEffectiveness: 60 });
|
|
6528
|
+
if (this.dryRun) {
|
|
6529
|
+
const globalStore = new LearningStore("global");
|
|
6530
|
+
const learnings = globalStore.getAll().filter((l) => (l.effectiveness ?? 0) >= 60 || l.useCount >= 3).slice(0, 20);
|
|
6531
|
+
console.log(chalk18.cyan(`Would add ${learnings.length} learnings to global CLAUDE.md`));
|
|
6532
|
+
for (const l of learnings.slice(0, 5)) {
|
|
6533
|
+
console.log(` ${chalk18.gray("\u25CF")} ${l.title}`);
|
|
6534
|
+
}
|
|
6535
|
+
if (learnings.length > 5) {
|
|
6536
|
+
console.log(chalk18.gray(` ... and ${learnings.length - 5} more`));
|
|
6537
|
+
}
|
|
6538
|
+
return 0;
|
|
6539
|
+
}
|
|
6540
|
+
if (result2.updated) {
|
|
6541
|
+
console.log(chalk18.green(`\u2713 Updated global CLAUDE.md with ${result2.learningsAdded} learnings`));
|
|
6542
|
+
console.log(chalk18.gray(` Path: ${result2.path}`));
|
|
6543
|
+
} else {
|
|
6544
|
+
console.log(chalk18.yellow("No learnings to sync to global CLAUDE.md"));
|
|
6545
|
+
}
|
|
6546
|
+
return 0;
|
|
6547
|
+
}
|
|
6548
|
+
const updater = createClaudeMdUpdater(projectPath);
|
|
6549
|
+
if (this.dryRun) {
|
|
6550
|
+
const preview = updater.preview({ minEffectiveness: 60 });
|
|
6551
|
+
console.log(chalk18.gray("(Dry run preview)\n"));
|
|
6552
|
+
if (!preview.wouldUpdate) {
|
|
6553
|
+
console.log(chalk18.yellow("No learnings to sync to CLAUDE.md"));
|
|
6554
|
+
return 0;
|
|
6555
|
+
}
|
|
6556
|
+
console.log(chalk18.cyan(`Would add ${preview.learnings.length} learnings to CLAUDE.md
|
|
6557
|
+
`));
|
|
6558
|
+
for (const learning of preview.learnings.slice(0, 5)) {
|
|
6559
|
+
console.log(` ${chalk18.gray("\u25CF")} ${learning.title}`);
|
|
6560
|
+
}
|
|
6561
|
+
if (preview.learnings.length > 5) {
|
|
6562
|
+
console.log(chalk18.gray(` ... and ${preview.learnings.length - 5} more`));
|
|
6563
|
+
}
|
|
6564
|
+
console.log(chalk18.bold("\nFormatted section preview:"));
|
|
6565
|
+
console.log(chalk18.gray("\u2500".repeat(50)));
|
|
6566
|
+
console.log(preview.formattedSection.slice(0, 500));
|
|
6567
|
+
if (preview.formattedSection.length > 500) {
|
|
6568
|
+
console.log(chalk18.gray("..."));
|
|
6569
|
+
}
|
|
6570
|
+
return 0;
|
|
6571
|
+
}
|
|
6572
|
+
const result = updater.update({ minEffectiveness: 60 });
|
|
6573
|
+
if (result.updated) {
|
|
6574
|
+
console.log(chalk18.green(`\u2713 Updated CLAUDE.md with ${result.learningsAdded} learnings`));
|
|
6575
|
+
console.log(chalk18.gray(` Path: ${result.path}`));
|
|
6576
|
+
if (this.verbose && result.learningSummaries.length > 0) {
|
|
6577
|
+
console.log(chalk18.cyan("\nLearnings added:"));
|
|
6578
|
+
for (const title of result.learningSummaries.slice(0, 10)) {
|
|
6579
|
+
console.log(` ${chalk18.gray("\u25CF")} ${title}`);
|
|
6580
|
+
}
|
|
6581
|
+
}
|
|
6582
|
+
} else {
|
|
6583
|
+
console.log(chalk18.yellow("No learnings to sync to CLAUDE.md"));
|
|
6584
|
+
}
|
|
6585
|
+
return 0;
|
|
6586
|
+
}
|
|
6587
|
+
/**
|
|
6588
|
+
* Show memory index (progressive disclosure Layer 1)
|
|
6589
|
+
*/
|
|
6590
|
+
async showIndex() {
|
|
6591
|
+
const projectPath = process.cwd();
|
|
6592
|
+
const manager = createProgressiveDisclosureManager(projectPath);
|
|
6593
|
+
let maxResults = 50;
|
|
6594
|
+
if (this.limit) {
|
|
6595
|
+
const parsed = parseInt(this.limit, 10);
|
|
6596
|
+
if (isNaN(parsed) || parsed <= 0) {
|
|
6597
|
+
console.log(chalk18.red("Invalid --limit value. Must be a positive number."));
|
|
6598
|
+
return 1;
|
|
6599
|
+
}
|
|
6600
|
+
maxResults = parsed;
|
|
6601
|
+
}
|
|
6602
|
+
const index = manager.getIndex({ includeGlobal: this.global, maxResults });
|
|
6603
|
+
if (this.json) {
|
|
6604
|
+
console.log(JSON.stringify(index, null, 2));
|
|
6605
|
+
return 0;
|
|
6606
|
+
}
|
|
6607
|
+
console.log(chalk18.bold(`
|
|
6608
|
+
Memory Index (${index.length} entries)
|
|
6609
|
+
`));
|
|
6610
|
+
if (index.length === 0) {
|
|
6611
|
+
console.log(chalk18.gray("No learnings found."));
|
|
6612
|
+
return 0;
|
|
6613
|
+
}
|
|
6614
|
+
const displayLimit = this.limit ? parseInt(this.limit, 10) : 20;
|
|
6615
|
+
const displayed = index.slice(0, displayLimit);
|
|
6616
|
+
for (const entry of displayed) {
|
|
6617
|
+
const effectiveness = entry.effectiveness !== void 0 ? ` [${this.formatScore(entry.effectiveness)}%]` : "";
|
|
6618
|
+
const scope = entry.scope === "global" ? chalk18.magenta("[G]") : chalk18.blue("[P]");
|
|
6619
|
+
console.log(`${scope} ${chalk18.gray(entry.id.slice(0, 8))} ${entry.title}${chalk18.green(effectiveness)}`);
|
|
6620
|
+
console.log(` Tags: ${entry.tags.join(", ")} | Uses: ${entry.useCount}`);
|
|
6621
|
+
}
|
|
6622
|
+
if (index.length > displayLimit) {
|
|
6623
|
+
console.log(chalk18.gray(`
|
|
6624
|
+
... and ${index.length - displayLimit} more (use --limit to show more)`));
|
|
6625
|
+
}
|
|
6626
|
+
console.log(chalk18.gray('\nUse "skillkit memory show <id>" to view full details'));
|
|
6627
|
+
return 0;
|
|
6628
|
+
}
|
|
5984
6629
|
/**
|
|
5985
6630
|
* Format relevance/effectiveness score with color
|
|
5986
6631
|
*/
|
|
@@ -6892,14 +7537,14 @@ var TeamCommand = class extends Command29 {
|
|
|
6892
7537
|
}
|
|
6893
7538
|
const projectPath = process.cwd();
|
|
6894
7539
|
const bundlePath = join12(projectPath, ".skillkit", "bundles", `${this.name}.json`);
|
|
6895
|
-
const { existsSync:
|
|
6896
|
-
if (!
|
|
7540
|
+
const { existsSync: existsSync24, readFileSync: readFileSync12, writeFileSync: writeFileSync13 } = await import("fs");
|
|
7541
|
+
if (!existsSync24(bundlePath)) {
|
|
6897
7542
|
this.context.stderr.write(chalk21.red(`Bundle "${this.name}" not found. Create it first with bundle-create.
|
|
6898
7543
|
`));
|
|
6899
7544
|
return 1;
|
|
6900
7545
|
}
|
|
6901
7546
|
const content = readFileSync12(bundlePath, "utf-8");
|
|
6902
|
-
|
|
7547
|
+
writeFileSync13(this.output, content, "utf-8");
|
|
6903
7548
|
this.context.stdout.write(chalk21.green(`\u2713 Bundle exported to: ${this.output}
|
|
6904
7549
|
`));
|
|
6905
7550
|
return 0;
|
|
@@ -6909,8 +7554,8 @@ var TeamCommand = class extends Command29 {
|
|
|
6909
7554
|
this.context.stderr.write(chalk21.red("--source <path> is required for bundle-import\n"));
|
|
6910
7555
|
return 1;
|
|
6911
7556
|
}
|
|
6912
|
-
const { existsSync:
|
|
6913
|
-
if (!
|
|
7557
|
+
const { existsSync: existsSync24 } = await import("fs");
|
|
7558
|
+
if (!existsSync24(this.source)) {
|
|
6914
7559
|
this.context.stderr.write(chalk21.red(`Bundle file not found: ${this.source}
|
|
6915
7560
|
`));
|
|
6916
7561
|
return 1;
|
|
@@ -8874,18 +9519,20 @@ Saved to: ${configPath}
|
|
|
8874
9519
|
};
|
|
8875
9520
|
|
|
8876
9521
|
// src/commands/ai.ts
|
|
8877
|
-
import { Command as
|
|
8878
|
-
import { resolve as
|
|
9522
|
+
import { Command as Command36, Option as Option35 } from "clipanion";
|
|
9523
|
+
import { resolve as resolve17 } from "path";
|
|
8879
9524
|
import { promises as fs2 } from "fs";
|
|
8880
9525
|
import chalk25 from "chalk";
|
|
8881
9526
|
import ora4 from "ora";
|
|
8882
9527
|
import {
|
|
8883
9528
|
AIManager,
|
|
8884
|
-
loadIndex as loadIndexFromCache2
|
|
9529
|
+
loadIndex as loadIndexFromCache2,
|
|
9530
|
+
detectProviders as detectProviders2,
|
|
9531
|
+
getDefaultProvider
|
|
8885
9532
|
} from "@skillkit/core";
|
|
8886
|
-
var AICommand = class extends
|
|
9533
|
+
var AICommand = class extends Command36 {
|
|
8887
9534
|
static paths = [["ai"]];
|
|
8888
|
-
static usage =
|
|
9535
|
+
static usage = Command36.Usage({
|
|
8889
9536
|
description: "AI-powered skill search and generation",
|
|
8890
9537
|
details: `
|
|
8891
9538
|
The ai command provides AI-powered features for skills:
|
|
@@ -8905,37 +9552,37 @@ var AICommand = class extends Command35 {
|
|
|
8905
9552
|
]
|
|
8906
9553
|
});
|
|
8907
9554
|
// Subcommand
|
|
8908
|
-
subcommand =
|
|
9555
|
+
subcommand = Option35.String({ required: true });
|
|
8909
9556
|
// Search options
|
|
8910
|
-
query =
|
|
9557
|
+
query = Option35.String("--query,-q", {
|
|
8911
9558
|
description: "Search query for natural language search"
|
|
8912
9559
|
});
|
|
8913
9560
|
// Generation options
|
|
8914
|
-
description =
|
|
9561
|
+
description = Option35.String("--description,-d", {
|
|
8915
9562
|
description: "Description of the skill to generate"
|
|
8916
9563
|
});
|
|
8917
|
-
fromCode =
|
|
9564
|
+
fromCode = Option35.String("--from-code", {
|
|
8918
9565
|
description: "Generate skill from code example file"
|
|
8919
9566
|
});
|
|
8920
|
-
additionalContext =
|
|
9567
|
+
additionalContext = Option35.String("--context", {
|
|
8921
9568
|
description: "Additional context for generation"
|
|
8922
9569
|
});
|
|
8923
|
-
targetAgent =
|
|
9570
|
+
targetAgent = Option35.String("--agent,-a", {
|
|
8924
9571
|
description: "Target agent for generated skill"
|
|
8925
9572
|
});
|
|
8926
9573
|
// Similar skills option
|
|
8927
|
-
skillName =
|
|
9574
|
+
skillName = Option35.String({ required: false });
|
|
8928
9575
|
// Common options
|
|
8929
|
-
limit =
|
|
9576
|
+
limit = Option35.String("--limit,-l", {
|
|
8930
9577
|
description: "Maximum number of results"
|
|
8931
9578
|
});
|
|
8932
|
-
minRelevance =
|
|
9579
|
+
minRelevance = Option35.String("--min-relevance", {
|
|
8933
9580
|
description: "Minimum relevance score (0-1)"
|
|
8934
9581
|
});
|
|
8935
|
-
json =
|
|
9582
|
+
json = Option35.Boolean("--json,-j", false, {
|
|
8936
9583
|
description: "Output in JSON format"
|
|
8937
9584
|
});
|
|
8938
|
-
output =
|
|
9585
|
+
output = Option35.String("--output,-o", {
|
|
8939
9586
|
description: "Output file for generated skill"
|
|
8940
9587
|
});
|
|
8941
9588
|
async execute() {
|
|
@@ -8959,12 +9606,16 @@ var AICommand = class extends Command35 {
|
|
|
8959
9606
|
return await this.handleGenerate(manager);
|
|
8960
9607
|
case "similar":
|
|
8961
9608
|
return await this.handleSimilar(manager);
|
|
9609
|
+
case "wizard":
|
|
9610
|
+
return await this.handleWizard();
|
|
9611
|
+
case "providers":
|
|
9612
|
+
return this.handleProviders();
|
|
8962
9613
|
default:
|
|
8963
9614
|
console.error(
|
|
8964
9615
|
chalk25.red(`Unknown subcommand: ${this.subcommand}
|
|
8965
9616
|
`)
|
|
8966
9617
|
);
|
|
8967
|
-
console.log("Valid subcommands: search, generate, similar");
|
|
9618
|
+
console.log("Valid subcommands: search, generate, similar, wizard, providers");
|
|
8968
9619
|
return 1;
|
|
8969
9620
|
}
|
|
8970
9621
|
}
|
|
@@ -9031,7 +9682,7 @@ AI Search Results (${results.length} found):
|
|
|
9031
9682
|
}
|
|
9032
9683
|
let codeExamples = [];
|
|
9033
9684
|
if (this.fromCode) {
|
|
9034
|
-
const codePath =
|
|
9685
|
+
const codePath = resolve17(this.fromCode);
|
|
9035
9686
|
try {
|
|
9036
9687
|
const code = await fs2.readFile(codePath, "utf-8");
|
|
9037
9688
|
codeExamples = [code];
|
|
@@ -9083,7 +9734,7 @@ AI Search Results (${results.length} found):
|
|
|
9083
9734
|
console.log(generated.content);
|
|
9084
9735
|
console.log(chalk25.dim("\u2500".repeat(60)));
|
|
9085
9736
|
if (this.output) {
|
|
9086
|
-
const outputPath =
|
|
9737
|
+
const outputPath = resolve17(this.output);
|
|
9087
9738
|
await fs2.writeFile(outputPath, generated.content, "utf-8");
|
|
9088
9739
|
console.log(chalk25.green(`
|
|
9089
9740
|
\u2713 Saved to: ${outputPath}`));
|
|
@@ -9180,28 +9831,63 @@ Skills similar to "${skillName}" (${results.length} found):
|
|
|
9180
9831
|
source: s.source
|
|
9181
9832
|
}));
|
|
9182
9833
|
}
|
|
9834
|
+
async handleWizard() {
|
|
9835
|
+
console.log(chalk25.cyan("\nLaunching Smart Generate Wizard...\n"));
|
|
9836
|
+
console.log(chalk25.dim("For the full wizard experience, use: skillkit generate\n"));
|
|
9837
|
+
const { GenerateCommand: GenerateCommand2 } = await Promise.resolve().then(() => (init_generate(), generate_exports));
|
|
9838
|
+
const generateCmd = new GenerateCommand2();
|
|
9839
|
+
return generateCmd.execute();
|
|
9840
|
+
}
|
|
9841
|
+
handleProviders() {
|
|
9842
|
+
const detected = detectProviders2();
|
|
9843
|
+
const defaultProvider = getDefaultProvider();
|
|
9844
|
+
console.log(chalk25.cyan("\nAvailable LLM Providers:\n"));
|
|
9845
|
+
for (const provider of detected) {
|
|
9846
|
+
const isDefault = provider.provider === defaultProvider;
|
|
9847
|
+
const status = provider.configured ? chalk25.green("\u2713 Configured") : chalk25.dim("\u25CB Not configured");
|
|
9848
|
+
const defaultBadge = isDefault ? chalk25.yellow(" (default)") : "";
|
|
9849
|
+
console.log(` ${provider.displayName}${defaultBadge}`);
|
|
9850
|
+
console.log(` ${status}`);
|
|
9851
|
+
if (provider.envVar) {
|
|
9852
|
+
console.log(` ${chalk25.dim(`Set ${provider.envVar} to configure`)}`);
|
|
9853
|
+
}
|
|
9854
|
+
console.log();
|
|
9855
|
+
}
|
|
9856
|
+
if (defaultProvider === "mock") {
|
|
9857
|
+
console.log(` Mock Provider${chalk25.yellow(" (default)")}`);
|
|
9858
|
+
console.log(` ${chalk25.green("\u2713 Always available")}`);
|
|
9859
|
+
console.log(` ${chalk25.dim("Basic functionality without API keys")}`);
|
|
9860
|
+
console.log();
|
|
9861
|
+
}
|
|
9862
|
+
console.log(chalk25.dim('Use "skillkit generate --provider <name>" to use a specific provider\n'));
|
|
9863
|
+
return 0;
|
|
9864
|
+
}
|
|
9183
9865
|
getAIConfig() {
|
|
9184
|
-
const
|
|
9866
|
+
const provider = process.env.ANTHROPIC_API_KEY ? "anthropic" : process.env.OPENAI_API_KEY ? "openai" : process.env.GOOGLE_AI_KEY || process.env.GEMINI_API_KEY ? "google" : process.env.OPENROUTER_API_KEY ? "openrouter" : process.env.OLLAMA_HOST ? "ollama" : "none";
|
|
9867
|
+
const apiKey = provider === "anthropic" ? process.env.ANTHROPIC_API_KEY : provider === "openai" ? process.env.OPENAI_API_KEY : provider === "google" ? process.env.GOOGLE_AI_KEY || process.env.GEMINI_API_KEY : provider === "openrouter" ? process.env.OPENROUTER_API_KEY : void 0;
|
|
9185
9868
|
return {
|
|
9186
|
-
provider
|
|
9869
|
+
provider,
|
|
9187
9870
|
apiKey,
|
|
9188
|
-
model:
|
|
9871
|
+
model: provider === "anthropic" ? "claude-sonnet-4-20250514" : void 0,
|
|
9189
9872
|
maxTokens: 4096,
|
|
9190
9873
|
temperature: 0.7
|
|
9191
9874
|
};
|
|
9192
9875
|
}
|
|
9193
9876
|
};
|
|
9194
9877
|
|
|
9878
|
+
// src/commands/index.ts
|
|
9879
|
+
init_generate();
|
|
9880
|
+
|
|
9195
9881
|
// src/commands/audit.ts
|
|
9196
|
-
import { Command as
|
|
9197
|
-
import { resolve as
|
|
9882
|
+
import { Command as Command37, Option as Option36 } from "clipanion";
|
|
9883
|
+
import { resolve as resolve18 } from "path";
|
|
9198
9884
|
import { promises as fs3 } from "fs";
|
|
9199
9885
|
import path2 from "path";
|
|
9200
9886
|
import chalk26 from "chalk";
|
|
9201
9887
|
import { AuditLogger } from "@skillkit/core";
|
|
9202
|
-
var AuditCommand = class extends
|
|
9888
|
+
var AuditCommand = class extends Command37 {
|
|
9203
9889
|
static paths = [["audit"]];
|
|
9204
|
-
static usage =
|
|
9890
|
+
static usage = Command37.Usage({
|
|
9205
9891
|
description: "View and manage audit logs",
|
|
9206
9892
|
details: `
|
|
9207
9893
|
The audit command provides access to the audit log system.
|
|
@@ -9221,52 +9907,52 @@ var AuditCommand = class extends Command36 {
|
|
|
9221
9907
|
["Clear logs older than 30 days", "$0 audit clear --days 30"]
|
|
9222
9908
|
]
|
|
9223
9909
|
});
|
|
9224
|
-
subcommand =
|
|
9910
|
+
subcommand = Option36.String({ required: true });
|
|
9225
9911
|
// Query options
|
|
9226
|
-
type =
|
|
9912
|
+
type = Option36.Array("--type,-t", {
|
|
9227
9913
|
description: "Filter by event type"
|
|
9228
9914
|
});
|
|
9229
|
-
user =
|
|
9915
|
+
user = Option36.String("--user,-u", {
|
|
9230
9916
|
description: "Filter by user"
|
|
9231
9917
|
});
|
|
9232
|
-
resource =
|
|
9918
|
+
resource = Option36.String("--resource,-r", {
|
|
9233
9919
|
description: "Filter by resource"
|
|
9234
9920
|
});
|
|
9235
|
-
success =
|
|
9921
|
+
success = Option36.Boolean("--success", {
|
|
9236
9922
|
description: "Show only successful operations"
|
|
9237
9923
|
});
|
|
9238
|
-
failed =
|
|
9924
|
+
failed = Option36.Boolean("--failed", {
|
|
9239
9925
|
description: "Show only failed operations"
|
|
9240
9926
|
});
|
|
9241
|
-
since =
|
|
9927
|
+
since = Option36.String("--since", {
|
|
9242
9928
|
description: "Show events since date (ISO 8601)"
|
|
9243
9929
|
});
|
|
9244
|
-
until =
|
|
9930
|
+
until = Option36.String("--until", {
|
|
9245
9931
|
description: "Show events until date (ISO 8601)"
|
|
9246
9932
|
});
|
|
9247
|
-
limit =
|
|
9933
|
+
limit = Option36.String("--limit,-l", {
|
|
9248
9934
|
description: "Maximum number of entries"
|
|
9249
9935
|
});
|
|
9250
9936
|
// Export options
|
|
9251
|
-
format =
|
|
9937
|
+
format = Option36.String("--format,-f", {
|
|
9252
9938
|
description: "Export format (json, csv, text)"
|
|
9253
9939
|
});
|
|
9254
|
-
output =
|
|
9940
|
+
output = Option36.String("--output,-o", {
|
|
9255
9941
|
description: "Output file path"
|
|
9256
9942
|
});
|
|
9257
9943
|
// Clear options
|
|
9258
|
-
days =
|
|
9944
|
+
days = Option36.String("--days", {
|
|
9259
9945
|
description: "Clear entries older than N days"
|
|
9260
9946
|
});
|
|
9261
9947
|
// Common options
|
|
9262
|
-
json =
|
|
9948
|
+
json = Option36.Boolean("--json,-j", false, {
|
|
9263
9949
|
description: "Output in JSON format"
|
|
9264
9950
|
});
|
|
9265
|
-
projectPath =
|
|
9951
|
+
projectPath = Option36.String("--path,-p", {
|
|
9266
9952
|
description: "Project path (default: current directory)"
|
|
9267
9953
|
});
|
|
9268
9954
|
async execute() {
|
|
9269
|
-
const targetPath =
|
|
9955
|
+
const targetPath = resolve18(this.projectPath || process.cwd());
|
|
9270
9956
|
const logDir = path2.join(targetPath, ".skillkit");
|
|
9271
9957
|
const logger = new AuditLogger(logDir);
|
|
9272
9958
|
try {
|
|
@@ -9334,7 +10020,7 @@ Audit Log (${events.length} entries):
|
|
|
9334
10020
|
const query = this.buildQuery();
|
|
9335
10021
|
const content = await logger.export({ format, query });
|
|
9336
10022
|
if (this.output) {
|
|
9337
|
-
const outputPath =
|
|
10023
|
+
const outputPath = resolve18(this.output);
|
|
9338
10024
|
await fs3.writeFile(outputPath, content, "utf-8");
|
|
9339
10025
|
console.log(chalk26.green(`\u2713 Exported audit log to: ${outputPath}`));
|
|
9340
10026
|
} else {
|
|
@@ -9432,10 +10118,10 @@ Recent Errors (${stats.recentErrors.length}):`));
|
|
|
9432
10118
|
};
|
|
9433
10119
|
|
|
9434
10120
|
// src/commands/publish.ts
|
|
9435
|
-
import { existsSync as
|
|
9436
|
-
import { join as join16, basename as basename4, dirname as dirname6, resolve as
|
|
10121
|
+
import { existsSync as existsSync18, readFileSync as readFileSync9, mkdirSync as mkdirSync9, writeFileSync as writeFileSync9, readdirSync as readdirSync3, statSync as statSync3 } from "fs";
|
|
10122
|
+
import { join as join16, basename as basename4, dirname as dirname6, resolve as resolve19 } from "path";
|
|
9437
10123
|
import chalk27 from "chalk";
|
|
9438
|
-
import { Command as
|
|
10124
|
+
import { Command as Command38, Option as Option37 } from "clipanion";
|
|
9439
10125
|
import { generateWellKnownIndex } from "@skillkit/core";
|
|
9440
10126
|
function sanitizeSkillName(name) {
|
|
9441
10127
|
if (!name || typeof name !== "string") return null;
|
|
@@ -9448,9 +10134,9 @@ function sanitizeSkillName(name) {
|
|
|
9448
10134
|
}
|
|
9449
10135
|
return name;
|
|
9450
10136
|
}
|
|
9451
|
-
var PublishCommand = class extends
|
|
10137
|
+
var PublishCommand = class extends Command38 {
|
|
9452
10138
|
static paths = [["publish"]];
|
|
9453
|
-
static usage =
|
|
10139
|
+
static usage = Command38.Usage({
|
|
9454
10140
|
description: "Generate well-known skills structure for hosting",
|
|
9455
10141
|
details: `
|
|
9456
10142
|
This command generates the RFC 8615 well-known URI structure for hosting skills.
|
|
@@ -9468,11 +10154,11 @@ var PublishCommand = class extends Command37 {
|
|
|
9468
10154
|
["Preview without writing", "$0 publish --dry-run"]
|
|
9469
10155
|
]
|
|
9470
10156
|
});
|
|
9471
|
-
skillPath =
|
|
9472
|
-
output =
|
|
10157
|
+
skillPath = Option37.String({ required: false, name: "path" });
|
|
10158
|
+
output = Option37.String("--output,-o", {
|
|
9473
10159
|
description: "Output directory for well-known structure (default: current directory)"
|
|
9474
10160
|
});
|
|
9475
|
-
dryRun =
|
|
10161
|
+
dryRun = Option37.Boolean("--dry-run,-n", false, {
|
|
9476
10162
|
description: "Show what would be generated without writing files"
|
|
9477
10163
|
});
|
|
9478
10164
|
async execute() {
|
|
@@ -9526,27 +10212,27 @@ var PublishCommand = class extends Command37 {
|
|
|
9526
10212
|
return 0;
|
|
9527
10213
|
}
|
|
9528
10214
|
const wellKnownDir = join16(outputDir, ".well-known", "skills");
|
|
9529
|
-
|
|
10215
|
+
mkdirSync9(wellKnownDir, { recursive: true });
|
|
9530
10216
|
for (const skill of validSkills) {
|
|
9531
10217
|
const skillDir = join16(wellKnownDir, skill.safeName);
|
|
9532
|
-
const resolvedSkillDir =
|
|
9533
|
-
const resolvedWellKnownDir =
|
|
10218
|
+
const resolvedSkillDir = resolve19(skillDir);
|
|
10219
|
+
const resolvedWellKnownDir = resolve19(wellKnownDir);
|
|
9534
10220
|
if (!resolvedSkillDir.startsWith(resolvedWellKnownDir)) {
|
|
9535
10221
|
console.log(chalk27.yellow(` Skipping "${skill.name}" (path traversal detected)`));
|
|
9536
10222
|
continue;
|
|
9537
10223
|
}
|
|
9538
|
-
|
|
10224
|
+
mkdirSync9(skillDir, { recursive: true });
|
|
9539
10225
|
const files = this.getSkillFiles(skill.path);
|
|
9540
10226
|
for (const file of files) {
|
|
9541
10227
|
const safeFile = basename4(file);
|
|
9542
10228
|
const sourcePath = join16(skill.path, file);
|
|
9543
10229
|
const destPath = join16(skillDir, safeFile);
|
|
9544
10230
|
const content = readFileSync9(sourcePath, "utf-8");
|
|
9545
|
-
|
|
10231
|
+
writeFileSync9(destPath, content);
|
|
9546
10232
|
}
|
|
9547
10233
|
}
|
|
9548
10234
|
const index = generateWellKnownIndex(wellKnownSkills);
|
|
9549
|
-
|
|
10235
|
+
writeFileSync9(join16(wellKnownDir, "index.json"), JSON.stringify(index, null, 2));
|
|
9550
10236
|
console.log(chalk27.green("Generated well-known structure:\n"));
|
|
9551
10237
|
console.log(chalk27.dim(` ${wellKnownDir}/index.json`));
|
|
9552
10238
|
for (const skill of wellKnownSkills) {
|
|
@@ -9562,7 +10248,7 @@ var PublishCommand = class extends Command37 {
|
|
|
9562
10248
|
discoverSkills(basePath) {
|
|
9563
10249
|
const skills = [];
|
|
9564
10250
|
const skillMdPath = join16(basePath, "SKILL.md");
|
|
9565
|
-
if (
|
|
10251
|
+
if (existsSync18(skillMdPath)) {
|
|
9566
10252
|
const content = readFileSync9(skillMdPath, "utf-8");
|
|
9567
10253
|
const frontmatter = this.parseFrontmatter(content);
|
|
9568
10254
|
skills.push({
|
|
@@ -9578,13 +10264,13 @@ var PublishCommand = class extends Command37 {
|
|
|
9578
10264
|
join16(basePath, ".claude", "skills")
|
|
9579
10265
|
];
|
|
9580
10266
|
for (const searchDir of searchDirs) {
|
|
9581
|
-
if (!
|
|
10267
|
+
if (!existsSync18(searchDir)) continue;
|
|
9582
10268
|
const entries = readdirSync3(searchDir);
|
|
9583
10269
|
for (const entry of entries) {
|
|
9584
10270
|
const entryPath = join16(searchDir, entry);
|
|
9585
10271
|
if (!statSync3(entryPath).isDirectory()) continue;
|
|
9586
10272
|
const entrySkillMd = join16(entryPath, "SKILL.md");
|
|
9587
|
-
if (
|
|
10273
|
+
if (existsSync18(entrySkillMd)) {
|
|
9588
10274
|
const content = readFileSync9(entrySkillMd, "utf-8");
|
|
9589
10275
|
const frontmatter = this.parseFrontmatter(content);
|
|
9590
10276
|
skills.push({
|
|
@@ -9656,20 +10342,20 @@ var PublishCommand = class extends Command37 {
|
|
|
9656
10342
|
return frontmatter;
|
|
9657
10343
|
}
|
|
9658
10344
|
};
|
|
9659
|
-
var PublishSubmitCommand = class extends
|
|
10345
|
+
var PublishSubmitCommand = class extends Command38 {
|
|
9660
10346
|
static paths = [["publish", "submit"]];
|
|
9661
|
-
static usage =
|
|
10347
|
+
static usage = Command38.Usage({
|
|
9662
10348
|
description: "Submit skill to SkillKit marketplace (requires review)",
|
|
9663
10349
|
examples: [
|
|
9664
10350
|
["Submit skill from current directory", "$0 publish submit"],
|
|
9665
10351
|
["Submit with custom name", "$0 publish submit --name my-skill"]
|
|
9666
10352
|
]
|
|
9667
10353
|
});
|
|
9668
|
-
skillPath =
|
|
9669
|
-
name =
|
|
10354
|
+
skillPath = Option37.String({ required: false, name: "path" });
|
|
10355
|
+
name = Option37.String("--name,-n", {
|
|
9670
10356
|
description: "Custom skill name"
|
|
9671
10357
|
});
|
|
9672
|
-
dryRun =
|
|
10358
|
+
dryRun = Option37.Boolean("--dry-run", false, {
|
|
9673
10359
|
description: "Show what would be submitted"
|
|
9674
10360
|
});
|
|
9675
10361
|
async execute() {
|
|
@@ -9734,11 +10420,11 @@ var PublishSubmitCommand = class extends Command37 {
|
|
|
9734
10420
|
return 0;
|
|
9735
10421
|
}
|
|
9736
10422
|
findSkillMd(basePath) {
|
|
9737
|
-
if (basePath.endsWith("SKILL.md") &&
|
|
10423
|
+
if (basePath.endsWith("SKILL.md") && existsSync18(basePath)) {
|
|
9738
10424
|
return basePath;
|
|
9739
10425
|
}
|
|
9740
10426
|
const direct = join16(basePath, "SKILL.md");
|
|
9741
|
-
if (
|
|
10427
|
+
if (existsSync18(direct)) {
|
|
9742
10428
|
return direct;
|
|
9743
10429
|
}
|
|
9744
10430
|
const locations = [
|
|
@@ -9746,7 +10432,7 @@ var PublishSubmitCommand = class extends Command37 {
|
|
|
9746
10432
|
join16(basePath, ".claude", "skills", "SKILL.md")
|
|
9747
10433
|
];
|
|
9748
10434
|
for (const loc of locations) {
|
|
9749
|
-
if (
|
|
10435
|
+
if (existsSync18(loc)) {
|
|
9750
10436
|
return loc;
|
|
9751
10437
|
}
|
|
9752
10438
|
}
|
|
@@ -9831,8 +10517,8 @@ Submitted via \`skillkit publish submit\``;
|
|
|
9831
10517
|
|
|
9832
10518
|
// src/commands/agent.ts
|
|
9833
10519
|
import chalk28 from "chalk";
|
|
9834
|
-
import { Command as
|
|
9835
|
-
import { existsSync as
|
|
10520
|
+
import { Command as Command39, Option as Option38 } from "clipanion";
|
|
10521
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync10, writeFileSync as writeFileSync10 } from "fs";
|
|
9836
10522
|
import { join as join17, basename as basename5 } from "path";
|
|
9837
10523
|
import { homedir as homedir3 } from "os";
|
|
9838
10524
|
import {
|
|
@@ -9854,9 +10540,9 @@ import {
|
|
|
9854
10540
|
installBundledAgent,
|
|
9855
10541
|
isAgentInstalled
|
|
9856
10542
|
} from "@skillkit/resources";
|
|
9857
|
-
var AgentCommand = class extends
|
|
10543
|
+
var AgentCommand = class extends Command39 {
|
|
9858
10544
|
static paths = [["agent"]];
|
|
9859
|
-
static usage =
|
|
10545
|
+
static usage = Command39.Usage({
|
|
9860
10546
|
description: "Manage custom AI sub-agents",
|
|
9861
10547
|
details: `
|
|
9862
10548
|
This command manages custom AI sub-agents that can be used with
|
|
@@ -9897,9 +10583,9 @@ var AgentCommand = class extends Command38 {
|
|
|
9897
10583
|
return 0;
|
|
9898
10584
|
}
|
|
9899
10585
|
};
|
|
9900
|
-
var AgentListCommand = class extends
|
|
10586
|
+
var AgentListCommand = class extends Command39 {
|
|
9901
10587
|
static paths = [["agent", "list"], ["agent", "ls"]];
|
|
9902
|
-
static usage =
|
|
10588
|
+
static usage = Command39.Usage({
|
|
9903
10589
|
description: "List all installed agents",
|
|
9904
10590
|
examples: [
|
|
9905
10591
|
["List all agents", "$0 agent list"],
|
|
@@ -9907,13 +10593,13 @@ var AgentListCommand = class extends Command38 {
|
|
|
9907
10593
|
["Show only project agents", "$0 agent list --project"]
|
|
9908
10594
|
]
|
|
9909
10595
|
});
|
|
9910
|
-
json =
|
|
10596
|
+
json = Option38.Boolean("--json,-j", false, {
|
|
9911
10597
|
description: "Output as JSON"
|
|
9912
10598
|
});
|
|
9913
|
-
project =
|
|
10599
|
+
project = Option38.Boolean("--project,-p", false, {
|
|
9914
10600
|
description: "Show only project agents"
|
|
9915
10601
|
});
|
|
9916
|
-
global =
|
|
10602
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
9917
10603
|
description: "Show only global agents"
|
|
9918
10604
|
});
|
|
9919
10605
|
async execute() {
|
|
@@ -9971,15 +10657,15 @@ var AgentListCommand = class extends Command38 {
|
|
|
9971
10657
|
return 0;
|
|
9972
10658
|
}
|
|
9973
10659
|
};
|
|
9974
|
-
var AgentShowCommand = class extends
|
|
10660
|
+
var AgentShowCommand = class extends Command39 {
|
|
9975
10661
|
static paths = [["agent", "show"], ["agent", "info"]];
|
|
9976
|
-
static usage =
|
|
10662
|
+
static usage = Command39.Usage({
|
|
9977
10663
|
description: "Show details for a specific agent",
|
|
9978
10664
|
examples: [
|
|
9979
10665
|
["Show agent details", "$0 agent show architect"]
|
|
9980
10666
|
]
|
|
9981
10667
|
});
|
|
9982
|
-
name =
|
|
10668
|
+
name = Option38.String({ required: true });
|
|
9983
10669
|
async execute() {
|
|
9984
10670
|
const searchDirs = [process.cwd()];
|
|
9985
10671
|
const agent = findAgent(this.name, searchDirs);
|
|
@@ -10028,9 +10714,9 @@ var AgentShowCommand = class extends Command38 {
|
|
|
10028
10714
|
return 0;
|
|
10029
10715
|
}
|
|
10030
10716
|
};
|
|
10031
|
-
var AgentCreateCommand = class extends
|
|
10717
|
+
var AgentCreateCommand = class extends Command39 {
|
|
10032
10718
|
static paths = [["agent", "create"], ["agent", "new"]];
|
|
10033
|
-
static usage =
|
|
10719
|
+
static usage = Command39.Usage({
|
|
10034
10720
|
description: "Create a new agent",
|
|
10035
10721
|
examples: [
|
|
10036
10722
|
["Create an agent", "$0 agent create security-reviewer"],
|
|
@@ -10038,14 +10724,14 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10038
10724
|
["Create globally", "$0 agent create my-agent --global"]
|
|
10039
10725
|
]
|
|
10040
10726
|
});
|
|
10041
|
-
name =
|
|
10042
|
-
model =
|
|
10727
|
+
name = Option38.String({ required: true });
|
|
10728
|
+
model = Option38.String("--model,-m", {
|
|
10043
10729
|
description: "Model to use (opus, sonnet, haiku)"
|
|
10044
10730
|
});
|
|
10045
|
-
description =
|
|
10731
|
+
description = Option38.String("--description,-d", {
|
|
10046
10732
|
description: "Agent description"
|
|
10047
10733
|
});
|
|
10048
|
-
global =
|
|
10734
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10049
10735
|
description: "Create in global agents directory"
|
|
10050
10736
|
});
|
|
10051
10737
|
async execute() {
|
|
@@ -10061,17 +10747,17 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10061
10747
|
} else {
|
|
10062
10748
|
targetDir = join17(process.cwd(), ".claude", "agents");
|
|
10063
10749
|
}
|
|
10064
|
-
if (!
|
|
10065
|
-
|
|
10750
|
+
if (!existsSync19(targetDir)) {
|
|
10751
|
+
mkdirSync10(targetDir, { recursive: true });
|
|
10066
10752
|
}
|
|
10067
10753
|
const agentPath = join17(targetDir, `${this.name}.md`);
|
|
10068
|
-
if (
|
|
10754
|
+
if (existsSync19(agentPath)) {
|
|
10069
10755
|
console.log(chalk28.red(`Agent already exists: ${agentPath}`));
|
|
10070
10756
|
return 1;
|
|
10071
10757
|
}
|
|
10072
10758
|
const description = this.description || `${this.name} agent`;
|
|
10073
10759
|
const content = generateAgentTemplate(this.name, description, this.model);
|
|
10074
|
-
|
|
10760
|
+
writeFileSync10(agentPath, content);
|
|
10075
10761
|
console.log(chalk28.green(`Created agent: ${agentPath}`));
|
|
10076
10762
|
console.log();
|
|
10077
10763
|
console.log(chalk28.dim("Edit the file to customize the agent system prompt."));
|
|
@@ -10079,9 +10765,9 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10079
10765
|
return 0;
|
|
10080
10766
|
}
|
|
10081
10767
|
};
|
|
10082
|
-
var AgentTranslateCommand = class extends
|
|
10768
|
+
var AgentTranslateCommand = class extends Command39 {
|
|
10083
10769
|
static paths = [["agent", "translate"]];
|
|
10084
|
-
static usage =
|
|
10770
|
+
static usage = Command39.Usage({
|
|
10085
10771
|
description: "Translate agents between AI coding agent formats",
|
|
10086
10772
|
details: `
|
|
10087
10773
|
Translates agent definitions between different AI coding agent formats.
|
|
@@ -10098,24 +10784,24 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10098
10784
|
["Dry run", "$0 agent translate --to cursor --dry-run"]
|
|
10099
10785
|
]
|
|
10100
10786
|
});
|
|
10101
|
-
name =
|
|
10102
|
-
to =
|
|
10787
|
+
name = Option38.String({ required: false });
|
|
10788
|
+
to = Option38.String("--to,-t", {
|
|
10103
10789
|
description: "Target AI agent (claude-code, cursor, codex, etc.)",
|
|
10104
10790
|
required: true
|
|
10105
10791
|
});
|
|
10106
|
-
source =
|
|
10792
|
+
source = Option38.String("--source,-s", {
|
|
10107
10793
|
description: "Source directory or file to translate from"
|
|
10108
10794
|
});
|
|
10109
|
-
output =
|
|
10795
|
+
output = Option38.String("--output,-o", {
|
|
10110
10796
|
description: "Output directory"
|
|
10111
10797
|
});
|
|
10112
|
-
dryRun =
|
|
10798
|
+
dryRun = Option38.Boolean("--dry-run,-n", false, {
|
|
10113
10799
|
description: "Show what would be done without writing files"
|
|
10114
10800
|
});
|
|
10115
|
-
all =
|
|
10801
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10116
10802
|
description: "Translate all agents"
|
|
10117
10803
|
});
|
|
10118
|
-
recursive =
|
|
10804
|
+
recursive = Option38.Boolean("--recursive,-r", false, {
|
|
10119
10805
|
description: "Recursively scan directories for agents"
|
|
10120
10806
|
});
|
|
10121
10807
|
async execute() {
|
|
@@ -10124,7 +10810,7 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10124
10810
|
let agents;
|
|
10125
10811
|
if (this.source) {
|
|
10126
10812
|
const sourcePath = this.source.startsWith("/") ? this.source : join17(process.cwd(), this.source);
|
|
10127
|
-
if (!
|
|
10813
|
+
if (!existsSync19(sourcePath)) {
|
|
10128
10814
|
console.log(chalk28.red(`Source path not found: ${sourcePath}`));
|
|
10129
10815
|
return 1;
|
|
10130
10816
|
}
|
|
@@ -10179,10 +10865,10 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10179
10865
|
}
|
|
10180
10866
|
}
|
|
10181
10867
|
} else {
|
|
10182
|
-
if (!
|
|
10183
|
-
|
|
10868
|
+
if (!existsSync19(outputDir)) {
|
|
10869
|
+
mkdirSync10(outputDir, { recursive: true });
|
|
10184
10870
|
}
|
|
10185
|
-
|
|
10871
|
+
writeFileSync10(outputPath, result.content);
|
|
10186
10872
|
console.log(chalk28.green(`\u2713 ${agent.name} \u2192 ${outputPath}`));
|
|
10187
10873
|
}
|
|
10188
10874
|
successCount++;
|
|
@@ -10200,16 +10886,16 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10200
10886
|
return errorCount > 0 ? 1 : 0;
|
|
10201
10887
|
}
|
|
10202
10888
|
};
|
|
10203
|
-
var AgentSyncCommand = class extends
|
|
10889
|
+
var AgentSyncCommand = class extends Command39 {
|
|
10204
10890
|
static paths = [["agent", "sync"]];
|
|
10205
|
-
static usage =
|
|
10891
|
+
static usage = Command39.Usage({
|
|
10206
10892
|
description: "Sync agents to target AI coding agent",
|
|
10207
10893
|
examples: [
|
|
10208
10894
|
["Sync to Claude Code", "$0 agent sync --agent claude-code"],
|
|
10209
10895
|
["Sync to multiple agents", "$0 agent sync --agent claude-code,cursor"]
|
|
10210
10896
|
]
|
|
10211
10897
|
});
|
|
10212
|
-
agent =
|
|
10898
|
+
agent = Option38.String("--agent,-a", {
|
|
10213
10899
|
description: "Target AI agent(s) (comma-separated)"
|
|
10214
10900
|
});
|
|
10215
10901
|
async execute() {
|
|
@@ -10225,14 +10911,14 @@ var AgentSyncCommand = class extends Command38 {
|
|
|
10225
10911
|
for (const targetAgent of targetAgents) {
|
|
10226
10912
|
const outputDir = getAgentTargetDirectory(process.cwd(), targetAgent);
|
|
10227
10913
|
console.log(chalk28.blue(`\u2192 ${targetAgent} (${outputDir})`));
|
|
10228
|
-
if (!
|
|
10229
|
-
|
|
10914
|
+
if (!existsSync19(outputDir)) {
|
|
10915
|
+
mkdirSync10(outputDir, { recursive: true });
|
|
10230
10916
|
}
|
|
10231
10917
|
for (const agent of agents) {
|
|
10232
10918
|
const result = translateAgent(agent, targetAgent);
|
|
10233
10919
|
if (result.success) {
|
|
10234
10920
|
const outputPath = join17(outputDir, result.filename);
|
|
10235
|
-
|
|
10921
|
+
writeFileSync10(outputPath, result.content);
|
|
10236
10922
|
console.log(chalk28.green(` \u2713 ${agent.name}`));
|
|
10237
10923
|
} else {
|
|
10238
10924
|
console.log(chalk28.red(` \u2717 ${agent.name}`));
|
|
@@ -10244,17 +10930,17 @@ var AgentSyncCommand = class extends Command38 {
|
|
|
10244
10930
|
return 0;
|
|
10245
10931
|
}
|
|
10246
10932
|
};
|
|
10247
|
-
var AgentValidateCommand = class extends
|
|
10933
|
+
var AgentValidateCommand = class extends Command39 {
|
|
10248
10934
|
static paths = [["agent", "validate"]];
|
|
10249
|
-
static usage =
|
|
10935
|
+
static usage = Command39.Usage({
|
|
10250
10936
|
description: "Validate agent definitions",
|
|
10251
10937
|
examples: [
|
|
10252
10938
|
["Validate specific agent", "$0 agent validate ./my-agent.md"],
|
|
10253
10939
|
["Validate all agents", "$0 agent validate --all"]
|
|
10254
10940
|
]
|
|
10255
10941
|
});
|
|
10256
|
-
agentPath =
|
|
10257
|
-
all =
|
|
10942
|
+
agentPath = Option38.String({ required: false });
|
|
10943
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10258
10944
|
description: "Validate all discovered agents"
|
|
10259
10945
|
});
|
|
10260
10946
|
async execute() {
|
|
@@ -10347,9 +11033,9 @@ function generateAgentTemplate(name, description, model) {
|
|
|
10347
11033
|
function formatAgentName(name) {
|
|
10348
11034
|
return name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
10349
11035
|
}
|
|
10350
|
-
var AgentInstallCommand = class extends
|
|
11036
|
+
var AgentInstallCommand = class extends Command39 {
|
|
10351
11037
|
static paths = [["agent", "install"]];
|
|
10352
|
-
static usage =
|
|
11038
|
+
static usage = Command39.Usage({
|
|
10353
11039
|
description: "Install a bundled agent template",
|
|
10354
11040
|
details: `
|
|
10355
11041
|
Installs a bundled agent template from @skillkit/resources.
|
|
@@ -10364,14 +11050,14 @@ var AgentInstallCommand = class extends Command38 {
|
|
|
10364
11050
|
["Install all bundled agents", "$0 agent install --all"]
|
|
10365
11051
|
]
|
|
10366
11052
|
});
|
|
10367
|
-
name =
|
|
10368
|
-
global =
|
|
11053
|
+
name = Option38.String({ required: false });
|
|
11054
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10369
11055
|
description: "Install to global agents directory"
|
|
10370
11056
|
});
|
|
10371
|
-
force =
|
|
11057
|
+
force = Option38.Boolean("--force,-f", false, {
|
|
10372
11058
|
description: "Overwrite if agent already exists"
|
|
10373
11059
|
});
|
|
10374
|
-
all =
|
|
11060
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10375
11061
|
description: "Install all bundled agents"
|
|
10376
11062
|
});
|
|
10377
11063
|
async execute() {
|
|
@@ -10435,9 +11121,9 @@ var AgentInstallCommand = class extends Command38 {
|
|
|
10435
11121
|
return errorCount > 0 ? 1 : 0;
|
|
10436
11122
|
}
|
|
10437
11123
|
};
|
|
10438
|
-
var AgentAvailableCommand = class extends
|
|
11124
|
+
var AgentAvailableCommand = class extends Command39 {
|
|
10439
11125
|
static paths = [["agent", "available"], ["agent", "bundled"]];
|
|
10440
|
-
static usage =
|
|
11126
|
+
static usage = Command39.Usage({
|
|
10441
11127
|
description: "List bundled agents available for installation",
|
|
10442
11128
|
examples: [
|
|
10443
11129
|
["List available agents", "$0 agent available"],
|
|
@@ -10445,13 +11131,13 @@ var AgentAvailableCommand = class extends Command38 {
|
|
|
10445
11131
|
["Filter by category", "$0 agent available --category testing"]
|
|
10446
11132
|
]
|
|
10447
11133
|
});
|
|
10448
|
-
json =
|
|
11134
|
+
json = Option38.Boolean("--json,-j", false, {
|
|
10449
11135
|
description: "Output as JSON"
|
|
10450
11136
|
});
|
|
10451
|
-
category =
|
|
11137
|
+
category = Option38.String("--category,-c", {
|
|
10452
11138
|
description: "Filter by category (planning, development, testing, review, documentation, security, refactoring)"
|
|
10453
11139
|
});
|
|
10454
|
-
installed =
|
|
11140
|
+
installed = Option38.Boolean("--installed,-i", false, {
|
|
10455
11141
|
description: "Show only installed bundled agents"
|
|
10456
11142
|
});
|
|
10457
11143
|
async execute() {
|
|
@@ -10506,9 +11192,9 @@ var AgentAvailableCommand = class extends Command38 {
|
|
|
10506
11192
|
return 0;
|
|
10507
11193
|
}
|
|
10508
11194
|
};
|
|
10509
|
-
var AgentFromSkillCommand = class extends
|
|
11195
|
+
var AgentFromSkillCommand = class extends Command39 {
|
|
10510
11196
|
static paths = [["agent", "from-skill"]];
|
|
10511
|
-
static usage =
|
|
11197
|
+
static usage = Command39.Usage({
|
|
10512
11198
|
description: "Convert a skill into a Claude Code subagent",
|
|
10513
11199
|
details: `
|
|
10514
11200
|
Converts a SkillKit skill into a Claude Code native subagent format.
|
|
@@ -10525,23 +11211,23 @@ var AgentFromSkillCommand = class extends Command38 {
|
|
|
10525
11211
|
["Preview without writing", "$0 agent from-skill code-simplifier --dry-run"]
|
|
10526
11212
|
]
|
|
10527
11213
|
});
|
|
10528
|
-
skillName =
|
|
10529
|
-
inline =
|
|
11214
|
+
skillName = Option38.String({ required: true });
|
|
11215
|
+
inline = Option38.Boolean("--inline,-i", false, {
|
|
10530
11216
|
description: "Embed full skill content in system prompt"
|
|
10531
11217
|
});
|
|
10532
|
-
model =
|
|
11218
|
+
model = Option38.String("--model,-m", {
|
|
10533
11219
|
description: "Model to use (sonnet, opus, haiku, inherit)"
|
|
10534
11220
|
});
|
|
10535
|
-
permission =
|
|
11221
|
+
permission = Option38.String("--permission,-p", {
|
|
10536
11222
|
description: "Permission mode (default, plan, auto-edit, full-auto, bypassPermissions)"
|
|
10537
11223
|
});
|
|
10538
|
-
global =
|
|
11224
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10539
11225
|
description: "Create in ~/.claude/agents/ instead of .claude/agents/"
|
|
10540
11226
|
});
|
|
10541
|
-
output =
|
|
11227
|
+
output = Option38.String("--output,-o", {
|
|
10542
11228
|
description: "Custom output filename (without .md)"
|
|
10543
11229
|
});
|
|
10544
|
-
dryRun =
|
|
11230
|
+
dryRun = Option38.Boolean("--dry-run,-n", false, {
|
|
10545
11231
|
description: "Preview without writing files"
|
|
10546
11232
|
});
|
|
10547
11233
|
async execute() {
|
|
@@ -10613,13 +11299,13 @@ var AgentFromSkillCommand = class extends Command38 {
|
|
|
10613
11299
|
console.log(chalk28.dim("\u2500".repeat(50)));
|
|
10614
11300
|
return 0;
|
|
10615
11301
|
}
|
|
10616
|
-
if (!
|
|
10617
|
-
|
|
11302
|
+
if (!existsSync19(targetDir)) {
|
|
11303
|
+
mkdirSync10(targetDir, { recursive: true });
|
|
10618
11304
|
}
|
|
10619
|
-
if (
|
|
11305
|
+
if (existsSync19(outputPath)) {
|
|
10620
11306
|
console.log(chalk28.yellow(`Overwriting existing file: ${outputPath}`));
|
|
10621
11307
|
}
|
|
10622
|
-
|
|
11308
|
+
writeFileSync10(outputPath, content);
|
|
10623
11309
|
console.log(chalk28.green(`Created subagent: ${outputPath}`));
|
|
10624
11310
|
console.log();
|
|
10625
11311
|
console.log(chalk28.dim(`Invoke with: @${skill.name}`));
|
|
@@ -10652,13 +11338,13 @@ function sanitizeFilename(input) {
|
|
|
10652
11338
|
// src/commands/check.ts
|
|
10653
11339
|
init_helpers();
|
|
10654
11340
|
init_onboarding();
|
|
10655
|
-
import { existsSync as
|
|
11341
|
+
import { existsSync as existsSync20 } from "fs";
|
|
10656
11342
|
import { join as join18 } from "path";
|
|
10657
|
-
import { Command as
|
|
11343
|
+
import { Command as Command40, Option as Option39 } from "clipanion";
|
|
10658
11344
|
import { findAllSkills as findAllSkills7, findSkill as findSkill5, detectProvider as detectProvider3, isLocalPath as isLocalPath3 } from "@skillkit/core";
|
|
10659
|
-
var CheckCommand = class extends
|
|
11345
|
+
var CheckCommand = class extends Command40 {
|
|
10660
11346
|
static paths = [["check"]];
|
|
10661
|
-
static usage =
|
|
11347
|
+
static usage = Command40.Usage({
|
|
10662
11348
|
description: "Check for available skill updates (dry-run)",
|
|
10663
11349
|
details: `
|
|
10664
11350
|
Checks if installed skills have updates available from their sources.
|
|
@@ -10670,11 +11356,11 @@ var CheckCommand = class extends Command39 {
|
|
|
10670
11356
|
["Show detailed output", "$0 check --verbose"]
|
|
10671
11357
|
]
|
|
10672
11358
|
});
|
|
10673
|
-
skills =
|
|
10674
|
-
verbose =
|
|
11359
|
+
skills = Option39.Rest();
|
|
11360
|
+
verbose = Option39.Boolean("--verbose,-v", false, {
|
|
10675
11361
|
description: "Show detailed information"
|
|
10676
11362
|
});
|
|
10677
|
-
quiet =
|
|
11363
|
+
quiet = Option39.Boolean("--quiet,-q", false, {
|
|
10678
11364
|
description: "Minimal output"
|
|
10679
11365
|
});
|
|
10680
11366
|
async execute() {
|
|
@@ -10723,7 +11409,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10723
11409
|
try {
|
|
10724
11410
|
if (isLocalPath3(metadata.source)) {
|
|
10725
11411
|
const localPath = metadata.subpath ? join18(metadata.source, metadata.subpath) : metadata.source;
|
|
10726
|
-
if (!
|
|
11412
|
+
if (!existsSync20(localPath)) {
|
|
10727
11413
|
results.push({
|
|
10728
11414
|
name: skill.name,
|
|
10729
11415
|
hasUpdate: false,
|
|
@@ -10734,7 +11420,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10734
11420
|
}
|
|
10735
11421
|
const sourceSkillMd = join18(localPath, "SKILL.md");
|
|
10736
11422
|
const installedSkillMd = join18(skill.path, "SKILL.md");
|
|
10737
|
-
if (
|
|
11423
|
+
if (existsSync20(sourceSkillMd) && existsSync20(installedSkillMd)) {
|
|
10738
11424
|
const { statSync: statSync4 } = await import("fs");
|
|
10739
11425
|
const sourceTime = statSync4(sourceSkillMd).mtime;
|
|
10740
11426
|
const installedTime = statSync4(installedSkillMd).mtime;
|
|
@@ -10814,7 +11500,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10814
11500
|
|
|
10815
11501
|
// src/commands/find.ts
|
|
10816
11502
|
init_onboarding();
|
|
10817
|
-
import { Command as
|
|
11503
|
+
import { Command as Command41, Option as Option40 } from "clipanion";
|
|
10818
11504
|
import { FederatedSearch, GitHubSkillRegistry, RateLimitError } from "@skillkit/core";
|
|
10819
11505
|
|
|
10820
11506
|
// ../../marketplace/skills.json
|
|
@@ -136466,9 +137152,9 @@ var sources_default = {
|
|
|
136466
137152
|
};
|
|
136467
137153
|
|
|
136468
137154
|
// src/commands/find.ts
|
|
136469
|
-
var FindCommand = class extends
|
|
137155
|
+
var FindCommand = class extends Command41 {
|
|
136470
137156
|
static paths = [["find"], ["search"]];
|
|
136471
|
-
static usage =
|
|
137157
|
+
static usage = Command41.Usage({
|
|
136472
137158
|
description: "Search for skills in the marketplace",
|
|
136473
137159
|
details: `
|
|
136474
137160
|
Quickly find and install skills from the marketplace.
|
|
@@ -136481,20 +137167,20 @@ var FindCommand = class extends Command40 {
|
|
|
136481
137167
|
["List top skills", "$0 find --top"]
|
|
136482
137168
|
]
|
|
136483
137169
|
});
|
|
136484
|
-
query =
|
|
136485
|
-
top =
|
|
137170
|
+
query = Option40.String({ required: false });
|
|
137171
|
+
top = Option40.Boolean("--top,-t", false, {
|
|
136486
137172
|
description: "Show top/featured skills"
|
|
136487
137173
|
});
|
|
136488
|
-
limit =
|
|
137174
|
+
limit = Option40.String("--limit,-l", "10", {
|
|
136489
137175
|
description: "Maximum results to show"
|
|
136490
137176
|
});
|
|
136491
|
-
install =
|
|
137177
|
+
install = Option40.Boolean("--install,-i", false, {
|
|
136492
137178
|
description: "Prompt to install after finding"
|
|
136493
137179
|
});
|
|
136494
|
-
quiet =
|
|
137180
|
+
quiet = Option40.Boolean("--quiet,-q", false, {
|
|
136495
137181
|
description: "Minimal output (just list skills)"
|
|
136496
137182
|
});
|
|
136497
|
-
federated =
|
|
137183
|
+
federated = Option40.Boolean("--federated,-f", false, {
|
|
136498
137184
|
description: "Search external registries (GitHub SKILL.md files)"
|
|
136499
137185
|
});
|
|
136500
137186
|
async execute() {
|
|
@@ -136623,7 +137309,7 @@ var FindCommand = class extends Command40 {
|
|
|
136623
137309
|
// src/commands/manifest.ts
|
|
136624
137310
|
init_helpers();
|
|
136625
137311
|
init_onboarding();
|
|
136626
|
-
import { Command as
|
|
137312
|
+
import { Command as Command42, Option as Option41 } from "clipanion";
|
|
136627
137313
|
import {
|
|
136628
137314
|
loadManifest,
|
|
136629
137315
|
saveManifest,
|
|
@@ -136634,9 +137320,9 @@ import {
|
|
|
136634
137320
|
generateManifestFromInstalled,
|
|
136635
137321
|
findAllSkills as findAllSkills8
|
|
136636
137322
|
} from "@skillkit/core";
|
|
136637
|
-
var ManifestCommand = class extends
|
|
137323
|
+
var ManifestCommand = class extends Command42 {
|
|
136638
137324
|
static paths = [["manifest"]];
|
|
136639
|
-
static usage =
|
|
137325
|
+
static usage = Command42.Usage({
|
|
136640
137326
|
description: "Manage .skills manifest file",
|
|
136641
137327
|
details: `
|
|
136642
137328
|
The .skills manifest file allows declarative skill management.
|
|
@@ -136701,12 +137387,12 @@ var ManifestCommand = class extends Command41 {
|
|
|
136701
137387
|
return 0;
|
|
136702
137388
|
}
|
|
136703
137389
|
};
|
|
136704
|
-
var ManifestInitCommand = class extends
|
|
137390
|
+
var ManifestInitCommand = class extends Command42 {
|
|
136705
137391
|
static paths = [["manifest", "init"]];
|
|
136706
|
-
static usage =
|
|
137392
|
+
static usage = Command42.Usage({
|
|
136707
137393
|
description: "Initialize a new .skills manifest"
|
|
136708
137394
|
});
|
|
136709
|
-
force =
|
|
137395
|
+
force = Option41.Boolean("--force,-f", false, {
|
|
136710
137396
|
description: "Overwrite existing manifest"
|
|
136711
137397
|
});
|
|
136712
137398
|
async execute() {
|
|
@@ -136724,16 +137410,16 @@ var ManifestInitCommand = class extends Command41 {
|
|
|
136724
137410
|
return 0;
|
|
136725
137411
|
}
|
|
136726
137412
|
};
|
|
136727
|
-
var ManifestAddCommand = class extends
|
|
137413
|
+
var ManifestAddCommand = class extends Command42 {
|
|
136728
137414
|
static paths = [["manifest", "add"]];
|
|
136729
|
-
static usage =
|
|
137415
|
+
static usage = Command42.Usage({
|
|
136730
137416
|
description: "Add a skill source to the manifest"
|
|
136731
137417
|
});
|
|
136732
|
-
source =
|
|
136733
|
-
skills =
|
|
137418
|
+
source = Option41.String({ required: true });
|
|
137419
|
+
skills = Option41.String("--skills,-s", {
|
|
136734
137420
|
description: "Specific skills to include (comma-separated)"
|
|
136735
137421
|
});
|
|
136736
|
-
agents =
|
|
137422
|
+
agents = Option41.String("--agents,-a", {
|
|
136737
137423
|
description: "Target agents (comma-separated)"
|
|
136738
137424
|
});
|
|
136739
137425
|
async execute() {
|
|
@@ -136749,12 +137435,12 @@ var ManifestAddCommand = class extends Command41 {
|
|
|
136749
137435
|
return 0;
|
|
136750
137436
|
}
|
|
136751
137437
|
};
|
|
136752
|
-
var ManifestRemoveCommand = class extends
|
|
137438
|
+
var ManifestRemoveCommand = class extends Command42 {
|
|
136753
137439
|
static paths = [["manifest", "remove"]];
|
|
136754
|
-
static usage =
|
|
137440
|
+
static usage = Command42.Usage({
|
|
136755
137441
|
description: "Remove a skill source from the manifest"
|
|
136756
137442
|
});
|
|
136757
|
-
source =
|
|
137443
|
+
source = Option41.String({ required: true });
|
|
136758
137444
|
async execute() {
|
|
136759
137445
|
const result = removeFromManifest(this.source);
|
|
136760
137446
|
if (!result) {
|
|
@@ -136765,12 +137451,12 @@ var ManifestRemoveCommand = class extends Command41 {
|
|
|
136765
137451
|
return 0;
|
|
136766
137452
|
}
|
|
136767
137453
|
};
|
|
136768
|
-
var ManifestInstallCommand = class extends
|
|
137454
|
+
var ManifestInstallCommand = class extends Command42 {
|
|
136769
137455
|
static paths = [["manifest", "install"]];
|
|
136770
|
-
static usage =
|
|
137456
|
+
static usage = Command42.Usage({
|
|
136771
137457
|
description: "Install all skills defined in the manifest"
|
|
136772
137458
|
});
|
|
136773
|
-
yes =
|
|
137459
|
+
yes = Option41.Boolean("--yes,-y", false, {
|
|
136774
137460
|
description: "Skip confirmation"
|
|
136775
137461
|
});
|
|
136776
137462
|
async execute() {
|
|
@@ -136832,12 +137518,12 @@ var ManifestInstallCommand = class extends Command41 {
|
|
|
136832
137518
|
return 0;
|
|
136833
137519
|
}
|
|
136834
137520
|
};
|
|
136835
|
-
var ManifestGenerateCommand = class extends
|
|
137521
|
+
var ManifestGenerateCommand = class extends Command42 {
|
|
136836
137522
|
static paths = [["manifest", "generate"]];
|
|
136837
|
-
static usage =
|
|
137523
|
+
static usage = Command42.Usage({
|
|
136838
137524
|
description: "Generate manifest from currently installed skills"
|
|
136839
137525
|
});
|
|
136840
|
-
output =
|
|
137526
|
+
output = Option41.String("--output,-o", {
|
|
136841
137527
|
description: "Output file path (default: .skills)"
|
|
136842
137528
|
});
|
|
136843
137529
|
async execute() {
|
|
@@ -136866,8 +137552,8 @@ var ManifestGenerateCommand = class extends Command41 {
|
|
|
136866
137552
|
};
|
|
136867
137553
|
|
|
136868
137554
|
// src/commands/primer.ts
|
|
136869
|
-
import { Command as
|
|
136870
|
-
import { resolve as
|
|
137555
|
+
import { Command as Command43, Option as Option42 } from "clipanion";
|
|
137556
|
+
import { resolve as resolve20 } from "path";
|
|
136871
137557
|
import chalk29 from "chalk";
|
|
136872
137558
|
import {
|
|
136873
137559
|
AgentType as AgentTypeSchema,
|
|
@@ -136877,9 +137563,9 @@ import {
|
|
|
136877
137563
|
addPattern,
|
|
136878
137564
|
AGENT_CONFIG
|
|
136879
137565
|
} from "@skillkit/core";
|
|
136880
|
-
var PrimerCommand = class extends
|
|
137566
|
+
var PrimerCommand = class extends Command43 {
|
|
136881
137567
|
static paths = [["primer"]];
|
|
136882
|
-
static usage =
|
|
137568
|
+
static usage = Command43.Usage({
|
|
136883
137569
|
description: "Analyze codebase and generate AI instruction files for agents",
|
|
136884
137570
|
details: `
|
|
136885
137571
|
The primer command analyzes your codebase to detect languages, frameworks,
|
|
@@ -136901,41 +137587,41 @@ var PrimerCommand = class extends Command42 {
|
|
|
136901
137587
|
["Verbose output", "$0 primer --verbose"]
|
|
136902
137588
|
]
|
|
136903
137589
|
});
|
|
136904
|
-
agent =
|
|
137590
|
+
agent = Option42.String("--agent,-a", {
|
|
136905
137591
|
description: "Comma-separated list of agents to generate for"
|
|
136906
137592
|
});
|
|
136907
|
-
allAgents =
|
|
137593
|
+
allAgents = Option42.Boolean("--all-agents,-A", false, {
|
|
136908
137594
|
description: "Generate for all 32 supported agents"
|
|
136909
137595
|
});
|
|
136910
|
-
output =
|
|
137596
|
+
output = Option42.String("--output,-o", {
|
|
136911
137597
|
description: "Output directory for generated files"
|
|
136912
137598
|
});
|
|
136913
|
-
dryRun =
|
|
137599
|
+
dryRun = Option42.Boolean("--dry-run,-n", false, {
|
|
136914
137600
|
description: "Preview what would be generated without writing files"
|
|
136915
137601
|
});
|
|
136916
|
-
analyzeOnly =
|
|
137602
|
+
analyzeOnly = Option42.Boolean("--analyze-only", false, {
|
|
136917
137603
|
description: "Only show codebase analysis, do not generate files"
|
|
136918
137604
|
});
|
|
136919
|
-
verbose =
|
|
137605
|
+
verbose = Option42.Boolean("--verbose,-v", false, {
|
|
136920
137606
|
description: "Show detailed output"
|
|
136921
137607
|
});
|
|
136922
|
-
includeExamples =
|
|
137608
|
+
includeExamples = Option42.Boolean("--examples", false, {
|
|
136923
137609
|
description: "Include code examples in generated instructions"
|
|
136924
137610
|
});
|
|
136925
|
-
json =
|
|
137611
|
+
json = Option42.Boolean("--json,-j", false, {
|
|
136926
137612
|
description: "Output analysis in JSON format"
|
|
136927
137613
|
});
|
|
136928
|
-
directory =
|
|
137614
|
+
directory = Option42.String("--dir,-d", {
|
|
136929
137615
|
description: "Project directory to analyze (default: current directory)"
|
|
136930
137616
|
});
|
|
136931
|
-
learn =
|
|
137617
|
+
learn = Option42.Boolean("--learn,-l", false, {
|
|
136932
137618
|
description: "Extract learnable patterns from git history"
|
|
136933
137619
|
});
|
|
136934
|
-
commits =
|
|
137620
|
+
commits = Option42.String("--commits", {
|
|
136935
137621
|
description: "Number of commits to analyze for learning (default: 100)"
|
|
136936
137622
|
});
|
|
136937
137623
|
async execute() {
|
|
136938
|
-
const projectPath =
|
|
137624
|
+
const projectPath = resolve20(this.directory || process.cwd());
|
|
136939
137625
|
if (this.analyzeOnly) {
|
|
136940
137626
|
return this.runAnalysis(projectPath);
|
|
136941
137627
|
}
|
|
@@ -137004,7 +137690,7 @@ var PrimerCommand = class extends Command42 {
|
|
|
137004
137690
|
const result = generatePrimer(projectPath, {
|
|
137005
137691
|
agents,
|
|
137006
137692
|
allAgents: this.allAgents,
|
|
137007
|
-
outputDir: this.output ?
|
|
137693
|
+
outputDir: this.output ? resolve20(this.output) : void 0,
|
|
137008
137694
|
dryRun: this.dryRun,
|
|
137009
137695
|
verbose: this.verbose,
|
|
137010
137696
|
includeExamples: this.includeExamples
|
|
@@ -137224,11 +137910,11 @@ var PrimerCommand = class extends Command42 {
|
|
|
137224
137910
|
};
|
|
137225
137911
|
|
|
137226
137912
|
// src/commands/mesh.ts
|
|
137227
|
-
import { Command as
|
|
137913
|
+
import { Command as Command44, Option as Option43 } from "clipanion";
|
|
137228
137914
|
import chalk30 from "chalk";
|
|
137229
|
-
var MeshCommand = class extends
|
|
137915
|
+
var MeshCommand = class extends Command44 {
|
|
137230
137916
|
static paths = [["mesh"]];
|
|
137231
|
-
static usage =
|
|
137917
|
+
static usage = Command44.Usage({
|
|
137232
137918
|
description: "Manage peer mesh network for multi-machine agent distribution",
|
|
137233
137919
|
details: `
|
|
137234
137920
|
The mesh command helps you manage a peer-to-peer network of hosts
|
|
@@ -137260,17 +137946,17 @@ var MeshCommand = class extends Command43 {
|
|
|
137260
137946
|
["List trusted peers", "$0 mesh peer list --trusted"]
|
|
137261
137947
|
]
|
|
137262
137948
|
});
|
|
137263
|
-
action =
|
|
137264
|
-
arg =
|
|
137265
|
-
subArg =
|
|
137266
|
-
name =
|
|
137267
|
-
port =
|
|
137268
|
-
tailscale =
|
|
137269
|
-
timeout =
|
|
137270
|
-
json =
|
|
137271
|
-
verbose =
|
|
137272
|
-
trusted =
|
|
137273
|
-
securityLevel =
|
|
137949
|
+
action = Option43.String({ required: false });
|
|
137950
|
+
arg = Option43.String({ required: false });
|
|
137951
|
+
subArg = Option43.String({ required: false });
|
|
137952
|
+
name = Option43.String("--name,-n", { description: "Name for the host" });
|
|
137953
|
+
port = Option43.String("--port,-p", { description: "Port number" });
|
|
137954
|
+
tailscale = Option43.Boolean("--tailscale,-t", false, { description: "Include Tailscale peers" });
|
|
137955
|
+
timeout = Option43.String("--timeout", { description: "Timeout in milliseconds" });
|
|
137956
|
+
json = Option43.Boolean("--json,-j", false, { description: "Output in JSON format" });
|
|
137957
|
+
verbose = Option43.Boolean("--verbose,-v", false, { description: "Show detailed output" });
|
|
137958
|
+
trusted = Option43.Boolean("--trusted", false, { description: "Show only trusted peers" });
|
|
137959
|
+
securityLevel = Option43.String("--security", { description: "Security level: development, signed, secure, strict" });
|
|
137274
137960
|
async execute() {
|
|
137275
137961
|
const action = this.action || "status";
|
|
137276
137962
|
switch (action) {
|
|
@@ -137773,11 +138459,11 @@ Total: ${trustedPeers.length} trusted, ${revokedFingerprints.length} revoked`));
|
|
|
137773
138459
|
};
|
|
137774
138460
|
|
|
137775
138461
|
// src/commands/message.ts
|
|
137776
|
-
import { Command as
|
|
138462
|
+
import { Command as Command45, Option as Option44 } from "clipanion";
|
|
137777
138463
|
import chalk31 from "chalk";
|
|
137778
|
-
var MessageCommand = class extends
|
|
138464
|
+
var MessageCommand = class extends Command45 {
|
|
137779
138465
|
static paths = [["message"], ["msg"]];
|
|
137780
|
-
static usage =
|
|
138466
|
+
static usage = Command45.Usage({
|
|
137781
138467
|
description: "Inter-agent messaging system",
|
|
137782
138468
|
details: `
|
|
137783
138469
|
The message command enables communication between AI agents
|
|
@@ -137804,18 +138490,18 @@ var MessageCommand = class extends Command44 {
|
|
|
137804
138490
|
["Forward a message", "$0 message forward <id> other-agent"]
|
|
137805
138491
|
]
|
|
137806
138492
|
});
|
|
137807
|
-
action =
|
|
137808
|
-
arg =
|
|
137809
|
-
arg2 =
|
|
137810
|
-
body =
|
|
137811
|
-
subject =
|
|
137812
|
-
priority =
|
|
137813
|
-
type =
|
|
137814
|
-
unread =
|
|
137815
|
-
limit =
|
|
137816
|
-
agent =
|
|
137817
|
-
json =
|
|
137818
|
-
verbose =
|
|
138493
|
+
action = Option44.String({ required: false });
|
|
138494
|
+
arg = Option44.String({ required: false });
|
|
138495
|
+
arg2 = Option44.String({ required: false });
|
|
138496
|
+
body = Option44.String("--body,-b", { description: "Message body" });
|
|
138497
|
+
subject = Option44.String("--subject,-s", { description: "Message subject" });
|
|
138498
|
+
priority = Option44.String("--priority,-p", { description: "Priority: low, normal, high, urgent" });
|
|
138499
|
+
type = Option44.String("--type,-t", { description: "Type: request, response, notification, update" });
|
|
138500
|
+
unread = Option44.Boolean("--unread,-u", false, { description: "Show only unread messages" });
|
|
138501
|
+
limit = Option44.String("--limit,-l", { description: "Maximum number of results" });
|
|
138502
|
+
agent = Option44.String("--agent,-a", { description: "Agent ID (defaults to current agent)" });
|
|
138503
|
+
json = Option44.Boolean("--json,-j", false, { description: "Output in JSON format" });
|
|
138504
|
+
verbose = Option44.Boolean("--verbose,-v", false, { description: "Show detailed output" });
|
|
137819
138505
|
async execute() {
|
|
137820
138506
|
const action = this.action || "inbox";
|
|
137821
138507
|
switch (action) {
|
|
@@ -138214,8 +138900,8 @@ Sent Messages (${messages.length})
|
|
|
138214
138900
|
};
|
|
138215
138901
|
|
|
138216
138902
|
// src/commands/learn.ts
|
|
138217
|
-
import { Command as
|
|
138218
|
-
import { resolve as
|
|
138903
|
+
import { Command as Command46, Option as Option45 } from "clipanion";
|
|
138904
|
+
import { resolve as resolve21 } from "path";
|
|
138219
138905
|
import chalk32 from "chalk";
|
|
138220
138906
|
import {
|
|
138221
138907
|
analyzeGitHistory as analyzeGitHistory2,
|
|
@@ -138235,10 +138921,10 @@ import {
|
|
|
138235
138921
|
getPatternStats,
|
|
138236
138922
|
clusterPatterns
|
|
138237
138923
|
} from "@skillkit/core";
|
|
138238
|
-
import { writeFileSync as
|
|
138239
|
-
var LearnCommand = class extends
|
|
138924
|
+
import { writeFileSync as writeFileSync11, readFileSync as readFileSync10, existsSync as existsSync21 } from "fs";
|
|
138925
|
+
var LearnCommand = class extends Command46 {
|
|
138240
138926
|
static paths = [["learn"]];
|
|
138241
|
-
static usage =
|
|
138927
|
+
static usage = Command46.Usage({
|
|
138242
138928
|
description: "Extract learnable patterns from git history or sessions",
|
|
138243
138929
|
details: `
|
|
138244
138930
|
Analyzes git commit history to extract reusable patterns for error fixes,
|
|
@@ -138253,26 +138939,26 @@ var LearnCommand = class extends Command45 {
|
|
|
138253
138939
|
["Show extracted patterns", "$0 learn --show"]
|
|
138254
138940
|
]
|
|
138255
138941
|
});
|
|
138256
|
-
commits =
|
|
138942
|
+
commits = Option45.String("--commits,-c", {
|
|
138257
138943
|
description: "Number of commits to analyze (default: 100)"
|
|
138258
138944
|
});
|
|
138259
|
-
since =
|
|
138945
|
+
since = Option45.String("--since,-s", {
|
|
138260
138946
|
description: 'Analyze commits since date (e.g., "2 weeks ago")'
|
|
138261
138947
|
});
|
|
138262
|
-
approve =
|
|
138948
|
+
approve = Option45.Boolean("--approve,-a", false, {
|
|
138263
138949
|
description: "Auto-approve extracted patterns"
|
|
138264
138950
|
});
|
|
138265
|
-
show =
|
|
138951
|
+
show = Option45.Boolean("--show", false, {
|
|
138266
138952
|
description: "Show existing patterns without analyzing"
|
|
138267
138953
|
});
|
|
138268
|
-
json =
|
|
138954
|
+
json = Option45.Boolean("--json,-j", false, {
|
|
138269
138955
|
description: "Output as JSON"
|
|
138270
138956
|
});
|
|
138271
|
-
directory =
|
|
138957
|
+
directory = Option45.String("--dir,-d", {
|
|
138272
138958
|
description: "Project directory to analyze (default: current directory)"
|
|
138273
138959
|
});
|
|
138274
138960
|
async execute() {
|
|
138275
|
-
const projectPath =
|
|
138961
|
+
const projectPath = resolve21(this.directory || process.cwd());
|
|
138276
138962
|
if (this.show) {
|
|
138277
138963
|
return this.showPatterns();
|
|
138278
138964
|
}
|
|
@@ -138377,19 +139063,19 @@ var LearnCommand = class extends Command45 {
|
|
|
138377
139063
|
console.log(chalk32.dim(` ${truncate5(pattern.problem, 60)}`));
|
|
138378
139064
|
}
|
|
138379
139065
|
};
|
|
138380
|
-
var PatternStatusCommand = class extends
|
|
139066
|
+
var PatternStatusCommand = class extends Command46 {
|
|
138381
139067
|
static paths = [["pattern", "status"], ["pattern", "list"]];
|
|
138382
|
-
static usage =
|
|
139068
|
+
static usage = Command46.Usage({
|
|
138383
139069
|
description: "Show status of learned patterns",
|
|
138384
139070
|
examples: [
|
|
138385
139071
|
["Show all patterns", "$0 pattern status"],
|
|
138386
139072
|
["Show by category", "$0 pattern status --category error_fix"]
|
|
138387
139073
|
]
|
|
138388
139074
|
});
|
|
138389
|
-
category =
|
|
139075
|
+
category = Option45.String("--category,-c", {
|
|
138390
139076
|
description: "Filter by category (error_fix, refactor, workaround, debugging, convention)"
|
|
138391
139077
|
});
|
|
138392
|
-
json =
|
|
139078
|
+
json = Option45.Boolean("--json,-j", false, {
|
|
138393
139079
|
description: "Output as JSON"
|
|
138394
139080
|
});
|
|
138395
139081
|
async execute() {
|
|
@@ -138420,20 +139106,20 @@ var PatternStatusCommand = class extends Command45 {
|
|
|
138420
139106
|
return 0;
|
|
138421
139107
|
}
|
|
138422
139108
|
};
|
|
138423
|
-
var PatternFeedbackCommand = class extends
|
|
139109
|
+
var PatternFeedbackCommand = class extends Command46 {
|
|
138424
139110
|
static paths = [["pattern", "feedback"]];
|
|
138425
|
-
static usage =
|
|
139111
|
+
static usage = Command46.Usage({
|
|
138426
139112
|
description: "Provide feedback on a pattern to evolve its confidence",
|
|
138427
139113
|
examples: [
|
|
138428
139114
|
["Mark pattern as successful", "$0 pattern feedback <id> --success"],
|
|
138429
139115
|
["Mark pattern as failed", "$0 pattern feedback <id> --failure"]
|
|
138430
139116
|
]
|
|
138431
139117
|
});
|
|
138432
|
-
id =
|
|
138433
|
-
success =
|
|
139118
|
+
id = Option45.String({ required: true });
|
|
139119
|
+
success = Option45.Boolean("--success,-s", false, {
|
|
138434
139120
|
description: "Pattern was helpful"
|
|
138435
139121
|
});
|
|
138436
|
-
failure =
|
|
139122
|
+
failure = Option45.Boolean("--failure,-f", false, {
|
|
138437
139123
|
description: "Pattern was not helpful"
|
|
138438
139124
|
});
|
|
138439
139125
|
async execute() {
|
|
@@ -138453,13 +139139,13 @@ var PatternFeedbackCommand = class extends Command45 {
|
|
|
138453
139139
|
return 0;
|
|
138454
139140
|
}
|
|
138455
139141
|
};
|
|
138456
|
-
var PatternApproveCommand = class extends
|
|
139142
|
+
var PatternApproveCommand = class extends Command46 {
|
|
138457
139143
|
static paths = [["pattern", "approve"]];
|
|
138458
|
-
static usage =
|
|
139144
|
+
static usage = Command46.Usage({
|
|
138459
139145
|
description: "Approve a pending pattern",
|
|
138460
139146
|
examples: [["Approve pattern", "$0 pattern approve <id>"]]
|
|
138461
139147
|
});
|
|
138462
|
-
id =
|
|
139148
|
+
id = Option45.String({ required: true });
|
|
138463
139149
|
async execute() {
|
|
138464
139150
|
const pattern = approvePattern(this.id);
|
|
138465
139151
|
if (!pattern) {
|
|
@@ -138470,13 +139156,13 @@ var PatternApproveCommand = class extends Command45 {
|
|
|
138470
139156
|
return 0;
|
|
138471
139157
|
}
|
|
138472
139158
|
};
|
|
138473
|
-
var PatternRejectCommand = class extends
|
|
139159
|
+
var PatternRejectCommand = class extends Command46 {
|
|
138474
139160
|
static paths = [["pattern", "reject"]];
|
|
138475
|
-
static usage =
|
|
139161
|
+
static usage = Command46.Usage({
|
|
138476
139162
|
description: "Reject and remove a pattern",
|
|
138477
139163
|
examples: [["Reject pattern", "$0 pattern reject <id>"]]
|
|
138478
139164
|
});
|
|
138479
|
-
id =
|
|
139165
|
+
id = Option45.String({ required: true });
|
|
138480
139166
|
async execute() {
|
|
138481
139167
|
const removed = rejectPattern(this.id);
|
|
138482
139168
|
if (!removed) {
|
|
@@ -138487,22 +139173,22 @@ var PatternRejectCommand = class extends Command45 {
|
|
|
138487
139173
|
return 0;
|
|
138488
139174
|
}
|
|
138489
139175
|
};
|
|
138490
|
-
var PatternExportCommand = class extends
|
|
139176
|
+
var PatternExportCommand = class extends Command46 {
|
|
138491
139177
|
static paths = [["pattern", "export"]];
|
|
138492
|
-
static usage =
|
|
139178
|
+
static usage = Command46.Usage({
|
|
138493
139179
|
description: "Export patterns to a file",
|
|
138494
139180
|
examples: [
|
|
138495
139181
|
["Export as JSON", "$0 pattern export --output patterns.json"],
|
|
138496
139182
|
["Export as markdown report", "$0 pattern export --format report"]
|
|
138497
139183
|
]
|
|
138498
139184
|
});
|
|
138499
|
-
output =
|
|
139185
|
+
output = Option45.String("--output,-o", {
|
|
138500
139186
|
description: "Output file path"
|
|
138501
139187
|
});
|
|
138502
|
-
format =
|
|
139188
|
+
format = Option45.String("--format,-f", {
|
|
138503
139189
|
description: "Format: json or report (default: json)"
|
|
138504
139190
|
});
|
|
138505
|
-
approvedOnly =
|
|
139191
|
+
approvedOnly = Option45.Boolean("--approved", false, {
|
|
138506
139192
|
description: "Export only approved patterns"
|
|
138507
139193
|
});
|
|
138508
139194
|
async execute() {
|
|
@@ -138519,7 +139205,7 @@ var PatternExportCommand = class extends Command45 {
|
|
|
138519
139205
|
content = exportPatternsAsJson(patterns);
|
|
138520
139206
|
}
|
|
138521
139207
|
if (this.output) {
|
|
138522
|
-
|
|
139208
|
+
writeFileSync11(this.output, content);
|
|
138523
139209
|
console.log(chalk32.green(`\u2713 Exported ${patterns.length} patterns to ${this.output}`));
|
|
138524
139210
|
} else {
|
|
138525
139211
|
console.log(content);
|
|
@@ -138527,15 +139213,15 @@ var PatternExportCommand = class extends Command45 {
|
|
|
138527
139213
|
return 0;
|
|
138528
139214
|
}
|
|
138529
139215
|
};
|
|
138530
|
-
var PatternImportCommand = class extends
|
|
139216
|
+
var PatternImportCommand = class extends Command46 {
|
|
138531
139217
|
static paths = [["pattern", "import"]];
|
|
138532
|
-
static usage =
|
|
139218
|
+
static usage = Command46.Usage({
|
|
138533
139219
|
description: "Import patterns from a file",
|
|
138534
139220
|
examples: [["Import patterns", "$0 pattern import patterns.json"]]
|
|
138535
139221
|
});
|
|
138536
|
-
file =
|
|
139222
|
+
file = Option45.String({ required: true });
|
|
138537
139223
|
async execute() {
|
|
138538
|
-
if (!
|
|
139224
|
+
if (!existsSync21(this.file)) {
|
|
138539
139225
|
console.log(chalk32.red(`File not found: ${this.file}`));
|
|
138540
139226
|
return 1;
|
|
138541
139227
|
}
|
|
@@ -138552,19 +139238,19 @@ var PatternImportCommand = class extends Command45 {
|
|
|
138552
139238
|
return 0;
|
|
138553
139239
|
}
|
|
138554
139240
|
};
|
|
138555
|
-
var PatternClusterCommand = class extends
|
|
139241
|
+
var PatternClusterCommand = class extends Command46 {
|
|
138556
139242
|
static paths = [["pattern", "cluster"]];
|
|
138557
|
-
static usage =
|
|
139243
|
+
static usage = Command46.Usage({
|
|
138558
139244
|
description: "Cluster similar patterns and generate skills",
|
|
138559
139245
|
examples: [
|
|
138560
139246
|
["Cluster patterns", "$0 pattern cluster"],
|
|
138561
139247
|
["Cluster and generate skills", "$0 pattern cluster --generate"]
|
|
138562
139248
|
]
|
|
138563
139249
|
});
|
|
138564
|
-
generate =
|
|
139250
|
+
generate = Option45.Boolean("--generate,-g", false, {
|
|
138565
139251
|
description: "Generate skills from clusters"
|
|
138566
139252
|
});
|
|
138567
|
-
minConfidence =
|
|
139253
|
+
minConfidence = Option45.String("--min-confidence", {
|
|
138568
139254
|
description: "Minimum confidence for clustering (default: 0.5)"
|
|
138569
139255
|
});
|
|
138570
139256
|
async execute() {
|
|
@@ -138603,7 +139289,7 @@ function truncate5(str, maxLen) {
|
|
|
138603
139289
|
}
|
|
138604
139290
|
|
|
138605
139291
|
// src/commands/session.ts
|
|
138606
|
-
import { Command as
|
|
139292
|
+
import { Command as Command47, Option as Option46 } from "clipanion";
|
|
138607
139293
|
import chalk33 from "chalk";
|
|
138608
139294
|
import {
|
|
138609
139295
|
loadSessionFile,
|
|
@@ -138613,9 +139299,9 @@ import {
|
|
|
138613
139299
|
listSessions,
|
|
138614
139300
|
getMostRecentSession
|
|
138615
139301
|
} from "@skillkit/core";
|
|
138616
|
-
var SessionCommand = class extends
|
|
139302
|
+
var SessionCommand = class extends Command47 {
|
|
138617
139303
|
static paths = [["session"]];
|
|
138618
|
-
static usage =
|
|
139304
|
+
static usage = Command47.Usage({
|
|
138619
139305
|
description: "Manage session state for context preservation",
|
|
138620
139306
|
details: `
|
|
138621
139307
|
Sessions track context across coding sessions, allowing you to
|
|
@@ -138639,13 +139325,13 @@ var SessionCommand = class extends Command46 {
|
|
|
138639
139325
|
return 0;
|
|
138640
139326
|
}
|
|
138641
139327
|
};
|
|
138642
|
-
var SessionStatusCommand = class extends
|
|
139328
|
+
var SessionStatusCommand = class extends Command47 {
|
|
138643
139329
|
static paths = [["session", "status"]];
|
|
138644
|
-
static usage =
|
|
139330
|
+
static usage = Command47.Usage({
|
|
138645
139331
|
description: "Show current session state",
|
|
138646
139332
|
examples: [["Show status", "$0 session status"]]
|
|
138647
139333
|
});
|
|
138648
|
-
json =
|
|
139334
|
+
json = Option46.Boolean("--json,-j", false, {
|
|
138649
139335
|
description: "Output as JSON"
|
|
138650
139336
|
});
|
|
138651
139337
|
async execute() {
|
|
@@ -138699,16 +139385,16 @@ var SessionStatusCommand = class extends Command46 {
|
|
|
138699
139385
|
}
|
|
138700
139386
|
}
|
|
138701
139387
|
};
|
|
138702
|
-
var SessionStartCommand = class extends
|
|
139388
|
+
var SessionStartCommand = class extends Command47 {
|
|
138703
139389
|
static paths = [["session", "start"]];
|
|
138704
|
-
static usage =
|
|
139390
|
+
static usage = Command47.Usage({
|
|
138705
139391
|
description: "Start a new session",
|
|
138706
139392
|
examples: [
|
|
138707
139393
|
["Start session", "$0 session start"],
|
|
138708
139394
|
["Start with agent", "$0 session start --agent claude-code"]
|
|
138709
139395
|
]
|
|
138710
139396
|
});
|
|
138711
|
-
agent =
|
|
139397
|
+
agent = Option46.String("--agent,-a", {
|
|
138712
139398
|
description: "AI agent being used"
|
|
138713
139399
|
});
|
|
138714
139400
|
async execute() {
|
|
@@ -138721,13 +139407,13 @@ var SessionStartCommand = class extends Command46 {
|
|
|
138721
139407
|
return 0;
|
|
138722
139408
|
}
|
|
138723
139409
|
};
|
|
138724
|
-
var SessionLoadCommand = class extends
|
|
139410
|
+
var SessionLoadCommand = class extends Command47 {
|
|
138725
139411
|
static paths = [["session", "load"]];
|
|
138726
|
-
static usage =
|
|
139412
|
+
static usage = Command47.Usage({
|
|
138727
139413
|
description: "Load session from specific date",
|
|
138728
139414
|
examples: [["Load session", "$0 session load 2026-01-30"]]
|
|
138729
139415
|
});
|
|
138730
|
-
date =
|
|
139416
|
+
date = Option46.String({ required: false });
|
|
138731
139417
|
async execute() {
|
|
138732
139418
|
const session = this.date ? loadSessionFile(this.date) : getMostRecentSession();
|
|
138733
139419
|
if (!session) {
|
|
@@ -138759,16 +139445,16 @@ var SessionLoadCommand = class extends Command46 {
|
|
|
138759
139445
|
return 0;
|
|
138760
139446
|
}
|
|
138761
139447
|
};
|
|
138762
|
-
var SessionListCommand = class extends
|
|
139448
|
+
var SessionListCommand = class extends Command47 {
|
|
138763
139449
|
static paths = [["session", "list"], ["session", "ls"]];
|
|
138764
|
-
static usage =
|
|
139450
|
+
static usage = Command47.Usage({
|
|
138765
139451
|
description: "List recent sessions",
|
|
138766
139452
|
examples: [["List sessions", "$0 session list"]]
|
|
138767
139453
|
});
|
|
138768
|
-
limit =
|
|
139454
|
+
limit = Option46.String("--limit,-l", {
|
|
138769
139455
|
description: "Number of sessions to show (default: 10)"
|
|
138770
139456
|
});
|
|
138771
|
-
json =
|
|
139457
|
+
json = Option46.Boolean("--json,-j", false, {
|
|
138772
139458
|
description: "Output as JSON"
|
|
138773
139459
|
});
|
|
138774
139460
|
async execute() {
|
|
@@ -138795,13 +139481,13 @@ var SessionListCommand = class extends Command46 {
|
|
|
138795
139481
|
return 0;
|
|
138796
139482
|
}
|
|
138797
139483
|
};
|
|
138798
|
-
var SessionNoteCommand = class extends
|
|
139484
|
+
var SessionNoteCommand = class extends Command47 {
|
|
138799
139485
|
static paths = [["session", "note"]];
|
|
138800
|
-
static usage =
|
|
139486
|
+
static usage = Command47.Usage({
|
|
138801
139487
|
description: "Add note to current session",
|
|
138802
139488
|
examples: [["Add note", '$0 session note "Remember to test edge cases"']]
|
|
138803
139489
|
});
|
|
138804
|
-
note =
|
|
139490
|
+
note = Option46.String({ required: true });
|
|
138805
139491
|
async execute() {
|
|
138806
139492
|
let session = getMostRecentSession();
|
|
138807
139493
|
if (!session) {
|
|
@@ -138815,13 +139501,13 @@ var SessionNoteCommand = class extends Command46 {
|
|
|
138815
139501
|
return 0;
|
|
138816
139502
|
}
|
|
138817
139503
|
};
|
|
138818
|
-
var SessionCompleteCommand = class extends
|
|
139504
|
+
var SessionCompleteCommand = class extends Command47 {
|
|
138819
139505
|
static paths = [["session", "complete"]];
|
|
138820
|
-
static usage =
|
|
139506
|
+
static usage = Command47.Usage({
|
|
138821
139507
|
description: "Mark task as completed",
|
|
138822
139508
|
examples: [["Mark completed", '$0 session complete "Implemented user auth"']]
|
|
138823
139509
|
});
|
|
138824
|
-
task =
|
|
139510
|
+
task = Option46.String({ required: true });
|
|
138825
139511
|
async execute() {
|
|
138826
139512
|
let session = getMostRecentSession();
|
|
138827
139513
|
if (!session) {
|
|
@@ -138838,13 +139524,13 @@ var SessionCompleteCommand = class extends Command46 {
|
|
|
138838
139524
|
return 0;
|
|
138839
139525
|
}
|
|
138840
139526
|
};
|
|
138841
|
-
var SessionInProgressCommand = class extends
|
|
139527
|
+
var SessionInProgressCommand = class extends Command47 {
|
|
138842
139528
|
static paths = [["session", "wip"], ["session", "progress"]];
|
|
138843
|
-
static usage =
|
|
139529
|
+
static usage = Command47.Usage({
|
|
138844
139530
|
description: "Mark task as in progress",
|
|
138845
139531
|
examples: [["Mark in progress", '$0 session wip "Working on auth flow"']]
|
|
138846
139532
|
});
|
|
138847
|
-
task =
|
|
139533
|
+
task = Option46.String({ required: true });
|
|
138848
139534
|
async execute() {
|
|
138849
139535
|
let session = getMostRecentSession();
|
|
138850
139536
|
if (!session) {
|
|
@@ -138860,7 +139546,7 @@ var SessionInProgressCommand = class extends Command46 {
|
|
|
138860
139546
|
};
|
|
138861
139547
|
|
|
138862
139548
|
// src/commands/profile.ts
|
|
138863
|
-
import { Command as
|
|
139549
|
+
import { Command as Command48, Option as Option47 } from "clipanion";
|
|
138864
139550
|
import chalk34 from "chalk";
|
|
138865
139551
|
import {
|
|
138866
139552
|
getActiveProfile,
|
|
@@ -138871,9 +139557,9 @@ import {
|
|
|
138871
139557
|
removeCustomProfile,
|
|
138872
139558
|
isBuiltinProfile
|
|
138873
139559
|
} from "@skillkit/core";
|
|
138874
|
-
var ProfileCommand = class extends
|
|
139560
|
+
var ProfileCommand = class extends Command48 {
|
|
138875
139561
|
static paths = [["profile"]];
|
|
138876
|
-
static usage =
|
|
139562
|
+
static usage = Command48.Usage({
|
|
138877
139563
|
description: "Manage operational profiles (dev, review, research modes)",
|
|
138878
139564
|
details: `
|
|
138879
139565
|
Profiles adjust agent behavior for different tasks.
|
|
@@ -138885,7 +139571,7 @@ var ProfileCommand = class extends Command47 {
|
|
|
138885
139571
|
["List all profiles", "$0 profile list"]
|
|
138886
139572
|
]
|
|
138887
139573
|
});
|
|
138888
|
-
name =
|
|
139574
|
+
name = Option47.String({ required: false });
|
|
138889
139575
|
async execute() {
|
|
138890
139576
|
if (this.name) {
|
|
138891
139577
|
const profile2 = getProfile(this.name);
|
|
@@ -138929,13 +139615,13 @@ var ProfileCommand = class extends Command47 {
|
|
|
138929
139615
|
return 0;
|
|
138930
139616
|
}
|
|
138931
139617
|
};
|
|
138932
|
-
var ProfileListCommand = class extends
|
|
139618
|
+
var ProfileListCommand = class extends Command48 {
|
|
138933
139619
|
static paths = [["profile", "list"], ["profile", "ls"]];
|
|
138934
|
-
static usage =
|
|
139620
|
+
static usage = Command48.Usage({
|
|
138935
139621
|
description: "List available profiles",
|
|
138936
139622
|
examples: [["List profiles", "$0 profile list"]]
|
|
138937
139623
|
});
|
|
138938
|
-
json =
|
|
139624
|
+
json = Option47.Boolean("--json,-j", false, {
|
|
138939
139625
|
description: "Output as JSON"
|
|
138940
139626
|
});
|
|
138941
139627
|
async execute() {
|
|
@@ -138960,23 +139646,23 @@ var ProfileListCommand = class extends Command47 {
|
|
|
138960
139646
|
return 0;
|
|
138961
139647
|
}
|
|
138962
139648
|
};
|
|
138963
|
-
var ProfileCreateCommand = class extends
|
|
139649
|
+
var ProfileCreateCommand = class extends Command48 {
|
|
138964
139650
|
static paths = [["profile", "create"]];
|
|
138965
|
-
static usage =
|
|
139651
|
+
static usage = Command48.Usage({
|
|
138966
139652
|
description: "Create a custom profile",
|
|
138967
139653
|
examples: [
|
|
138968
139654
|
["Create profile", '$0 profile create --name my-profile --description "My custom profile"']
|
|
138969
139655
|
]
|
|
138970
139656
|
});
|
|
138971
|
-
name =
|
|
139657
|
+
name = Option47.String("--name,-n", {
|
|
138972
139658
|
description: "Profile name",
|
|
138973
139659
|
required: true
|
|
138974
139660
|
});
|
|
138975
|
-
description =
|
|
139661
|
+
description = Option47.String("--description,-d", {
|
|
138976
139662
|
description: "Profile description",
|
|
138977
139663
|
required: true
|
|
138978
139664
|
});
|
|
138979
|
-
focus =
|
|
139665
|
+
focus = Option47.String("--focus,-f", {
|
|
138980
139666
|
description: "Profile focus"
|
|
138981
139667
|
});
|
|
138982
139668
|
async execute() {
|
|
@@ -138997,13 +139683,13 @@ var ProfileCreateCommand = class extends Command47 {
|
|
|
138997
139683
|
return 0;
|
|
138998
139684
|
}
|
|
138999
139685
|
};
|
|
139000
|
-
var ProfileRemoveCommand = class extends
|
|
139686
|
+
var ProfileRemoveCommand = class extends Command48 {
|
|
139001
139687
|
static paths = [["profile", "remove"], ["profile", "rm"]];
|
|
139002
|
-
static usage =
|
|
139688
|
+
static usage = Command48.Usage({
|
|
139003
139689
|
description: "Remove a custom profile",
|
|
139004
139690
|
examples: [["Remove profile", "$0 profile remove my-profile"]]
|
|
139005
139691
|
});
|
|
139006
|
-
name =
|
|
139692
|
+
name = Option47.String({ required: true });
|
|
139007
139693
|
async execute() {
|
|
139008
139694
|
if (isBuiltinProfile(this.name)) {
|
|
139009
139695
|
console.log(chalk34.red(`Cannot remove built-in profile: ${this.name}`));
|
|
@@ -139020,7 +139706,7 @@ var ProfileRemoveCommand = class extends Command47 {
|
|
|
139020
139706
|
};
|
|
139021
139707
|
|
|
139022
139708
|
// src/commands/guideline.ts
|
|
139023
|
-
import { Command as
|
|
139709
|
+
import { Command as Command49, Option as Option48 } from "clipanion";
|
|
139024
139710
|
import chalk35 from "chalk";
|
|
139025
139711
|
import {
|
|
139026
139712
|
getAllGuidelines,
|
|
@@ -139033,9 +139719,9 @@ import {
|
|
|
139033
139719
|
addCustomGuideline,
|
|
139034
139720
|
removeCustomGuideline
|
|
139035
139721
|
} from "@skillkit/core";
|
|
139036
|
-
var GuidelineCommand = class extends
|
|
139722
|
+
var GuidelineCommand = class extends Command49 {
|
|
139037
139723
|
static paths = [["guideline"], ["guide"]];
|
|
139038
|
-
static usage =
|
|
139724
|
+
static usage = Command49.Usage({
|
|
139039
139725
|
description: "Manage coding guidelines (always-on rules)",
|
|
139040
139726
|
details: `
|
|
139041
139727
|
Guidelines are always-on coding standards that guide agent behavior.
|
|
@@ -139058,19 +139744,19 @@ var GuidelineCommand = class extends Command48 {
|
|
|
139058
139744
|
return 0;
|
|
139059
139745
|
}
|
|
139060
139746
|
};
|
|
139061
|
-
var GuidelineListCommand = class extends
|
|
139747
|
+
var GuidelineListCommand = class extends Command49 {
|
|
139062
139748
|
static paths = [["guideline", "list"], ["guideline", "ls"]];
|
|
139063
|
-
static usage =
|
|
139749
|
+
static usage = Command49.Usage({
|
|
139064
139750
|
description: "List all guidelines",
|
|
139065
139751
|
examples: [
|
|
139066
139752
|
["List all", "$0 guideline list"],
|
|
139067
139753
|
["Show only enabled", "$0 guideline list --enabled"]
|
|
139068
139754
|
]
|
|
139069
139755
|
});
|
|
139070
|
-
enabled =
|
|
139756
|
+
enabled = Option48.Boolean("--enabled,-e", false, {
|
|
139071
139757
|
description: "Show only enabled guidelines"
|
|
139072
139758
|
});
|
|
139073
|
-
json =
|
|
139759
|
+
json = Option48.Boolean("--json,-j", false, {
|
|
139074
139760
|
description: "Output as JSON"
|
|
139075
139761
|
});
|
|
139076
139762
|
async execute() {
|
|
@@ -139106,13 +139792,13 @@ var GuidelineListCommand = class extends Command48 {
|
|
|
139106
139792
|
return 0;
|
|
139107
139793
|
}
|
|
139108
139794
|
};
|
|
139109
|
-
var GuidelineShowCommand = class extends
|
|
139795
|
+
var GuidelineShowCommand = class extends Command49 {
|
|
139110
139796
|
static paths = [["guideline", "show"]];
|
|
139111
|
-
static usage =
|
|
139797
|
+
static usage = Command49.Usage({
|
|
139112
139798
|
description: "Show guideline content",
|
|
139113
139799
|
examples: [["Show guideline", "$0 guideline show security"]]
|
|
139114
139800
|
});
|
|
139115
|
-
id =
|
|
139801
|
+
id = Option48.String({ required: true });
|
|
139116
139802
|
async execute() {
|
|
139117
139803
|
const guideline = getGuideline(this.id);
|
|
139118
139804
|
if (!guideline) {
|
|
@@ -139133,13 +139819,13 @@ var GuidelineShowCommand = class extends Command48 {
|
|
|
139133
139819
|
return 0;
|
|
139134
139820
|
}
|
|
139135
139821
|
};
|
|
139136
|
-
var GuidelineEnableCommand = class extends
|
|
139822
|
+
var GuidelineEnableCommand = class extends Command49 {
|
|
139137
139823
|
static paths = [["guideline", "enable"]];
|
|
139138
|
-
static usage =
|
|
139824
|
+
static usage = Command49.Usage({
|
|
139139
139825
|
description: "Enable a guideline",
|
|
139140
139826
|
examples: [["Enable security", "$0 guideline enable security"]]
|
|
139141
139827
|
});
|
|
139142
|
-
id =
|
|
139828
|
+
id = Option48.String({ required: true });
|
|
139143
139829
|
async execute() {
|
|
139144
139830
|
const success2 = enableGuideline(this.id);
|
|
139145
139831
|
if (!success2) {
|
|
@@ -139150,13 +139836,13 @@ var GuidelineEnableCommand = class extends Command48 {
|
|
|
139150
139836
|
return 0;
|
|
139151
139837
|
}
|
|
139152
139838
|
};
|
|
139153
|
-
var GuidelineDisableCommand = class extends
|
|
139839
|
+
var GuidelineDisableCommand = class extends Command49 {
|
|
139154
139840
|
static paths = [["guideline", "disable"]];
|
|
139155
|
-
static usage =
|
|
139841
|
+
static usage = Command49.Usage({
|
|
139156
139842
|
description: "Disable a guideline",
|
|
139157
139843
|
examples: [["Disable performance", "$0 guideline disable performance"]]
|
|
139158
139844
|
});
|
|
139159
|
-
id =
|
|
139845
|
+
id = Option48.String({ required: true });
|
|
139160
139846
|
async execute() {
|
|
139161
139847
|
const success2 = disableGuideline(this.id);
|
|
139162
139848
|
if (!success2) {
|
|
@@ -139167,29 +139853,29 @@ var GuidelineDisableCommand = class extends Command48 {
|
|
|
139167
139853
|
return 0;
|
|
139168
139854
|
}
|
|
139169
139855
|
};
|
|
139170
|
-
var GuidelineCreateCommand = class extends
|
|
139856
|
+
var GuidelineCreateCommand = class extends Command49 {
|
|
139171
139857
|
static paths = [["guideline", "create"]];
|
|
139172
|
-
static usage =
|
|
139858
|
+
static usage = Command49.Usage({
|
|
139173
139859
|
description: "Create a custom guideline",
|
|
139174
139860
|
examples: [
|
|
139175
139861
|
["Create guideline", '$0 guideline create --id my-rules --name "My Rules" --category custom']
|
|
139176
139862
|
]
|
|
139177
139863
|
});
|
|
139178
|
-
id =
|
|
139864
|
+
id = Option48.String("--id", {
|
|
139179
139865
|
description: "Guideline ID",
|
|
139180
139866
|
required: true
|
|
139181
139867
|
});
|
|
139182
|
-
name =
|
|
139868
|
+
name = Option48.String("--name,-n", {
|
|
139183
139869
|
description: "Guideline name",
|
|
139184
139870
|
required: true
|
|
139185
139871
|
});
|
|
139186
|
-
description =
|
|
139872
|
+
description = Option48.String("--description,-d", {
|
|
139187
139873
|
description: "Guideline description"
|
|
139188
139874
|
});
|
|
139189
|
-
category =
|
|
139875
|
+
category = Option48.String("--category,-c", {
|
|
139190
139876
|
description: "Category (security, code-style, testing, git, performance, custom)"
|
|
139191
139877
|
});
|
|
139192
|
-
priority =
|
|
139878
|
+
priority = Option48.String("--priority,-p", {
|
|
139193
139879
|
description: "Priority (1-10, higher = more important)"
|
|
139194
139880
|
});
|
|
139195
139881
|
async execute() {
|
|
@@ -139216,13 +139902,13 @@ Add your guidelines here.`
|
|
|
139216
139902
|
return 0;
|
|
139217
139903
|
}
|
|
139218
139904
|
};
|
|
139219
|
-
var GuidelineRemoveCommand = class extends
|
|
139905
|
+
var GuidelineRemoveCommand = class extends Command49 {
|
|
139220
139906
|
static paths = [["guideline", "remove"], ["guideline", "rm"]];
|
|
139221
|
-
static usage =
|
|
139907
|
+
static usage = Command49.Usage({
|
|
139222
139908
|
description: "Remove a custom guideline",
|
|
139223
139909
|
examples: [["Remove guideline", "$0 guideline remove my-rules"]]
|
|
139224
139910
|
});
|
|
139225
|
-
id =
|
|
139911
|
+
id = Option48.String({ required: true });
|
|
139226
139912
|
async execute() {
|
|
139227
139913
|
if (isBuiltinGuideline(this.id)) {
|
|
139228
139914
|
console.log(chalk35.red(`Cannot remove built-in guideline: ${this.id}`));
|
|
@@ -139243,7 +139929,7 @@ function formatCategoryName2(category) {
|
|
|
139243
139929
|
|
|
139244
139930
|
// src/commands/tree.ts
|
|
139245
139931
|
init_onboarding();
|
|
139246
|
-
import { Command as
|
|
139932
|
+
import { Command as Command50, Option as Option49 } from "clipanion";
|
|
139247
139933
|
import { join as join19 } from "path";
|
|
139248
139934
|
import { homedir as homedir4 } from "os";
|
|
139249
139935
|
import {
|
|
@@ -139253,9 +139939,9 @@ import {
|
|
|
139253
139939
|
loadTree
|
|
139254
139940
|
} from "@skillkit/core";
|
|
139255
139941
|
var TREE_PATH = join19(homedir4(), ".skillkit", "skill-tree.json");
|
|
139256
|
-
var TreeCommand = class extends
|
|
139942
|
+
var TreeCommand = class extends Command50 {
|
|
139257
139943
|
static paths = [["tree"]];
|
|
139258
|
-
static usage =
|
|
139944
|
+
static usage = Command50.Usage({
|
|
139259
139945
|
description: "Browse skills in a hierarchical tree structure",
|
|
139260
139946
|
details: `
|
|
139261
139947
|
The tree command displays skills organized in a hierarchical taxonomy.
|
|
@@ -139277,23 +139963,23 @@ var TreeCommand = class extends Command49 {
|
|
|
139277
139963
|
["Show tree stats", "$0 tree --stats"]
|
|
139278
139964
|
]
|
|
139279
139965
|
});
|
|
139280
|
-
treePath =
|
|
139281
|
-
depth =
|
|
139966
|
+
treePath = Option49.String({ required: false });
|
|
139967
|
+
depth = Option49.String("--depth,-d", {
|
|
139282
139968
|
description: "Maximum depth to display"
|
|
139283
139969
|
});
|
|
139284
|
-
generate =
|
|
139970
|
+
generate = Option49.Boolean("--generate,-g", false, {
|
|
139285
139971
|
description: "Generate/update tree from skill index"
|
|
139286
139972
|
});
|
|
139287
|
-
markdown =
|
|
139973
|
+
markdown = Option49.Boolean("--markdown,-m", false, {
|
|
139288
139974
|
description: "Output in markdown format"
|
|
139289
139975
|
});
|
|
139290
|
-
stats =
|
|
139976
|
+
stats = Option49.Boolean("--stats,-s", false, {
|
|
139291
139977
|
description: "Show tree statistics"
|
|
139292
139978
|
});
|
|
139293
|
-
json =
|
|
139979
|
+
json = Option49.Boolean("--json,-j", false, {
|
|
139294
139980
|
description: "Output in JSON format"
|
|
139295
139981
|
});
|
|
139296
|
-
quiet =
|
|
139982
|
+
quiet = Option49.Boolean("--quiet,-q", false, {
|
|
139297
139983
|
description: "Minimal output"
|
|
139298
139984
|
});
|
|
139299
139985
|
async execute() {
|
|
@@ -139446,11 +140132,11 @@ var TreeCommand = class extends Command49 {
|
|
|
139446
140132
|
// src/commands/quick.ts
|
|
139447
140133
|
init_helpers();
|
|
139448
140134
|
init_onboarding();
|
|
139449
|
-
import { existsSync as
|
|
139450
|
-
import { join as join20, resolve as
|
|
140135
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync11, cpSync as cpSync4, rmSync as rmSync5, symlinkSync as symlinkSync2 } from "fs";
|
|
140136
|
+
import { join as join20, resolve as resolve22, normalize } from "path";
|
|
139451
140137
|
import { execFile as execFile2 } from "child_process";
|
|
139452
140138
|
import { promisify as promisify2 } from "util";
|
|
139453
|
-
import { Command as
|
|
140139
|
+
import { Command as Command51 } from "clipanion";
|
|
139454
140140
|
import {
|
|
139455
140141
|
ContextManager as ContextManager3,
|
|
139456
140142
|
RecommendationEngine as RecommendationEngine2,
|
|
@@ -139469,9 +140155,9 @@ function truncate6(str, maxLen) {
|
|
|
139469
140155
|
if (str.length <= maxLen) return str;
|
|
139470
140156
|
return str.slice(0, maxLen - 3) + "...";
|
|
139471
140157
|
}
|
|
139472
|
-
var QuickCommand = class extends
|
|
140158
|
+
var QuickCommand = class extends Command51 {
|
|
139473
140159
|
static paths = [["quick"]];
|
|
139474
|
-
static usage =
|
|
140160
|
+
static usage = Command51.Usage({
|
|
139475
140161
|
description: "Zero-friction skill setup: detect agents, analyze project, recommend and install",
|
|
139476
140162
|
examples: [
|
|
139477
140163
|
["Quick setup", "$0 quick"]
|
|
@@ -139490,7 +140176,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139490
140176
|
try {
|
|
139491
140177
|
const installDir = getInstallDir(false, adapter.type);
|
|
139492
140178
|
const globalDir = getInstallDir(true, adapter.type);
|
|
139493
|
-
if (
|
|
140179
|
+
if (existsSync22(installDir) || existsSync22(globalDir) || existsSync22(adapter.configFile)) {
|
|
139494
140180
|
detectedAgents.push(adapter.type);
|
|
139495
140181
|
}
|
|
139496
140182
|
} catch {
|
|
@@ -139502,7 +140188,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139502
140188
|
}
|
|
139503
140189
|
s.stop(`Detected ${detectedAgents.length} agent${detectedAgents.length !== 1 ? "s" : ""}: ${detectedAgents.map(formatAgent).join(", ")}`);
|
|
139504
140190
|
s.start("Analyzing project...");
|
|
139505
|
-
const targetPath =
|
|
140191
|
+
const targetPath = resolve22(process.cwd());
|
|
139506
140192
|
const manager = new ContextManager3(targetPath);
|
|
139507
140193
|
let context = manager.get();
|
|
139508
140194
|
if (!context) {
|
|
@@ -139637,8 +140323,8 @@ var QuickCommand = class extends Command50 {
|
|
|
139637
140323
|
for (const agentType of detectedAgents) {
|
|
139638
140324
|
const adapter = getAdapter6(agentType);
|
|
139639
140325
|
const installDir = getInstallDir(false, agentType);
|
|
139640
|
-
if (!
|
|
139641
|
-
|
|
140326
|
+
if (!existsSync22(installDir)) {
|
|
140327
|
+
mkdirSync11(installDir, { recursive: true });
|
|
139642
140328
|
}
|
|
139643
140329
|
const sanitizedName = matchedSkill.name.split(/[/\\]/).pop() || matchedSkill.name;
|
|
139644
140330
|
const targetInstallPath = normalize(join20(installDir, sanitizedName));
|
|
@@ -139654,7 +140340,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139654
140340
|
const useSymlink = detectedAgents.length > 1 && primaryPath !== null;
|
|
139655
140341
|
s.start(`Installing to ${adapter.name}${useSymlink ? " (symlink)" : ""}...`);
|
|
139656
140342
|
try {
|
|
139657
|
-
if (
|
|
140343
|
+
if (existsSync22(targetInstallPath)) {
|
|
139658
140344
|
rmSync5(targetInstallPath, { recursive: true, force: true });
|
|
139659
140345
|
}
|
|
139660
140346
|
if (useSymlink && primaryPath) {
|
|
@@ -139665,7 +140351,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139665
140351
|
primaryPath = targetInstallPath;
|
|
139666
140352
|
}
|
|
139667
140353
|
const packageJsonPath = join20(targetInstallPath, "package.json");
|
|
139668
|
-
if (
|
|
140354
|
+
if (existsSync22(packageJsonPath)) {
|
|
139669
140355
|
s.stop(`Installed to ${adapter.name}`);
|
|
139670
140356
|
s.start("Installing npm dependencies...");
|
|
139671
140357
|
try {
|
|
@@ -139696,7 +140382,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139696
140382
|
}
|
|
139697
140383
|
}
|
|
139698
140384
|
const cleanupPath = cloneResult.tempRoot || cloneResult.path;
|
|
139699
|
-
if (!isLocalPath4(selectedSkill.skill.source) && cleanupPath &&
|
|
140385
|
+
if (!isLocalPath4(selectedSkill.skill.source) && cleanupPath && existsSync22(cleanupPath)) {
|
|
139700
140386
|
rmSync5(cleanupPath, { recursive: true, force: true });
|
|
139701
140387
|
}
|
|
139702
140388
|
if (installedAgents.length > 0) {
|
|
@@ -139730,9 +140416,9 @@ var QuickCommand = class extends Command50 {
|
|
|
139730
140416
|
|
|
139731
140417
|
// src/commands/skillmd.ts
|
|
139732
140418
|
init_onboarding();
|
|
139733
|
-
import { existsSync as
|
|
139734
|
-
import { join as join21, resolve as
|
|
139735
|
-
import { Command as
|
|
140419
|
+
import { existsSync as existsSync23, readFileSync as readFileSync11, writeFileSync as writeFileSync12, readdirSync as readdirSync4 } from "fs";
|
|
140420
|
+
import { join as join21, resolve as resolve23, basename as basename6, relative } from "path";
|
|
140421
|
+
import { Command as Command52, Option as Option50 } from "clipanion";
|
|
139736
140422
|
function validateSkillMd(filePath) {
|
|
139737
140423
|
const result = {
|
|
139738
140424
|
path: filePath,
|
|
@@ -139746,7 +140432,7 @@ function validateSkillMd(filePath) {
|
|
|
139746
140432
|
score: 0,
|
|
139747
140433
|
issues: []
|
|
139748
140434
|
};
|
|
139749
|
-
if (!
|
|
140435
|
+
if (!existsSync23(filePath)) {
|
|
139750
140436
|
result.issues.push("File does not exist");
|
|
139751
140437
|
return result;
|
|
139752
140438
|
}
|
|
@@ -139847,25 +140533,25 @@ function printValidation(validation, verbose = false) {
|
|
|
139847
140533
|
}
|
|
139848
140534
|
}
|
|
139849
140535
|
}
|
|
139850
|
-
var SkillMdValidateCommand = class extends
|
|
140536
|
+
var SkillMdValidateCommand = class extends Command52 {
|
|
139851
140537
|
static paths = [["skillmd", "validate"], ["skill-md", "validate"]];
|
|
139852
|
-
static usage =
|
|
140538
|
+
static usage = Command52.Usage({
|
|
139853
140539
|
description: "Validate a SKILL.md file against the standard",
|
|
139854
140540
|
examples: [
|
|
139855
140541
|
["Validate SKILL.md in current directory", "$0 skillmd validate"],
|
|
139856
140542
|
["Validate specific file", "$0 skillmd validate ./path/to/SKILL.md"]
|
|
139857
140543
|
]
|
|
139858
140544
|
});
|
|
139859
|
-
targetPath =
|
|
139860
|
-
verbose =
|
|
140545
|
+
targetPath = Option50.String({ required: false, name: "path" });
|
|
140546
|
+
verbose = Option50.Boolean("--verbose,-v", false, {
|
|
139861
140547
|
description: "Show detailed validation results"
|
|
139862
140548
|
});
|
|
139863
|
-
json =
|
|
140549
|
+
json = Option50.Boolean("--json", false, {
|
|
139864
140550
|
description: "Output as JSON"
|
|
139865
140551
|
});
|
|
139866
140552
|
async execute() {
|
|
139867
140553
|
const targetPath = this.targetPath || join21(process.cwd(), "SKILL.md");
|
|
139868
|
-
const resolvedPath =
|
|
140554
|
+
const resolvedPath = resolve23(targetPath);
|
|
139869
140555
|
const filePath = resolvedPath.endsWith("SKILL.md") ? resolvedPath : join21(resolvedPath, "SKILL.md");
|
|
139870
140556
|
if (!this.json) {
|
|
139871
140557
|
header("SKILL.md Validation");
|
|
@@ -139890,24 +140576,24 @@ var SkillMdValidateCommand = class extends Command51 {
|
|
|
139890
140576
|
return validation.score >= 60 ? 0 : 1;
|
|
139891
140577
|
}
|
|
139892
140578
|
};
|
|
139893
|
-
var SkillMdInitCommand = class extends
|
|
140579
|
+
var SkillMdInitCommand = class extends Command52 {
|
|
139894
140580
|
static paths = [["skillmd", "init"], ["skill-md", "init"]];
|
|
139895
|
-
static usage =
|
|
140581
|
+
static usage = Command52.Usage({
|
|
139896
140582
|
description: "Create a template SKILL.md in the current directory",
|
|
139897
140583
|
examples: [
|
|
139898
140584
|
["Create SKILL.md template", "$0 skillmd init"],
|
|
139899
140585
|
["Create with custom name", "$0 skillmd init --name my-skill"]
|
|
139900
140586
|
]
|
|
139901
140587
|
});
|
|
139902
|
-
name =
|
|
140588
|
+
name = Option50.String("--name,-n", {
|
|
139903
140589
|
description: "Skill name"
|
|
139904
140590
|
});
|
|
139905
|
-
force =
|
|
140591
|
+
force = Option50.Boolean("--force,-f", false, {
|
|
139906
140592
|
description: "Overwrite existing SKILL.md"
|
|
139907
140593
|
});
|
|
139908
140594
|
async execute() {
|
|
139909
140595
|
const outputPath = join21(process.cwd(), "SKILL.md");
|
|
139910
|
-
if (
|
|
140596
|
+
if (existsSync23(outputPath) && !this.force) {
|
|
139911
140597
|
warn("SKILL.md already exists");
|
|
139912
140598
|
console.log(colors.muted("Use --force to overwrite"));
|
|
139913
140599
|
return 1;
|
|
@@ -139952,7 +140638,7 @@ var SkillMdInitCommand = class extends Command51 {
|
|
|
139952
140638
|
"```",
|
|
139953
140639
|
""
|
|
139954
140640
|
].join("\n");
|
|
139955
|
-
|
|
140641
|
+
writeFileSync12(outputPath, template);
|
|
139956
140642
|
success(`Created SKILL.md for "${skillName}"`);
|
|
139957
140643
|
console.log("");
|
|
139958
140644
|
console.log(colors.muted("Next steps:"));
|
|
@@ -139962,21 +140648,21 @@ var SkillMdInitCommand = class extends Command51 {
|
|
|
139962
140648
|
return 0;
|
|
139963
140649
|
}
|
|
139964
140650
|
};
|
|
139965
|
-
var SkillMdCheckCommand = class extends
|
|
140651
|
+
var SkillMdCheckCommand = class extends Command52 {
|
|
139966
140652
|
static paths = [["skillmd", "check"], ["skill-md", "check"]];
|
|
139967
|
-
static usage =
|
|
140653
|
+
static usage = Command52.Usage({
|
|
139968
140654
|
description: "Check all SKILL.md files in the project for compliance",
|
|
139969
140655
|
examples: [
|
|
139970
140656
|
["Check current directory", "$0 skillmd check"],
|
|
139971
140657
|
["Check specific directory", "$0 skillmd check ./skills"]
|
|
139972
140658
|
]
|
|
139973
140659
|
});
|
|
139974
|
-
targetPath =
|
|
139975
|
-
verbose =
|
|
140660
|
+
targetPath = Option50.String({ required: false, name: "path" });
|
|
140661
|
+
verbose = Option50.Boolean("--verbose,-v", false, {
|
|
139976
140662
|
description: "Show detailed validation results"
|
|
139977
140663
|
});
|
|
139978
140664
|
async execute() {
|
|
139979
|
-
const targetPath =
|
|
140665
|
+
const targetPath = resolve23(this.targetPath || process.cwd());
|
|
139980
140666
|
header("SKILL.md Compliance Check");
|
|
139981
140667
|
const s = spinner2();
|
|
139982
140668
|
s.start("Scanning for SKILL.md files...");
|
|
@@ -140024,7 +140710,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140024
140710
|
findSkillMdFiles(dir) {
|
|
140025
140711
|
const results = [];
|
|
140026
140712
|
const directFile = join21(dir, "SKILL.md");
|
|
140027
|
-
if (
|
|
140713
|
+
if (existsSync23(directFile)) results.push(directFile);
|
|
140028
140714
|
const searchDirs = [
|
|
140029
140715
|
join21(dir, "skills"),
|
|
140030
140716
|
join21(dir, ".claude", "skills"),
|
|
@@ -140033,7 +140719,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140033
140719
|
join21(dir, ".github", "skills")
|
|
140034
140720
|
];
|
|
140035
140721
|
for (const searchDir of searchDirs) {
|
|
140036
|
-
if (!
|
|
140722
|
+
if (!existsSync23(searchDir)) continue;
|
|
140037
140723
|
this.scanDir(searchDir, results, 0);
|
|
140038
140724
|
}
|
|
140039
140725
|
try {
|
|
@@ -140042,7 +140728,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140042
140728
|
if (!entry.isDirectory()) continue;
|
|
140043
140729
|
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
140044
140730
|
const entrySkillMd = join21(dir, entry.name, "SKILL.md");
|
|
140045
|
-
if (
|
|
140731
|
+
if (existsSync23(entrySkillMd) && !results.includes(entrySkillMd)) {
|
|
140046
140732
|
results.push(entrySkillMd);
|
|
140047
140733
|
}
|
|
140048
140734
|
}
|
|
@@ -140070,10 +140756,10 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140070
140756
|
|
|
140071
140757
|
// src/commands/serve.ts
|
|
140072
140758
|
init_onboarding();
|
|
140073
|
-
import { Command as
|
|
140074
|
-
var ServeCommand = class extends
|
|
140759
|
+
import { Command as Command53, Option as Option51 } from "clipanion";
|
|
140760
|
+
var ServeCommand = class extends Command53 {
|
|
140075
140761
|
static paths = [["serve"], ["server"]];
|
|
140076
|
-
static usage =
|
|
140762
|
+
static usage = Command53.Usage({
|
|
140077
140763
|
description: "Start the SkillKit REST API server for skill discovery",
|
|
140078
140764
|
details: `
|
|
140079
140765
|
Launches a local HTTP server that exposes the SkillKit skill catalog
|
|
@@ -140086,16 +140772,16 @@ var ServeCommand = class extends Command52 {
|
|
|
140086
140772
|
["Start with custom CORS", '$0 serve --cors "http://localhost:3000"']
|
|
140087
140773
|
]
|
|
140088
140774
|
});
|
|
140089
|
-
port =
|
|
140775
|
+
port = Option51.String("--port,-p", "3737", {
|
|
140090
140776
|
description: "Port to listen on"
|
|
140091
140777
|
});
|
|
140092
|
-
host =
|
|
140778
|
+
host = Option51.String("--host,-H", "0.0.0.0", {
|
|
140093
140779
|
description: "Host to bind to"
|
|
140094
140780
|
});
|
|
140095
|
-
corsOrigin =
|
|
140781
|
+
corsOrigin = Option51.String("--cors", "*", {
|
|
140096
140782
|
description: "CORS allowed origin"
|
|
140097
140783
|
});
|
|
140098
|
-
cacheTtl =
|
|
140784
|
+
cacheTtl = Option51.String("--cache-ttl", "86400000", {
|
|
140099
140785
|
description: "Cache TTL in milliseconds"
|
|
140100
140786
|
});
|
|
140101
140787
|
async execute() {
|
|
@@ -140130,6 +140816,8 @@ var ServeCommand = class extends Command52 {
|
|
|
140130
140816
|
console.log(colors.muted(` GET /trending - Top skills`));
|
|
140131
140817
|
console.log(colors.muted(` GET /categories - Skill categories`));
|
|
140132
140818
|
console.log(colors.muted(` GET /cache/stats - Cache statistics`));
|
|
140819
|
+
console.log(colors.muted(` GET /docs - Interactive API docs`));
|
|
140820
|
+
console.log(colors.muted(` GET /openapi.json - OpenAPI specification`));
|
|
140133
140821
|
console.log("");
|
|
140134
140822
|
console.log(colors.muted("Press Ctrl+C to stop"));
|
|
140135
140823
|
await new Promise(() => {
|
|
@@ -140169,6 +140857,7 @@ export {
|
|
|
140169
140857
|
EnableCommand,
|
|
140170
140858
|
FindCommand,
|
|
140171
140859
|
FixCommand,
|
|
140860
|
+
GenerateCommand,
|
|
140172
140861
|
GuidelineCommand,
|
|
140173
140862
|
GuidelineCreateCommand,
|
|
140174
140863
|
GuidelineDisableCommand,
|