skilldrop-cli 0.2.0 → 0.4.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 +33 -4
- package/bin/skilldrop.js +119 -0
- package/model-routing.json +4 -1
- package/package.json +3 -2
- package/packs.json +4 -1
- package/skills/agent-budget/SKILL.md +61 -0
- package/skills/agent-budget/evals/eval_queries.json +11 -0
- package/skills/agent-budget/evals/evals.json +28 -0
- package/skills/agent-budget/manifest.json +11 -0
- package/skills/agent-budget/templates/budget-spec.md +30 -0
- package/skills/agent-loop-design/SKILL.md +68 -0
- package/skills/agent-loop-design/evals/eval_queries.json +11 -0
- package/skills/agent-loop-design/evals/evals.json +28 -0
- package/skills/agent-loop-design/manifest.json +11 -0
- package/skills/agent-loop-design/templates/loop-spec.md +46 -0
- package/skills/ai-usage-report/SKILL.md +1 -1
- package/skills/devils-advocate/manifest.json +3 -0
- package/skills/subagent-design/SKILL.md +67 -0
- package/skills/subagent-design/evals/eval_queries.json +11 -0
- package/skills/subagent-design/evals/evals.json +29 -0
- package/skills/subagent-design/manifest.json +11 -0
- package/skills/subagent-design/templates/orchestration-plan.md +47 -0
package/README.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# skilldrop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/skilldrop-cli)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
**48 portable AI-agent skills for the deliverables knowledge workers actually ship** — diagrams, design docs, ADRs, PRDs, runbooks, decks, decision logs, threat models, adversarial reviews — installable into **Claude Code**, **Cursor**, **Kiro**, and any AI tool that accepts custom instructions, one skill or one role-based pack at a time:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npx skilldrop-cli install --pack product-manager # or: solution-architect, dev-team,
|
|
10
|
+
npx skilldrop-cli list # sre-oncall, stakeholder-comms, ai-engineering
|
|
11
|
+
```
|
|
4
12
|
|
|
5
13
|
Originally scoped to solution architects, now broadly useful to PMs, founders, consultants, engineering leaders, exec assistants — anyone who turns ideas into stakeholder-ready artifacts.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
**Why skilldrop over heavier agent platforms:** every skill is a plain folder (`SKILL.md` + `manifest.json` + supporting files) and installs by *copy, never transformation* — what runs in your IDE is byte-identical to what's reviewed in this repo. The flat layout doubles as an open catalog contract: [any repo shaped like this one](#third-party-catalogs--publish-your-own-skills-through-the-same-cli) is installable through the same CLI. Skills are *opinionated* — each ships a quality bar, anti-patterns, and acceptance evals, so the output is an artifact, not a vibe.
|
|
8
16
|
|
|
9
17
|
## How skilldrop works
|
|
10
18
|
|
|
@@ -130,6 +138,16 @@ Skills for the direction-setting layer above any single feature — testing whet
|
|
|
130
138
|
| [`data-contract`](skills/data-contract/SKILL.md) | Draft a data contract for a dataset, table, or event stream others depend on — the data-engineering counterpart to `api-contract-draft`. Schema specified with **per-field semantics and units** (the cents-vs-dollars, UTC-vs-local, gross-vs-net firewall), measurable quality SLAs across freshness / completeness / validity / uniqueness / distribution — each with a threshold, a check, and a **breach action** — a schema-evolution policy that names the silent killer (changing a field's *meaning* under a stable name/type is breaking, and no validator catches it), enumerated consumers (so "breaking" is defined and notices have an address), a named owner, and per-field PII classification. Marks aspirational-vs-met SLAs honestly on existing assets. |
|
|
131
139
|
| [`tech-comparison-matrix`](skills/tech-comparison-matrix/SKILL.md) | Produce a weighted comparison matrix for a tech-selection question (e.g. "Postgres vs DynamoDB") with criteria, weights, scores, and a recommendation. |
|
|
132
140
|
|
|
141
|
+
### Agent engineering
|
|
142
|
+
|
|
143
|
+
Designing the agentic systems themselves — the loops, orchestrations, and budgets that turn "prompting an agent" into infrastructure a team can run unattended. (`feature-implement-loop` under Dev workflow is the in-repo worked example of a supervised loop; `llm-eval-harness` below builds the verifier's quality gate.)
|
|
144
|
+
|
|
145
|
+
| Skill | What it does |
|
|
146
|
+
|---|---|
|
|
147
|
+
| [`agent-loop-design`](skills/agent-loop-design/SKILL.md) | Design a supervised agent loop as an implementable **loop spec**: a strict generate→verify→gate state machine (no mushy "reflect" states), an **observable done-condition** (never "output looks good"), verifier structurally ≠ generator (self-grading inflates), **both caps as numbers** (revision cap defaulting to 3, budget cap per run), human gates at every irreversible action with **decision-shaped digests** (never transcripts), findings flowing into the next round (else it's retry, not iteration), three specified failure routes (cap-hit / can't-judge / systemic early-stop), and a telemetry row so the loop's degradation shows up before its output does. |
|
|
148
|
+
| [`subagent-design`](skills/subagent-design/SKILL.md) | Decompose a task into orchestrator + subagents — starting from **"the default answer is one agent"**: fan-out must earn itself via context separation, independence, or role conflict, or the plan says so. One-mission **role cards** (typed output contracts, explicit context-isolation lines, least-privilege tools, structured failure behavior), topology chosen with the reason attached (pipeline default; barriers only for named cross-item dependencies; judge panels with a vote rule), depth capped at one level, an **adversarial verification stage that is never a generator**, and a budget line per fleet. |
|
|
149
|
+
| [`agent-budget`](skills/agent-budget/SKILL.md) | The spend spec for an agentic workflow: cheapest-adequate **tier per stage** (light/standard/heavy — heavy verification is never downgraded to save money), three numbers per stage (expected, hard cap, on-cap action — "warn and continue" banned), a run-level cap *below* the sum of stage caps, a **degradation ladder where verification is last and never cut**, and **cost-per-outcome** as the governing metric with a comparison line against the manual alternative — so "$900/week" becomes answerable. Estimates tagged `[assumption]` until calibrated on real runs. |
|
|
150
|
+
|
|
133
151
|
### AI adoption & observability
|
|
134
152
|
|
|
135
153
|
| Skill | What it does |
|
|
@@ -209,7 +227,7 @@ Categories (above) say what a skill *is*; packs say *who needs it*. [`packs.json
|
|
|
209
227
|
| `dev-team` | 11 | Build-and-ship loop: implementation with adversarial review, test plans, triage, migrations, release notes, quality gates |
|
|
210
228
|
| `stakeholder-comms` | 8 | Non-technical audiences: audience profiling, deck outlines and real `.pptx` decks, exec summaries, decision logs, guides |
|
|
211
229
|
| `sre-oncall` | 5 | Operate the service: runbooks, observability design, incident comms, postmortems, capacity/cost models |
|
|
212
|
-
| `ai-engineering` |
|
|
230
|
+
| `ai-engineering` | 6 | Build and run AI systems: agent loop design, subagent orchestration, spend budgets, eval harnesses, usage reporting, data contracts |
|
|
213
231
|
|
|
214
232
|
```bash
|
|
215
233
|
python3 pack.py # list packs
|
|
@@ -236,7 +254,18 @@ npx skilldrop-cli outdated && npx skilldrop-cli update # skills improve; cp -R
|
|
|
236
254
|
npx skilldrop-cli list | skilldrop info <skill> | skilldrop packs | skilldrop uninstall <skill>
|
|
237
255
|
```
|
|
238
256
|
|
|
239
|
-
`--with-related` also pulls each skill's companions. From a clone (or before the package is published): `node bin/skilldrop.js <same args>`. Scope and design: [RFC-0002](docs/rfcs/0002-skilldrop-cli.md), full command surface in [`skilldrop-cli-design
|
|
257
|
+
`--with-related` also pulls each skill's companions. From a clone (or before the package is published): `node bin/skilldrop.js <same args>`. Scope and design: [RFC-0002](docs/rfcs/0002-skilldrop-cli.md), full command surface in [`docs/designs/skilldrop-cli-design.md`](docs/designs/skilldrop-cli-design.md).
|
|
258
|
+
|
|
259
|
+
### Hooks (opt-in) — wire a skill to an event
|
|
260
|
+
|
|
261
|
+
Some loop-shaped skills declare **hooks** — event-triggered nudges the CLI wires into your environment when you pass `--with-hooks` ([RFC-0006](docs/rfcs/0006-per-ide-hooks.md)). It's off by default, so a plain install never touches your git repo or editor settings.
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
npx skilldrop-cli install devils-advocate --with-hooks --project
|
|
265
|
+
# → appends a marker-fenced reminder to .git/hooks/pre-commit: "run /devils-advocate on staged changes"
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The CLI emits per target and **degrades gracefully** — a `pre-commit-review` hook becomes an IDE-agnostic git hook (needs a git repo); a `session-start` hook becomes a Claude Code `settings.json` entry, and is cleanly skipped where the target has no equivalent (Cursor, Kiro, plain `--dest`), printing what it did and where. Hooks are reminders/context, not autonomous execution — skilldrop skills are agent instructions, so the hook prompts *you* to run the review, it doesn't silently run an AI pass. `skilldrop uninstall` removes any hook artifacts it wrote. Vocabulary and the per-target mapping are in the RFC.
|
|
240
269
|
|
|
241
270
|
### Third-party catalogs — publish your own skills through the same CLI
|
|
242
271
|
|
package/bin/skilldrop.js
CHANGED
|
@@ -15,6 +15,8 @@ const { execFileSync } = require("child_process");
|
|
|
15
15
|
const ROOT = path.resolve(__dirname, "..");
|
|
16
16
|
const LEDGER = ".skilldrop.json";
|
|
17
17
|
const BUNDLED = "bundled";
|
|
18
|
+
// Neutral hook vocabulary (RFC-0006). Kept in sync with validate.py's HOOK_EVENTS.
|
|
19
|
+
const HOOK_EVENTS = ["session-start", "pre-commit-review", "on-demand"];
|
|
18
20
|
|
|
19
21
|
const HELP = `skilldrop — portable AI-agent skills for Claude Code, Cursor, Kiro, and more
|
|
20
22
|
|
|
@@ -44,6 +46,10 @@ Install/update/uninstall targets (pick one):
|
|
|
44
46
|
|
|
45
47
|
Options:
|
|
46
48
|
--with-related also install each skill's related companions (one level)
|
|
49
|
+
--with-hooks also wire any hooks a skill declares (RFC-0006) — git pre-commit
|
|
50
|
+
reminders and Claude Code session-start context; degrades where the
|
|
51
|
+
target has no hook mechanism. Off by default so installs never touch
|
|
52
|
+
your git repo or settings unasked.
|
|
47
53
|
`;
|
|
48
54
|
|
|
49
55
|
function die(msg) { console.error("error: " + msg); process.exit(1); }
|
|
@@ -163,6 +169,106 @@ function writeWiring(ide, dest, s, desc) {
|
|
|
163
169
|
fs.writeFileSync(p, `When the user requests the following, defer to the instructions in .kiro/skills/${s}/SKILL.md:\n\n${desc}\n`);
|
|
164
170
|
}
|
|
165
171
|
|
|
172
|
+
/* ---------- hooks (RFC-0006: emit per target, degrade where unsupported) ---------- */
|
|
173
|
+
|
|
174
|
+
function gitRoot(startDir) {
|
|
175
|
+
let d = path.resolve(startDir);
|
|
176
|
+
for (;;) {
|
|
177
|
+
if (fs.existsSync(path.join(d, ".git"))) return d;
|
|
178
|
+
const up = path.dirname(d);
|
|
179
|
+
if (up === d) return null;
|
|
180
|
+
d = up;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Append an idempotent, marker-fenced reminder to .git/hooks/pre-commit. IDE-agnostic.
|
|
185
|
+
function writeGitPreCommitHook(root, skill, hook) {
|
|
186
|
+
const p = path.join(root, ".git", "hooks", "pre-commit");
|
|
187
|
+
const marker = `skilldrop-hook:${skill}:pre-commit-review`;
|
|
188
|
+
let body = fs.existsSync(p) ? fs.readFileSync(p, "utf8") : "";
|
|
189
|
+
if (!body.startsWith("#!")) body = "#!/bin/sh\n" + body;
|
|
190
|
+
if (body.includes(marker)) return p; // already wired
|
|
191
|
+
const line = `echo "skilldrop: run /${hook.action} on your staged changes before committing — ${hook.description}"`;
|
|
192
|
+
body += `\n# >>> ${marker} >>>\n${line}\n# <<< ${marker} <<<\n`;
|
|
193
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
194
|
+
fs.writeFileSync(p, body);
|
|
195
|
+
fs.chmodSync(p, 0o755);
|
|
196
|
+
return p;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Merge a SessionStart command into Claude Code settings.json. Returns the path,
|
|
200
|
+
// or null if the file exists but is malformed (we never clobber unparseable JSON).
|
|
201
|
+
function writeClaudeSessionHook(settingsPath, skill, hook) {
|
|
202
|
+
let data = {};
|
|
203
|
+
if (fs.existsSync(settingsPath)) {
|
|
204
|
+
try { data = JSON.parse(fs.readFileSync(settingsPath, "utf8")); }
|
|
205
|
+
catch (e) { return null; }
|
|
206
|
+
}
|
|
207
|
+
data.hooks = data.hooks || {};
|
|
208
|
+
data.hooks.SessionStart = data.hooks.SessionStart || [];
|
|
209
|
+
const marker = `skilldrop-hook:${skill}:session-start`;
|
|
210
|
+
if (!JSON.stringify(data.hooks.SessionStart).includes(marker)) {
|
|
211
|
+
const cmd = `echo "skilldrop: /${hook.action} is available — ${hook.description}" # ${marker}`;
|
|
212
|
+
data.hooks.SessionStart.push({ hooks: [{ type: "command", command: cmd }] });
|
|
213
|
+
fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
|
|
214
|
+
fs.writeFileSync(settingsPath, JSON.stringify(data, null, 2) + "\n");
|
|
215
|
+
}
|
|
216
|
+
return settingsPath;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Wire one skill's declared hooks; returns human-readable status lines.
|
|
220
|
+
function emitHooks(cat, skill, dest, ide) {
|
|
221
|
+
let hooks = [];
|
|
222
|
+
try { hooks = manifestOf(cat, skill).hooks || []; } catch (e) { return []; }
|
|
223
|
+
const lines = [];
|
|
224
|
+
for (const h of hooks) {
|
|
225
|
+
if (h.event === "pre-commit-review") {
|
|
226
|
+
const root = gitRoot(process.cwd());
|
|
227
|
+
if (root) lines.push(` ${skill}: pre-commit reminder -> ${path.join(root, ".git/hooks/pre-commit")}`);
|
|
228
|
+
else lines.push(` ${skill}: pre-commit-review skipped — no git repo at ${process.cwd()}`);
|
|
229
|
+
if (root) writeGitPreCommitHook(root, skill, h);
|
|
230
|
+
} else if (h.event === "session-start") {
|
|
231
|
+
if (ide === "claude") {
|
|
232
|
+
const sp = path.join(path.dirname(dest), "settings.json");
|
|
233
|
+
const written = writeClaudeSessionHook(sp, skill, h);
|
|
234
|
+
lines.push(written ? ` ${skill}: session-start context -> ${sp}`
|
|
235
|
+
: ` ${skill}: session-start skipped — ${sp} is not valid JSON`);
|
|
236
|
+
} else {
|
|
237
|
+
lines.push(` ${skill}: session-start skipped — no hook mechanism for ${ide}`);
|
|
238
|
+
}
|
|
239
|
+
} else if (h.event === "on-demand") {
|
|
240
|
+
lines.push(` ${skill}: on-demand — invoke /${h.action} manually (no artifact needed)`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return lines;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function removeHooksFor(skill, dest, ide) {
|
|
247
|
+
const root = gitRoot(process.cwd());
|
|
248
|
+
if (root) {
|
|
249
|
+
const p = path.join(root, ".git", "hooks", "pre-commit");
|
|
250
|
+
if (fs.existsSync(p)) {
|
|
251
|
+
const body = fs.readFileSync(p, "utf8");
|
|
252
|
+
const re = new RegExp(`\\n?# >>> skilldrop-hook:${skill}:[^\\n]* >>>[\\s\\S]*?# <<< skilldrop-hook:${skill}:[^\\n]* <<<\\n?`, "g");
|
|
253
|
+
const next = body.replace(re, "\n");
|
|
254
|
+
if (next !== body) fs.writeFileSync(p, next);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (ide === "claude") {
|
|
258
|
+
const sp = path.join(path.dirname(dest), "settings.json");
|
|
259
|
+
if (fs.existsSync(sp)) {
|
|
260
|
+
try {
|
|
261
|
+
const data = JSON.parse(fs.readFileSync(sp, "utf8"));
|
|
262
|
+
const arr = data.hooks && data.hooks.SessionStart;
|
|
263
|
+
if (Array.isArray(arr)) {
|
|
264
|
+
const kept = arr.filter((e) => !JSON.stringify(e).includes(`skilldrop-hook:${skill}:`));
|
|
265
|
+
if (kept.length !== arr.length) { data.hooks.SessionStart = kept; fs.writeFileSync(sp, JSON.stringify(data, null, 2) + "\n"); }
|
|
266
|
+
}
|
|
267
|
+
} catch (e) { /* leave malformed settings untouched */ }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
166
272
|
/* ---------- commands ---------- */
|
|
167
273
|
|
|
168
274
|
function expandNames(args, cat) {
|
|
@@ -211,6 +317,18 @@ function install(args) {
|
|
|
211
317
|
}
|
|
212
318
|
saveLedger(l);
|
|
213
319
|
console.log(`\n${names.length} skill(s) installed (${ide}).`);
|
|
320
|
+
|
|
321
|
+
const withHooks = names.filter((s) => { try { return (manifestOf(cat, s).hooks || []).length; } catch (e) { return false; } });
|
|
322
|
+
if (withHooks.length && args.flags["with-hooks"]) {
|
|
323
|
+
const lines = withHooks.flatMap((s) => emitHooks(cat, s, dest, ide));
|
|
324
|
+
console.log(`\nHooks wired (RFC-0006):\n${lines.join("\n")}`);
|
|
325
|
+
if (cat.source !== BUNDLED)
|
|
326
|
+
console.log(` NOTE: these hooks run commands from third-party catalog '${cat.source}' — read them before trusting them.`);
|
|
327
|
+
console.log(` Undo any of these with: skilldrop uninstall <skill> ${ide === "claude" ? "" : "--ide " + ide}`.trimEnd());
|
|
328
|
+
} else if (withHooks.length) {
|
|
329
|
+
console.log(`\n${withHooks.join(", ")} declare hooks — re-run with --with-hooks to wire them (git pre-commit reminders / session-start context).`);
|
|
330
|
+
}
|
|
331
|
+
|
|
214
332
|
if (cat.source !== BUNDLED)
|
|
215
333
|
console.log(`\nWARNING: third-party catalog '${cat.source}'. Skills are instructions your AI agent will follow — review each installed SKILL.md under ${dest} before first use. Install copied files only; nothing was executed.`);
|
|
216
334
|
if (ide === "generic")
|
|
@@ -269,6 +387,7 @@ function uninstall(args) {
|
|
|
269
387
|
fs.rmSync(path.join(dest, s), { recursive: true, force: true });
|
|
270
388
|
const w = wiringPath(ide, dest, s);
|
|
271
389
|
if (w) fs.rmSync(w, { force: true });
|
|
390
|
+
removeHooksFor(s, dest, ide);
|
|
272
391
|
delete l.data[s];
|
|
273
392
|
console.log(`removed ${s} from ${dest}`);
|
|
274
393
|
}
|
package/model-routing.json
CHANGED
|
@@ -142,6 +142,9 @@
|
|
|
142
142
|
"prfaq": { "tier": "standard", "rationale": "Synthesizes a press release and FAQs from a product concept against a fixed format. The specificity discipline needs care but the template bounds it; escalate via ambiguous-input when the concept itself is contested." },
|
|
143
143
|
"okr-cascade": { "tier": "standard", "rationale": "Structured derivation against a fixed roll-up discipline; the causal-sentence and gap judgments need care but the template bounds them. Escalate via ambiguous-input when the company objectives themselves are contested." },
|
|
144
144
|
"user-journey-map": { "tier": "standard", "rationale": "Structured synthesis into a fixed four-row stage model plus bounded ranking judgment. Escalate via ambiguous-input when the persona or outcome is contested or research inputs conflict." },
|
|
145
|
-
"strategy-analysis": { "tier": "heavy", "rationale": "Framework selection plus evidenced multi-factor judgment ending in a ranked, committal verdict. Cheaper models fill cells with generic filler, skip the TOWS crossings, and refuse to take a side. Never downgrade." }
|
|
145
|
+
"strategy-analysis": { "tier": "heavy", "rationale": "Framework selection plus evidenced multi-factor judgment ending in a ranked, committal verdict. Cheaper models fill cells with generic filler, skip the TOWS crossings, and refuse to take a side. Never downgrade." },
|
|
146
|
+
"agent-loop-design": { "tier": "standard", "rationale": "Design synthesis against a fixed state-machine pattern and exit-criteria catalog. The gate-placement judgment is bounded by the blast-radius rule; escalate via ambiguous-input when the task itself is contested." },
|
|
147
|
+
"subagent-design": { "tier": "standard", "rationale": "Design synthesis against a fixed topology catalog and role-card template. The fan-out-or-refuse judgment is bounded by the three-reasons rule; escalate via ambiguous-input on genuinely novel workflow shapes." },
|
|
148
|
+
"agent-budget": { "tier": "standard", "rationale": "Quantitative spec synthesis against a fixed tier vocabulary and degradation ladder. Cap-setting judgment is bounded by the 3-5x rule; escalate via ambiguous-input when the workflow itself is undefined." }
|
|
146
149
|
}
|
|
147
150
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skilldrop-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Portable AI-agent skills for the deliverables knowledge workers ship — diagrams, ADRs, PRDs, runbooks, decks, reviews — installable into Claude Code, Cursor, Kiro, and any IDE that takes custom instructions. One command per skill or per role-based pack.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"skilldrop": "bin/skilldrop.js"
|
|
@@ -32,5 +32,6 @@
|
|
|
32
32
|
"type": "git",
|
|
33
33
|
"url": "git+https://github.com/sananthanarayan/skilldrop.git"
|
|
34
34
|
},
|
|
35
|
-
"license": "MIT"
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"homepage": "https://github.com/sananthanarayan/skilldrop#readme"
|
|
36
37
|
}
|
package/packs.json
CHANGED
|
@@ -79,8 +79,11 @@
|
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
81
|
"ai-engineering": {
|
|
82
|
-
"description": "
|
|
82
|
+
"description": "Build and run AI systems: agent loop design, subagent orchestration, spend budgets, eval harnesses, AI-usage reporting, and the data contracts AI pipelines depend on.",
|
|
83
83
|
"skills": [
|
|
84
|
+
"agent-loop-design",
|
|
85
|
+
"subagent-design",
|
|
86
|
+
"agent-budget",
|
|
84
87
|
"llm-eval-harness",
|
|
85
88
|
"ai-usage-report",
|
|
86
89
|
"data-contract"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-budget
|
|
3
|
+
description: Write the spend spec for an agentic workflow — per-stage model tiers, token caps with hard abort rules, a graceful-degradation order, and cost-per-outcome as the governing metric. Use when the user asks what an agent loop or multi-agent workflow should be allowed to spend, wants token/cost budgets and caps for AI automation, or got a surprise bill from an agent fleet.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# agent-budget
|
|
7
|
+
|
|
8
|
+
An unbudgeted agent loop is a runaway-cost incident with an architecture diagram. This skill produces the **budget spec** that governs an agentic workflow: what each stage may spend, on which tier of model, what happens at the cap, and — the number that actually matters — what one *outcome* costs. Pairs with `agent-loop-design` (the caps land in its loop spec) and `subagent-design` (the fleet line lands in its role cards); the tier vocabulary is this repo's own light/standard/heavy routing abstraction, so the spec ports across providers. Infra spend (compute, storage, egress) is `capacity-cost-model`'s domain — this skill budgets the tokens.
|
|
9
|
+
|
|
10
|
+
## How to respond
|
|
11
|
+
|
|
12
|
+
1. **Pin the outcome unit and the workflow's stages.** Ask at most 2 questions, spent on: *"what is one successful outcome?"* (a merged PR, a triaged ticket, a verified report — the denominator every cost divides by) and *"what does a typical run look like today?"* (stages, rounds, models — or "not built yet", which makes this a design-time budget, the cheap time to write one). Non-interactive run (no user to ask): derive both from the input and tag `[assumption]`; no outcome unit derivable → emit `BLOCKED: need the workflow and its outcome unit`.
|
|
13
|
+
|
|
14
|
+
2. **Assign each stage the cheapest adequate tier** — light / standard / heavy, per the routing rule of thumb: **light** for mechanical extraction and formatting, **standard** for most generation, **heavy** only where the hard thinking *is* the value (adversarial verification, weighted judgment) — and heavy stages are never downgraded to save money; they're where the money buys correctness. Every tier assignment carries a one-line rationale. The classic misallocation runs both directions: frontier models formatting JSON, and — worse — the cheap model doing the verify pass that exists to catch the cheap mistakes.
|
|
15
|
+
|
|
16
|
+
3. **Set three numbers per stage** in [`templates/budget-spec.md`](templates/budget-spec.md): **expected** spend per run (estimate honestly, tag `[assumption]` until measured), **cap** (the hard stop — 3–5× expected, tighter for unattended loops), and **on-cap action** (abort-and-escalate, or degrade — never "continue and warn"; a warning nobody is watching is a continue). State each as tokens **and** approximate money — tokens are what the harness enforces, but money is the only unit that sums across tiers, so **all cap comparisons happen in currency**. A stage that fans out per item carries two caps: a per-item cap (that item fails to the report's needs-human list; the rest continue) and a stage-wide cap. Then the **run-level cap** for the whole workflow — in currency, *less* than the sum of stage caps: every stage simultaneously hitting its cap is not a run to finish, it's an anomaly to stop.
|
|
17
|
+
|
|
18
|
+
4. **Write the degradation ladder** — what gives, in order, when spend pressure hits: first **narrow scope** (fewer items per run), then **reduce parallelism** (smaller fleet, slower wall-clock), then **cut non-verification stages** (skip the polish pass), and **last — never — verification**. Skipping verify to save tokens converts a cost problem into a correctness problem at the exact moment quality is already under pressure; a workflow that can't afford its verifier can't afford to run. State each rung's trigger and who flips it.
|
|
19
|
+
|
|
20
|
+
5. **Make cost-per-outcome the governing metric.** Total tokens is noise; **spend ÷ successful outcomes** is the number with meaning — a loop that gets cheaper per run but passes fewer runs got more expensive. Give it a target and a review threshold, and put beside it the **comparison line**: what the same outcome costs today (an hour of an engineer's time, the manual process) — a $4 triaged ticket is expensive against 60 seconds of a human's glance and cheap against twenty minutes of one; without the line, nobody can say which.
|
|
21
|
+
|
|
22
|
+
6. **Add measurement and emit.** Spend logged per run per stage (tagged by stage name, feeding the loop spec's telemetry row); weekly review of cost-per-outcome and cap-hit counts by a named role; alert on cap-hit rate rising (the leading indicator of drift — inputs grew, a prompt regressed, or a model changed under you) and on any run breaching the run-level cap (that's an incident, not a line item). Emit the spec in one message: stage table, run cap, degradation ladder, cost-per-outcome with comparison line, measurement plan. Flag every `[assumption]` estimate as the calibration backlog — after ~20 real runs, expected values stop being guesses. Hand off: the caps → `agent-loop-design`'s loop spec; per-agent tiers → `subagent-design`'s role cards; the verifier's quality gate → `llm-eval-harness`.
|
|
23
|
+
|
|
24
|
+
## Useful references in this skill
|
|
25
|
+
|
|
26
|
+
- [`templates/budget-spec.md`](templates/budget-spec.md) — stage table, degradation ladder, cost-per-outcome, and measurement skeleton
|
|
27
|
+
|
|
28
|
+
## Quality bar
|
|
29
|
+
|
|
30
|
+
- **The outcome unit is named** and every cost in the doc divides by it.
|
|
31
|
+
- **Every stage has tier + rationale + three numbers** (expected, cap, on-cap action). No stage rides free.
|
|
32
|
+
- **Heavy tiers survive.** No verification or judgment stage was downgraded to make the total look better.
|
|
33
|
+
- **Caps are hard.** Every on-cap action is abort or degrade — "warn and continue" appears nowhere.
|
|
34
|
+
- **The run cap is less than the sum of stage caps**, and the doc says why.
|
|
35
|
+
- **Verification is last on the degradation ladder**, explicitly.
|
|
36
|
+
- **The comparison line exists** — cost-per-outcome sits next to what the outcome costs without the agents.
|
|
37
|
+
- **Estimates are tagged.** `[assumption]` until measured; the calibration step is scheduled, not implied.
|
|
38
|
+
|
|
39
|
+
## When to use this skill
|
|
40
|
+
|
|
41
|
+
- ✅ "What should this agent workflow be allowed to spend?" — at design time, the cheap time
|
|
42
|
+
- ✅ A surprise token bill arrived — retrofit caps and a degradation ladder
|
|
43
|
+
- ✅ An `agent-loop-design` or `subagent-design` spec needs its budget line filled in
|
|
44
|
+
- ✅ "Is this automation actually cheaper than doing it by hand?" — build the comparison line
|
|
45
|
+
|
|
46
|
+
## When NOT to use this skill
|
|
47
|
+
|
|
48
|
+
- ❌ Infra/cloud cost modeling (compute, storage, egress) — `capacity-cost-model`
|
|
49
|
+
- ❌ Choosing a model tier for a single skilldrop skill — that's `model-routing.json`'s table, already decided
|
|
50
|
+
- ❌ Designing the loop or the fan-out itself — `agent-loop-design` / `subagent-design`; this skill prices what they draw
|
|
51
|
+
- ❌ Negotiating provider contracts or rate limits — procurement, not a spec
|
|
52
|
+
|
|
53
|
+
## Anti-patterns to avoid
|
|
54
|
+
|
|
55
|
+
- ❌ **Budget-free loops.** "We'll see what it costs" means the invoice is the monitoring system.
|
|
56
|
+
- ❌ **Warn-and-continue caps.** A cap whose breach action is a log line is a number, not a cap.
|
|
57
|
+
- ❌ **Skimping the verifier.** Downgrading or skipping verification under spend pressure — the false economy that ships fleet-speed garbage precisely when scrutiny dropped.
|
|
58
|
+
- ❌ **Token vanity metrics.** Celebrating "20% fewer tokens" while cost-per-successful-outcome rose because pass rates fell.
|
|
59
|
+
- ❌ **Frontier-everything.** The orchestrator's model formatting JSON at heavy-tier prices because nobody assigned tiers per stage.
|
|
60
|
+
- ❌ **Missing comparison line.** A cost-per-outcome with nothing beside it can justify anything or condemn anything.
|
|
61
|
+
- ❌ **Estimates that never graduate.** `[assumption]` numbers still governing caps six months and a thousand runs later.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "query": "What should our agent workflow be allowed to spend in tokens?", "should_trigger": true },
|
|
3
|
+
{ "query": "We got a surprise LLM bill from our automation — put budgets and caps on it", "should_trigger": true },
|
|
4
|
+
{ "query": "Is this agent pipeline actually cheaper than doing the work manually?", "should_trigger": true },
|
|
5
|
+
{ "query": "Add a budget line to this loop spec", "should_trigger": true },
|
|
6
|
+
|
|
7
|
+
{ "query": "Model our service's cloud infrastructure costs at 10x scale", "should_trigger": false },
|
|
8
|
+
{ "query": "Which model tier should the adr-generator skill run on?", "should_trigger": false },
|
|
9
|
+
{ "query": "Design the loop with exit criteria for this automation", "should_trigger": false },
|
|
10
|
+
{ "query": "Design the eval golden set for our LLM judge", "should_trigger": false }
|
|
11
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "agent-budget",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Budget our nightly agent workflow: it reviews the day's merged PRs for security issues. Stages: collect diffs, one reviewer agent per PR (typically 15 PRs), an adversarial verifier on each finding, and a summary report. One outcome = a verified finding report delivered by 8am. We got a $900 bill last week and nobody can say if that's bad.",
|
|
7
|
+
"assertions": [
|
|
8
|
+
"The outcome unit is the verified report (or per-PR-reviewed), and every cost divides by it",
|
|
9
|
+
"Every stage has a tier with a one-line rationale — collection is light, review standard/heavy, verification heavy and explicitly never downgraded",
|
|
10
|
+
"Every stage has expected spend, a hard cap (roughly 3-5x expected), and an on-cap action that is abort or degrade — no warn-and-continue",
|
|
11
|
+
"A run-level cap exists and is less than the sum of stage caps, with the reason stated",
|
|
12
|
+
"The degradation ladder is ordered scope -> parallelism -> non-verification stages, with verification explicitly last/never",
|
|
13
|
+
"Cost-per-outcome gets a target and a comparison line against the manual alternative (e.g. engineer review time), addressing whether $900/week is bad",
|
|
14
|
+
"Estimates are tagged [assumption] with a calibration step after ~20 runs",
|
|
15
|
+
"Measurement includes per-stage spend logging, a review cadence, and an alert on rising cap-hit rate",
|
|
16
|
+
"Hand-offs route caps to agent-loop-design and per-agent tiers to subagent-design"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": 2,
|
|
21
|
+
"prompt": "[Non-interactive run — no user available to answer questions] Set a token budget.",
|
|
22
|
+
"assertions": [
|
|
23
|
+
"No budget is fabricated — the output is BLOCKED: need the workflow and its outcome unit",
|
|
24
|
+
"No stage table or caps appear"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-budget",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Write the spend spec for an agentic workflow — per-stage model tiers, token caps with hard abort rules, a graceful-degradation order, and cost-per-outcome as the governing metric. Use when the user asks what an agent loop or multi-agent workflow should be allowed to spend, wants token/cost budgets and caps for AI automation, or got a surprise bill from an agent fleet.",
|
|
5
|
+
"entrypoint": "SKILL.md",
|
|
6
|
+
"deps": { "npm": [], "pip": [] },
|
|
7
|
+
"env": { "required": [], "optional": [] },
|
|
8
|
+
"related": ["agent-loop-design", "capacity-cost-model", "llm-eval-harness", "subagent-design"],
|
|
9
|
+
"tags": ["agent-budget", "token-budget", "cost-control", "agentic", "caps", "cost-per-outcome"],
|
|
10
|
+
"model": { "tier": "standard", "rationale": "Quantitative spec synthesis against a fixed tier vocabulary and degradation ladder. Cap-setting judgment is bounded by the 3-5x rule; escalate via ambiguous-input when the workflow itself is undefined." }
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Agent budget: {workflow name}
|
|
2
|
+
|
|
3
|
+
> Outcome unit: {one successful …} · Status: {design-time [assumption] | calibrated on {N} runs} · Owner: {role}
|
|
4
|
+
|
|
5
|
+
## Stage budgets
|
|
6
|
+
|
|
7
|
+
| Stage | Tier | Why this tier | Expected / run | Cap (hard) | On cap |
|
|
8
|
+
|---|---|---|---|---|---|
|
|
9
|
+
| {stage} | light / standard / heavy | {one line} | {tokens ≈ ${…} `[assumption]`?} | {3–5× expected, tokens ≈ $; per-item + stage-wide for fan-out stages} | abort→escalate / degrade rung {n} / per-item: fail item to needs-human, continue rest |
|
|
10
|
+
|
|
11
|
+
**Run-level cap:** ${number, < sum of stage caps in currency — the only unit that sums across tiers} — all stages capping at once is an anomaly to stop, not a run to finish.
|
|
12
|
+
|
|
13
|
+
## Degradation ladder (in order; trigger and owner per rung)
|
|
14
|
+
|
|
15
|
+
1. Narrow scope — {fewer items per run} · trigger: {…} · flipped by: {role}
|
|
16
|
+
2. Reduce parallelism — {smaller fleet} · trigger: {…}
|
|
17
|
+
3. Cut non-verification stages — {which} · trigger: {…}
|
|
18
|
+
4. **Verification is never cut.** A workflow that can't afford its verifier can't afford to run.
|
|
19
|
+
|
|
20
|
+
## Cost per outcome
|
|
21
|
+
|
|
22
|
+
- **Target:** {spend ÷ successful outcomes} · review threshold: {value that triggers investigation}
|
|
23
|
+
- **Comparison line:** the same outcome today costs {manual process, time × rate} — the number that says whether this is cheap.
|
|
24
|
+
|
|
25
|
+
## Measurement
|
|
26
|
+
|
|
27
|
+
- Spend logged per run, per stage (stage-tagged; feeds the loop spec's telemetry row)
|
|
28
|
+
- {cadence} review of cost-per-outcome + cap-hit counts by {role}
|
|
29
|
+
- Alerts: cap-hit rate rising ({threshold}) → drift investigation · run-level cap breached → incident, not a line item
|
|
30
|
+
- Calibration: replace `[assumption]` expecteds after {~20} real runs · date: {…}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-loop-design
|
|
3
|
+
description: Design a supervised agent loop — the generate→verify→gate cycle, observable exit criteria, hard iteration cap, human gates at irreversible steps, and failure routes — as a loop spec a team can implement in any agent harness. Use when the user wants to automate a recurring task with an AI agent loop, design a work loop / review loop / research loop, or asks "how do I stop my agent from running forever or shipping junk".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# agent-loop-design
|
|
7
|
+
|
|
8
|
+
You shouldn't be prompting agents; you should be designing the loops that prompt them — and a loop is only as good as its exits. This skill produces a **loop spec**: the states, gates, caps, and failure routes that turn "run the agent again until it looks right" into a system a team can trust unattended. `feature-implement-loop` is this repo's worked example of the pattern (generate → adversarial review → gate, capped at 3 rounds); this skill designs *new* loops for the user's own tasks. Fan-out inside a stage is `subagent-design`'s job; what the loop may spend is `agent-budget`'s.
|
|
9
|
+
|
|
10
|
+
## How to respond
|
|
11
|
+
|
|
12
|
+
1. **Pin the loop's job and its "done".** Ask at most 2 questions, spent on: *"what artifact does one successful run produce?"* and *"how would a human verify it's right without watching the run?"* The done-condition must be **observable** — tests pass, checklist satisfied, reviewer-agent returns zero blockers — never "output looks good". No observable done-condition derivable → the task isn't loop-ready; say what needs defining first. Non-interactive run (no user to ask): derive both from the input and tag `[assumption]`; no artifact derivable → emit `BLOCKED: need the task and its done-condition`.
|
|
13
|
+
|
|
14
|
+
2. **Draw the state machine — generate, verify, gate, and nothing mushier.**
|
|
15
|
+
- **Generate**: produces or revises the artifact. Must consume the verifier's findings from the previous round as explicit input — a generate step that can't see why it failed is retry, not iteration.
|
|
16
|
+
- **Verify**: judges the artifact against the done-condition. **The verifier is never the generator** — same model grading its own homework inflates; use a different persona, prompt, or agent (`devils-advocate`-style adversarial framing where quality is the risk, or programmatic checks where they exist — cheapest adequate check wins, per `llm-eval-harness`'s grading ladder).
|
|
17
|
+
- **Gate**: routes on the verdict — pass → exit/handoff; fail → generate with findings; fail at cap → escalate. Every loop has exactly these three state types; "polish", "reflect", and "improve" states with no verdict are where loops go to wander.
|
|
18
|
+
|
|
19
|
+
3. **Set the caps — both of them, as numbers.**
|
|
20
|
+
- **Revision cap**: max verify-fail rounds before escalation. Default 3 (`feature-implement-loop`'s cap); justify anything higher with what new information later rounds could possibly have.
|
|
21
|
+
- **Budget cap**: max spend per run, referencing an `agent-budget` line (or a stated token/cost number when no budget spec exists yet, tagged `[assumption]`). A loop without numeric caps is a runaway incident scheduled for later.
|
|
22
|
+
|
|
23
|
+
4. **Place the human gates.** Every **irreversible or outward-facing action** — merge, deploy, send, publish, delete — sits behind a human gate: the loop stops and presents; it never proceeds on its own verdict. Reversible internal work (drafts, branches, scratch files) runs unattended; that's the point of the loop. Name each gate's presenter format: what the human sees must be a **decision-shaped digest** (the artifact + the verifier's verdict + what changed since the last gate), not a transcript.
|
|
24
|
+
|
|
25
|
+
5. **Design the failure routes.** Three exits, each specified:
|
|
26
|
+
- **Cap hit** → escalate to a named role with a digest: rounds used, last findings, the diff of attempts. Raw logs are not an escalation.
|
|
27
|
+
- **Verifier can't judge** (input outside the done-condition's domain) → route out with `BLOCKED: <what's missing>`, don't loop on it.
|
|
28
|
+
- **Systemic failure** (same finding class every round) → stop early — identical findings twice means the generate step can't fix it; more rounds spend budget to relearn that.
|
|
29
|
+
|
|
30
|
+
6. **Add the telemetry row and emit** with [`templates/loop-spec.md`](templates/loop-spec.md): per-run log of rounds-used, spend, verdict, and escalations — the numbers that tell you the loop is degrading before its output does (rounds-to-pass creeping up is the leading indicator). Emit the spec in one message: state machine (Mermaid `stateDiagram-v2`), caps, gates, failure routes, telemetry. Hand off: stage fan-out → `subagent-design`; the spend model → `agent-budget`; the verifier's golden set → `llm-eval-harness`.
|
|
31
|
+
|
|
32
|
+
## Useful references in this skill
|
|
33
|
+
|
|
34
|
+
- [`templates/loop-spec.md`](templates/loop-spec.md) — state machine, caps, gates, failure-route, and telemetry skeleton
|
|
35
|
+
|
|
36
|
+
## Quality bar
|
|
37
|
+
|
|
38
|
+
- **The done-condition is observable** — a person who didn't watch the run can check it in minutes.
|
|
39
|
+
- **Verifier ≠ generator**, structurally: different persona, prompt, or program — stated in the spec, not implied.
|
|
40
|
+
- **Both caps are numbers.** "Reasonable number of iterations" is not a cap; 3 is.
|
|
41
|
+
- **Every irreversible action has a human gate**, and every gate has a decision-shaped digest format.
|
|
42
|
+
- **Generate consumes findings.** The spec shows the findings flowing into the next round's input.
|
|
43
|
+
- **All three failure routes are specified** — cap-hit, can't-judge, systemic — each with a destination.
|
|
44
|
+
- **The Mermaid renders** and contains only generate/verify/gate states plus the human-gate and escalate exits — no "polish"/"reflect" states without a verdict.
|
|
45
|
+
|
|
46
|
+
## When to use this skill
|
|
47
|
+
|
|
48
|
+
- ✅ "I want an agent to keep our runbooks up to date / triage inbound bugs / draft weekly reports — design the loop"
|
|
49
|
+
- ✅ "My agent keeps running forever / declaring victory on garbage" — retrofit exits onto an existing loop
|
|
50
|
+
- ✅ Turning a one-shot prompt that "usually works" into something a team can run unattended
|
|
51
|
+
- ✅ Reviewing a proposed automation for missing gates before it touches production
|
|
52
|
+
|
|
53
|
+
## When NOT to use this skill
|
|
54
|
+
|
|
55
|
+
- ❌ Implementing one feature right now — run `feature-implement-loop`; it *is* the loop
|
|
56
|
+
- ❌ Splitting one task across parallel agents — `subagent-design`
|
|
57
|
+
- ❌ Deciding what the loop may spend — `agent-budget`
|
|
58
|
+
- ❌ One-off tasks — a loop for something that runs once is ceremony
|
|
59
|
+
|
|
60
|
+
## Anti-patterns to avoid
|
|
61
|
+
|
|
62
|
+
- ❌ **Self-grading.** The generator's model praising the generator's output is how confident garbage ships. The verifier is a different pass with an adversarial job description.
|
|
63
|
+
- ❌ **Cap-free loops.** "It'll converge" is a hypothesis; the cap is what makes it a safe one to be wrong about.
|
|
64
|
+
- ❌ **Vibes exits.** "Loop until the output is good" defers the definition of good to the loop's most tired moment.
|
|
65
|
+
- ❌ **Retry cosplay.** If round N's generate can't see round N-1's findings, you built retry with extra steps — findings flow forward or the loop learns nothing.
|
|
66
|
+
- ❌ **Transcript escalations.** Escalating a 40-page log teaches humans to ignore escalations. Digest: rounds, findings, attempts, the ask.
|
|
67
|
+
- ❌ **Gating the reversible, freeing the irreversible.** Human approval for a draft file but auto-send on the customer email is the exact wrong way around — gate placement follows blast radius, not effort.
|
|
68
|
+
- ❌ **Loops without telemetry.** A loop that doesn't log rounds-and-spend per run degrades silently until the quarter's token bill or a shipped defect announces it.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "query": "Design an agent loop to keep our runbooks up to date", "should_trigger": true },
|
|
3
|
+
{ "query": "My agent keeps iterating forever — how do I add proper exit criteria?", "should_trigger": true },
|
|
4
|
+
{ "query": "Turn this prompt we run by hand every week into a supervised automation loop", "should_trigger": true },
|
|
5
|
+
{ "query": "Review this proposed agent automation for missing human gates", "should_trigger": true },
|
|
6
|
+
|
|
7
|
+
{ "query": "Implement this user story with tests", "should_trigger": false },
|
|
8
|
+
{ "query": "Split this task across parallel subagents", "should_trigger": false },
|
|
9
|
+
{ "query": "How many tokens should this workflow be allowed to spend?", "should_trigger": false },
|
|
10
|
+
{ "query": "Design the eval set for our LLM feature", "should_trigger": false }
|
|
11
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "agent-loop-design",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Design an agent loop that keeps our API reference docs in sync with the codebase: when endpoints change, the agent should update the docs, and we want to review before anything is published to the public docs site.",
|
|
7
|
+
"assertions": [
|
|
8
|
+
"One run's artifact and an observable done-condition are named (not 'docs look correct')",
|
|
9
|
+
"The state machine has exactly generate/verify/gate(/escalate) states, rendered as valid Mermaid stateDiagram-v2",
|
|
10
|
+
"The verifier is structurally different from the generator, with the independence stated",
|
|
11
|
+
"Both caps are numbers: a revision cap and a per-run budget line",
|
|
12
|
+
"Publishing to the public docs site sits behind a human gate with a decision-shaped digest format described",
|
|
13
|
+
"Findings from a failed verify flow into the next generate round explicitly",
|
|
14
|
+
"All three failure routes are specified: cap-hit escalation with digest, can't-judge BLOCKED route, systemic early-stop",
|
|
15
|
+
"A telemetry row logs rounds/spend/verdict per run with a review cadence",
|
|
16
|
+
"Hand-offs point to subagent-design for fan-out and agent-budget for the spend model"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": 2,
|
|
21
|
+
"prompt": "[Non-interactive run — no user available to answer questions] Design an agent loop.",
|
|
22
|
+
"assertions": [
|
|
23
|
+
"No loop is designed — the output is BLOCKED: need the task and its done-condition",
|
|
24
|
+
"No state machine or caps are fabricated"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-loop-design",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Design a supervised agent loop — the generate→verify→gate cycle, observable exit criteria, hard iteration cap, human gates at irreversible steps, and failure routes — as a loop spec a team can implement in any agent harness. Use when the user wants to automate a recurring task with an AI agent loop, design a work loop / review loop / research loop, or asks \"how do I stop my agent from running forever or shipping junk\".",
|
|
5
|
+
"entrypoint": "SKILL.md",
|
|
6
|
+
"deps": { "npm": [], "pip": [] },
|
|
7
|
+
"env": { "required": [], "optional": [] },
|
|
8
|
+
"related": ["agent-budget", "devils-advocate", "feature-implement-loop", "llm-eval-harness", "subagent-design"],
|
|
9
|
+
"tags": ["agent-loop", "loop-engineering", "automation", "supervised-loop", "agentic", "guardrails"],
|
|
10
|
+
"model": { "tier": "standard", "rationale": "Design synthesis against a fixed state-machine pattern and exit-criteria catalog. The gate-placement judgment is bounded by the blast-radius rule; escalate via ambiguous-input when the task itself is contested." }
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Loop spec: {loop name — the task, not the tech}
|
|
2
|
+
|
|
3
|
+
> One run produces: {artifact} · Done when: {observable condition} · Owner: {role}
|
|
4
|
+
|
|
5
|
+
## State machine
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
stateDiagram-v2
|
|
9
|
+
[*] --> Generate: {trigger}
|
|
10
|
+
Generate --> Verify: artifact + round log
|
|
11
|
+
Verify --> Gate: verdict + findings
|
|
12
|
+
Gate --> Generate: fail (findings feed next round)
|
|
13
|
+
Gate --> HumanGate: pass
|
|
14
|
+
Gate --> Escalate: fail at cap {N}
|
|
15
|
+
HumanGate --> [*]: approved → {irreversible action}
|
|
16
|
+
Escalate --> [*]: digest → {role}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Caps
|
|
20
|
+
|
|
21
|
+
| Cap | Value | Rationale |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Revision cap | {N, default 3} | {what could later rounds know that round 3 didn't?} |
|
|
24
|
+
| Budget per run | {tokens or currency; cite the `agent-budget` line, or a stated number tagged [assumption] until that spec exists} | {…} |
|
|
25
|
+
|
|
26
|
+
## Verification (never the generator)
|
|
27
|
+
|
|
28
|
+
- Verifier: {persona/prompt/program, and why it's independent of the generator}
|
|
29
|
+
- Judges against: {the done-condition, itemized}
|
|
30
|
+
- Cheapest adequate check: {programmatic where possible → structured assertions → LLM judge last}
|
|
31
|
+
|
|
32
|
+
## Human gates
|
|
33
|
+
|
|
34
|
+
| Gate | Guards (irreversible action) | Digest the human sees |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| {name} | {merge / send / deploy / delete} | {artifact + verdict + delta since last gate} |
|
|
37
|
+
|
|
38
|
+
## Failure routes
|
|
39
|
+
|
|
40
|
+
- **Cap hit** → {role} with digest: rounds used, last findings, attempt diffs
|
|
41
|
+
- **Verifier can't judge** → `BLOCKED: {what's missing}` to {destination}
|
|
42
|
+
- **Systemic** (same finding class twice) → stop early, route to {role}
|
|
43
|
+
|
|
44
|
+
## Telemetry (per run)
|
|
45
|
+
|
|
46
|
+
rounds-used · spend · verdict · escalated? — reviewed {cadence} by {role}; alert when rounds-to-pass trends up {threshold}.
|
|
@@ -95,7 +95,7 @@ The skill has **no magic classifier**. It exposes a set of signals the user inte
|
|
|
95
95
|
|
|
96
96
|
## When NOT to use this skill
|
|
97
97
|
|
|
98
|
-
- ❌ You don't have usage telemetry yet — the skill consumes data, doesn't collect it.
|
|
98
|
+
- ❌ You don't have usage telemetry yet — the skill consumes data, doesn't collect it. The collection-side spec (event schema, MCP server) lives in the skilldrop repo at `docs/designs/ai-usage-telemetry-design.md`.
|
|
99
99
|
- ❌ You want to *judge* specific named people. The skill surfaces patterns; performance judgments based on AI usage are a different (and harder) decision.
|
|
100
100
|
- ❌ The input lacks every effectiveness field. You can still produce a volume report, but call out the limitation explicitly — don't ship a report that looks like effectiveness analysis when it isn't.
|
|
101
101
|
- ❌ Your team is < 5 people *and* the view is team-rollup. Aggregate views aren't anonymous at that size.
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
"deps": { "npm": [], "pip": [] },
|
|
7
7
|
"env": { "required": [], "optional": [] },
|
|
8
8
|
"related": ["design-doc", "doc-critique"],
|
|
9
|
+
"hooks": [
|
|
10
|
+
{ "event": "pre-commit-review", "action": "devils-advocate", "description": "adversarially review staged changes before they land" }
|
|
11
|
+
],
|
|
9
12
|
"tags": ["review", "code-review", "adversarial", "edge-cases", "future-proofing", "test-coverage", "dev-workflow"],
|
|
10
13
|
"model": { "tier": "heavy", "rationale": "Adversarial code review across four lenses. Cheaper models miss edge cases and under-call severity. Never downgrade." }
|
|
11
14
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagent-design
|
|
3
|
+
description: Decompose a task into an orchestrator and subagents — one-mission role cards with typed output contracts, a topology (pipeline / parallel / judge panel) chosen with a reason, context-isolation rationale, and a verification stage that is never a generator. Use when the user wants to fan work out across multiple agents, design a multi-agent workflow or orchestration, or asks "should this be one agent or several".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# subagent-design
|
|
7
|
+
|
|
8
|
+
Produces an **orchestration plan**: which subagents exist, what each one alone is for, how their outputs compose, and who checks the result. The default answer to "should this be several agents?" is **no** — one context that fits is always simpler; fan out only when a plan survives step 1. Two skilldrop skills are ready-made instances of the patterns worth copying — `council-review` (a judge panel of independent perspectives) and `devils-advocate` (an adversarial verifier that isn't the generator) — cite them as patterns even where they aren't installed. Loop mechanics around the fan-out belong to `agent-loop-design`; what the fleet may spend belongs to `agent-budget`.
|
|
9
|
+
|
|
10
|
+
## How to respond
|
|
11
|
+
|
|
12
|
+
1. **Justify the fan-out or refuse it.** Exactly three reasons earn multiple agents — name which applies, or recommend a single agent and stop:
|
|
13
|
+
- **Context separation**: the task spans more material than one context holds well, and it partitions cleanly (per-module audit, per-source research).
|
|
14
|
+
- **Independence**: judgments must not contaminate each other — reviewers, estimators, hypothesis-testers whose value is that they haven't seen each other's answers.
|
|
15
|
+
- **Role conflict**: one agent can't hold both jobs honestly — the generator must not grade itself; the negotiator must not also be the auditor.
|
|
16
|
+
|
|
17
|
+
"It would be faster" alone is not on the list — parallelism is a consequence of separation, not a reason to manufacture it. Non-interactive run (no user to ask): derive the task from the input, tag assumptions `[assumption]`; no task derivable → emit `BLOCKED: need the task being decomposed`.
|
|
18
|
+
|
|
19
|
+
2. **Write one role card per agent** — the plan's core, using [`templates/orchestration-plan.md`](templates/orchestration-plan.md). Each card: **mission** (one sentence, one job — an agent with "and" in its mission is two agents or one agent over-split; a mission repeated across items is one card with a ×N multiplier, and splitting one item's work into separate per-check cards is worth the extra invocations only when the isolation or tier difference pays for it), **inputs** (exactly what it's given — and, as important, what it's *denied*: the context-isolation line states what this agent must not see, e.g. a judge never sees the other judges' verdicts), **output contract** (a typed schema — fields and types, not "a summary"; prose outputs make aggregation a second AI task you didn't budget), **tools/permissions** (least privilege: a research agent gets read, never write), and **failure behavior** (what it returns when it can't do the job — a structured `BLOCKED`/empty result, never improvisation).
|
|
20
|
+
|
|
21
|
+
3. **Pick the topology, with the reason attached:**
|
|
22
|
+
- **Pipeline** — stages feed forward; item B needn't wait for item A's later stages. The default for multi-stage work.
|
|
23
|
+
- **Parallel + barrier** — only when a stage genuinely needs *all* prior results at once (dedup across findings, a zero-count early exit). A barrier "because the stages feel separate" burns wall-clock for tidiness.
|
|
24
|
+
- **Judge panel** — N independent attempts or verdicts, then score/merge (`council-review`'s shape). For wide solution spaces and contested judgments; specify the vote rule (majority, unanimous-to-kill) up front.
|
|
25
|
+
- **Depth cap: one level.** Subagents spawning subagents needs a written justification; two levels of delegation is where accountability and budgets go to disappear.
|
|
26
|
+
|
|
27
|
+
4. **Design the aggregation and verification stage.** Aggregation is code-shaped where possible (merge schemas, dedup by key) — an "aggregator agent" summarizing prose is a smell that the output contracts were too loose. Verification is a **separate stage with an adversarial job description** (`devils-advocate` framing): it tries to refute, and its verdict gates the result. The orchestrator trusts contracts, not content — a subagent's confident prose is not evidence; count only schema-valid outputs, and route contract violations to the failure path, never into the merge.
|
|
28
|
+
|
|
29
|
+
5. **Attach the budget line and emit.** Per-agent tier (light/standard/heavy — the repo's routing abstraction; most fan-out workers are one tier below the orchestrator's instinct) and the fleet's cap per run, referencing an `agent-budget` spec or tagging the numbers `[assumption]`. Emit in one message: fan-out justification, role cards, topology (Mermaid `flowchart`) with the reason, aggregation + verification, budget line. Hand off: the loop around this fan-out → `agent-loop-design`; the full spend model → `agent-budget`; implementing a coding task through it → `feature-implement-loop`.
|
|
30
|
+
|
|
31
|
+
## Useful references in this skill
|
|
32
|
+
|
|
33
|
+
- [`templates/orchestration-plan.md`](templates/orchestration-plan.md) — role cards, topology diagram, aggregation/verification, budget line
|
|
34
|
+
|
|
35
|
+
## Quality bar
|
|
36
|
+
|
|
37
|
+
- **The fan-out is justified by one of the three reasons, by name** — or the plan says "one agent" and means it.
|
|
38
|
+
- **Every mission is one sentence with no "and".** Two jobs, two cards.
|
|
39
|
+
- **Every output contract is typed.** A reader could write the JSON schema from the card.
|
|
40
|
+
- **Isolation lines are explicit** — each card says what the agent is denied and why.
|
|
41
|
+
- **The topology has its reason attached**, and any barrier names the cross-item dependency that earns it.
|
|
42
|
+
- **Verification is adversarial and separate** — never the generator, never "the orchestrator double-checks".
|
|
43
|
+
- **The budget line exists** — per-agent tier + fleet cap, sourced or tagged.
|
|
44
|
+
|
|
45
|
+
## When to use this skill
|
|
46
|
+
|
|
47
|
+
- ✅ "Should this be one agent or several?" — including when the honest answer is one
|
|
48
|
+
- ✅ Designing a multi-agent review, audit, research sweep, or migration
|
|
49
|
+
- ✅ A fan-out exists but produces mush — retrofit contracts, isolation, and verification
|
|
50
|
+
- ✅ Choosing between pipeline, barrier, and judge-panel shapes for a workflow
|
|
51
|
+
|
|
52
|
+
## When NOT to use this skill
|
|
53
|
+
|
|
54
|
+
- ❌ Designing the loop that wraps the fan-out (caps, gates, exits) — `agent-loop-design`
|
|
55
|
+
- ❌ Setting the spend policy — `agent-budget`
|
|
56
|
+
- ❌ Running a multi-perspective review right now — `council-review` is the panel, ready-made
|
|
57
|
+
- ❌ Implementing one story — `feature-implement-loop`
|
|
58
|
+
|
|
59
|
+
## Anti-patterns to avoid
|
|
60
|
+
|
|
61
|
+
- ❌ **Fan-out as a lifestyle.** Five agents doing what one context does well is five times the cost for a coordination tax. The burden of proof is on splitting.
|
|
62
|
+
- ❌ **Prose contracts.** "Each agent reports its findings" guarantees an unmergeable pile and a surprise summarization stage. Schemas or it didn't happen.
|
|
63
|
+
- ❌ **Contaminated judges.** A panel that sees each other's verdicts is one opinion with extra steps — independence is the entire value.
|
|
64
|
+
- ❌ **The trusting orchestrator.** Merging whatever comes back because it arrived confidently. Contract-invalid output goes to the failure route, not the report.
|
|
65
|
+
- ❌ **Unbounded depth.** Subagents spawning subagents until nobody can say who decided what or spent which tokens.
|
|
66
|
+
- ❌ **Barrier by aesthetics.** Synchronizing stages because the diagram looks cleaner — pay wall-clock only for a named cross-item dependency.
|
|
67
|
+
- ❌ **Verifier-free fleets.** Ten generators and no refuter ships ten agents' worth of plausible-but-wrong at fleet speed.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "query": "Should this task be one agent or several?", "should_trigger": true },
|
|
3
|
+
{ "query": "Design a multi-agent workflow to audit all our repos", "should_trigger": true },
|
|
4
|
+
{ "query": "My agent fan-out produces mush — help me add contracts and verification", "should_trigger": true },
|
|
5
|
+
{ "query": "Pipeline or parallel for this multi-stage agent job?", "should_trigger": true },
|
|
6
|
+
|
|
7
|
+
{ "query": "Design the loop with exit criteria and human gates for this automation", "should_trigger": false },
|
|
8
|
+
{ "query": "Set a token budget for our agent workflows", "should_trigger": false },
|
|
9
|
+
{ "query": "Run a council review on this architecture decision", "should_trigger": false },
|
|
10
|
+
{ "query": "Implement this feature with tests", "should_trigger": false }
|
|
11
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "subagent-design",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Design a multi-agent workflow to audit our 40-repo GitHub org for secrets committed to git history, hardcoded credentials, and misconfigured CI permissions. Results should end up as one prioritized report.",
|
|
7
|
+
"assertions": [
|
|
8
|
+
"The fan-out is justified by name (context separation across 40 repos) rather than assumed",
|
|
9
|
+
"Every role card has a one-sentence single mission with no 'and'",
|
|
10
|
+
"Every output contract is a typed schema, not 'reports its findings'",
|
|
11
|
+
"Each card states what the agent is denied seeing (isolation) and least-privilege tools (read-only for auditors)",
|
|
12
|
+
"The topology is named with its reason; any barrier names the cross-item dependency (e.g. dedup before prioritization)",
|
|
13
|
+
"A separate adversarial verification stage gates findings before the report — verifier is not a generator",
|
|
14
|
+
"Contract-invalid subagent output routes to a failure path, not the merged report",
|
|
15
|
+
"Depth is capped at one level",
|
|
16
|
+
"A budget line gives per-agent tiers and a fleet cap, sourced or tagged [assumption]",
|
|
17
|
+
"A Mermaid flowchart of the topology is emitted with valid syntax"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": 2,
|
|
22
|
+
"prompt": "Should I use multiple agents to write a single 500-word blog post from an outline I already have?",
|
|
23
|
+
"assertions": [
|
|
24
|
+
"The skill recommends a single agent — the task fits one context and no fan-out reason applies",
|
|
25
|
+
"The three-reasons test is applied explicitly rather than a fan-out being designed anyway"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "subagent-design",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Decompose a task into an orchestrator and subagents — one-mission role cards with typed output contracts, a topology (pipeline / parallel / judge panel) chosen with a reason, context-isolation rationale, and a verification stage that is never a generator. Use when the user wants to fan work out across multiple agents, design a multi-agent workflow or orchestration, or asks \"should this be one agent or several\".",
|
|
5
|
+
"entrypoint": "SKILL.md",
|
|
6
|
+
"deps": { "npm": [], "pip": [] },
|
|
7
|
+
"env": { "required": [], "optional": [] },
|
|
8
|
+
"related": ["agent-budget", "agent-loop-design", "council-review", "devils-advocate", "feature-implement-loop"],
|
|
9
|
+
"tags": ["subagents", "orchestration", "multi-agent", "fan-out", "agentic", "role-cards"],
|
|
10
|
+
"model": { "tier": "standard", "rationale": "Design synthesis against a fixed topology catalog and role-card template. The fan-out-or-refuse judgment is bounded by the three-reasons rule; escalate via ambiguous-input on genuinely novel workflow shapes." }
|
|
11
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Orchestration plan: {task}
|
|
2
|
+
|
|
3
|
+
> Fan-out justification: {context separation | independence | role conflict} — {one line why}. If none applies, this document should instead say: use one agent.
|
|
4
|
+
|
|
5
|
+
## Role cards
|
|
6
|
+
|
|
7
|
+
### {agent-name}
|
|
8
|
+
- **Mission:** {one sentence, one job, no "and"}
|
|
9
|
+
- **Inputs:** {exactly what it receives}
|
|
10
|
+
- **Denied (isolation):** {what it must not see, and why}
|
|
11
|
+
- **Output contract:** `{ field: type, field: type }` — schema, not prose
|
|
12
|
+
- **Tools/permissions:** {least privilege}
|
|
13
|
+
- **On failure:** {structured BLOCKED/empty return — never improvisation}
|
|
14
|
+
- **Tier:** {light | standard | heavy} — {why this tier suffices}
|
|
15
|
+
|
|
16
|
+
<!-- one card per agent role (use ×N in the name for a mission repeated per item), and always include a card for the orchestrator itself -->
|
|
17
|
+
|
|
18
|
+
## Topology
|
|
19
|
+
|
|
20
|
+
**Shape:** {pipeline | parallel+barrier | judge panel} — **because** {the named dependency or independence requirement}.
|
|
21
|
+
{If barrier: the cross-item dependency that earns it. If judge panel: the vote rule.}
|
|
22
|
+
**Depth:** one level. {Justification here if any agent spawns agents.}
|
|
23
|
+
|
|
24
|
+
```mermaid
|
|
25
|
+
flowchart LR
|
|
26
|
+
O[orchestrator] --> A[{agent}]
|
|
27
|
+
O --> B[{agent}]
|
|
28
|
+
A --> V{verify}
|
|
29
|
+
B --> V
|
|
30
|
+
V -->|pass| OUT[{artifact}]
|
|
31
|
+
V -->|refuted| F[failure route]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Aggregation & verification
|
|
35
|
+
|
|
36
|
+
- **Aggregation:** {code-shaped merge — dedup key, schema union}; contract-invalid output → failure route, never the merge
|
|
37
|
+
- **Verification:** {adversarial verifier — persona/prompt, independent of all generators}; verdict gates the result
|
|
38
|
+
- **Vote rule:** {panels: e.g. finding survives unless 2 of 3 refute · single verifier: "ships unless refuted"}
|
|
39
|
+
|
|
40
|
+
## Budget line
|
|
41
|
+
|
|
42
|
+
Fleet cap per run: {tokens/currency} `[source: agent-budget spec | assumption]` · Worker tiers as carded above · On cap: {stop and escalate — see the loop spec}
|
|
43
|
+
|
|
44
|
+
## Hand-offs
|
|
45
|
+
|
|
46
|
+
- Loop wrapping this fan-out (caps, gates, exits) → `agent-loop-design`
|
|
47
|
+
- Full spend model → `agent-budget`
|