Skip to content

Methodology & Philosophy

spechatch is not just a CLI or a database — it is an opinionated engineering workflow built on the Spec-Driven Development (SDD) methodology defined at specdriven.ai, combined with Test-Driven Development (TDD) and Behavior-Driven Development (BDD) for modern human + AI agent teams.


1. Why SDD — Solving Team & Agent Synchronization

Section titled “1. Why SDD — Solving Team & Agent Synchronization”

AI coding assistants have made generating code 10x faster — and made drift, misalignment, and unspoken assumptions 10x easier to introduce.

When a team relies on ephemeral chat prompts:

  • Developer A and Developer B (or two parallel AI agents) unknowingly make conflicting architectural choices.
  • Requirements live in Slack threads or vanished chat sessions instead of version control.
  • Nobody can tell which tests actually prove which feature, or when a refactor silently broke an earlier contract.

spechatch solves the team synchronization problem by making versioned Markdown specifications (and optionally the shared multi-project Incubator ledger) the single living source of truth:

  • Every feature, bugfix, hotfix, and epic gets a monotonic ID, explicit scope, testable acceptance criteria, and tracked file/test ownership.
  • specs/ROADMAP.md and CHANGELOG.md are generated deterministically from specs — never hand-edited.
  • Across multi-developer and multi-agent teams, the Incubator coordinates atomic IDs, soft advisory TTL leases (claim), epic DAG queues (epic next), and real-time Slack/Discord/Teams notifications.

2. Software Engineering Thinking at the Core of Every Spec

Section titled “2. Software Engineering Thinking at the Core of Every Spec”

In spechatch, a specification is not bureaucratic paperwork — it is where real software engineering happens before a single line of code is written:

  • Problem framing & non-goals: Force clarity on why something is being built and what is explicitly out of scope.
  • Architecture & trade-offs (plan.md): Reason about module boundaries, data contracts, concurrency, migrations, security boundaries, and failure modes up front.
  • Zero-ambiguity gate ([NEEDS CLARIFICATION]): spechatch test and spechatch verify block promotion when unresolved ambiguity markers remain.
  • Atomic execution (tasks.md): Break implementation into small, verifiable steps instead of sprawling, unreviewable diffs.

Code becomes a clean, verifiable derivation of sound engineering ideas — not a prompt-lottery output.


3. Always Human-in-the-Loop for Specs and Code

Section titled “3. Always Human-in-the-Loop for Specs and Code”

AI agents are extraordinary force multipliers for drafting specs, exploring codebases, writing tests, and implementing atomic tasks — but humans always remain accountable for architectural intent, security, and release decisions.

spechatch enforces Human-in-the-Loop technically, not just by convention:

  1. Explicit Human Checkpoints: Agent skills (spechatch-driven-development) pause for human review after drafting/clarifying a spec and before finalizing commits or merges.
  2. Cryptographic Actor Distinction (human vs. agent / ci): In authenticated Incubator deployments (SPECHATCH_AUTH_ENABLED=true), recording an immutable checkpoint approval (spechatch approve / POST /approvals) requires a human API key. Attempting to approve with an agent or ci key is rejected with 403 Forbidden.
  3. Human-Gated Statuses & Confirmation Targets: Status transitions into approved and done are human-gated, and heavy/sensitive command targets (such as make check or package installations) can require explicit human confirmation (require_confirmation: true).

AI agent pausing at a Human Checkpoint for explicit approval before implementing a spec


4. The Importance of Blueprinting (spechatch create blueprint)

Section titled “4. The Importance of Blueprinting (spechatch create blueprint)”

Before writing your first ten specs, teams need a shared high-level map of the system. Starting with an Architecture Blueprint prevents local optimizations that clash three sprints later.

spechatch includes a dedicated scaffolder that works even before spechatch init:

Terminal window
# Scaffold <slug>-blueprint.md using the built-in architecture template
spechatch create blueprint --name "Payments Platform"
# Or write to a custom path
spechatch create blueprint --name "Payments Platform" --output docs/architecture-blueprint.md

The built-in blueprint guides your team through:

  • Executive summary, goals, and non-goals
  • Architecture & tech-stack trade-offs
  • Data models, API contracts, and security/ops guardrails
  • Proposed repository layout, phased roadmap, and open questions

