diff --git a/COMMANDS.md b/COMMANDS.md index 3e4736f..6b51d79 100644 --- a/COMMANDS.md +++ b/COMMANDS.md @@ -251,6 +251,9 @@ fable-agent plinius godmode "improve explanation quality" - `fable5 goal ` - `-i, --iterations ` - `-s, --min-score ` +- `fable5 spec ` + - `--repo ` + - `--out ` - `fable5 zte ` - `--repo ` - `--out ` diff --git a/src/index.ts b/src/index.ts index 17e4d82..00d8cdd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1865,6 +1865,24 @@ fable console.log(` `); }); +fable + .command("spec ") + .description("Generate a six-section anti-hallucination spec with verifier gates") + .option("--repo ", "Repo path for validation commands", ".") + .option("--out ", "Write spec markdown to a file") + .action(async (task: string, opts: { repo?: string; out?: string }) => { + const { createZteSpec } = await import("./fable5/zte-protocol.js"); + const spec = createZteSpec(task, { repo: opts.repo ?? "." }); + + if (opts.out) { + fs.writeFileSync(path.resolve(opts.out), spec.markdown); + console.log(` ✓ Spec written: ${path.resolve(opts.out)}`); + return; + } + + console.log(spec.markdown); + }); + fable .command("zte ") .description("Generate a Zero-Touch Engineering spec with verifier gates")