@greenrenge/skills 0.1.0 → 0.3.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/README.md +84 -23
- package/bin/cli.mjs +414 -123
- package/bin/lib/onboard.mjs +1179 -0
- package/bin/lib/probe.mjs +782 -0
- package/bin/lib/recipes/index.mjs +57 -0
- package/bin/lib/recipes/security-cron.mjs +1140 -0
- package/catalog.json +501 -51
- package/package.json +10 -8
- package/skills/security-remediation-epic/prompt-template.md +87 -20
- package/skills/ticket-orchestrator/SKILL.md +349 -0
- package/skills/ticket-orchestrator/references/proving-the-gates.md +63 -0
- package/skills/ticket-scheme/SKILL.md +144 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dedicated workflow recipes registry for @greenrenge/skills.
|
|
3
|
+
*
|
|
4
|
+
* Unlike passive bundles, each recipe can compose an overlapping subset of
|
|
5
|
+
* skills, run a custom preflight probe, walk a tailored CLI wizard, and emit
|
|
6
|
+
* runnable artifacts (prompts, slash commands, runner scripts, CI workflows).
|
|
7
|
+
*/
|
|
8
|
+
import { c } from "../onboard.mjs";
|
|
9
|
+
import { runSecurityCronRecipe } from "./security-cron.mjs";
|
|
10
|
+
|
|
11
|
+
export const RECIPE_HANDLERS = {
|
|
12
|
+
"security-cron": runSecurityCronRecipe,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function hasRecipe(name, catalog) {
|
|
16
|
+
return Boolean(name && RECIPE_HANDLERS[name] && catalog.recipes?.[name]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function renderRecipesList(catalog, pkgJson) {
|
|
20
|
+
const recipes = catalog.recipes ?? {};
|
|
21
|
+
const entries = Object.entries(recipes);
|
|
22
|
+
const lines = [];
|
|
23
|
+
lines.push(`${c.bold(pkgJson.name)} v${pkgJson.version} — Dedicated Recipes`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
if (entries.length === 0) {
|
|
26
|
+
lines.push(" (no recipes registered)");
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
for (const [id, meta] of entries) {
|
|
30
|
+
lines.push(` ${c.bold(c.cyan(id))} — ${meta.title}`);
|
|
31
|
+
lines.push(` ${c.dim(meta.description)}`);
|
|
32
|
+
if (meta.baseSkills?.length) {
|
|
33
|
+
lines.push(` Base skills: ${meta.baseSkills.join(", ")}`);
|
|
34
|
+
}
|
|
35
|
+
if (meta.overlays && Object.keys(meta.overlays).length > 0) {
|
|
36
|
+
const ov = Object.entries(meta.overlays)
|
|
37
|
+
.map(([k, v]) => `${k}: [${v.join(", ")}]`)
|
|
38
|
+
.join(" | ");
|
|
39
|
+
lines.push(` Overlays: ${ov}`);
|
|
40
|
+
}
|
|
41
|
+
if (meta.schedules?.length) {
|
|
42
|
+
lines.push(` Schedules: ${meta.schedules.join(", ")}`);
|
|
43
|
+
}
|
|
44
|
+
lines.push(` Run: npx ${pkgJson.name} setup ${id} (or: npx ${pkgJson.name} ${id})`);
|
|
45
|
+
lines.push("");
|
|
46
|
+
}
|
|
47
|
+
return lines.join("\n");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function runRecipe(name, ctx) {
|
|
51
|
+
const handler = RECIPE_HANDLERS[name];
|
|
52
|
+
if (!handler || !ctx.catalog.recipes?.[name]) {
|
|
53
|
+
const known = Object.keys(ctx.catalog.recipes ?? {}).join(", ") || "(none)";
|
|
54
|
+
throw new Error(`Unknown recipe "${name}". Available recipes: ${known}`);
|
|
55
|
+
}
|
|
56
|
+
return await handler(ctx);
|
|
57
|
+
}
|