Every organization has its own RFC / Architecture Decision Record (ADR) style. spechatch create blueprint resolves templates in strict priority order:

  1. Explicit flag: --template path/to/custom-blueprint.md
  2. Repo-local override: .spechatch/templates/blueprint.md (committed to git so the whole team shares the exact same blueprint structure)
  3. Built-in default template

All custom templates automatically support safe placeholder substitution for {{name}}, {{slug}}, {{project}}, and {{date}}.


5. Living Documentation with BDD GIVEN / WHEN / THEN Acceptance Criteria

Section titled “5. Living Documentation with BDD GIVEN / WHEN / THEN Acceptance Criteria”

Just like BDD Gherkin .feature files, spechatch writes Acceptance Criteria in structured GIVEN / WHEN / THEN checkboxes:

- [ ] **AC-1:** **GIVEN** an authenticated developer calling `POST /projects/{slug}/ids` with an `Idempotency-Key`,
**WHEN** the same request is retried after a network timeout,
**THEN** the server returns the exact same allocated spec ID without advancing the counter.

Why this format works so well for both humans and AI agents:

  • Living documentation: Anyone (product managers, QA, new engineers) can read a spec six months later and immediately understand exact system behavior without decoding implementation code.
  • Unambiguous test contract: Each AC-* maps 1:1 to automated unit, integration, or BDD/Gherkin tests — and spechatch forbids marking a spec done until every AC-* checkbox is verified.
  • Built-in BDD support: Enable the bundled acceptance-criteria rule pack and spechatch-bdd-testing skill (spechatch agents add acceptance-criteria spechatch-bdd-testing --sync) to enforce GIVEN / WHEN / THEN across every spec and translate ACs cleanly into reusable .feature files and step definitions.

6. Standing on Proven Foundations: specdriven.ai, TDD & BDD

Section titled “6. Standing on Proven Foundations: specdriven.ai, TDD & BDD”

spechatch synthesizes three proven engineering disciplines into one cohesive workflow:

  • specdriven.ai Lifecycle: Constitute (spechatch constitute) → Specify (spechatch new) → Clarify (resolve [NEEDS CLARIFICATION]) → Plan (plan.md) → Tasks (tasks.md) → Implement → Verify (spechatch verify & spechatch test run).
  • Test-Driven Development (TDD): Reinforced by the bundled tdd-first rule pack and enforced mechanically by spechatch’s non-empty JUnit execution gate (executed_count > 0) — a spec is never marked healthy until real linked tests execute and pass.
  • Behavior-Driven Development (BDD): Expressed through human-readable GIVEN / WHEN / THEN Acceptance Criteria (acceptance-criteria rule pack + spechatch-bdd-testing skill) so specifications double as executable, living documentation.

7. Canonical Command Entrypoints (Makefile / justfile) — No Rogue Agent Commands

Section titled “7. Canonical Command Entrypoints (Makefile / justfile) — No Rogue Agent Commands”

One of the highest-leverage guardrails in spechatch is declaring canonical command entrypoints in spechatch.project.yml:

commands:
strict: true
entrypoints:
- name: make
file: Makefile
invoke: "make {target}"
forbid_raw: [pytest, ruff, mypy]
targets:
test: { description: "Run test suite", require_confirmation: false }
lint: { description: "Run linters and format checks", require_confirmation: false }
check: { description: "Run full quality gate", require_confirmation: true }

Without explicit command governance, AI agents routinely improvise shell commands — invoking bare pytest outside your virtualenv, skipping typechecks or linters, running inconsistent flags across sessions, or executing heavy/destructive commands without asking.

When you run spechatch init --scan and spechatch agents sync:

  1. spechatch detects your Makefile or cross-platform justfile targets automatically.
  2. It generates the managed spechatch-command-entrypoints rule across Antigravity, Cursor, Claude Code, Codex, and Copilot instructing agents to exclusively use your canonical entrypoints and never invoke forbidden raw commands directly.
  3. Targets flagged require_confirmation: true force agents to ask a human before executing them.

Need low-typing sh-* wrappers in your project? Scaffold them in one command:

Terminal window
spechatch create makefile --append # macOS / Linux
spechatch create justfile --append # Cross-platform (macOS / Linux / Windows)