@skillkit/cli 1.13.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 +26 -1
- package/dist/index.js +958 -393
- 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();
|
|
@@ -5801,12 +6324,12 @@ ${learning.title}
|
|
|
5801
6324
|
}
|
|
5802
6325
|
const outputPath = this.output || `.skillkit/exports/${skillName}/SKILL.md`;
|
|
5803
6326
|
const { dirname: dirname7 } = await import("path");
|
|
5804
|
-
const { existsSync:
|
|
6327
|
+
const { existsSync: existsSync24, mkdirSync: mkdirSync12, writeFileSync: writeFileSync13 } = await import("fs");
|
|
5805
6328
|
const outputDir = dirname7(outputPath);
|
|
5806
|
-
if (!
|
|
5807
|
-
|
|
6329
|
+
if (!existsSync24(outputDir)) {
|
|
6330
|
+
mkdirSync12(outputDir, { recursive: true });
|
|
5808
6331
|
}
|
|
5809
|
-
|
|
6332
|
+
writeFileSync13(outputPath, skillContent, "utf-8");
|
|
5810
6333
|
console.log(chalk18.green(`\u2713 Exported learning as skill: ${skillName}`));
|
|
5811
6334
|
console.log(chalk18.gray(` Path: ${outputPath}`));
|
|
5812
6335
|
return 0;
|
|
@@ -5821,10 +6344,10 @@ ${learning.title}
|
|
|
5821
6344
|
console.log(chalk18.gray("Usage: skillkit memory import --input <path>"));
|
|
5822
6345
|
return 1;
|
|
5823
6346
|
}
|
|
5824
|
-
const { existsSync:
|
|
5825
|
-
const { resolve:
|
|
5826
|
-
const fullPath =
|
|
5827
|
-
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)) {
|
|
5828
6351
|
console.error(chalk18.red(`File not found: ${fullPath}`));
|
|
5829
6352
|
return 1;
|
|
5830
6353
|
}
|
|
@@ -7014,14 +7537,14 @@ var TeamCommand = class extends Command29 {
|
|
|
7014
7537
|
}
|
|
7015
7538
|
const projectPath = process.cwd();
|
|
7016
7539
|
const bundlePath = join12(projectPath, ".skillkit", "bundles", `${this.name}.json`);
|
|
7017
|
-
const { existsSync:
|
|
7018
|
-
if (!
|
|
7540
|
+
const { existsSync: existsSync24, readFileSync: readFileSync12, writeFileSync: writeFileSync13 } = await import("fs");
|
|
7541
|
+
if (!existsSync24(bundlePath)) {
|
|
7019
7542
|
this.context.stderr.write(chalk21.red(`Bundle "${this.name}" not found. Create it first with bundle-create.
|
|
7020
7543
|
`));
|
|
7021
7544
|
return 1;
|
|
7022
7545
|
}
|
|
7023
7546
|
const content = readFileSync12(bundlePath, "utf-8");
|
|
7024
|
-
|
|
7547
|
+
writeFileSync13(this.output, content, "utf-8");
|
|
7025
7548
|
this.context.stdout.write(chalk21.green(`\u2713 Bundle exported to: ${this.output}
|
|
7026
7549
|
`));
|
|
7027
7550
|
return 0;
|
|
@@ -7031,8 +7554,8 @@ var TeamCommand = class extends Command29 {
|
|
|
7031
7554
|
this.context.stderr.write(chalk21.red("--source <path> is required for bundle-import\n"));
|
|
7032
7555
|
return 1;
|
|
7033
7556
|
}
|
|
7034
|
-
const { existsSync:
|
|
7035
|
-
if (!
|
|
7557
|
+
const { existsSync: existsSync24 } = await import("fs");
|
|
7558
|
+
if (!existsSync24(this.source)) {
|
|
7036
7559
|
this.context.stderr.write(chalk21.red(`Bundle file not found: ${this.source}
|
|
7037
7560
|
`));
|
|
7038
7561
|
return 1;
|
|
@@ -8996,18 +9519,20 @@ Saved to: ${configPath}
|
|
|
8996
9519
|
};
|
|
8997
9520
|
|
|
8998
9521
|
// src/commands/ai.ts
|
|
8999
|
-
import { Command as
|
|
9000
|
-
import { resolve as
|
|
9522
|
+
import { Command as Command36, Option as Option35 } from "clipanion";
|
|
9523
|
+
import { resolve as resolve17 } from "path";
|
|
9001
9524
|
import { promises as fs2 } from "fs";
|
|
9002
9525
|
import chalk25 from "chalk";
|
|
9003
9526
|
import ora4 from "ora";
|
|
9004
9527
|
import {
|
|
9005
9528
|
AIManager,
|
|
9006
|
-
loadIndex as loadIndexFromCache2
|
|
9529
|
+
loadIndex as loadIndexFromCache2,
|
|
9530
|
+
detectProviders as detectProviders2,
|
|
9531
|
+
getDefaultProvider
|
|
9007
9532
|
} from "@skillkit/core";
|
|
9008
|
-
var AICommand = class extends
|
|
9533
|
+
var AICommand = class extends Command36 {
|
|
9009
9534
|
static paths = [["ai"]];
|
|
9010
|
-
static usage =
|
|
9535
|
+
static usage = Command36.Usage({
|
|
9011
9536
|
description: "AI-powered skill search and generation",
|
|
9012
9537
|
details: `
|
|
9013
9538
|
The ai command provides AI-powered features for skills:
|
|
@@ -9027,37 +9552,37 @@ var AICommand = class extends Command35 {
|
|
|
9027
9552
|
]
|
|
9028
9553
|
});
|
|
9029
9554
|
// Subcommand
|
|
9030
|
-
subcommand =
|
|
9555
|
+
subcommand = Option35.String({ required: true });
|
|
9031
9556
|
// Search options
|
|
9032
|
-
query =
|
|
9557
|
+
query = Option35.String("--query,-q", {
|
|
9033
9558
|
description: "Search query for natural language search"
|
|
9034
9559
|
});
|
|
9035
9560
|
// Generation options
|
|
9036
|
-
description =
|
|
9561
|
+
description = Option35.String("--description,-d", {
|
|
9037
9562
|
description: "Description of the skill to generate"
|
|
9038
9563
|
});
|
|
9039
|
-
fromCode =
|
|
9564
|
+
fromCode = Option35.String("--from-code", {
|
|
9040
9565
|
description: "Generate skill from code example file"
|
|
9041
9566
|
});
|
|
9042
|
-
additionalContext =
|
|
9567
|
+
additionalContext = Option35.String("--context", {
|
|
9043
9568
|
description: "Additional context for generation"
|
|
9044
9569
|
});
|
|
9045
|
-
targetAgent =
|
|
9570
|
+
targetAgent = Option35.String("--agent,-a", {
|
|
9046
9571
|
description: "Target agent for generated skill"
|
|
9047
9572
|
});
|
|
9048
9573
|
// Similar skills option
|
|
9049
|
-
skillName =
|
|
9574
|
+
skillName = Option35.String({ required: false });
|
|
9050
9575
|
// Common options
|
|
9051
|
-
limit =
|
|
9576
|
+
limit = Option35.String("--limit,-l", {
|
|
9052
9577
|
description: "Maximum number of results"
|
|
9053
9578
|
});
|
|
9054
|
-
minRelevance =
|
|
9579
|
+
minRelevance = Option35.String("--min-relevance", {
|
|
9055
9580
|
description: "Minimum relevance score (0-1)"
|
|
9056
9581
|
});
|
|
9057
|
-
json =
|
|
9582
|
+
json = Option35.Boolean("--json,-j", false, {
|
|
9058
9583
|
description: "Output in JSON format"
|
|
9059
9584
|
});
|
|
9060
|
-
output =
|
|
9585
|
+
output = Option35.String("--output,-o", {
|
|
9061
9586
|
description: "Output file for generated skill"
|
|
9062
9587
|
});
|
|
9063
9588
|
async execute() {
|
|
@@ -9081,12 +9606,16 @@ var AICommand = class extends Command35 {
|
|
|
9081
9606
|
return await this.handleGenerate(manager);
|
|
9082
9607
|
case "similar":
|
|
9083
9608
|
return await this.handleSimilar(manager);
|
|
9609
|
+
case "wizard":
|
|
9610
|
+
return await this.handleWizard();
|
|
9611
|
+
case "providers":
|
|
9612
|
+
return this.handleProviders();
|
|
9084
9613
|
default:
|
|
9085
9614
|
console.error(
|
|
9086
9615
|
chalk25.red(`Unknown subcommand: ${this.subcommand}
|
|
9087
9616
|
`)
|
|
9088
9617
|
);
|
|
9089
|
-
console.log("Valid subcommands: search, generate, similar");
|
|
9618
|
+
console.log("Valid subcommands: search, generate, similar, wizard, providers");
|
|
9090
9619
|
return 1;
|
|
9091
9620
|
}
|
|
9092
9621
|
}
|
|
@@ -9153,7 +9682,7 @@ AI Search Results (${results.length} found):
|
|
|
9153
9682
|
}
|
|
9154
9683
|
let codeExamples = [];
|
|
9155
9684
|
if (this.fromCode) {
|
|
9156
|
-
const codePath =
|
|
9685
|
+
const codePath = resolve17(this.fromCode);
|
|
9157
9686
|
try {
|
|
9158
9687
|
const code = await fs2.readFile(codePath, "utf-8");
|
|
9159
9688
|
codeExamples = [code];
|
|
@@ -9205,7 +9734,7 @@ AI Search Results (${results.length} found):
|
|
|
9205
9734
|
console.log(generated.content);
|
|
9206
9735
|
console.log(chalk25.dim("\u2500".repeat(60)));
|
|
9207
9736
|
if (this.output) {
|
|
9208
|
-
const outputPath =
|
|
9737
|
+
const outputPath = resolve17(this.output);
|
|
9209
9738
|
await fs2.writeFile(outputPath, generated.content, "utf-8");
|
|
9210
9739
|
console.log(chalk25.green(`
|
|
9211
9740
|
\u2713 Saved to: ${outputPath}`));
|
|
@@ -9302,28 +9831,63 @@ Skills similar to "${skillName}" (${results.length} found):
|
|
|
9302
9831
|
source: s.source
|
|
9303
9832
|
}));
|
|
9304
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
|
+
}
|
|
9305
9865
|
getAIConfig() {
|
|
9306
|
-
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;
|
|
9307
9868
|
return {
|
|
9308
|
-
provider
|
|
9869
|
+
provider,
|
|
9309
9870
|
apiKey,
|
|
9310
|
-
model:
|
|
9871
|
+
model: provider === "anthropic" ? "claude-sonnet-4-20250514" : void 0,
|
|
9311
9872
|
maxTokens: 4096,
|
|
9312
9873
|
temperature: 0.7
|
|
9313
9874
|
};
|
|
9314
9875
|
}
|
|
9315
9876
|
};
|
|
9316
9877
|
|
|
9878
|
+
// src/commands/index.ts
|
|
9879
|
+
init_generate();
|
|
9880
|
+
|
|
9317
9881
|
// src/commands/audit.ts
|
|
9318
|
-
import { Command as
|
|
9319
|
-
import { resolve as
|
|
9882
|
+
import { Command as Command37, Option as Option36 } from "clipanion";
|
|
9883
|
+
import { resolve as resolve18 } from "path";
|
|
9320
9884
|
import { promises as fs3 } from "fs";
|
|
9321
9885
|
import path2 from "path";
|
|
9322
9886
|
import chalk26 from "chalk";
|
|
9323
9887
|
import { AuditLogger } from "@skillkit/core";
|
|
9324
|
-
var AuditCommand = class extends
|
|
9888
|
+
var AuditCommand = class extends Command37 {
|
|
9325
9889
|
static paths = [["audit"]];
|
|
9326
|
-
static usage =
|
|
9890
|
+
static usage = Command37.Usage({
|
|
9327
9891
|
description: "View and manage audit logs",
|
|
9328
9892
|
details: `
|
|
9329
9893
|
The audit command provides access to the audit log system.
|
|
@@ -9343,52 +9907,52 @@ var AuditCommand = class extends Command36 {
|
|
|
9343
9907
|
["Clear logs older than 30 days", "$0 audit clear --days 30"]
|
|
9344
9908
|
]
|
|
9345
9909
|
});
|
|
9346
|
-
subcommand =
|
|
9910
|
+
subcommand = Option36.String({ required: true });
|
|
9347
9911
|
// Query options
|
|
9348
|
-
type =
|
|
9912
|
+
type = Option36.Array("--type,-t", {
|
|
9349
9913
|
description: "Filter by event type"
|
|
9350
9914
|
});
|
|
9351
|
-
user =
|
|
9915
|
+
user = Option36.String("--user,-u", {
|
|
9352
9916
|
description: "Filter by user"
|
|
9353
9917
|
});
|
|
9354
|
-
resource =
|
|
9918
|
+
resource = Option36.String("--resource,-r", {
|
|
9355
9919
|
description: "Filter by resource"
|
|
9356
9920
|
});
|
|
9357
|
-
success =
|
|
9921
|
+
success = Option36.Boolean("--success", {
|
|
9358
9922
|
description: "Show only successful operations"
|
|
9359
9923
|
});
|
|
9360
|
-
failed =
|
|
9924
|
+
failed = Option36.Boolean("--failed", {
|
|
9361
9925
|
description: "Show only failed operations"
|
|
9362
9926
|
});
|
|
9363
|
-
since =
|
|
9927
|
+
since = Option36.String("--since", {
|
|
9364
9928
|
description: "Show events since date (ISO 8601)"
|
|
9365
9929
|
});
|
|
9366
|
-
until =
|
|
9930
|
+
until = Option36.String("--until", {
|
|
9367
9931
|
description: "Show events until date (ISO 8601)"
|
|
9368
9932
|
});
|
|
9369
|
-
limit =
|
|
9933
|
+
limit = Option36.String("--limit,-l", {
|
|
9370
9934
|
description: "Maximum number of entries"
|
|
9371
9935
|
});
|
|
9372
9936
|
// Export options
|
|
9373
|
-
format =
|
|
9937
|
+
format = Option36.String("--format,-f", {
|
|
9374
9938
|
description: "Export format (json, csv, text)"
|
|
9375
9939
|
});
|
|
9376
|
-
output =
|
|
9940
|
+
output = Option36.String("--output,-o", {
|
|
9377
9941
|
description: "Output file path"
|
|
9378
9942
|
});
|
|
9379
9943
|
// Clear options
|
|
9380
|
-
days =
|
|
9944
|
+
days = Option36.String("--days", {
|
|
9381
9945
|
description: "Clear entries older than N days"
|
|
9382
9946
|
});
|
|
9383
9947
|
// Common options
|
|
9384
|
-
json =
|
|
9948
|
+
json = Option36.Boolean("--json,-j", false, {
|
|
9385
9949
|
description: "Output in JSON format"
|
|
9386
9950
|
});
|
|
9387
|
-
projectPath =
|
|
9951
|
+
projectPath = Option36.String("--path,-p", {
|
|
9388
9952
|
description: "Project path (default: current directory)"
|
|
9389
9953
|
});
|
|
9390
9954
|
async execute() {
|
|
9391
|
-
const targetPath =
|
|
9955
|
+
const targetPath = resolve18(this.projectPath || process.cwd());
|
|
9392
9956
|
const logDir = path2.join(targetPath, ".skillkit");
|
|
9393
9957
|
const logger = new AuditLogger(logDir);
|
|
9394
9958
|
try {
|
|
@@ -9456,7 +10020,7 @@ Audit Log (${events.length} entries):
|
|
|
9456
10020
|
const query = this.buildQuery();
|
|
9457
10021
|
const content = await logger.export({ format, query });
|
|
9458
10022
|
if (this.output) {
|
|
9459
|
-
const outputPath =
|
|
10023
|
+
const outputPath = resolve18(this.output);
|
|
9460
10024
|
await fs3.writeFile(outputPath, content, "utf-8");
|
|
9461
10025
|
console.log(chalk26.green(`\u2713 Exported audit log to: ${outputPath}`));
|
|
9462
10026
|
} else {
|
|
@@ -9554,10 +10118,10 @@ Recent Errors (${stats.recentErrors.length}):`));
|
|
|
9554
10118
|
};
|
|
9555
10119
|
|
|
9556
10120
|
// src/commands/publish.ts
|
|
9557
|
-
import { existsSync as
|
|
9558
|
-
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";
|
|
9559
10123
|
import chalk27 from "chalk";
|
|
9560
|
-
import { Command as
|
|
10124
|
+
import { Command as Command38, Option as Option37 } from "clipanion";
|
|
9561
10125
|
import { generateWellKnownIndex } from "@skillkit/core";
|
|
9562
10126
|
function sanitizeSkillName(name) {
|
|
9563
10127
|
if (!name || typeof name !== "string") return null;
|
|
@@ -9570,9 +10134,9 @@ function sanitizeSkillName(name) {
|
|
|
9570
10134
|
}
|
|
9571
10135
|
return name;
|
|
9572
10136
|
}
|
|
9573
|
-
var PublishCommand = class extends
|
|
10137
|
+
var PublishCommand = class extends Command38 {
|
|
9574
10138
|
static paths = [["publish"]];
|
|
9575
|
-
static usage =
|
|
10139
|
+
static usage = Command38.Usage({
|
|
9576
10140
|
description: "Generate well-known skills structure for hosting",
|
|
9577
10141
|
details: `
|
|
9578
10142
|
This command generates the RFC 8615 well-known URI structure for hosting skills.
|
|
@@ -9590,11 +10154,11 @@ var PublishCommand = class extends Command37 {
|
|
|
9590
10154
|
["Preview without writing", "$0 publish --dry-run"]
|
|
9591
10155
|
]
|
|
9592
10156
|
});
|
|
9593
|
-
skillPath =
|
|
9594
|
-
output =
|
|
10157
|
+
skillPath = Option37.String({ required: false, name: "path" });
|
|
10158
|
+
output = Option37.String("--output,-o", {
|
|
9595
10159
|
description: "Output directory for well-known structure (default: current directory)"
|
|
9596
10160
|
});
|
|
9597
|
-
dryRun =
|
|
10161
|
+
dryRun = Option37.Boolean("--dry-run,-n", false, {
|
|
9598
10162
|
description: "Show what would be generated without writing files"
|
|
9599
10163
|
});
|
|
9600
10164
|
async execute() {
|
|
@@ -9648,27 +10212,27 @@ var PublishCommand = class extends Command37 {
|
|
|
9648
10212
|
return 0;
|
|
9649
10213
|
}
|
|
9650
10214
|
const wellKnownDir = join16(outputDir, ".well-known", "skills");
|
|
9651
|
-
|
|
10215
|
+
mkdirSync9(wellKnownDir, { recursive: true });
|
|
9652
10216
|
for (const skill of validSkills) {
|
|
9653
10217
|
const skillDir = join16(wellKnownDir, skill.safeName);
|
|
9654
|
-
const resolvedSkillDir =
|
|
9655
|
-
const resolvedWellKnownDir =
|
|
10218
|
+
const resolvedSkillDir = resolve19(skillDir);
|
|
10219
|
+
const resolvedWellKnownDir = resolve19(wellKnownDir);
|
|
9656
10220
|
if (!resolvedSkillDir.startsWith(resolvedWellKnownDir)) {
|
|
9657
10221
|
console.log(chalk27.yellow(` Skipping "${skill.name}" (path traversal detected)`));
|
|
9658
10222
|
continue;
|
|
9659
10223
|
}
|
|
9660
|
-
|
|
10224
|
+
mkdirSync9(skillDir, { recursive: true });
|
|
9661
10225
|
const files = this.getSkillFiles(skill.path);
|
|
9662
10226
|
for (const file of files) {
|
|
9663
10227
|
const safeFile = basename4(file);
|
|
9664
10228
|
const sourcePath = join16(skill.path, file);
|
|
9665
10229
|
const destPath = join16(skillDir, safeFile);
|
|
9666
10230
|
const content = readFileSync9(sourcePath, "utf-8");
|
|
9667
|
-
|
|
10231
|
+
writeFileSync9(destPath, content);
|
|
9668
10232
|
}
|
|
9669
10233
|
}
|
|
9670
10234
|
const index = generateWellKnownIndex(wellKnownSkills);
|
|
9671
|
-
|
|
10235
|
+
writeFileSync9(join16(wellKnownDir, "index.json"), JSON.stringify(index, null, 2));
|
|
9672
10236
|
console.log(chalk27.green("Generated well-known structure:\n"));
|
|
9673
10237
|
console.log(chalk27.dim(` ${wellKnownDir}/index.json`));
|
|
9674
10238
|
for (const skill of wellKnownSkills) {
|
|
@@ -9684,7 +10248,7 @@ var PublishCommand = class extends Command37 {
|
|
|
9684
10248
|
discoverSkills(basePath) {
|
|
9685
10249
|
const skills = [];
|
|
9686
10250
|
const skillMdPath = join16(basePath, "SKILL.md");
|
|
9687
|
-
if (
|
|
10251
|
+
if (existsSync18(skillMdPath)) {
|
|
9688
10252
|
const content = readFileSync9(skillMdPath, "utf-8");
|
|
9689
10253
|
const frontmatter = this.parseFrontmatter(content);
|
|
9690
10254
|
skills.push({
|
|
@@ -9700,13 +10264,13 @@ var PublishCommand = class extends Command37 {
|
|
|
9700
10264
|
join16(basePath, ".claude", "skills")
|
|
9701
10265
|
];
|
|
9702
10266
|
for (const searchDir of searchDirs) {
|
|
9703
|
-
if (!
|
|
10267
|
+
if (!existsSync18(searchDir)) continue;
|
|
9704
10268
|
const entries = readdirSync3(searchDir);
|
|
9705
10269
|
for (const entry of entries) {
|
|
9706
10270
|
const entryPath = join16(searchDir, entry);
|
|
9707
10271
|
if (!statSync3(entryPath).isDirectory()) continue;
|
|
9708
10272
|
const entrySkillMd = join16(entryPath, "SKILL.md");
|
|
9709
|
-
if (
|
|
10273
|
+
if (existsSync18(entrySkillMd)) {
|
|
9710
10274
|
const content = readFileSync9(entrySkillMd, "utf-8");
|
|
9711
10275
|
const frontmatter = this.parseFrontmatter(content);
|
|
9712
10276
|
skills.push({
|
|
@@ -9778,20 +10342,20 @@ var PublishCommand = class extends Command37 {
|
|
|
9778
10342
|
return frontmatter;
|
|
9779
10343
|
}
|
|
9780
10344
|
};
|
|
9781
|
-
var PublishSubmitCommand = class extends
|
|
10345
|
+
var PublishSubmitCommand = class extends Command38 {
|
|
9782
10346
|
static paths = [["publish", "submit"]];
|
|
9783
|
-
static usage =
|
|
10347
|
+
static usage = Command38.Usage({
|
|
9784
10348
|
description: "Submit skill to SkillKit marketplace (requires review)",
|
|
9785
10349
|
examples: [
|
|
9786
10350
|
["Submit skill from current directory", "$0 publish submit"],
|
|
9787
10351
|
["Submit with custom name", "$0 publish submit --name my-skill"]
|
|
9788
10352
|
]
|
|
9789
10353
|
});
|
|
9790
|
-
skillPath =
|
|
9791
|
-
name =
|
|
10354
|
+
skillPath = Option37.String({ required: false, name: "path" });
|
|
10355
|
+
name = Option37.String("--name,-n", {
|
|
9792
10356
|
description: "Custom skill name"
|
|
9793
10357
|
});
|
|
9794
|
-
dryRun =
|
|
10358
|
+
dryRun = Option37.Boolean("--dry-run", false, {
|
|
9795
10359
|
description: "Show what would be submitted"
|
|
9796
10360
|
});
|
|
9797
10361
|
async execute() {
|
|
@@ -9856,11 +10420,11 @@ var PublishSubmitCommand = class extends Command37 {
|
|
|
9856
10420
|
return 0;
|
|
9857
10421
|
}
|
|
9858
10422
|
findSkillMd(basePath) {
|
|
9859
|
-
if (basePath.endsWith("SKILL.md") &&
|
|
10423
|
+
if (basePath.endsWith("SKILL.md") && existsSync18(basePath)) {
|
|
9860
10424
|
return basePath;
|
|
9861
10425
|
}
|
|
9862
10426
|
const direct = join16(basePath, "SKILL.md");
|
|
9863
|
-
if (
|
|
10427
|
+
if (existsSync18(direct)) {
|
|
9864
10428
|
return direct;
|
|
9865
10429
|
}
|
|
9866
10430
|
const locations = [
|
|
@@ -9868,7 +10432,7 @@ var PublishSubmitCommand = class extends Command37 {
|
|
|
9868
10432
|
join16(basePath, ".claude", "skills", "SKILL.md")
|
|
9869
10433
|
];
|
|
9870
10434
|
for (const loc of locations) {
|
|
9871
|
-
if (
|
|
10435
|
+
if (existsSync18(loc)) {
|
|
9872
10436
|
return loc;
|
|
9873
10437
|
}
|
|
9874
10438
|
}
|
|
@@ -9953,8 +10517,8 @@ Submitted via \`skillkit publish submit\``;
|
|
|
9953
10517
|
|
|
9954
10518
|
// src/commands/agent.ts
|
|
9955
10519
|
import chalk28 from "chalk";
|
|
9956
|
-
import { Command as
|
|
9957
|
-
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";
|
|
9958
10522
|
import { join as join17, basename as basename5 } from "path";
|
|
9959
10523
|
import { homedir as homedir3 } from "os";
|
|
9960
10524
|
import {
|
|
@@ -9976,9 +10540,9 @@ import {
|
|
|
9976
10540
|
installBundledAgent,
|
|
9977
10541
|
isAgentInstalled
|
|
9978
10542
|
} from "@skillkit/resources";
|
|
9979
|
-
var AgentCommand = class extends
|
|
10543
|
+
var AgentCommand = class extends Command39 {
|
|
9980
10544
|
static paths = [["agent"]];
|
|
9981
|
-
static usage =
|
|
10545
|
+
static usage = Command39.Usage({
|
|
9982
10546
|
description: "Manage custom AI sub-agents",
|
|
9983
10547
|
details: `
|
|
9984
10548
|
This command manages custom AI sub-agents that can be used with
|
|
@@ -10019,9 +10583,9 @@ var AgentCommand = class extends Command38 {
|
|
|
10019
10583
|
return 0;
|
|
10020
10584
|
}
|
|
10021
10585
|
};
|
|
10022
|
-
var AgentListCommand = class extends
|
|
10586
|
+
var AgentListCommand = class extends Command39 {
|
|
10023
10587
|
static paths = [["agent", "list"], ["agent", "ls"]];
|
|
10024
|
-
static usage =
|
|
10588
|
+
static usage = Command39.Usage({
|
|
10025
10589
|
description: "List all installed agents",
|
|
10026
10590
|
examples: [
|
|
10027
10591
|
["List all agents", "$0 agent list"],
|
|
@@ -10029,13 +10593,13 @@ var AgentListCommand = class extends Command38 {
|
|
|
10029
10593
|
["Show only project agents", "$0 agent list --project"]
|
|
10030
10594
|
]
|
|
10031
10595
|
});
|
|
10032
|
-
json =
|
|
10596
|
+
json = Option38.Boolean("--json,-j", false, {
|
|
10033
10597
|
description: "Output as JSON"
|
|
10034
10598
|
});
|
|
10035
|
-
project =
|
|
10599
|
+
project = Option38.Boolean("--project,-p", false, {
|
|
10036
10600
|
description: "Show only project agents"
|
|
10037
10601
|
});
|
|
10038
|
-
global =
|
|
10602
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10039
10603
|
description: "Show only global agents"
|
|
10040
10604
|
});
|
|
10041
10605
|
async execute() {
|
|
@@ -10093,15 +10657,15 @@ var AgentListCommand = class extends Command38 {
|
|
|
10093
10657
|
return 0;
|
|
10094
10658
|
}
|
|
10095
10659
|
};
|
|
10096
|
-
var AgentShowCommand = class extends
|
|
10660
|
+
var AgentShowCommand = class extends Command39 {
|
|
10097
10661
|
static paths = [["agent", "show"], ["agent", "info"]];
|
|
10098
|
-
static usage =
|
|
10662
|
+
static usage = Command39.Usage({
|
|
10099
10663
|
description: "Show details for a specific agent",
|
|
10100
10664
|
examples: [
|
|
10101
10665
|
["Show agent details", "$0 agent show architect"]
|
|
10102
10666
|
]
|
|
10103
10667
|
});
|
|
10104
|
-
name =
|
|
10668
|
+
name = Option38.String({ required: true });
|
|
10105
10669
|
async execute() {
|
|
10106
10670
|
const searchDirs = [process.cwd()];
|
|
10107
10671
|
const agent = findAgent(this.name, searchDirs);
|
|
@@ -10150,9 +10714,9 @@ var AgentShowCommand = class extends Command38 {
|
|
|
10150
10714
|
return 0;
|
|
10151
10715
|
}
|
|
10152
10716
|
};
|
|
10153
|
-
var AgentCreateCommand = class extends
|
|
10717
|
+
var AgentCreateCommand = class extends Command39 {
|
|
10154
10718
|
static paths = [["agent", "create"], ["agent", "new"]];
|
|
10155
|
-
static usage =
|
|
10719
|
+
static usage = Command39.Usage({
|
|
10156
10720
|
description: "Create a new agent",
|
|
10157
10721
|
examples: [
|
|
10158
10722
|
["Create an agent", "$0 agent create security-reviewer"],
|
|
@@ -10160,14 +10724,14 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10160
10724
|
["Create globally", "$0 agent create my-agent --global"]
|
|
10161
10725
|
]
|
|
10162
10726
|
});
|
|
10163
|
-
name =
|
|
10164
|
-
model =
|
|
10727
|
+
name = Option38.String({ required: true });
|
|
10728
|
+
model = Option38.String("--model,-m", {
|
|
10165
10729
|
description: "Model to use (opus, sonnet, haiku)"
|
|
10166
10730
|
});
|
|
10167
|
-
description =
|
|
10731
|
+
description = Option38.String("--description,-d", {
|
|
10168
10732
|
description: "Agent description"
|
|
10169
10733
|
});
|
|
10170
|
-
global =
|
|
10734
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10171
10735
|
description: "Create in global agents directory"
|
|
10172
10736
|
});
|
|
10173
10737
|
async execute() {
|
|
@@ -10183,17 +10747,17 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10183
10747
|
} else {
|
|
10184
10748
|
targetDir = join17(process.cwd(), ".claude", "agents");
|
|
10185
10749
|
}
|
|
10186
|
-
if (!
|
|
10187
|
-
|
|
10750
|
+
if (!existsSync19(targetDir)) {
|
|
10751
|
+
mkdirSync10(targetDir, { recursive: true });
|
|
10188
10752
|
}
|
|
10189
10753
|
const agentPath = join17(targetDir, `${this.name}.md`);
|
|
10190
|
-
if (
|
|
10754
|
+
if (existsSync19(agentPath)) {
|
|
10191
10755
|
console.log(chalk28.red(`Agent already exists: ${agentPath}`));
|
|
10192
10756
|
return 1;
|
|
10193
10757
|
}
|
|
10194
10758
|
const description = this.description || `${this.name} agent`;
|
|
10195
10759
|
const content = generateAgentTemplate(this.name, description, this.model);
|
|
10196
|
-
|
|
10760
|
+
writeFileSync10(agentPath, content);
|
|
10197
10761
|
console.log(chalk28.green(`Created agent: ${agentPath}`));
|
|
10198
10762
|
console.log();
|
|
10199
10763
|
console.log(chalk28.dim("Edit the file to customize the agent system prompt."));
|
|
@@ -10201,9 +10765,9 @@ var AgentCreateCommand = class extends Command38 {
|
|
|
10201
10765
|
return 0;
|
|
10202
10766
|
}
|
|
10203
10767
|
};
|
|
10204
|
-
var AgentTranslateCommand = class extends
|
|
10768
|
+
var AgentTranslateCommand = class extends Command39 {
|
|
10205
10769
|
static paths = [["agent", "translate"]];
|
|
10206
|
-
static usage =
|
|
10770
|
+
static usage = Command39.Usage({
|
|
10207
10771
|
description: "Translate agents between AI coding agent formats",
|
|
10208
10772
|
details: `
|
|
10209
10773
|
Translates agent definitions between different AI coding agent formats.
|
|
@@ -10220,24 +10784,24 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10220
10784
|
["Dry run", "$0 agent translate --to cursor --dry-run"]
|
|
10221
10785
|
]
|
|
10222
10786
|
});
|
|
10223
|
-
name =
|
|
10224
|
-
to =
|
|
10787
|
+
name = Option38.String({ required: false });
|
|
10788
|
+
to = Option38.String("--to,-t", {
|
|
10225
10789
|
description: "Target AI agent (claude-code, cursor, codex, etc.)",
|
|
10226
10790
|
required: true
|
|
10227
10791
|
});
|
|
10228
|
-
source =
|
|
10792
|
+
source = Option38.String("--source,-s", {
|
|
10229
10793
|
description: "Source directory or file to translate from"
|
|
10230
10794
|
});
|
|
10231
|
-
output =
|
|
10795
|
+
output = Option38.String("--output,-o", {
|
|
10232
10796
|
description: "Output directory"
|
|
10233
10797
|
});
|
|
10234
|
-
dryRun =
|
|
10798
|
+
dryRun = Option38.Boolean("--dry-run,-n", false, {
|
|
10235
10799
|
description: "Show what would be done without writing files"
|
|
10236
10800
|
});
|
|
10237
|
-
all =
|
|
10801
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10238
10802
|
description: "Translate all agents"
|
|
10239
10803
|
});
|
|
10240
|
-
recursive =
|
|
10804
|
+
recursive = Option38.Boolean("--recursive,-r", false, {
|
|
10241
10805
|
description: "Recursively scan directories for agents"
|
|
10242
10806
|
});
|
|
10243
10807
|
async execute() {
|
|
@@ -10246,7 +10810,7 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10246
10810
|
let agents;
|
|
10247
10811
|
if (this.source) {
|
|
10248
10812
|
const sourcePath = this.source.startsWith("/") ? this.source : join17(process.cwd(), this.source);
|
|
10249
|
-
if (!
|
|
10813
|
+
if (!existsSync19(sourcePath)) {
|
|
10250
10814
|
console.log(chalk28.red(`Source path not found: ${sourcePath}`));
|
|
10251
10815
|
return 1;
|
|
10252
10816
|
}
|
|
@@ -10301,10 +10865,10 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10301
10865
|
}
|
|
10302
10866
|
}
|
|
10303
10867
|
} else {
|
|
10304
|
-
if (!
|
|
10305
|
-
|
|
10868
|
+
if (!existsSync19(outputDir)) {
|
|
10869
|
+
mkdirSync10(outputDir, { recursive: true });
|
|
10306
10870
|
}
|
|
10307
|
-
|
|
10871
|
+
writeFileSync10(outputPath, result.content);
|
|
10308
10872
|
console.log(chalk28.green(`\u2713 ${agent.name} \u2192 ${outputPath}`));
|
|
10309
10873
|
}
|
|
10310
10874
|
successCount++;
|
|
@@ -10322,16 +10886,16 @@ var AgentTranslateCommand = class extends Command38 {
|
|
|
10322
10886
|
return errorCount > 0 ? 1 : 0;
|
|
10323
10887
|
}
|
|
10324
10888
|
};
|
|
10325
|
-
var AgentSyncCommand = class extends
|
|
10889
|
+
var AgentSyncCommand = class extends Command39 {
|
|
10326
10890
|
static paths = [["agent", "sync"]];
|
|
10327
|
-
static usage =
|
|
10891
|
+
static usage = Command39.Usage({
|
|
10328
10892
|
description: "Sync agents to target AI coding agent",
|
|
10329
10893
|
examples: [
|
|
10330
10894
|
["Sync to Claude Code", "$0 agent sync --agent claude-code"],
|
|
10331
10895
|
["Sync to multiple agents", "$0 agent sync --agent claude-code,cursor"]
|
|
10332
10896
|
]
|
|
10333
10897
|
});
|
|
10334
|
-
agent =
|
|
10898
|
+
agent = Option38.String("--agent,-a", {
|
|
10335
10899
|
description: "Target AI agent(s) (comma-separated)"
|
|
10336
10900
|
});
|
|
10337
10901
|
async execute() {
|
|
@@ -10347,14 +10911,14 @@ var AgentSyncCommand = class extends Command38 {
|
|
|
10347
10911
|
for (const targetAgent of targetAgents) {
|
|
10348
10912
|
const outputDir = getAgentTargetDirectory(process.cwd(), targetAgent);
|
|
10349
10913
|
console.log(chalk28.blue(`\u2192 ${targetAgent} (${outputDir})`));
|
|
10350
|
-
if (!
|
|
10351
|
-
|
|
10914
|
+
if (!existsSync19(outputDir)) {
|
|
10915
|
+
mkdirSync10(outputDir, { recursive: true });
|
|
10352
10916
|
}
|
|
10353
10917
|
for (const agent of agents) {
|
|
10354
10918
|
const result = translateAgent(agent, targetAgent);
|
|
10355
10919
|
if (result.success) {
|
|
10356
10920
|
const outputPath = join17(outputDir, result.filename);
|
|
10357
|
-
|
|
10921
|
+
writeFileSync10(outputPath, result.content);
|
|
10358
10922
|
console.log(chalk28.green(` \u2713 ${agent.name}`));
|
|
10359
10923
|
} else {
|
|
10360
10924
|
console.log(chalk28.red(` \u2717 ${agent.name}`));
|
|
@@ -10366,17 +10930,17 @@ var AgentSyncCommand = class extends Command38 {
|
|
|
10366
10930
|
return 0;
|
|
10367
10931
|
}
|
|
10368
10932
|
};
|
|
10369
|
-
var AgentValidateCommand = class extends
|
|
10933
|
+
var AgentValidateCommand = class extends Command39 {
|
|
10370
10934
|
static paths = [["agent", "validate"]];
|
|
10371
|
-
static usage =
|
|
10935
|
+
static usage = Command39.Usage({
|
|
10372
10936
|
description: "Validate agent definitions",
|
|
10373
10937
|
examples: [
|
|
10374
10938
|
["Validate specific agent", "$0 agent validate ./my-agent.md"],
|
|
10375
10939
|
["Validate all agents", "$0 agent validate --all"]
|
|
10376
10940
|
]
|
|
10377
10941
|
});
|
|
10378
|
-
agentPath =
|
|
10379
|
-
all =
|
|
10942
|
+
agentPath = Option38.String({ required: false });
|
|
10943
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10380
10944
|
description: "Validate all discovered agents"
|
|
10381
10945
|
});
|
|
10382
10946
|
async execute() {
|
|
@@ -10469,9 +11033,9 @@ function generateAgentTemplate(name, description, model) {
|
|
|
10469
11033
|
function formatAgentName(name) {
|
|
10470
11034
|
return name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
10471
11035
|
}
|
|
10472
|
-
var AgentInstallCommand = class extends
|
|
11036
|
+
var AgentInstallCommand = class extends Command39 {
|
|
10473
11037
|
static paths = [["agent", "install"]];
|
|
10474
|
-
static usage =
|
|
11038
|
+
static usage = Command39.Usage({
|
|
10475
11039
|
description: "Install a bundled agent template",
|
|
10476
11040
|
details: `
|
|
10477
11041
|
Installs a bundled agent template from @skillkit/resources.
|
|
@@ -10486,14 +11050,14 @@ var AgentInstallCommand = class extends Command38 {
|
|
|
10486
11050
|
["Install all bundled agents", "$0 agent install --all"]
|
|
10487
11051
|
]
|
|
10488
11052
|
});
|
|
10489
|
-
name =
|
|
10490
|
-
global =
|
|
11053
|
+
name = Option38.String({ required: false });
|
|
11054
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10491
11055
|
description: "Install to global agents directory"
|
|
10492
11056
|
});
|
|
10493
|
-
force =
|
|
11057
|
+
force = Option38.Boolean("--force,-f", false, {
|
|
10494
11058
|
description: "Overwrite if agent already exists"
|
|
10495
11059
|
});
|
|
10496
|
-
all =
|
|
11060
|
+
all = Option38.Boolean("--all,-a", false, {
|
|
10497
11061
|
description: "Install all bundled agents"
|
|
10498
11062
|
});
|
|
10499
11063
|
async execute() {
|
|
@@ -10557,9 +11121,9 @@ var AgentInstallCommand = class extends Command38 {
|
|
|
10557
11121
|
return errorCount > 0 ? 1 : 0;
|
|
10558
11122
|
}
|
|
10559
11123
|
};
|
|
10560
|
-
var AgentAvailableCommand = class extends
|
|
11124
|
+
var AgentAvailableCommand = class extends Command39 {
|
|
10561
11125
|
static paths = [["agent", "available"], ["agent", "bundled"]];
|
|
10562
|
-
static usage =
|
|
11126
|
+
static usage = Command39.Usage({
|
|
10563
11127
|
description: "List bundled agents available for installation",
|
|
10564
11128
|
examples: [
|
|
10565
11129
|
["List available agents", "$0 agent available"],
|
|
@@ -10567,13 +11131,13 @@ var AgentAvailableCommand = class extends Command38 {
|
|
|
10567
11131
|
["Filter by category", "$0 agent available --category testing"]
|
|
10568
11132
|
]
|
|
10569
11133
|
});
|
|
10570
|
-
json =
|
|
11134
|
+
json = Option38.Boolean("--json,-j", false, {
|
|
10571
11135
|
description: "Output as JSON"
|
|
10572
11136
|
});
|
|
10573
|
-
category =
|
|
11137
|
+
category = Option38.String("--category,-c", {
|
|
10574
11138
|
description: "Filter by category (planning, development, testing, review, documentation, security, refactoring)"
|
|
10575
11139
|
});
|
|
10576
|
-
installed =
|
|
11140
|
+
installed = Option38.Boolean("--installed,-i", false, {
|
|
10577
11141
|
description: "Show only installed bundled agents"
|
|
10578
11142
|
});
|
|
10579
11143
|
async execute() {
|
|
@@ -10628,9 +11192,9 @@ var AgentAvailableCommand = class extends Command38 {
|
|
|
10628
11192
|
return 0;
|
|
10629
11193
|
}
|
|
10630
11194
|
};
|
|
10631
|
-
var AgentFromSkillCommand = class extends
|
|
11195
|
+
var AgentFromSkillCommand = class extends Command39 {
|
|
10632
11196
|
static paths = [["agent", "from-skill"]];
|
|
10633
|
-
static usage =
|
|
11197
|
+
static usage = Command39.Usage({
|
|
10634
11198
|
description: "Convert a skill into a Claude Code subagent",
|
|
10635
11199
|
details: `
|
|
10636
11200
|
Converts a SkillKit skill into a Claude Code native subagent format.
|
|
@@ -10647,23 +11211,23 @@ var AgentFromSkillCommand = class extends Command38 {
|
|
|
10647
11211
|
["Preview without writing", "$0 agent from-skill code-simplifier --dry-run"]
|
|
10648
11212
|
]
|
|
10649
11213
|
});
|
|
10650
|
-
skillName =
|
|
10651
|
-
inline =
|
|
11214
|
+
skillName = Option38.String({ required: true });
|
|
11215
|
+
inline = Option38.Boolean("--inline,-i", false, {
|
|
10652
11216
|
description: "Embed full skill content in system prompt"
|
|
10653
11217
|
});
|
|
10654
|
-
model =
|
|
11218
|
+
model = Option38.String("--model,-m", {
|
|
10655
11219
|
description: "Model to use (sonnet, opus, haiku, inherit)"
|
|
10656
11220
|
});
|
|
10657
|
-
permission =
|
|
11221
|
+
permission = Option38.String("--permission,-p", {
|
|
10658
11222
|
description: "Permission mode (default, plan, auto-edit, full-auto, bypassPermissions)"
|
|
10659
11223
|
});
|
|
10660
|
-
global =
|
|
11224
|
+
global = Option38.Boolean("--global,-g", false, {
|
|
10661
11225
|
description: "Create in ~/.claude/agents/ instead of .claude/agents/"
|
|
10662
11226
|
});
|
|
10663
|
-
output =
|
|
11227
|
+
output = Option38.String("--output,-o", {
|
|
10664
11228
|
description: "Custom output filename (without .md)"
|
|
10665
11229
|
});
|
|
10666
|
-
dryRun =
|
|
11230
|
+
dryRun = Option38.Boolean("--dry-run,-n", false, {
|
|
10667
11231
|
description: "Preview without writing files"
|
|
10668
11232
|
});
|
|
10669
11233
|
async execute() {
|
|
@@ -10735,13 +11299,13 @@ var AgentFromSkillCommand = class extends Command38 {
|
|
|
10735
11299
|
console.log(chalk28.dim("\u2500".repeat(50)));
|
|
10736
11300
|
return 0;
|
|
10737
11301
|
}
|
|
10738
|
-
if (!
|
|
10739
|
-
|
|
11302
|
+
if (!existsSync19(targetDir)) {
|
|
11303
|
+
mkdirSync10(targetDir, { recursive: true });
|
|
10740
11304
|
}
|
|
10741
|
-
if (
|
|
11305
|
+
if (existsSync19(outputPath)) {
|
|
10742
11306
|
console.log(chalk28.yellow(`Overwriting existing file: ${outputPath}`));
|
|
10743
11307
|
}
|
|
10744
|
-
|
|
11308
|
+
writeFileSync10(outputPath, content);
|
|
10745
11309
|
console.log(chalk28.green(`Created subagent: ${outputPath}`));
|
|
10746
11310
|
console.log();
|
|
10747
11311
|
console.log(chalk28.dim(`Invoke with: @${skill.name}`));
|
|
@@ -10774,13 +11338,13 @@ function sanitizeFilename(input) {
|
|
|
10774
11338
|
// src/commands/check.ts
|
|
10775
11339
|
init_helpers();
|
|
10776
11340
|
init_onboarding();
|
|
10777
|
-
import { existsSync as
|
|
11341
|
+
import { existsSync as existsSync20 } from "fs";
|
|
10778
11342
|
import { join as join18 } from "path";
|
|
10779
|
-
import { Command as
|
|
11343
|
+
import { Command as Command40, Option as Option39 } from "clipanion";
|
|
10780
11344
|
import { findAllSkills as findAllSkills7, findSkill as findSkill5, detectProvider as detectProvider3, isLocalPath as isLocalPath3 } from "@skillkit/core";
|
|
10781
|
-
var CheckCommand = class extends
|
|
11345
|
+
var CheckCommand = class extends Command40 {
|
|
10782
11346
|
static paths = [["check"]];
|
|
10783
|
-
static usage =
|
|
11347
|
+
static usage = Command40.Usage({
|
|
10784
11348
|
description: "Check for available skill updates (dry-run)",
|
|
10785
11349
|
details: `
|
|
10786
11350
|
Checks if installed skills have updates available from their sources.
|
|
@@ -10792,11 +11356,11 @@ var CheckCommand = class extends Command39 {
|
|
|
10792
11356
|
["Show detailed output", "$0 check --verbose"]
|
|
10793
11357
|
]
|
|
10794
11358
|
});
|
|
10795
|
-
skills =
|
|
10796
|
-
verbose =
|
|
11359
|
+
skills = Option39.Rest();
|
|
11360
|
+
verbose = Option39.Boolean("--verbose,-v", false, {
|
|
10797
11361
|
description: "Show detailed information"
|
|
10798
11362
|
});
|
|
10799
|
-
quiet =
|
|
11363
|
+
quiet = Option39.Boolean("--quiet,-q", false, {
|
|
10800
11364
|
description: "Minimal output"
|
|
10801
11365
|
});
|
|
10802
11366
|
async execute() {
|
|
@@ -10845,7 +11409,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10845
11409
|
try {
|
|
10846
11410
|
if (isLocalPath3(metadata.source)) {
|
|
10847
11411
|
const localPath = metadata.subpath ? join18(metadata.source, metadata.subpath) : metadata.source;
|
|
10848
|
-
if (!
|
|
11412
|
+
if (!existsSync20(localPath)) {
|
|
10849
11413
|
results.push({
|
|
10850
11414
|
name: skill.name,
|
|
10851
11415
|
hasUpdate: false,
|
|
@@ -10856,7 +11420,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10856
11420
|
}
|
|
10857
11421
|
const sourceSkillMd = join18(localPath, "SKILL.md");
|
|
10858
11422
|
const installedSkillMd = join18(skill.path, "SKILL.md");
|
|
10859
|
-
if (
|
|
11423
|
+
if (existsSync20(sourceSkillMd) && existsSync20(installedSkillMd)) {
|
|
10860
11424
|
const { statSync: statSync4 } = await import("fs");
|
|
10861
11425
|
const sourceTime = statSync4(sourceSkillMd).mtime;
|
|
10862
11426
|
const installedTime = statSync4(installedSkillMd).mtime;
|
|
@@ -10936,7 +11500,7 @@ var CheckCommand = class extends Command39 {
|
|
|
10936
11500
|
|
|
10937
11501
|
// src/commands/find.ts
|
|
10938
11502
|
init_onboarding();
|
|
10939
|
-
import { Command as
|
|
11503
|
+
import { Command as Command41, Option as Option40 } from "clipanion";
|
|
10940
11504
|
import { FederatedSearch, GitHubSkillRegistry, RateLimitError } from "@skillkit/core";
|
|
10941
11505
|
|
|
10942
11506
|
// ../../marketplace/skills.json
|
|
@@ -136588,9 +137152,9 @@ var sources_default = {
|
|
|
136588
137152
|
};
|
|
136589
137153
|
|
|
136590
137154
|
// src/commands/find.ts
|
|
136591
|
-
var FindCommand = class extends
|
|
137155
|
+
var FindCommand = class extends Command41 {
|
|
136592
137156
|
static paths = [["find"], ["search"]];
|
|
136593
|
-
static usage =
|
|
137157
|
+
static usage = Command41.Usage({
|
|
136594
137158
|
description: "Search for skills in the marketplace",
|
|
136595
137159
|
details: `
|
|
136596
137160
|
Quickly find and install skills from the marketplace.
|
|
@@ -136603,20 +137167,20 @@ var FindCommand = class extends Command40 {
|
|
|
136603
137167
|
["List top skills", "$0 find --top"]
|
|
136604
137168
|
]
|
|
136605
137169
|
});
|
|
136606
|
-
query =
|
|
136607
|
-
top =
|
|
137170
|
+
query = Option40.String({ required: false });
|
|
137171
|
+
top = Option40.Boolean("--top,-t", false, {
|
|
136608
137172
|
description: "Show top/featured skills"
|
|
136609
137173
|
});
|
|
136610
|
-
limit =
|
|
137174
|
+
limit = Option40.String("--limit,-l", "10", {
|
|
136611
137175
|
description: "Maximum results to show"
|
|
136612
137176
|
});
|
|
136613
|
-
install =
|
|
137177
|
+
install = Option40.Boolean("--install,-i", false, {
|
|
136614
137178
|
description: "Prompt to install after finding"
|
|
136615
137179
|
});
|
|
136616
|
-
quiet =
|
|
137180
|
+
quiet = Option40.Boolean("--quiet,-q", false, {
|
|
136617
137181
|
description: "Minimal output (just list skills)"
|
|
136618
137182
|
});
|
|
136619
|
-
federated =
|
|
137183
|
+
federated = Option40.Boolean("--federated,-f", false, {
|
|
136620
137184
|
description: "Search external registries (GitHub SKILL.md files)"
|
|
136621
137185
|
});
|
|
136622
137186
|
async execute() {
|
|
@@ -136745,7 +137309,7 @@ var FindCommand = class extends Command40 {
|
|
|
136745
137309
|
// src/commands/manifest.ts
|
|
136746
137310
|
init_helpers();
|
|
136747
137311
|
init_onboarding();
|
|
136748
|
-
import { Command as
|
|
137312
|
+
import { Command as Command42, Option as Option41 } from "clipanion";
|
|
136749
137313
|
import {
|
|
136750
137314
|
loadManifest,
|
|
136751
137315
|
saveManifest,
|
|
@@ -136756,9 +137320,9 @@ import {
|
|
|
136756
137320
|
generateManifestFromInstalled,
|
|
136757
137321
|
findAllSkills as findAllSkills8
|
|
136758
137322
|
} from "@skillkit/core";
|
|
136759
|
-
var ManifestCommand = class extends
|
|
137323
|
+
var ManifestCommand = class extends Command42 {
|
|
136760
137324
|
static paths = [["manifest"]];
|
|
136761
|
-
static usage =
|
|
137325
|
+
static usage = Command42.Usage({
|
|
136762
137326
|
description: "Manage .skills manifest file",
|
|
136763
137327
|
details: `
|
|
136764
137328
|
The .skills manifest file allows declarative skill management.
|
|
@@ -136823,12 +137387,12 @@ var ManifestCommand = class extends Command41 {
|
|
|
136823
137387
|
return 0;
|
|
136824
137388
|
}
|
|
136825
137389
|
};
|
|
136826
|
-
var ManifestInitCommand = class extends
|
|
137390
|
+
var ManifestInitCommand = class extends Command42 {
|
|
136827
137391
|
static paths = [["manifest", "init"]];
|
|
136828
|
-
static usage =
|
|
137392
|
+
static usage = Command42.Usage({
|
|
136829
137393
|
description: "Initialize a new .skills manifest"
|
|
136830
137394
|
});
|
|
136831
|
-
force =
|
|
137395
|
+
force = Option41.Boolean("--force,-f", false, {
|
|
136832
137396
|
description: "Overwrite existing manifest"
|
|
136833
137397
|
});
|
|
136834
137398
|
async execute() {
|
|
@@ -136846,16 +137410,16 @@ var ManifestInitCommand = class extends Command41 {
|
|
|
136846
137410
|
return 0;
|
|
136847
137411
|
}
|
|
136848
137412
|
};
|
|
136849
|
-
var ManifestAddCommand = class extends
|
|
137413
|
+
var ManifestAddCommand = class extends Command42 {
|
|
136850
137414
|
static paths = [["manifest", "add"]];
|
|
136851
|
-
static usage =
|
|
137415
|
+
static usage = Command42.Usage({
|
|
136852
137416
|
description: "Add a skill source to the manifest"
|
|
136853
137417
|
});
|
|
136854
|
-
source =
|
|
136855
|
-
skills =
|
|
137418
|
+
source = Option41.String({ required: true });
|
|
137419
|
+
skills = Option41.String("--skills,-s", {
|
|
136856
137420
|
description: "Specific skills to include (comma-separated)"
|
|
136857
137421
|
});
|
|
136858
|
-
agents =
|
|
137422
|
+
agents = Option41.String("--agents,-a", {
|
|
136859
137423
|
description: "Target agents (comma-separated)"
|
|
136860
137424
|
});
|
|
136861
137425
|
async execute() {
|
|
@@ -136871,12 +137435,12 @@ var ManifestAddCommand = class extends Command41 {
|
|
|
136871
137435
|
return 0;
|
|
136872
137436
|
}
|
|
136873
137437
|
};
|
|
136874
|
-
var ManifestRemoveCommand = class extends
|
|
137438
|
+
var ManifestRemoveCommand = class extends Command42 {
|
|
136875
137439
|
static paths = [["manifest", "remove"]];
|
|
136876
|
-
static usage =
|
|
137440
|
+
static usage = Command42.Usage({
|
|
136877
137441
|
description: "Remove a skill source from the manifest"
|
|
136878
137442
|
});
|
|
136879
|
-
source =
|
|
137443
|
+
source = Option41.String({ required: true });
|
|
136880
137444
|
async execute() {
|
|
136881
137445
|
const result = removeFromManifest(this.source);
|
|
136882
137446
|
if (!result) {
|
|
@@ -136887,12 +137451,12 @@ var ManifestRemoveCommand = class extends Command41 {
|
|
|
136887
137451
|
return 0;
|
|
136888
137452
|
}
|
|
136889
137453
|
};
|
|
136890
|
-
var ManifestInstallCommand = class extends
|
|
137454
|
+
var ManifestInstallCommand = class extends Command42 {
|
|
136891
137455
|
static paths = [["manifest", "install"]];
|
|
136892
|
-
static usage =
|
|
137456
|
+
static usage = Command42.Usage({
|
|
136893
137457
|
description: "Install all skills defined in the manifest"
|
|
136894
137458
|
});
|
|
136895
|
-
yes =
|
|
137459
|
+
yes = Option41.Boolean("--yes,-y", false, {
|
|
136896
137460
|
description: "Skip confirmation"
|
|
136897
137461
|
});
|
|
136898
137462
|
async execute() {
|
|
@@ -136954,12 +137518,12 @@ var ManifestInstallCommand = class extends Command41 {
|
|
|
136954
137518
|
return 0;
|
|
136955
137519
|
}
|
|
136956
137520
|
};
|
|
136957
|
-
var ManifestGenerateCommand = class extends
|
|
137521
|
+
var ManifestGenerateCommand = class extends Command42 {
|
|
136958
137522
|
static paths = [["manifest", "generate"]];
|
|
136959
|
-
static usage =
|
|
137523
|
+
static usage = Command42.Usage({
|
|
136960
137524
|
description: "Generate manifest from currently installed skills"
|
|
136961
137525
|
});
|
|
136962
|
-
output =
|
|
137526
|
+
output = Option41.String("--output,-o", {
|
|
136963
137527
|
description: "Output file path (default: .skills)"
|
|
136964
137528
|
});
|
|
136965
137529
|
async execute() {
|
|
@@ -136988,8 +137552,8 @@ var ManifestGenerateCommand = class extends Command41 {
|
|
|
136988
137552
|
};
|
|
136989
137553
|
|
|
136990
137554
|
// src/commands/primer.ts
|
|
136991
|
-
import { Command as
|
|
136992
|
-
import { resolve as
|
|
137555
|
+
import { Command as Command43, Option as Option42 } from "clipanion";
|
|
137556
|
+
import { resolve as resolve20 } from "path";
|
|
136993
137557
|
import chalk29 from "chalk";
|
|
136994
137558
|
import {
|
|
136995
137559
|
AgentType as AgentTypeSchema,
|
|
@@ -136999,9 +137563,9 @@ import {
|
|
|
136999
137563
|
addPattern,
|
|
137000
137564
|
AGENT_CONFIG
|
|
137001
137565
|
} from "@skillkit/core";
|
|
137002
|
-
var PrimerCommand = class extends
|
|
137566
|
+
var PrimerCommand = class extends Command43 {
|
|
137003
137567
|
static paths = [["primer"]];
|
|
137004
|
-
static usage =
|
|
137568
|
+
static usage = Command43.Usage({
|
|
137005
137569
|
description: "Analyze codebase and generate AI instruction files for agents",
|
|
137006
137570
|
details: `
|
|
137007
137571
|
The primer command analyzes your codebase to detect languages, frameworks,
|
|
@@ -137023,41 +137587,41 @@ var PrimerCommand = class extends Command42 {
|
|
|
137023
137587
|
["Verbose output", "$0 primer --verbose"]
|
|
137024
137588
|
]
|
|
137025
137589
|
});
|
|
137026
|
-
agent =
|
|
137590
|
+
agent = Option42.String("--agent,-a", {
|
|
137027
137591
|
description: "Comma-separated list of agents to generate for"
|
|
137028
137592
|
});
|
|
137029
|
-
allAgents =
|
|
137593
|
+
allAgents = Option42.Boolean("--all-agents,-A", false, {
|
|
137030
137594
|
description: "Generate for all 32 supported agents"
|
|
137031
137595
|
});
|
|
137032
|
-
output =
|
|
137596
|
+
output = Option42.String("--output,-o", {
|
|
137033
137597
|
description: "Output directory for generated files"
|
|
137034
137598
|
});
|
|
137035
|
-
dryRun =
|
|
137599
|
+
dryRun = Option42.Boolean("--dry-run,-n", false, {
|
|
137036
137600
|
description: "Preview what would be generated without writing files"
|
|
137037
137601
|
});
|
|
137038
|
-
analyzeOnly =
|
|
137602
|
+
analyzeOnly = Option42.Boolean("--analyze-only", false, {
|
|
137039
137603
|
description: "Only show codebase analysis, do not generate files"
|
|
137040
137604
|
});
|
|
137041
|
-
verbose =
|
|
137605
|
+
verbose = Option42.Boolean("--verbose,-v", false, {
|
|
137042
137606
|
description: "Show detailed output"
|
|
137043
137607
|
});
|
|
137044
|
-
includeExamples =
|
|
137608
|
+
includeExamples = Option42.Boolean("--examples", false, {
|
|
137045
137609
|
description: "Include code examples in generated instructions"
|
|
137046
137610
|
});
|
|
137047
|
-
json =
|
|
137611
|
+
json = Option42.Boolean("--json,-j", false, {
|
|
137048
137612
|
description: "Output analysis in JSON format"
|
|
137049
137613
|
});
|
|
137050
|
-
directory =
|
|
137614
|
+
directory = Option42.String("--dir,-d", {
|
|
137051
137615
|
description: "Project directory to analyze (default: current directory)"
|
|
137052
137616
|
});
|
|
137053
|
-
learn =
|
|
137617
|
+
learn = Option42.Boolean("--learn,-l", false, {
|
|
137054
137618
|
description: "Extract learnable patterns from git history"
|
|
137055
137619
|
});
|
|
137056
|
-
commits =
|
|
137620
|
+
commits = Option42.String("--commits", {
|
|
137057
137621
|
description: "Number of commits to analyze for learning (default: 100)"
|
|
137058
137622
|
});
|
|
137059
137623
|
async execute() {
|
|
137060
|
-
const projectPath =
|
|
137624
|
+
const projectPath = resolve20(this.directory || process.cwd());
|
|
137061
137625
|
if (this.analyzeOnly) {
|
|
137062
137626
|
return this.runAnalysis(projectPath);
|
|
137063
137627
|
}
|
|
@@ -137126,7 +137690,7 @@ var PrimerCommand = class extends Command42 {
|
|
|
137126
137690
|
const result = generatePrimer(projectPath, {
|
|
137127
137691
|
agents,
|
|
137128
137692
|
allAgents: this.allAgents,
|
|
137129
|
-
outputDir: this.output ?
|
|
137693
|
+
outputDir: this.output ? resolve20(this.output) : void 0,
|
|
137130
137694
|
dryRun: this.dryRun,
|
|
137131
137695
|
verbose: this.verbose,
|
|
137132
137696
|
includeExamples: this.includeExamples
|
|
@@ -137346,11 +137910,11 @@ var PrimerCommand = class extends Command42 {
|
|
|
137346
137910
|
};
|
|
137347
137911
|
|
|
137348
137912
|
// src/commands/mesh.ts
|
|
137349
|
-
import { Command as
|
|
137913
|
+
import { Command as Command44, Option as Option43 } from "clipanion";
|
|
137350
137914
|
import chalk30 from "chalk";
|
|
137351
|
-
var MeshCommand = class extends
|
|
137915
|
+
var MeshCommand = class extends Command44 {
|
|
137352
137916
|
static paths = [["mesh"]];
|
|
137353
|
-
static usage =
|
|
137917
|
+
static usage = Command44.Usage({
|
|
137354
137918
|
description: "Manage peer mesh network for multi-machine agent distribution",
|
|
137355
137919
|
details: `
|
|
137356
137920
|
The mesh command helps you manage a peer-to-peer network of hosts
|
|
@@ -137382,17 +137946,17 @@ var MeshCommand = class extends Command43 {
|
|
|
137382
137946
|
["List trusted peers", "$0 mesh peer list --trusted"]
|
|
137383
137947
|
]
|
|
137384
137948
|
});
|
|
137385
|
-
action =
|
|
137386
|
-
arg =
|
|
137387
|
-
subArg =
|
|
137388
|
-
name =
|
|
137389
|
-
port =
|
|
137390
|
-
tailscale =
|
|
137391
|
-
timeout =
|
|
137392
|
-
json =
|
|
137393
|
-
verbose =
|
|
137394
|
-
trusted =
|
|
137395
|
-
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" });
|
|
137396
137960
|
async execute() {
|
|
137397
137961
|
const action = this.action || "status";
|
|
137398
137962
|
switch (action) {
|
|
@@ -137895,11 +138459,11 @@ Total: ${trustedPeers.length} trusted, ${revokedFingerprints.length} revoked`));
|
|
|
137895
138459
|
};
|
|
137896
138460
|
|
|
137897
138461
|
// src/commands/message.ts
|
|
137898
|
-
import { Command as
|
|
138462
|
+
import { Command as Command45, Option as Option44 } from "clipanion";
|
|
137899
138463
|
import chalk31 from "chalk";
|
|
137900
|
-
var MessageCommand = class extends
|
|
138464
|
+
var MessageCommand = class extends Command45 {
|
|
137901
138465
|
static paths = [["message"], ["msg"]];
|
|
137902
|
-
static usage =
|
|
138466
|
+
static usage = Command45.Usage({
|
|
137903
138467
|
description: "Inter-agent messaging system",
|
|
137904
138468
|
details: `
|
|
137905
138469
|
The message command enables communication between AI agents
|
|
@@ -137926,18 +138490,18 @@ var MessageCommand = class extends Command44 {
|
|
|
137926
138490
|
["Forward a message", "$0 message forward <id> other-agent"]
|
|
137927
138491
|
]
|
|
137928
138492
|
});
|
|
137929
|
-
action =
|
|
137930
|
-
arg =
|
|
137931
|
-
arg2 =
|
|
137932
|
-
body =
|
|
137933
|
-
subject =
|
|
137934
|
-
priority =
|
|
137935
|
-
type =
|
|
137936
|
-
unread =
|
|
137937
|
-
limit =
|
|
137938
|
-
agent =
|
|
137939
|
-
json =
|
|
137940
|
-
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" });
|
|
137941
138505
|
async execute() {
|
|
137942
138506
|
const action = this.action || "inbox";
|
|
137943
138507
|
switch (action) {
|
|
@@ -138336,8 +138900,8 @@ Sent Messages (${messages.length})
|
|
|
138336
138900
|
};
|
|
138337
138901
|
|
|
138338
138902
|
// src/commands/learn.ts
|
|
138339
|
-
import { Command as
|
|
138340
|
-
import { resolve as
|
|
138903
|
+
import { Command as Command46, Option as Option45 } from "clipanion";
|
|
138904
|
+
import { resolve as resolve21 } from "path";
|
|
138341
138905
|
import chalk32 from "chalk";
|
|
138342
138906
|
import {
|
|
138343
138907
|
analyzeGitHistory as analyzeGitHistory2,
|
|
@@ -138357,10 +138921,10 @@ import {
|
|
|
138357
138921
|
getPatternStats,
|
|
138358
138922
|
clusterPatterns
|
|
138359
138923
|
} from "@skillkit/core";
|
|
138360
|
-
import { writeFileSync as
|
|
138361
|
-
var LearnCommand = class extends
|
|
138924
|
+
import { writeFileSync as writeFileSync11, readFileSync as readFileSync10, existsSync as existsSync21 } from "fs";
|
|
138925
|
+
var LearnCommand = class extends Command46 {
|
|
138362
138926
|
static paths = [["learn"]];
|
|
138363
|
-
static usage =
|
|
138927
|
+
static usage = Command46.Usage({
|
|
138364
138928
|
description: "Extract learnable patterns from git history or sessions",
|
|
138365
138929
|
details: `
|
|
138366
138930
|
Analyzes git commit history to extract reusable patterns for error fixes,
|
|
@@ -138375,26 +138939,26 @@ var LearnCommand = class extends Command45 {
|
|
|
138375
138939
|
["Show extracted patterns", "$0 learn --show"]
|
|
138376
138940
|
]
|
|
138377
138941
|
});
|
|
138378
|
-
commits =
|
|
138942
|
+
commits = Option45.String("--commits,-c", {
|
|
138379
138943
|
description: "Number of commits to analyze (default: 100)"
|
|
138380
138944
|
});
|
|
138381
|
-
since =
|
|
138945
|
+
since = Option45.String("--since,-s", {
|
|
138382
138946
|
description: 'Analyze commits since date (e.g., "2 weeks ago")'
|
|
138383
138947
|
});
|
|
138384
|
-
approve =
|
|
138948
|
+
approve = Option45.Boolean("--approve,-a", false, {
|
|
138385
138949
|
description: "Auto-approve extracted patterns"
|
|
138386
138950
|
});
|
|
138387
|
-
show =
|
|
138951
|
+
show = Option45.Boolean("--show", false, {
|
|
138388
138952
|
description: "Show existing patterns without analyzing"
|
|
138389
138953
|
});
|
|
138390
|
-
json =
|
|
138954
|
+
json = Option45.Boolean("--json,-j", false, {
|
|
138391
138955
|
description: "Output as JSON"
|
|
138392
138956
|
});
|
|
138393
|
-
directory =
|
|
138957
|
+
directory = Option45.String("--dir,-d", {
|
|
138394
138958
|
description: "Project directory to analyze (default: current directory)"
|
|
138395
138959
|
});
|
|
138396
138960
|
async execute() {
|
|
138397
|
-
const projectPath =
|
|
138961
|
+
const projectPath = resolve21(this.directory || process.cwd());
|
|
138398
138962
|
if (this.show) {
|
|
138399
138963
|
return this.showPatterns();
|
|
138400
138964
|
}
|
|
@@ -138499,19 +139063,19 @@ var LearnCommand = class extends Command45 {
|
|
|
138499
139063
|
console.log(chalk32.dim(` ${truncate5(pattern.problem, 60)}`));
|
|
138500
139064
|
}
|
|
138501
139065
|
};
|
|
138502
|
-
var PatternStatusCommand = class extends
|
|
139066
|
+
var PatternStatusCommand = class extends Command46 {
|
|
138503
139067
|
static paths = [["pattern", "status"], ["pattern", "list"]];
|
|
138504
|
-
static usage =
|
|
139068
|
+
static usage = Command46.Usage({
|
|
138505
139069
|
description: "Show status of learned patterns",
|
|
138506
139070
|
examples: [
|
|
138507
139071
|
["Show all patterns", "$0 pattern status"],
|
|
138508
139072
|
["Show by category", "$0 pattern status --category error_fix"]
|
|
138509
139073
|
]
|
|
138510
139074
|
});
|
|
138511
|
-
category =
|
|
139075
|
+
category = Option45.String("--category,-c", {
|
|
138512
139076
|
description: "Filter by category (error_fix, refactor, workaround, debugging, convention)"
|
|
138513
139077
|
});
|
|
138514
|
-
json =
|
|
139078
|
+
json = Option45.Boolean("--json,-j", false, {
|
|
138515
139079
|
description: "Output as JSON"
|
|
138516
139080
|
});
|
|
138517
139081
|
async execute() {
|
|
@@ -138542,20 +139106,20 @@ var PatternStatusCommand = class extends Command45 {
|
|
|
138542
139106
|
return 0;
|
|
138543
139107
|
}
|
|
138544
139108
|
};
|
|
138545
|
-
var PatternFeedbackCommand = class extends
|
|
139109
|
+
var PatternFeedbackCommand = class extends Command46 {
|
|
138546
139110
|
static paths = [["pattern", "feedback"]];
|
|
138547
|
-
static usage =
|
|
139111
|
+
static usage = Command46.Usage({
|
|
138548
139112
|
description: "Provide feedback on a pattern to evolve its confidence",
|
|
138549
139113
|
examples: [
|
|
138550
139114
|
["Mark pattern as successful", "$0 pattern feedback <id> --success"],
|
|
138551
139115
|
["Mark pattern as failed", "$0 pattern feedback <id> --failure"]
|
|
138552
139116
|
]
|
|
138553
139117
|
});
|
|
138554
|
-
id =
|
|
138555
|
-
success =
|
|
139118
|
+
id = Option45.String({ required: true });
|
|
139119
|
+
success = Option45.Boolean("--success,-s", false, {
|
|
138556
139120
|
description: "Pattern was helpful"
|
|
138557
139121
|
});
|
|
138558
|
-
failure =
|
|
139122
|
+
failure = Option45.Boolean("--failure,-f", false, {
|
|
138559
139123
|
description: "Pattern was not helpful"
|
|
138560
139124
|
});
|
|
138561
139125
|
async execute() {
|
|
@@ -138575,13 +139139,13 @@ var PatternFeedbackCommand = class extends Command45 {
|
|
|
138575
139139
|
return 0;
|
|
138576
139140
|
}
|
|
138577
139141
|
};
|
|
138578
|
-
var PatternApproveCommand = class extends
|
|
139142
|
+
var PatternApproveCommand = class extends Command46 {
|
|
138579
139143
|
static paths = [["pattern", "approve"]];
|
|
138580
|
-
static usage =
|
|
139144
|
+
static usage = Command46.Usage({
|
|
138581
139145
|
description: "Approve a pending pattern",
|
|
138582
139146
|
examples: [["Approve pattern", "$0 pattern approve <id>"]]
|
|
138583
139147
|
});
|
|
138584
|
-
id =
|
|
139148
|
+
id = Option45.String({ required: true });
|
|
138585
139149
|
async execute() {
|
|
138586
139150
|
const pattern = approvePattern(this.id);
|
|
138587
139151
|
if (!pattern) {
|
|
@@ -138592,13 +139156,13 @@ var PatternApproveCommand = class extends Command45 {
|
|
|
138592
139156
|
return 0;
|
|
138593
139157
|
}
|
|
138594
139158
|
};
|
|
138595
|
-
var PatternRejectCommand = class extends
|
|
139159
|
+
var PatternRejectCommand = class extends Command46 {
|
|
138596
139160
|
static paths = [["pattern", "reject"]];
|
|
138597
|
-
static usage =
|
|
139161
|
+
static usage = Command46.Usage({
|
|
138598
139162
|
description: "Reject and remove a pattern",
|
|
138599
139163
|
examples: [["Reject pattern", "$0 pattern reject <id>"]]
|
|
138600
139164
|
});
|
|
138601
|
-
id =
|
|
139165
|
+
id = Option45.String({ required: true });
|
|
138602
139166
|
async execute() {
|
|
138603
139167
|
const removed = rejectPattern(this.id);
|
|
138604
139168
|
if (!removed) {
|
|
@@ -138609,22 +139173,22 @@ var PatternRejectCommand = class extends Command45 {
|
|
|
138609
139173
|
return 0;
|
|
138610
139174
|
}
|
|
138611
139175
|
};
|
|
138612
|
-
var PatternExportCommand = class extends
|
|
139176
|
+
var PatternExportCommand = class extends Command46 {
|
|
138613
139177
|
static paths = [["pattern", "export"]];
|
|
138614
|
-
static usage =
|
|
139178
|
+
static usage = Command46.Usage({
|
|
138615
139179
|
description: "Export patterns to a file",
|
|
138616
139180
|
examples: [
|
|
138617
139181
|
["Export as JSON", "$0 pattern export --output patterns.json"],
|
|
138618
139182
|
["Export as markdown report", "$0 pattern export --format report"]
|
|
138619
139183
|
]
|
|
138620
139184
|
});
|
|
138621
|
-
output =
|
|
139185
|
+
output = Option45.String("--output,-o", {
|
|
138622
139186
|
description: "Output file path"
|
|
138623
139187
|
});
|
|
138624
|
-
format =
|
|
139188
|
+
format = Option45.String("--format,-f", {
|
|
138625
139189
|
description: "Format: json or report (default: json)"
|
|
138626
139190
|
});
|
|
138627
|
-
approvedOnly =
|
|
139191
|
+
approvedOnly = Option45.Boolean("--approved", false, {
|
|
138628
139192
|
description: "Export only approved patterns"
|
|
138629
139193
|
});
|
|
138630
139194
|
async execute() {
|
|
@@ -138641,7 +139205,7 @@ var PatternExportCommand = class extends Command45 {
|
|
|
138641
139205
|
content = exportPatternsAsJson(patterns);
|
|
138642
139206
|
}
|
|
138643
139207
|
if (this.output) {
|
|
138644
|
-
|
|
139208
|
+
writeFileSync11(this.output, content);
|
|
138645
139209
|
console.log(chalk32.green(`\u2713 Exported ${patterns.length} patterns to ${this.output}`));
|
|
138646
139210
|
} else {
|
|
138647
139211
|
console.log(content);
|
|
@@ -138649,15 +139213,15 @@ var PatternExportCommand = class extends Command45 {
|
|
|
138649
139213
|
return 0;
|
|
138650
139214
|
}
|
|
138651
139215
|
};
|
|
138652
|
-
var PatternImportCommand = class extends
|
|
139216
|
+
var PatternImportCommand = class extends Command46 {
|
|
138653
139217
|
static paths = [["pattern", "import"]];
|
|
138654
|
-
static usage =
|
|
139218
|
+
static usage = Command46.Usage({
|
|
138655
139219
|
description: "Import patterns from a file",
|
|
138656
139220
|
examples: [["Import patterns", "$0 pattern import patterns.json"]]
|
|
138657
139221
|
});
|
|
138658
|
-
file =
|
|
139222
|
+
file = Option45.String({ required: true });
|
|
138659
139223
|
async execute() {
|
|
138660
|
-
if (!
|
|
139224
|
+
if (!existsSync21(this.file)) {
|
|
138661
139225
|
console.log(chalk32.red(`File not found: ${this.file}`));
|
|
138662
139226
|
return 1;
|
|
138663
139227
|
}
|
|
@@ -138674,19 +139238,19 @@ var PatternImportCommand = class extends Command45 {
|
|
|
138674
139238
|
return 0;
|
|
138675
139239
|
}
|
|
138676
139240
|
};
|
|
138677
|
-
var PatternClusterCommand = class extends
|
|
139241
|
+
var PatternClusterCommand = class extends Command46 {
|
|
138678
139242
|
static paths = [["pattern", "cluster"]];
|
|
138679
|
-
static usage =
|
|
139243
|
+
static usage = Command46.Usage({
|
|
138680
139244
|
description: "Cluster similar patterns and generate skills",
|
|
138681
139245
|
examples: [
|
|
138682
139246
|
["Cluster patterns", "$0 pattern cluster"],
|
|
138683
139247
|
["Cluster and generate skills", "$0 pattern cluster --generate"]
|
|
138684
139248
|
]
|
|
138685
139249
|
});
|
|
138686
|
-
generate =
|
|
139250
|
+
generate = Option45.Boolean("--generate,-g", false, {
|
|
138687
139251
|
description: "Generate skills from clusters"
|
|
138688
139252
|
});
|
|
138689
|
-
minConfidence =
|
|
139253
|
+
minConfidence = Option45.String("--min-confidence", {
|
|
138690
139254
|
description: "Minimum confidence for clustering (default: 0.5)"
|
|
138691
139255
|
});
|
|
138692
139256
|
async execute() {
|
|
@@ -138725,7 +139289,7 @@ function truncate5(str, maxLen) {
|
|
|
138725
139289
|
}
|
|
138726
139290
|
|
|
138727
139291
|
// src/commands/session.ts
|
|
138728
|
-
import { Command as
|
|
139292
|
+
import { Command as Command47, Option as Option46 } from "clipanion";
|
|
138729
139293
|
import chalk33 from "chalk";
|
|
138730
139294
|
import {
|
|
138731
139295
|
loadSessionFile,
|
|
@@ -138735,9 +139299,9 @@ import {
|
|
|
138735
139299
|
listSessions,
|
|
138736
139300
|
getMostRecentSession
|
|
138737
139301
|
} from "@skillkit/core";
|
|
138738
|
-
var SessionCommand = class extends
|
|
139302
|
+
var SessionCommand = class extends Command47 {
|
|
138739
139303
|
static paths = [["session"]];
|
|
138740
|
-
static usage =
|
|
139304
|
+
static usage = Command47.Usage({
|
|
138741
139305
|
description: "Manage session state for context preservation",
|
|
138742
139306
|
details: `
|
|
138743
139307
|
Sessions track context across coding sessions, allowing you to
|
|
@@ -138761,13 +139325,13 @@ var SessionCommand = class extends Command46 {
|
|
|
138761
139325
|
return 0;
|
|
138762
139326
|
}
|
|
138763
139327
|
};
|
|
138764
|
-
var SessionStatusCommand = class extends
|
|
139328
|
+
var SessionStatusCommand = class extends Command47 {
|
|
138765
139329
|
static paths = [["session", "status"]];
|
|
138766
|
-
static usage =
|
|
139330
|
+
static usage = Command47.Usage({
|
|
138767
139331
|
description: "Show current session state",
|
|
138768
139332
|
examples: [["Show status", "$0 session status"]]
|
|
138769
139333
|
});
|
|
138770
|
-
json =
|
|
139334
|
+
json = Option46.Boolean("--json,-j", false, {
|
|
138771
139335
|
description: "Output as JSON"
|
|
138772
139336
|
});
|
|
138773
139337
|
async execute() {
|
|
@@ -138821,16 +139385,16 @@ var SessionStatusCommand = class extends Command46 {
|
|
|
138821
139385
|
}
|
|
138822
139386
|
}
|
|
138823
139387
|
};
|
|
138824
|
-
var SessionStartCommand = class extends
|
|
139388
|
+
var SessionStartCommand = class extends Command47 {
|
|
138825
139389
|
static paths = [["session", "start"]];
|
|
138826
|
-
static usage =
|
|
139390
|
+
static usage = Command47.Usage({
|
|
138827
139391
|
description: "Start a new session",
|
|
138828
139392
|
examples: [
|
|
138829
139393
|
["Start session", "$0 session start"],
|
|
138830
139394
|
["Start with agent", "$0 session start --agent claude-code"]
|
|
138831
139395
|
]
|
|
138832
139396
|
});
|
|
138833
|
-
agent =
|
|
139397
|
+
agent = Option46.String("--agent,-a", {
|
|
138834
139398
|
description: "AI agent being used"
|
|
138835
139399
|
});
|
|
138836
139400
|
async execute() {
|
|
@@ -138843,13 +139407,13 @@ var SessionStartCommand = class extends Command46 {
|
|
|
138843
139407
|
return 0;
|
|
138844
139408
|
}
|
|
138845
139409
|
};
|
|
138846
|
-
var SessionLoadCommand = class extends
|
|
139410
|
+
var SessionLoadCommand = class extends Command47 {
|
|
138847
139411
|
static paths = [["session", "load"]];
|
|
138848
|
-
static usage =
|
|
139412
|
+
static usage = Command47.Usage({
|
|
138849
139413
|
description: "Load session from specific date",
|
|
138850
139414
|
examples: [["Load session", "$0 session load 2026-01-30"]]
|
|
138851
139415
|
});
|
|
138852
|
-
date =
|
|
139416
|
+
date = Option46.String({ required: false });
|
|
138853
139417
|
async execute() {
|
|
138854
139418
|
const session = this.date ? loadSessionFile(this.date) : getMostRecentSession();
|
|
138855
139419
|
if (!session) {
|
|
@@ -138881,16 +139445,16 @@ var SessionLoadCommand = class extends Command46 {
|
|
|
138881
139445
|
return 0;
|
|
138882
139446
|
}
|
|
138883
139447
|
};
|
|
138884
|
-
var SessionListCommand = class extends
|
|
139448
|
+
var SessionListCommand = class extends Command47 {
|
|
138885
139449
|
static paths = [["session", "list"], ["session", "ls"]];
|
|
138886
|
-
static usage =
|
|
139450
|
+
static usage = Command47.Usage({
|
|
138887
139451
|
description: "List recent sessions",
|
|
138888
139452
|
examples: [["List sessions", "$0 session list"]]
|
|
138889
139453
|
});
|
|
138890
|
-
limit =
|
|
139454
|
+
limit = Option46.String("--limit,-l", {
|
|
138891
139455
|
description: "Number of sessions to show (default: 10)"
|
|
138892
139456
|
});
|
|
138893
|
-
json =
|
|
139457
|
+
json = Option46.Boolean("--json,-j", false, {
|
|
138894
139458
|
description: "Output as JSON"
|
|
138895
139459
|
});
|
|
138896
139460
|
async execute() {
|
|
@@ -138917,13 +139481,13 @@ var SessionListCommand = class extends Command46 {
|
|
|
138917
139481
|
return 0;
|
|
138918
139482
|
}
|
|
138919
139483
|
};
|
|
138920
|
-
var SessionNoteCommand = class extends
|
|
139484
|
+
var SessionNoteCommand = class extends Command47 {
|
|
138921
139485
|
static paths = [["session", "note"]];
|
|
138922
|
-
static usage =
|
|
139486
|
+
static usage = Command47.Usage({
|
|
138923
139487
|
description: "Add note to current session",
|
|
138924
139488
|
examples: [["Add note", '$0 session note "Remember to test edge cases"']]
|
|
138925
139489
|
});
|
|
138926
|
-
note =
|
|
139490
|
+
note = Option46.String({ required: true });
|
|
138927
139491
|
async execute() {
|
|
138928
139492
|
let session = getMostRecentSession();
|
|
138929
139493
|
if (!session) {
|
|
@@ -138937,13 +139501,13 @@ var SessionNoteCommand = class extends Command46 {
|
|
|
138937
139501
|
return 0;
|
|
138938
139502
|
}
|
|
138939
139503
|
};
|
|
138940
|
-
var SessionCompleteCommand = class extends
|
|
139504
|
+
var SessionCompleteCommand = class extends Command47 {
|
|
138941
139505
|
static paths = [["session", "complete"]];
|
|
138942
|
-
static usage =
|
|
139506
|
+
static usage = Command47.Usage({
|
|
138943
139507
|
description: "Mark task as completed",
|
|
138944
139508
|
examples: [["Mark completed", '$0 session complete "Implemented user auth"']]
|
|
138945
139509
|
});
|
|
138946
|
-
task =
|
|
139510
|
+
task = Option46.String({ required: true });
|
|
138947
139511
|
async execute() {
|
|
138948
139512
|
let session = getMostRecentSession();
|
|
138949
139513
|
if (!session) {
|
|
@@ -138960,13 +139524,13 @@ var SessionCompleteCommand = class extends Command46 {
|
|
|
138960
139524
|
return 0;
|
|
138961
139525
|
}
|
|
138962
139526
|
};
|
|
138963
|
-
var SessionInProgressCommand = class extends
|
|
139527
|
+
var SessionInProgressCommand = class extends Command47 {
|
|
138964
139528
|
static paths = [["session", "wip"], ["session", "progress"]];
|
|
138965
|
-
static usage =
|
|
139529
|
+
static usage = Command47.Usage({
|
|
138966
139530
|
description: "Mark task as in progress",
|
|
138967
139531
|
examples: [["Mark in progress", '$0 session wip "Working on auth flow"']]
|
|
138968
139532
|
});
|
|
138969
|
-
task =
|
|
139533
|
+
task = Option46.String({ required: true });
|
|
138970
139534
|
async execute() {
|
|
138971
139535
|
let session = getMostRecentSession();
|
|
138972
139536
|
if (!session) {
|
|
@@ -138982,7 +139546,7 @@ var SessionInProgressCommand = class extends Command46 {
|
|
|
138982
139546
|
};
|
|
138983
139547
|
|
|
138984
139548
|
// src/commands/profile.ts
|
|
138985
|
-
import { Command as
|
|
139549
|
+
import { Command as Command48, Option as Option47 } from "clipanion";
|
|
138986
139550
|
import chalk34 from "chalk";
|
|
138987
139551
|
import {
|
|
138988
139552
|
getActiveProfile,
|
|
@@ -138993,9 +139557,9 @@ import {
|
|
|
138993
139557
|
removeCustomProfile,
|
|
138994
139558
|
isBuiltinProfile
|
|
138995
139559
|
} from "@skillkit/core";
|
|
138996
|
-
var ProfileCommand = class extends
|
|
139560
|
+
var ProfileCommand = class extends Command48 {
|
|
138997
139561
|
static paths = [["profile"]];
|
|
138998
|
-
static usage =
|
|
139562
|
+
static usage = Command48.Usage({
|
|
138999
139563
|
description: "Manage operational profiles (dev, review, research modes)",
|
|
139000
139564
|
details: `
|
|
139001
139565
|
Profiles adjust agent behavior for different tasks.
|
|
@@ -139007,7 +139571,7 @@ var ProfileCommand = class extends Command47 {
|
|
|
139007
139571
|
["List all profiles", "$0 profile list"]
|
|
139008
139572
|
]
|
|
139009
139573
|
});
|
|
139010
|
-
name =
|
|
139574
|
+
name = Option47.String({ required: false });
|
|
139011
139575
|
async execute() {
|
|
139012
139576
|
if (this.name) {
|
|
139013
139577
|
const profile2 = getProfile(this.name);
|
|
@@ -139051,13 +139615,13 @@ var ProfileCommand = class extends Command47 {
|
|
|
139051
139615
|
return 0;
|
|
139052
139616
|
}
|
|
139053
139617
|
};
|
|
139054
|
-
var ProfileListCommand = class extends
|
|
139618
|
+
var ProfileListCommand = class extends Command48 {
|
|
139055
139619
|
static paths = [["profile", "list"], ["profile", "ls"]];
|
|
139056
|
-
static usage =
|
|
139620
|
+
static usage = Command48.Usage({
|
|
139057
139621
|
description: "List available profiles",
|
|
139058
139622
|
examples: [["List profiles", "$0 profile list"]]
|
|
139059
139623
|
});
|
|
139060
|
-
json =
|
|
139624
|
+
json = Option47.Boolean("--json,-j", false, {
|
|
139061
139625
|
description: "Output as JSON"
|
|
139062
139626
|
});
|
|
139063
139627
|
async execute() {
|
|
@@ -139082,23 +139646,23 @@ var ProfileListCommand = class extends Command47 {
|
|
|
139082
139646
|
return 0;
|
|
139083
139647
|
}
|
|
139084
139648
|
};
|
|
139085
|
-
var ProfileCreateCommand = class extends
|
|
139649
|
+
var ProfileCreateCommand = class extends Command48 {
|
|
139086
139650
|
static paths = [["profile", "create"]];
|
|
139087
|
-
static usage =
|
|
139651
|
+
static usage = Command48.Usage({
|
|
139088
139652
|
description: "Create a custom profile",
|
|
139089
139653
|
examples: [
|
|
139090
139654
|
["Create profile", '$0 profile create --name my-profile --description "My custom profile"']
|
|
139091
139655
|
]
|
|
139092
139656
|
});
|
|
139093
|
-
name =
|
|
139657
|
+
name = Option47.String("--name,-n", {
|
|
139094
139658
|
description: "Profile name",
|
|
139095
139659
|
required: true
|
|
139096
139660
|
});
|
|
139097
|
-
description =
|
|
139661
|
+
description = Option47.String("--description,-d", {
|
|
139098
139662
|
description: "Profile description",
|
|
139099
139663
|
required: true
|
|
139100
139664
|
});
|
|
139101
|
-
focus =
|
|
139665
|
+
focus = Option47.String("--focus,-f", {
|
|
139102
139666
|
description: "Profile focus"
|
|
139103
139667
|
});
|
|
139104
139668
|
async execute() {
|
|
@@ -139119,13 +139683,13 @@ var ProfileCreateCommand = class extends Command47 {
|
|
|
139119
139683
|
return 0;
|
|
139120
139684
|
}
|
|
139121
139685
|
};
|
|
139122
|
-
var ProfileRemoveCommand = class extends
|
|
139686
|
+
var ProfileRemoveCommand = class extends Command48 {
|
|
139123
139687
|
static paths = [["profile", "remove"], ["profile", "rm"]];
|
|
139124
|
-
static usage =
|
|
139688
|
+
static usage = Command48.Usage({
|
|
139125
139689
|
description: "Remove a custom profile",
|
|
139126
139690
|
examples: [["Remove profile", "$0 profile remove my-profile"]]
|
|
139127
139691
|
});
|
|
139128
|
-
name =
|
|
139692
|
+
name = Option47.String({ required: true });
|
|
139129
139693
|
async execute() {
|
|
139130
139694
|
if (isBuiltinProfile(this.name)) {
|
|
139131
139695
|
console.log(chalk34.red(`Cannot remove built-in profile: ${this.name}`));
|
|
@@ -139142,7 +139706,7 @@ var ProfileRemoveCommand = class extends Command47 {
|
|
|
139142
139706
|
};
|
|
139143
139707
|
|
|
139144
139708
|
// src/commands/guideline.ts
|
|
139145
|
-
import { Command as
|
|
139709
|
+
import { Command as Command49, Option as Option48 } from "clipanion";
|
|
139146
139710
|
import chalk35 from "chalk";
|
|
139147
139711
|
import {
|
|
139148
139712
|
getAllGuidelines,
|
|
@@ -139155,9 +139719,9 @@ import {
|
|
|
139155
139719
|
addCustomGuideline,
|
|
139156
139720
|
removeCustomGuideline
|
|
139157
139721
|
} from "@skillkit/core";
|
|
139158
|
-
var GuidelineCommand = class extends
|
|
139722
|
+
var GuidelineCommand = class extends Command49 {
|
|
139159
139723
|
static paths = [["guideline"], ["guide"]];
|
|
139160
|
-
static usage =
|
|
139724
|
+
static usage = Command49.Usage({
|
|
139161
139725
|
description: "Manage coding guidelines (always-on rules)",
|
|
139162
139726
|
details: `
|
|
139163
139727
|
Guidelines are always-on coding standards that guide agent behavior.
|
|
@@ -139180,19 +139744,19 @@ var GuidelineCommand = class extends Command48 {
|
|
|
139180
139744
|
return 0;
|
|
139181
139745
|
}
|
|
139182
139746
|
};
|
|
139183
|
-
var GuidelineListCommand = class extends
|
|
139747
|
+
var GuidelineListCommand = class extends Command49 {
|
|
139184
139748
|
static paths = [["guideline", "list"], ["guideline", "ls"]];
|
|
139185
|
-
static usage =
|
|
139749
|
+
static usage = Command49.Usage({
|
|
139186
139750
|
description: "List all guidelines",
|
|
139187
139751
|
examples: [
|
|
139188
139752
|
["List all", "$0 guideline list"],
|
|
139189
139753
|
["Show only enabled", "$0 guideline list --enabled"]
|
|
139190
139754
|
]
|
|
139191
139755
|
});
|
|
139192
|
-
enabled =
|
|
139756
|
+
enabled = Option48.Boolean("--enabled,-e", false, {
|
|
139193
139757
|
description: "Show only enabled guidelines"
|
|
139194
139758
|
});
|
|
139195
|
-
json =
|
|
139759
|
+
json = Option48.Boolean("--json,-j", false, {
|
|
139196
139760
|
description: "Output as JSON"
|
|
139197
139761
|
});
|
|
139198
139762
|
async execute() {
|
|
@@ -139228,13 +139792,13 @@ var GuidelineListCommand = class extends Command48 {
|
|
|
139228
139792
|
return 0;
|
|
139229
139793
|
}
|
|
139230
139794
|
};
|
|
139231
|
-
var GuidelineShowCommand = class extends
|
|
139795
|
+
var GuidelineShowCommand = class extends Command49 {
|
|
139232
139796
|
static paths = [["guideline", "show"]];
|
|
139233
|
-
static usage =
|
|
139797
|
+
static usage = Command49.Usage({
|
|
139234
139798
|
description: "Show guideline content",
|
|
139235
139799
|
examples: [["Show guideline", "$0 guideline show security"]]
|
|
139236
139800
|
});
|
|
139237
|
-
id =
|
|
139801
|
+
id = Option48.String({ required: true });
|
|
139238
139802
|
async execute() {
|
|
139239
139803
|
const guideline = getGuideline(this.id);
|
|
139240
139804
|
if (!guideline) {
|
|
@@ -139255,13 +139819,13 @@ var GuidelineShowCommand = class extends Command48 {
|
|
|
139255
139819
|
return 0;
|
|
139256
139820
|
}
|
|
139257
139821
|
};
|
|
139258
|
-
var GuidelineEnableCommand = class extends
|
|
139822
|
+
var GuidelineEnableCommand = class extends Command49 {
|
|
139259
139823
|
static paths = [["guideline", "enable"]];
|
|
139260
|
-
static usage =
|
|
139824
|
+
static usage = Command49.Usage({
|
|
139261
139825
|
description: "Enable a guideline",
|
|
139262
139826
|
examples: [["Enable security", "$0 guideline enable security"]]
|
|
139263
139827
|
});
|
|
139264
|
-
id =
|
|
139828
|
+
id = Option48.String({ required: true });
|
|
139265
139829
|
async execute() {
|
|
139266
139830
|
const success2 = enableGuideline(this.id);
|
|
139267
139831
|
if (!success2) {
|
|
@@ -139272,13 +139836,13 @@ var GuidelineEnableCommand = class extends Command48 {
|
|
|
139272
139836
|
return 0;
|
|
139273
139837
|
}
|
|
139274
139838
|
};
|
|
139275
|
-
var GuidelineDisableCommand = class extends
|
|
139839
|
+
var GuidelineDisableCommand = class extends Command49 {
|
|
139276
139840
|
static paths = [["guideline", "disable"]];
|
|
139277
|
-
static usage =
|
|
139841
|
+
static usage = Command49.Usage({
|
|
139278
139842
|
description: "Disable a guideline",
|
|
139279
139843
|
examples: [["Disable performance", "$0 guideline disable performance"]]
|
|
139280
139844
|
});
|
|
139281
|
-
id =
|
|
139845
|
+
id = Option48.String({ required: true });
|
|
139282
139846
|
async execute() {
|
|
139283
139847
|
const success2 = disableGuideline(this.id);
|
|
139284
139848
|
if (!success2) {
|
|
@@ -139289,29 +139853,29 @@ var GuidelineDisableCommand = class extends Command48 {
|
|
|
139289
139853
|
return 0;
|
|
139290
139854
|
}
|
|
139291
139855
|
};
|
|
139292
|
-
var GuidelineCreateCommand = class extends
|
|
139856
|
+
var GuidelineCreateCommand = class extends Command49 {
|
|
139293
139857
|
static paths = [["guideline", "create"]];
|
|
139294
|
-
static usage =
|
|
139858
|
+
static usage = Command49.Usage({
|
|
139295
139859
|
description: "Create a custom guideline",
|
|
139296
139860
|
examples: [
|
|
139297
139861
|
["Create guideline", '$0 guideline create --id my-rules --name "My Rules" --category custom']
|
|
139298
139862
|
]
|
|
139299
139863
|
});
|
|
139300
|
-
id =
|
|
139864
|
+
id = Option48.String("--id", {
|
|
139301
139865
|
description: "Guideline ID",
|
|
139302
139866
|
required: true
|
|
139303
139867
|
});
|
|
139304
|
-
name =
|
|
139868
|
+
name = Option48.String("--name,-n", {
|
|
139305
139869
|
description: "Guideline name",
|
|
139306
139870
|
required: true
|
|
139307
139871
|
});
|
|
139308
|
-
description =
|
|
139872
|
+
description = Option48.String("--description,-d", {
|
|
139309
139873
|
description: "Guideline description"
|
|
139310
139874
|
});
|
|
139311
|
-
category =
|
|
139875
|
+
category = Option48.String("--category,-c", {
|
|
139312
139876
|
description: "Category (security, code-style, testing, git, performance, custom)"
|
|
139313
139877
|
});
|
|
139314
|
-
priority =
|
|
139878
|
+
priority = Option48.String("--priority,-p", {
|
|
139315
139879
|
description: "Priority (1-10, higher = more important)"
|
|
139316
139880
|
});
|
|
139317
139881
|
async execute() {
|
|
@@ -139338,13 +139902,13 @@ Add your guidelines here.`
|
|
|
139338
139902
|
return 0;
|
|
139339
139903
|
}
|
|
139340
139904
|
};
|
|
139341
|
-
var GuidelineRemoveCommand = class extends
|
|
139905
|
+
var GuidelineRemoveCommand = class extends Command49 {
|
|
139342
139906
|
static paths = [["guideline", "remove"], ["guideline", "rm"]];
|
|
139343
|
-
static usage =
|
|
139907
|
+
static usage = Command49.Usage({
|
|
139344
139908
|
description: "Remove a custom guideline",
|
|
139345
139909
|
examples: [["Remove guideline", "$0 guideline remove my-rules"]]
|
|
139346
139910
|
});
|
|
139347
|
-
id =
|
|
139911
|
+
id = Option48.String({ required: true });
|
|
139348
139912
|
async execute() {
|
|
139349
139913
|
if (isBuiltinGuideline(this.id)) {
|
|
139350
139914
|
console.log(chalk35.red(`Cannot remove built-in guideline: ${this.id}`));
|
|
@@ -139365,7 +139929,7 @@ function formatCategoryName2(category) {
|
|
|
139365
139929
|
|
|
139366
139930
|
// src/commands/tree.ts
|
|
139367
139931
|
init_onboarding();
|
|
139368
|
-
import { Command as
|
|
139932
|
+
import { Command as Command50, Option as Option49 } from "clipanion";
|
|
139369
139933
|
import { join as join19 } from "path";
|
|
139370
139934
|
import { homedir as homedir4 } from "os";
|
|
139371
139935
|
import {
|
|
@@ -139375,9 +139939,9 @@ import {
|
|
|
139375
139939
|
loadTree
|
|
139376
139940
|
} from "@skillkit/core";
|
|
139377
139941
|
var TREE_PATH = join19(homedir4(), ".skillkit", "skill-tree.json");
|
|
139378
|
-
var TreeCommand = class extends
|
|
139942
|
+
var TreeCommand = class extends Command50 {
|
|
139379
139943
|
static paths = [["tree"]];
|
|
139380
|
-
static usage =
|
|
139944
|
+
static usage = Command50.Usage({
|
|
139381
139945
|
description: "Browse skills in a hierarchical tree structure",
|
|
139382
139946
|
details: `
|
|
139383
139947
|
The tree command displays skills organized in a hierarchical taxonomy.
|
|
@@ -139399,23 +139963,23 @@ var TreeCommand = class extends Command49 {
|
|
|
139399
139963
|
["Show tree stats", "$0 tree --stats"]
|
|
139400
139964
|
]
|
|
139401
139965
|
});
|
|
139402
|
-
treePath =
|
|
139403
|
-
depth =
|
|
139966
|
+
treePath = Option49.String({ required: false });
|
|
139967
|
+
depth = Option49.String("--depth,-d", {
|
|
139404
139968
|
description: "Maximum depth to display"
|
|
139405
139969
|
});
|
|
139406
|
-
generate =
|
|
139970
|
+
generate = Option49.Boolean("--generate,-g", false, {
|
|
139407
139971
|
description: "Generate/update tree from skill index"
|
|
139408
139972
|
});
|
|
139409
|
-
markdown =
|
|
139973
|
+
markdown = Option49.Boolean("--markdown,-m", false, {
|
|
139410
139974
|
description: "Output in markdown format"
|
|
139411
139975
|
});
|
|
139412
|
-
stats =
|
|
139976
|
+
stats = Option49.Boolean("--stats,-s", false, {
|
|
139413
139977
|
description: "Show tree statistics"
|
|
139414
139978
|
});
|
|
139415
|
-
json =
|
|
139979
|
+
json = Option49.Boolean("--json,-j", false, {
|
|
139416
139980
|
description: "Output in JSON format"
|
|
139417
139981
|
});
|
|
139418
|
-
quiet =
|
|
139982
|
+
quiet = Option49.Boolean("--quiet,-q", false, {
|
|
139419
139983
|
description: "Minimal output"
|
|
139420
139984
|
});
|
|
139421
139985
|
async execute() {
|
|
@@ -139568,11 +140132,11 @@ var TreeCommand = class extends Command49 {
|
|
|
139568
140132
|
// src/commands/quick.ts
|
|
139569
140133
|
init_helpers();
|
|
139570
140134
|
init_onboarding();
|
|
139571
|
-
import { existsSync as
|
|
139572
|
-
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";
|
|
139573
140137
|
import { execFile as execFile2 } from "child_process";
|
|
139574
140138
|
import { promisify as promisify2 } from "util";
|
|
139575
|
-
import { Command as
|
|
140139
|
+
import { Command as Command51 } from "clipanion";
|
|
139576
140140
|
import {
|
|
139577
140141
|
ContextManager as ContextManager3,
|
|
139578
140142
|
RecommendationEngine as RecommendationEngine2,
|
|
@@ -139591,9 +140155,9 @@ function truncate6(str, maxLen) {
|
|
|
139591
140155
|
if (str.length <= maxLen) return str;
|
|
139592
140156
|
return str.slice(0, maxLen - 3) + "...";
|
|
139593
140157
|
}
|
|
139594
|
-
var QuickCommand = class extends
|
|
140158
|
+
var QuickCommand = class extends Command51 {
|
|
139595
140159
|
static paths = [["quick"]];
|
|
139596
|
-
static usage =
|
|
140160
|
+
static usage = Command51.Usage({
|
|
139597
140161
|
description: "Zero-friction skill setup: detect agents, analyze project, recommend and install",
|
|
139598
140162
|
examples: [
|
|
139599
140163
|
["Quick setup", "$0 quick"]
|
|
@@ -139612,7 +140176,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139612
140176
|
try {
|
|
139613
140177
|
const installDir = getInstallDir(false, adapter.type);
|
|
139614
140178
|
const globalDir = getInstallDir(true, adapter.type);
|
|
139615
|
-
if (
|
|
140179
|
+
if (existsSync22(installDir) || existsSync22(globalDir) || existsSync22(adapter.configFile)) {
|
|
139616
140180
|
detectedAgents.push(adapter.type);
|
|
139617
140181
|
}
|
|
139618
140182
|
} catch {
|
|
@@ -139624,7 +140188,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139624
140188
|
}
|
|
139625
140189
|
s.stop(`Detected ${detectedAgents.length} agent${detectedAgents.length !== 1 ? "s" : ""}: ${detectedAgents.map(formatAgent).join(", ")}`);
|
|
139626
140190
|
s.start("Analyzing project...");
|
|
139627
|
-
const targetPath =
|
|
140191
|
+
const targetPath = resolve22(process.cwd());
|
|
139628
140192
|
const manager = new ContextManager3(targetPath);
|
|
139629
140193
|
let context = manager.get();
|
|
139630
140194
|
if (!context) {
|
|
@@ -139759,8 +140323,8 @@ var QuickCommand = class extends Command50 {
|
|
|
139759
140323
|
for (const agentType of detectedAgents) {
|
|
139760
140324
|
const adapter = getAdapter6(agentType);
|
|
139761
140325
|
const installDir = getInstallDir(false, agentType);
|
|
139762
|
-
if (!
|
|
139763
|
-
|
|
140326
|
+
if (!existsSync22(installDir)) {
|
|
140327
|
+
mkdirSync11(installDir, { recursive: true });
|
|
139764
140328
|
}
|
|
139765
140329
|
const sanitizedName = matchedSkill.name.split(/[/\\]/).pop() || matchedSkill.name;
|
|
139766
140330
|
const targetInstallPath = normalize(join20(installDir, sanitizedName));
|
|
@@ -139776,7 +140340,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139776
140340
|
const useSymlink = detectedAgents.length > 1 && primaryPath !== null;
|
|
139777
140341
|
s.start(`Installing to ${adapter.name}${useSymlink ? " (symlink)" : ""}...`);
|
|
139778
140342
|
try {
|
|
139779
|
-
if (
|
|
140343
|
+
if (existsSync22(targetInstallPath)) {
|
|
139780
140344
|
rmSync5(targetInstallPath, { recursive: true, force: true });
|
|
139781
140345
|
}
|
|
139782
140346
|
if (useSymlink && primaryPath) {
|
|
@@ -139787,7 +140351,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139787
140351
|
primaryPath = targetInstallPath;
|
|
139788
140352
|
}
|
|
139789
140353
|
const packageJsonPath = join20(targetInstallPath, "package.json");
|
|
139790
|
-
if (
|
|
140354
|
+
if (existsSync22(packageJsonPath)) {
|
|
139791
140355
|
s.stop(`Installed to ${adapter.name}`);
|
|
139792
140356
|
s.start("Installing npm dependencies...");
|
|
139793
140357
|
try {
|
|
@@ -139818,7 +140382,7 @@ var QuickCommand = class extends Command50 {
|
|
|
139818
140382
|
}
|
|
139819
140383
|
}
|
|
139820
140384
|
const cleanupPath = cloneResult.tempRoot || cloneResult.path;
|
|
139821
|
-
if (!isLocalPath4(selectedSkill.skill.source) && cleanupPath &&
|
|
140385
|
+
if (!isLocalPath4(selectedSkill.skill.source) && cleanupPath && existsSync22(cleanupPath)) {
|
|
139822
140386
|
rmSync5(cleanupPath, { recursive: true, force: true });
|
|
139823
140387
|
}
|
|
139824
140388
|
if (installedAgents.length > 0) {
|
|
@@ -139852,9 +140416,9 @@ var QuickCommand = class extends Command50 {
|
|
|
139852
140416
|
|
|
139853
140417
|
// src/commands/skillmd.ts
|
|
139854
140418
|
init_onboarding();
|
|
139855
|
-
import { existsSync as
|
|
139856
|
-
import { join as join21, resolve as
|
|
139857
|
-
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";
|
|
139858
140422
|
function validateSkillMd(filePath) {
|
|
139859
140423
|
const result = {
|
|
139860
140424
|
path: filePath,
|
|
@@ -139868,7 +140432,7 @@ function validateSkillMd(filePath) {
|
|
|
139868
140432
|
score: 0,
|
|
139869
140433
|
issues: []
|
|
139870
140434
|
};
|
|
139871
|
-
if (!
|
|
140435
|
+
if (!existsSync23(filePath)) {
|
|
139872
140436
|
result.issues.push("File does not exist");
|
|
139873
140437
|
return result;
|
|
139874
140438
|
}
|
|
@@ -139969,25 +140533,25 @@ function printValidation(validation, verbose = false) {
|
|
|
139969
140533
|
}
|
|
139970
140534
|
}
|
|
139971
140535
|
}
|
|
139972
|
-
var SkillMdValidateCommand = class extends
|
|
140536
|
+
var SkillMdValidateCommand = class extends Command52 {
|
|
139973
140537
|
static paths = [["skillmd", "validate"], ["skill-md", "validate"]];
|
|
139974
|
-
static usage =
|
|
140538
|
+
static usage = Command52.Usage({
|
|
139975
140539
|
description: "Validate a SKILL.md file against the standard",
|
|
139976
140540
|
examples: [
|
|
139977
140541
|
["Validate SKILL.md in current directory", "$0 skillmd validate"],
|
|
139978
140542
|
["Validate specific file", "$0 skillmd validate ./path/to/SKILL.md"]
|
|
139979
140543
|
]
|
|
139980
140544
|
});
|
|
139981
|
-
targetPath =
|
|
139982
|
-
verbose =
|
|
140545
|
+
targetPath = Option50.String({ required: false, name: "path" });
|
|
140546
|
+
verbose = Option50.Boolean("--verbose,-v", false, {
|
|
139983
140547
|
description: "Show detailed validation results"
|
|
139984
140548
|
});
|
|
139985
|
-
json =
|
|
140549
|
+
json = Option50.Boolean("--json", false, {
|
|
139986
140550
|
description: "Output as JSON"
|
|
139987
140551
|
});
|
|
139988
140552
|
async execute() {
|
|
139989
140553
|
const targetPath = this.targetPath || join21(process.cwd(), "SKILL.md");
|
|
139990
|
-
const resolvedPath =
|
|
140554
|
+
const resolvedPath = resolve23(targetPath);
|
|
139991
140555
|
const filePath = resolvedPath.endsWith("SKILL.md") ? resolvedPath : join21(resolvedPath, "SKILL.md");
|
|
139992
140556
|
if (!this.json) {
|
|
139993
140557
|
header("SKILL.md Validation");
|
|
@@ -140012,24 +140576,24 @@ var SkillMdValidateCommand = class extends Command51 {
|
|
|
140012
140576
|
return validation.score >= 60 ? 0 : 1;
|
|
140013
140577
|
}
|
|
140014
140578
|
};
|
|
140015
|
-
var SkillMdInitCommand = class extends
|
|
140579
|
+
var SkillMdInitCommand = class extends Command52 {
|
|
140016
140580
|
static paths = [["skillmd", "init"], ["skill-md", "init"]];
|
|
140017
|
-
static usage =
|
|
140581
|
+
static usage = Command52.Usage({
|
|
140018
140582
|
description: "Create a template SKILL.md in the current directory",
|
|
140019
140583
|
examples: [
|
|
140020
140584
|
["Create SKILL.md template", "$0 skillmd init"],
|
|
140021
140585
|
["Create with custom name", "$0 skillmd init --name my-skill"]
|
|
140022
140586
|
]
|
|
140023
140587
|
});
|
|
140024
|
-
name =
|
|
140588
|
+
name = Option50.String("--name,-n", {
|
|
140025
140589
|
description: "Skill name"
|
|
140026
140590
|
});
|
|
140027
|
-
force =
|
|
140591
|
+
force = Option50.Boolean("--force,-f", false, {
|
|
140028
140592
|
description: "Overwrite existing SKILL.md"
|
|
140029
140593
|
});
|
|
140030
140594
|
async execute() {
|
|
140031
140595
|
const outputPath = join21(process.cwd(), "SKILL.md");
|
|
140032
|
-
if (
|
|
140596
|
+
if (existsSync23(outputPath) && !this.force) {
|
|
140033
140597
|
warn("SKILL.md already exists");
|
|
140034
140598
|
console.log(colors.muted("Use --force to overwrite"));
|
|
140035
140599
|
return 1;
|
|
@@ -140074,7 +140638,7 @@ var SkillMdInitCommand = class extends Command51 {
|
|
|
140074
140638
|
"```",
|
|
140075
140639
|
""
|
|
140076
140640
|
].join("\n");
|
|
140077
|
-
|
|
140641
|
+
writeFileSync12(outputPath, template);
|
|
140078
140642
|
success(`Created SKILL.md for "${skillName}"`);
|
|
140079
140643
|
console.log("");
|
|
140080
140644
|
console.log(colors.muted("Next steps:"));
|
|
@@ -140084,21 +140648,21 @@ var SkillMdInitCommand = class extends Command51 {
|
|
|
140084
140648
|
return 0;
|
|
140085
140649
|
}
|
|
140086
140650
|
};
|
|
140087
|
-
var SkillMdCheckCommand = class extends
|
|
140651
|
+
var SkillMdCheckCommand = class extends Command52 {
|
|
140088
140652
|
static paths = [["skillmd", "check"], ["skill-md", "check"]];
|
|
140089
|
-
static usage =
|
|
140653
|
+
static usage = Command52.Usage({
|
|
140090
140654
|
description: "Check all SKILL.md files in the project for compliance",
|
|
140091
140655
|
examples: [
|
|
140092
140656
|
["Check current directory", "$0 skillmd check"],
|
|
140093
140657
|
["Check specific directory", "$0 skillmd check ./skills"]
|
|
140094
140658
|
]
|
|
140095
140659
|
});
|
|
140096
|
-
targetPath =
|
|
140097
|
-
verbose =
|
|
140660
|
+
targetPath = Option50.String({ required: false, name: "path" });
|
|
140661
|
+
verbose = Option50.Boolean("--verbose,-v", false, {
|
|
140098
140662
|
description: "Show detailed validation results"
|
|
140099
140663
|
});
|
|
140100
140664
|
async execute() {
|
|
140101
|
-
const targetPath =
|
|
140665
|
+
const targetPath = resolve23(this.targetPath || process.cwd());
|
|
140102
140666
|
header("SKILL.md Compliance Check");
|
|
140103
140667
|
const s = spinner2();
|
|
140104
140668
|
s.start("Scanning for SKILL.md files...");
|
|
@@ -140146,7 +140710,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140146
140710
|
findSkillMdFiles(dir) {
|
|
140147
140711
|
const results = [];
|
|
140148
140712
|
const directFile = join21(dir, "SKILL.md");
|
|
140149
|
-
if (
|
|
140713
|
+
if (existsSync23(directFile)) results.push(directFile);
|
|
140150
140714
|
const searchDirs = [
|
|
140151
140715
|
join21(dir, "skills"),
|
|
140152
140716
|
join21(dir, ".claude", "skills"),
|
|
@@ -140155,7 +140719,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140155
140719
|
join21(dir, ".github", "skills")
|
|
140156
140720
|
];
|
|
140157
140721
|
for (const searchDir of searchDirs) {
|
|
140158
|
-
if (!
|
|
140722
|
+
if (!existsSync23(searchDir)) continue;
|
|
140159
140723
|
this.scanDir(searchDir, results, 0);
|
|
140160
140724
|
}
|
|
140161
140725
|
try {
|
|
@@ -140164,7 +140728,7 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140164
140728
|
if (!entry.isDirectory()) continue;
|
|
140165
140729
|
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
140166
140730
|
const entrySkillMd = join21(dir, entry.name, "SKILL.md");
|
|
140167
|
-
if (
|
|
140731
|
+
if (existsSync23(entrySkillMd) && !results.includes(entrySkillMd)) {
|
|
140168
140732
|
results.push(entrySkillMd);
|
|
140169
140733
|
}
|
|
140170
140734
|
}
|
|
@@ -140192,10 +140756,10 @@ var SkillMdCheckCommand = class extends Command51 {
|
|
|
140192
140756
|
|
|
140193
140757
|
// src/commands/serve.ts
|
|
140194
140758
|
init_onboarding();
|
|
140195
|
-
import { Command as
|
|
140196
|
-
var ServeCommand = class extends
|
|
140759
|
+
import { Command as Command53, Option as Option51 } from "clipanion";
|
|
140760
|
+
var ServeCommand = class extends Command53 {
|
|
140197
140761
|
static paths = [["serve"], ["server"]];
|
|
140198
|
-
static usage =
|
|
140762
|
+
static usage = Command53.Usage({
|
|
140199
140763
|
description: "Start the SkillKit REST API server for skill discovery",
|
|
140200
140764
|
details: `
|
|
140201
140765
|
Launches a local HTTP server that exposes the SkillKit skill catalog
|
|
@@ -140208,16 +140772,16 @@ var ServeCommand = class extends Command52 {
|
|
|
140208
140772
|
["Start with custom CORS", '$0 serve --cors "http://localhost:3000"']
|
|
140209
140773
|
]
|
|
140210
140774
|
});
|
|
140211
|
-
port =
|
|
140775
|
+
port = Option51.String("--port,-p", "3737", {
|
|
140212
140776
|
description: "Port to listen on"
|
|
140213
140777
|
});
|
|
140214
|
-
host =
|
|
140778
|
+
host = Option51.String("--host,-H", "0.0.0.0", {
|
|
140215
140779
|
description: "Host to bind to"
|
|
140216
140780
|
});
|
|
140217
|
-
corsOrigin =
|
|
140781
|
+
corsOrigin = Option51.String("--cors", "*", {
|
|
140218
140782
|
description: "CORS allowed origin"
|
|
140219
140783
|
});
|
|
140220
|
-
cacheTtl =
|
|
140784
|
+
cacheTtl = Option51.String("--cache-ttl", "86400000", {
|
|
140221
140785
|
description: "Cache TTL in milliseconds"
|
|
140222
140786
|
});
|
|
140223
140787
|
async execute() {
|
|
@@ -140293,6 +140857,7 @@ export {
|
|
|
140293
140857
|
EnableCommand,
|
|
140294
140858
|
FindCommand,
|
|
140295
140859
|
FixCommand,
|
|
140860
|
+
GenerateCommand,
|
|
140296
140861
|
GuidelineCommand,
|
|
140297
140862
|
GuidelineCreateCommand,
|
|
140298
140863
|
GuidelineDisableCommand,
|