Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

cli: gbrain skills index build|status|remove and skills resolve

garrytanf151e465dfe8
diff --git a/src/cli/command-route.ts b/src/cli/command-route.ts
index ea746fefcc..19b81a4ec0 100644
--- a/src/cli/command-route.ts
+++ b/src/cli/command-route.ts
@@ -5,8 +5,13 @@
* dispatcher (cli/main.ts) and the docs command checker so both read the same
* command. The `ask` alias stays inline in main.ts, where the dispatch-shape
* analyzer reads it.
+ *
+ * GBRA-377: `skills index ...` and `skills resolve ...` route to the
+ * engine-free skill resolver (`skill-resolver`) before help, prewarming or
+ * any engine work; plain `skills` stays the `list_skills` listing.
*/
export function routeCommand(command: string, subArgs: string[]): { command: string; subArgs: string[] } {
+ if (command === 'skills' && (subArgs[0] === 'index' || subArgs[0] === 'resolve')) return { command: 'skill-resolver', subArgs };
if (command !== 'search') return { command, subArgs };
const at = subArgs.indexOf('--exact');
const end = subArgs.indexOf('--');
diff --git a/src/cli/command-table.ts b/src/cli/command-table.ts
index bfe396b69d..b0fed31fd4 100644
--- a/src/cli/command-table.ts
+++ b/src/cli/command-table.ts
@@ -154,6 +154,8 @@ export const CLI_COMMANDS: readonly CliCommandRecord[] = [ // Pre-connect: disp
{ name: 'protocol', phase: 'pre-connect', thinClient: 'none', selfHelp: true, load: () => import('./commands/protocol.ts') },
{ name: 'errors', phase: 'pre-connect', thinClient: 'none', selfHelp: true, json: 'document', read_only: true, load: () => import('./commands/errors.ts') },
{ name: 'bundled-skill', phase: 'pre-connect', thinClient: 'none', selfHelp: true, json: 'document', read_only: true, skipStartupHooks: true, load: () => import('./commands/bundled-skill.ts') },
+ // GBRA-377: `skills index|resolve` (routed by cli/command-route.ts); engine-free on every install shape.
+ { name: 'skill-resolver', phase: 'pre-connect', thinClient: 'none', selfHelp: true, skipStartupHooks: true, load: () => import('./commands/skill-resolver.ts') },
{ name: 'notices', phase: 'pre-connect', thinClient: 'none', selfHelp: true, load: () => import('./commands/notices.ts') },
// selfHelp: `gbrain init --help` prints its own usage from runInit; route around the generic
// one-line short-circuit (matches `connect`). Without this, `init` is in CLI_ONLY but not
diff --git a/src/cli/commands/skill-resolver.ts b/src/cli/commands/skill-resolver.ts
new file mode 100644
index 0000000000..b1a975e6de
--- /dev/null
+++ b/src/cli/commands/skill-resolver.ts
@@ -0,0 +1,10 @@
+/**
+ * Dispatch for `gbrain skills index ...` and `gbrain skills resolve ...`
+ * (routed here from `skills` by src/cli/command-route.ts). Engine-free:
+ * no brain connection, works on thin clients, brainless installs and while
+ * `gbrain serve` holds the PGLite lock. Behavior: src/commands/skill-resolver.ts.
+ */
+export async function run(args: string[]): Promise<void> {
+ const { runSkillResolver } = await import('../../commands/skill-resolver.ts');
+ await runSkillResolver(args);
+}
diff --git a/src/commands/skill-resolver.ts b/src/commands/skill-resolver.ts
new file mode 100644
index 0000000000..dab91c1555
--- /dev/null
+++ b/src/commands/skill-resolver.ts
@@ -0,0 +1,263 @@
+/**
+ * `gbrain skills index build|status|remove` and `gbrain skills resolve`:
+ * the skill resolver's CLI (library: src/core/skills/resolver/). The router
+ * (src/cli/command-route.ts) sends these two `skills` subcommands here
+ * before any engine or brain is touched; plain `gbrain skills` keeps
+ * listing skills through `list_skills`.
+ *
+ * Exit codes: 0 on success (a no_skill turn and an empty block are
+ * successes); 1 on a runtime error (skill_index_missing and the rest), with
+ * the code and fix on stderr and, under --json, the turn output with
+ * `error` set on stdout; `--fail-open` turns a runtime error into exit 0
+ * with `block: ""` and `error` set; 2 on a usage error (no input, bad JSON,
+ * an unknown flag or catalog name), with the agent-protocol refusal.
+ */
+import { appendFileSync } from 'node:fs';
+import { exitCliError, usageError, writeCliError } from '../cli/cli-error.ts';
+import { opError } from '../core/ops/contract.ts';
+import type { RegistryCode } from '../core/error-registry.ts';
+import {
+ buildSkillIndex, catalogStatus, listCatalogs, removeSkillIndex, resolveSkills, resolverHome, sessionStatus,
+ ResolverError, HARNESSES, errorTurnOutput, type BuildInput, type TurnInput,
+} from '../core/skills/resolver/index.ts';
+
+const HELP_INDEX = `Usage: gbrain skills index <build|status|remove> [options]
+
+Build, inspect or remove a skill catalog's index (under GBRAIN_HOME/skill-index/).
+No brain connection is needed.
+
+ gbrain skills index build --catalog <name> (--dir <d>... | --bundled | --from-json <file|->)
+ [--routing <file>] [--harness <h>] [--scope user|project] [--json]
+ gbrain skills index status [--catalog <name>] [--session <id> [--harness <h>] [--shadow]] [--json]
+ gbrain skills index remove --catalog <name> [--json]
+
+ --catalog <name> catalog name: a-z, 0-9, _ and -, up to 64 characters
+ --dir <d> a SKILL.md directory (repeatable; earlier wins on duplicate ids)
+ --bundled gbrain's own bundled skills
+ --from-json <f|-> an adapter's skill list ([{id, name, description, triggers?, path?, eligible?}])
+ --routing <file> one RESOLVER-style routing table; rows add trigger text to skills
+ --harness <h> openclaw, claude-code, codex, hermes or qm (recorded in the receipt)
+ --scope project a cloned repository's skills: blocks show ids and names only
+ --session <id> status: that session's turn count and token budget
+
+Guide: docs/guides/skill-resolver.md
+`;
+
+const HELP_RESOLVE = `Usage: gbrain skills resolve [--catalog <name>]... (--text <t> [--previous <t>] | --input-json -)
+ [--session <id>] [--harness <h>] [--exclude a,b] [--top-k n] [--shadow [--shadow-log <file>]]
+ [--expect-catalog <hash>] [--reset-session] [--names-only] [--load-hint <text>]
+ [--explain-target <id>] [--fail-open] [--json]
+
+Pick the few skills that fit one user turn (or none) and print the <relevant_skills>
+block for the harness to show the model. Word matching only: nothing leaves this machine,
+and no brain connection is needed.
+
+ --catalog <name> the catalog to rank (repeatable to merge; default: the only one)
+ --text <t> the user message (or send turn JSON with --input-json -)
+ --session <id> the harness session: suggestions are not repeated within it, and its
+ block tokens are capped by skills.resolver.session_token_budget (2000)
+ --harness <h> picks the load line: openclaw, claude-code, codex, hermes or qm
+ --top-k <n> at most n suggestions (1-8, default 5)
+ --exclude <ids> comma-separated skill ids to leave out
+ --shadow compute the block without injecting it (block "" on stdout);
+ --shadow-log <file> appends what would have been injected
+ --expect-catalog <h> refuse with skill_catalog_mismatch unless the catalog hash is h
+ --reset-session the session was compacted: start its dedupe and budget again
+ --explain-target <id> why a skill did or did not rank
+ --fail-open a runtime error exits 0 with block "" and error set (for hooks)
+ --json the turn output document (docs/schemas/skill-resolver.v1.turn-output.json)
+
+Guide: docs/guides/skill-resolver.md
+`;
+
+const CMD = 'skills';
+
+function toOpError(e: ResolverError) {
+ const command = e.toJSON().fix.command;
+ return opError(e.code as RegistryCode, e.message, command ? `${e.fix.hint} Run: ${command}` : e.fix.hint,
+ e.fix.argv ? { fix: { argv: e.fix.argv, consent: [], actor: 'agent', why: e.fix.hint, requires_exclusive: false } } : {});
+}
+
+function usage(message: string, suggestion: string): never {
+ exitCliError(usageError(message, suggestion), CMD);
+}
+
+interface Parsed { flags: Map<string, string[]>; bools: Set<string>; positionals: string[] }
+
+function parseFlags(args: string[], valued: readonly string[], booleans: readonly string[], help: string): Parsed {
+ const flags = new Map<string, string[]>();
+ const bools = new Set<string>();
+ const positionals: string[] = [];
+ for (let i = 0; i < args.length; i++) {
+ const a = args[i]!;
+ if (a === '--help' || a === '-h') { process.stdout.write(help); process.exit(0); }
+ if (!a.startsWith('--')) { positionals.push(a); continue; }
+ if (booleans.includes(a)) { bools.add(a); continue; }
+ if (!valued.includes(a)) usage(`unknown flag ${a} for 'gbrain skills'`, 'Run gbrain skills resolve --help or gbrain skills index --help for the accepted flags.');
+ const v = args[i + 1];
+ if (v === undefined || (v.startsWith('--') && v !== '-')) usage(`${a} requires a value.`, `Pass a value after ${a}.`);
+ flags.set(a, [...(flags.get(a) ?? []), v!]);
+ i++;
+ }
+ return { flags, bools, positionals };
+}
+
+const one = (p: Parsed, f: string) => { const v = p.flags.get(f); if (v && v.length > 1) usage(`${f} was given more than once.`, `Pass ${f} once.`); return v?.[0]; };
+
+async function readStdinCapped(max: number): Promise<string | null> {
+ if (process.stdin.isTTY) return null;
+ const chunks: Buffer[] = [];
+ let size = 0;
+ for await (const c of process.stdin) {
+ const b = Buffer.isBuffer(c) ? c : Buffer.from(c as string);
+ size += b.length;
+ if (size > max) usage(`stdin is over ${max} bytes.`, 'Send one turn (or one catalog of at most 8 MB) on stdin.');
+ chunks.push(b);
+ }
+ return Buffer.concat(chunks).toString('utf8');
+}
+
+function write(text: string): Promise<boolean> {
+ if (!text) return Promise.resolve(true);
+ return new Promise(res => { try { process.stdout.write(text, err => res(!err)); } catch { res(false); } });
+}
+
+function runtimeFailure(e: ResolverError, json: boolean): never {
+ if (json) {
+ exitCliError(toOpError(e), CMD, { json: true });
+ }
+ writeCliError(toOpError(e), CMD, { json: false });
+ process.exit(1);
+}
+
+async function runIndex(args: string[]): Promise<void> {
+ const sub = args[0];
+ if (sub !== 'build' && sub !== 'status' && sub !== 'remove') {
+ if (sub === undefined || sub === 'help') { process.stdout.write(HELP_INDEX); return; }
+ usage(`Unknown subcommand "skills index ${sub}".`, 'Use gbrain skills index build, status or remove.');
+ }
+ const p = parseFlags(args.slice(1), ['--catalog', '--dir', '--from-json', '--routing', '--harness', '--scope', '--session'], ['--bundled', '--json', '--shadow'], HELP_INDEX);
+ const json = p.bools.has('--json');
+ if (p.positionals.length) usage(`Unexpected argument "${p.positionals[0]}".`, 'Pass options as flags; see gbrain skills index --help.');
+ try {
+ if (sub === 'build') {
+ const catalog = one(p, '--catalog');
+ if (!catalog) usage('skills index build needs --catalog <name>.', 'Example: gbrain skills index build --catalog claude-user --dir ~/.claude/skills');
+ const fromJson = one(p, '--from-json');
+ const input: BuildInput = { catalog: catalog!, ...(p.flags.get('--dir') ? { dirs: p.flags.get('--dir') } : {}), ...(p.bools.has('--bundled') ? { bundled: true } : {}),
+ ...(one(p, '--routing') ? { routing: one(p, '--routing') } : {}), ...(one(p, '--harness') ? { harness: one(p, '--harness') } : {}),
+ ...(one(p, '--scope') ? { scope: one(p, '--scope') as 'user' | 'project' } : {}) };
+ if (fromJson === '-') {
+ const text = await readStdinCapped(8 * 1024 * 1024);
+ if (!text) exitCliError(toOpError(new ResolverError('skill_resolve_no_input', 'No catalog JSON arrived on stdin.', { hint: 'Pipe the skill list: <adapter> | gbrain skills index build --catalog <name> --from-json -' })), CMD);
+ input.fromJson = text!;
+ input.fromJsonStdin = true;
+ } else if (fromJson !== undefined) input.fromJson = fromJson;
+ const receipt = await buildSkillIndex(input);
+ if (json) await write(`${JSON.stringify(receipt, null, 2)}\n`);
+ else await write(`Built catalog ${receipt.catalog.name}: ${receipt.catalog.skill_count} skills (${receipt.catalog.skipped.length} skipped), variant ${receipt.ranker.variant}, ${receipt.index.size} bytes, ${receipt.build.ms} ms.\n`);
+ return;
+ }
+ if (sub === 'remove') {
+ const catalog = one(p, '--catalog');
+ if (!catalog) usage('skills index remove needs --catalog <name>.', 'Example: gbrain skills index remove --catalog claude-user');
+ const r = await removeSkillIndex(catalog!);
+ await write(json ? `${JSON.stringify(r)}\n` : r.removed ? `Removed catalog ${r.catalog}.\n` : `No catalog named ${r.catalog}.\n`);
+ return;
+ }
+ const home = resolverHome();
+ const named = one(p, '--catalog');
+ const names = named ? [named] : listCatalogs(home);
+ const catalogs = [];
+ for (const n of names) catalogs.push(await catalogStatus(n));
+ const session = one(p, '--session') ? sessionStatus(one(p, '--session')!, { harness: one(p, '--harness'), shadow: p.bools.has('--shadow') }) : null;
+ const doc = { schema_version: 1, home, catalogs, ...(session ? { session } : {}) };
+ if (json) { await write(`${JSON.stringify(doc, null, 2)}\n`); return; }
+ const lines = catalogs.length ? catalogs.map(c => c.present
+ ? `${c.catalog}: ${c.receipt!.skill_count} skills, variant ${c.receipt!.variant}, ${c.fresh ? 'fresh' : `stale (${c.stale_reason})`}${c.rebuild.running ? `, rebuild running (${c.rebuild.holder})` : ''}${c.rebuild.last_error ? `, last build failed: ${c.rebuild.last_error.code} (${c.rebuild.log_path})` : ''}`
+ : `${c.catalog}: not built (${c.stale_reason})`) : ['No skill catalogs. Build one with gbrain skills index build --catalog <name> --dir <skills dir>.'];
+ if (session) lines.push(`session ${session.session_id}: turn ${session.turn}, ${session.spent}/${session.budget} block tokens spent, ${session.remaining} left`);
+ await write(`${lines.join('\n')}\n`);
+ } catch (e) {
+ if (!(e instanceof ResolverError)) throw e;
+ if (e.usage) exitCliError(toOpError(e), CMD);
+ runtimeFailure(e, json);
+ }
+}
+
+async function runResolve(args: string[]): Promise<void> {
+ const p = parseFlags(args, ['--catalog', '--text', '--previous', '--input-json', '--session', '--harness', '--exclude', '--top-k', '--shadow-log', '--explain-target', '--expect-catalog', '--load-hint'],
+ ['--shadow', '--json', '--fail-open', '--reset-session', '--names-only'], HELP_RESOLVE);
+ if (p.positionals.length) usage(`Unexpected argument "${p.positionals[0]}".`, 'Pass the message with --text "<message>" or turn JSON with --input-json -.');
+ const json = p.bools.has('--json');
+ const failOpen = p.bools.has('--fail-open');
+ const text = one(p, '--text');
+ const inputJson = one(p, '--input-json');
+ if (text !== undefined && inputJson !== undefined) usage('Pass either --text or --input-json, not both.', 'Use --text "<message>" for one message, or --input-json - for turn JSON on stdin.');
+ if (inputJson !== undefined && inputJson !== '-') usage('--input-json reads stdin only; pass --input-json -.', 'Pipe the turn JSON: echo \'{"message":"..."}\' | gbrain skills resolve --input-json -');
+ let input: Record<string, unknown>;
+ try {
+ if (inputJson === '-') {
+ const raw = await readStdinCapped(1024 * 1024);
+ if (raw === null || !raw.trim()) throw new ResolverError('skill_resolve_no_input', raw === null ? 'stdin is a terminal, so no turn JSON arrived.' : 'stdin was empty, so no turn JSON arrived.', { hint: 'Pipe the turn JSON: echo \'{"message":"..."}\' | gbrain skills resolve --input-json -' });
+ try { input = JSON.parse(raw) as Record<string, unknown>; } catch { throw new ResolverError('skill_resolve_invalid_input', 'The turn input on stdin is not valid JSON.', { hint: 'Send one JSON object such as {"message": "..."}.' }); }
+ if (!input || typeof input !== 'object' || Array.isArray(input)) throw new ResolverError('skill_resolve_invalid_input', 'The turn input must be a JSON object.', { hint: 'Send one JSON object such as {"message": "..."}.' });
+ } else if (text !== undefined) input = { message: text };
+ else throw new ResolverError('skill_resolve_no_input', 'No message: pass --text "<message>" or --input-json -.', { hint: 'Example: gbrain skills resolve --text "summarize my meeting notes"' });
+ const prev = one(p, '--previous');
+ if (prev !== undefined) input.previous_user_message = prev;
+ const session = one(p, '--session'); if (session !== undefined) input.session_id = session;
+ const harness = one(p, '--harness'); if (harness !== undefined) input.harness = harness;
+ const exclude = one(p, '--exclude'); if (exclude !== undefined) input.exclude = exclude.split(',').map(s => s.trim()).filter(Boolean);
+ const topK = one(p, '--top-k');
+ if (topK !== undefined) { if (!/^\d+$/.test(topK)) throw new ResolverError('skill_resolve_invalid_input', '--top-k takes an integer from 1 to 8.', { hint: 'Example: --top-k 3' }); input.top_k = Number(topK); }
+ if (p.bools.has('--shadow')) input.shadow = true;
+ if (p.bools.has('--reset-session')) input.reset_session = true;
+ const expect = one(p, '--expect-catalog'); if (expect !== undefined) input.expected_catalog_hash = expect;
+ if (harness !== undefined && !(HARNESSES as readonly string[]).includes(harness)) throw new ResolverError('skill_resolve_invalid_input', `Unknown harness "${harness}".`, { hint: `Use one of: ${HARNESSES.join(', ')}.` });
+ } catch (e) {
+ if (e instanceof ResolverError) exitCliError(toOpError(e), CMD);
+ throw e;
+ }
+ let result;
+ try {
+ result = await resolveSkills(input as unknown as TurnInput, {
+ ...(p.flags.get('--catalog') ? { catalogs: p.flags.get('--catalog') } : {}), failOpen,
+ ...(one(p, '--load-hint') ? { loadHint: one(p, '--load-hint') } : {}), namesOnly: p.bools.has('--names-only'),
+ ...(one(p, '--explain-target') !== undefined ? { explainTarget: one(p, '--explain-target') } : {}),
+ });
+ } catch (e) {
+ if (!(e instanceof ResolverError)) throw e;
+ if (e.usage) exitCliError(toOpError(e), CMD);
+ if (json) await write(`${JSON.stringify(errorTurnOutput(e, { shadow: input.shadow === true, catalog: p.flags.get('--catalog')?.length === 1 ? p.flags.get('--catalog')![0]! : null }))}\n`);
+ writeCliError(toOpError(e), CMD, { json: false });
+ process.exit(1);
+ }
+ const out = result.output;
+ if (out.error) writeCliError(toOpError(new ResolverError(out.error.code as never, out.error.message, { hint: out.error.fix.hint })), CMD, { json: false });
+ const shadowLog = one(p, '--shadow-log');
+ if (shadowLog && result.shadowOutput) {
+ try { appendFileSync(shadowLog, `${JSON.stringify(result.shadowOutput)}\n`, { mode: 0o600 }); } catch { /* the log is best effort; the turn is unaffected */ }
+ }
+ let delivered: boolean;
+ if (json) delivered = await write(`${JSON.stringify(result.explain ? { ...out, explain: result.explain } : out)}\n`);
+ else if (result.explain) {
+ const x = result.explain;
+ delivered = await write([
+ `${x.target}: ${x.indexed ? `indexed in ${x.catalog}` : x.skip_reason ? `not indexed (${x.skip_reason})` : 'not in the catalog'}`,
+ x.indexed ? `rank: ${x.rank ?? 'no match'}${x.score !== null ? `, score ${x.score}` : ''}` : '',
+ Object.keys(x.fields).length ? `matched: ${Object.entries(x.fields).map(([f, t]) => `${f} (${t.join(', ')})`).join('; ')}` : '',
+ x.excluded ? 'excluded by --exclude' : '', x.deduped ? 'already suggested in this session (deduped)' : '', `in block: ${x.in_block ? 'yes' : 'no'}`,
+ x.session ? `session: turn ${x.session.turn}, ${x.session.spent}/${x.session.budget} block tokens spent, ${x.session.remaining} left` : '',
+ ].filter(Boolean).join('\n') + '\n');
+ } else delivered = await write(out.block ? `${out.block}\n` : '');
+ if (delivered) await result.commit();
+ if (out.error && !failOpen) process.exit(1);
+}
+
+export async function runSkillResolver(args: string[]): Promise<void> {
+ const [sub, ...rest] = args;
+ if (sub === 'index') return runIndex(rest);
+ if (sub === 'resolve') return runResolve(rest);
+ process.stdout.write(`${HELP_RESOLVE}\n${HELP_INDEX}`);
+}
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index d41e26eeb2..ee6c3e1fa8 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -124,6 +124,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'self-upgrade': ['--apply', '--brain', '--channel', '--check-only', '--clear-never-installed', '--exit-code', '--ff-only', '--force', '--force-retry', '--help', '--is-ancestor', '--json', '--markdown', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-restart', '--non-interactive', '--quiet', '--refresh-cache', '--refs', '--remediation-plan', '--restart-only', '--snooze', '--source', '--stop-mcp', '--swap-only', '--tags', '--version', '--yes'],
'serve': ['--access', '--add', '--adopt-columns', '--adopt-permissions', '--advertise', '--all-new', '--apply-rewrites', '--attest-actor', '--attest-ops', '--bind', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--cli-socket', '--client', '--days', '--delegated-namespace', '--delegated-slug-prefixes', '--enable-dcr', '--enable-dcr-insecure', '--expect', '--fail-fast', '--federated-read', '--grant-types', '--harness', '--help', '--http', '--id', '--if-version', '--json', '--log-full-params', '--may-act-for', '--member', '--migrate-legacy', '--min-trust', '--no-embedding', '--no-pull', '--oauth-request', '--only', '--operations', '--path', '--pglite', '--port', '--prefer-postgres', '--print-admin-token', '--private-pages', '--profile', '--provenance', '--public-url', '--read-sources', '--redirect-uri', '--refresh-operations', '--repair', '--reset-default', '--retry-failed', '--scopes', '--source', '--source-guard', '--source-id', '--sources', '--stale', '--stdio-idle-timeout', '--suppress-bootstrap-token', '--surface', '--takes-holders', '--token', '--token-endpoint-auth-method', '--token-ttl', '--tools-json', '--url', '--usage', '--yes'],
'setup': ['--accept-capabilities', '--advertise', '--agent', '--auto', '--bearer-token-env-var', '--brain', '--break-lock', '--capture', '--credentials-file', '--dry-run', '--env', '--force', '--gbrain-bin', '--harness', '--header', '--help', '--http', '--images', '--install', '--instructions', '--instructions-only', '--issuer-url', '--json', '--legacy-lock', '--link', '--mcp-only', '--mcp-url', '--name', '--no-capture', '--no-embedding', '--no-hooks', '--no-instructions', '--no-providers', '--oauth-client-id', '--oauth-client-secret', '--only', '--path', '--pglite', '--probe', '--providers', '--pure', '--remove', '--root', '--runtime', '--save', '--scope', '--skill-loading', '--skills-index-only', '--source', '--source-ids', '--stale', '--surface', '--token', '--url', '--workspace', '--yes'],
+ 'skill-resolver': ['--brain', '--bundled', '--catalog', '--dir', '--exclude', '--expect-catalog', '--explain-target', '--fail-open', '--from-json', '--harness', '--help', '--input-json', '--json', '--load-hint', '--names-only', '--previous', '--reset-session', '--routing', '--scope', '--session', '--shadow', '--shadow-log', '--source', '--text', '--top-k'],
'skillify': ['--brain', '--description', '--dry-run', '--force', '--help', '--json', '--mutating', '--recent', '--skills-dir', '--source', '--strict', '--triggers', '--writes-pages', '--writes-to'],
'skillopt': ['--all', '--allow-mutate-bundled', '--background', '--batch-size', '--benchmark', '--bootstrap-from-routing', '--bootstrap-from-skill', '--bootstrap-reviewed', '--bootstrap-tasks', '--brain', '--brain-wide-max-cost-usd', '--dry-run', '--epochs', '--follow', '--force', '--held-out', '--help', '--json', '--judge-model', '--loop', '--lr', '--lr-schedule', '--max-cost-usd', '--max-runtime-min', '--max-usd', '--models-strict', '--no-max-cost', '--no-mutate', '--optimizer-model', '--patch', '--reflect-max-tokens', '--resume', '--rewrite', '--skills-dir', '--source', '--split', '--status', '--target-model', '--target-models'],
'skillpack': ['--all', '--apply-clean-hunks', '--author', '--auto', '--brain', '--dest', '--dry-run', '--env', '--exit-code', '--fast', '--fix', '--force-unlock', '--format', '--from', '--full', '--harness', '--help', '--homepage', '--json', '--license', '--list', '--minimal', '--name-only', '--no-cache', '--no-lint', '--note', '--out', '--overwrite-local', '--persona', '--probe', '--pure', '--push', '--quick', '--quiet', '--refresh', '--repo', '--schema-pack', '--scope', '--short', '--since', '--skill', '--skills', '--skills-dir', '--skip-doctor', '--source', '--strict', '--stub', '--supabase', '--target', '--tier', '--trust', '--url', '--verify', '--version', '--workspace', '--yes'],