Skip to main content
Back to case studies
ai2 min read

AI-assisted engineering: TDD and SDD harnesses

My role & accountability

Designed and use the workflows daily.

Claude CodeMCPTypeScriptVitestPlaywrightPowerShell

Problem

Using AI agents to generate code quickly is easy; maintaining architectural quality, domain accuracy and zero regressions across months on real production systems is hard. Without structure, initial speed turns into technical debt, duplicated logic and subtle bugs caused by model assumptions.

The goal was to turn AI from an ad-hoc "snippet generator" into a predictable engineering process applicable both to enterprise legacy modernization with a lean team and to a live consumer product (Fit Tracker).

Constraints

  • Zero hallucinations on critical infrastructure: when working with enterprise databases, an agent must never guess column names or run destructive mutations autonomously.
  • Context and cost discipline: long sessions without clear boundaries degrade output quality and waste tokens.
  • Objective verifiability: no task can be considered done just because the AI claims it is; every deliverable must pass deterministic checks.

Decision

Trade-off

Chosen

SDD + TDD workflow with deterministic verification gates before commit

Discarded alternative

Ad-hoc prompting directly in the editor without specs or automated checks

Writing a concise spec takes a few minutes upfront, but saves hours of review and prevents AI from building the wrong abstraction at high speed.

AI-assisted engineering loop (SDD + TDD)
  1. Short spec (acceptance + out-of-scope)
  2. Read-only MCP schema inspection
  3. Failing tests first (TDD)
  4. Incremental implementation
  5. Gates (build, lint, tests, parity)

I built and operate daily a combined SDD (Spec-Driven Development) + TDD harness anchored on four pillars:

  1. Spec → Tests → Implementation loop: every change starts with a concise specification (goal, acceptance criteria and explicit non-goals), followed by automated tests and then implementation until tests pass.
  2. Safe inspection via MCP: read-only SQL Server MCP server to inspect real schemas, tables, relationships and query plans before writing any query or data-access code.
  3. Deterministic completion gates: skills and hooks requiring green build, typecheck, lint, unit/E2E tests and — for migrated reports — legacy parity validation prior to commit.
  4. Practical operational automation: applying the same toolkit to remove real bottlenecks, such as structured extraction pipelines turning PDF contract spreadsheets into database-ready loads.

Outcome

  • Adopted daily across enterprise legacy modernization and Fit Tracker in production, as well as this portfolio (verri.dev), whose repository records specs and tests from the very first commit.
  • Significant reduction in rework and contract/schema mismatches, since the agent validates types, queries and tests against real artifacts before wrapping up.
  • Ability to coordinate and ship complex software projects while maintaining consistent code, testing and documentation standards.

What I learned

  • The edge is in the harness, not a magic prompt: structured context, trustworthy read-only tools (MCP) and automated verification gates matter far more than prompt phrasing tweaks.
  • Short specs save hours of review: aligning acceptance criteria and out-of-scope boundaries before coding stops AI from efficiently building the wrong thing.
  • AI-assisted engineering bridges coordination and execution: technical leaders can validate architectural options with tested prototypes while keeping strict visibility over production quality.