Specgate
Approved specs in, reviewed code out
This production is a private summary: description, learnings and stack are shown, the code stays private.
- Status
- Case study
- Type
- Agentic workflow
- Started
- January 2025
- Role
- Architect and lead engineer
- Domains
- software delivery, governance
- Stack
- TypeScript, GitHub Actions, OpenAPI, PostgreSQL
Specgate Case study Approved specs in, reviewed code out
Agentic workflow
Context and problem
Delivery intelligence in Go: business-hours flow metrics, QA bugs mapped to OpenAPI contracts, specs served to coding agents over MCP.
Assumption: teams adopting AI coding agents merge code that drifts from the specification that was approved, and reviewers cannot tell which specification a change implements.
Specgate keeps approved specifications as the single input of AI coding agents and ties every reviewed change back to the specification it implements.
Screens
How it was built
224 tests · 10 audits
From the build report, 21 November 2026.
Architecture and interfaces
- Provides
- mcp specgate
- Data keys
- spec_ref, endpoint, error_code
Decisions and trade-offs
- Approving a spec needs a scoped approver key, the approver's name comes from the key and self-approval is refused, instead of refusing names that start with agent: (no protection) or real user accounts (out of scope): an agent holding the agent key, even one injected into running curl, cannot approve. (ADR-0008)
- The deterministic core is evaluated directly against hand-labelled cases and gated in CI, instead of the template's eval script or a harness built for model outputs: it measures the code that ships. The first run found two real defects; the gold set is only 36 cases. (ADR-0010)
- One Go module with hexagonal packages and an architecture test that keeps the domain on the standard library, instead of the template's services/app layout or flat feature packages: domain logic is unit-tested in milliseconds and adapters can be swapped. (ADR-0003)
- Without Docker, an in-memory store runs the service while the PostgreSQL adapter stays written in full with its tests tagged docker, instead of waiting for Docker or swapping PostgreSQL for SQLite: work keeps shipping without weakening the database design, at the risk of SQL defects surfacing late. (ADR-0005)
- Backups as store snapshots, optionally sealed with AES-256-GCM, rotated and restored only at start-up, instead of a CLI reading another process's store or persisting every write (a second database in disguise): backups survive restarts and never overwrite live data. (ADR-0009)
What the project taught
- A specification reference carried from the approved document to the pull request makes drift visible at review time instead of after release.
- Treating the approved specification as the single input of a coding agent constrains what it builds better than prompting rules do.
- Being the source of specifications for a downstream software factory requires a stable read interface; the consumer should depend on a port, not on the storage.
- Gating merges on a missing specification reference is accepted by a team once the reference is one click away.
Related projects
Highlights
spec driven, governance, github actions