« All posts

Spec Forge: Adversarially Certifying Specs as Behaviorally Complete

Spec Forge is a Claude Code skill that adversarially certifies specifications as behaviorally complete before any code is written.

Spec Forge is a Claude Code skill that treats a specification as behaviorally complete only when every implementation satisfying it is indistinguishable from every other under a declared observation alphabet (Σ). Instead of relying on a human sign-off, it runs adversarial 'witness' searches that try to construct two conforming implementations diverging on observable behavior; each divergence becomes a concrete gap, a ratified decision, and eventually a test case in the harvested acceptance suite.

The tool is explicit about its limits: since checking full completeness is undecidable in general, it issues a statistical certificate rather than a proof, and that certificate is scoped to a specific agent class and toolchain rather than claimed universally. Its acceptance bar is equally mechanical — the coding agent's question count and uncited-decision count must both be zero, replacing subjective 'a human read it and liked it' review with something an agent can't quietly route around.

The six-phase pipeline — declaring Σ, clausifying the spec, building an ontology grid, hunting underdetermination and contradictions, ratifying decisions, discharging each clause to an enforcement mechanism, then building — is driven entirely by a Python CLI and Workflow scripts that cannot be delegated to subagents. Hard gates covering transcript-based blindness checks, canary-aim verification, and citation linting prevent an agent from silently gaming the process. On a real 9-clause spec, the full run cost roughly 90 agent calls and 2.5 million tokens, giving engineers a concrete data point for weighing spec rigor against LLM spend.