Skip to content

About

Minimalist SDD + TDD harness for AI coding agents: vertical slices from idea to release, with frozen acceptance tests and script-checked gates.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spec-harness

A minimalist harness for AI coding agents that combines spec-driven development (SDD) and test-driven development (TDD). It takes small vertical slices from idea to release, with gates checked by a script instead of by ceremony.

Principles

  • Vertical slices. One user-observable behavior per slice, 1–6 acceptance criteria, explicit boundaries and an explicit out of scope.
  • Specs are the contract, tests are the proof. Each acceptance criterion becomes a test before any implementation exists, and those tests are frozen together with their fixtures.
  • Gates, not approvals. A stdlib-only Python CLI verifies every transition. People step in at three checkpoints only: the spec, the acceptance tests and the pull request. A bug fix joins the first two.
  • Process sized to the change. A new behavior is a slice; a bug fix is a small slice with the same gates; a change that keeps behavior needs no slice.
  • Living spec. Closed slices merge into a spec of how the system behaves today, traceable to its tests.
  • One slice, one pull request. Each slice lives on its own branch and is squash-merged as one Conventional Commit carrying a Slice: trailer.
  • Continuous deployment. Every merged slice is a release, cut after the merge: a Semantic Versioning tag whose message carries Keep a Changelog notes, published as a GitHub Release. Nothing is committed to main; CHANGELOG.md is generated from the tags when needed.

Lifecycle

sdd-idea ──► sdd-spec ──► sdd-red ──► sdd-green ──► sdd-close ──► merge ──► sdd-release
(optional)    draft→ready   ready→red    red→green     green→done     squash     tags on main
              + branch                                 + PR
                   ✋            ✋                          ✋

✋ marks a checkpoint: the skill stops and waits for approval. Review changes before the merge go through sdd-revise, on the same branch and pull request. The release runs after the merge, from a CI workflow or locally with sdd-release, and covers every slice merged since the last release.

Bug fixes

sdd-fix takes a bug through a fix slice (track: fix): a short spec, at most two criteria that reproduce the bug, and one checkpoint for the spec and its failing tests together. sdd-green and sdd-close follow as usual. The CLI keeps it small: change is fixed or security, no plan and no new ADR. A fix that outgrows those limits continues as a regular slice.

Changes without a slice

Refactors, docs, CI and dependency updates keep behavior, so they need no slice: one pull request with a Conventional Commit title, which verify accepts as long as lint passes. They ship in their unit's next release without a note. Any change to observable behavior, however small, goes through a slice.

Pull requests and releases

On GitHub, sdd-init proposes two workflows: check runs sdd.py verify on every pull request, so the rules hold even when a skill is skipped, and release cuts the release on every push to main.

Skills

The skills follow the Agent Skills standard and live in .agents/skills/.

Skill Purpose
sdd-init Set up a project: overview, glossary, tests, releases and the AGENTS.md block
sdd-idea Decompose an idea into candidate slices
sdd-spec Write a slice spec and take it to ready, or amend it
sdd-fix Fix a bug through a small slice: short spec and failing tests, one checkpoint
sdd-adr Record a cross-cutting decision, or replace an outdated one
sdd-red Write the failing acceptance tests and freeze them
sdd-green Implement with TDD until the frozen tests and the full suite pass
sdd-close Close the slice, merge it into the living spec and open its pull request
sdd-revise Apply review feedback to a closed slice's pull request before it is merged
sdd-release Release merged slices, check releases, render the changelog and declare 1.0.0
sdd-next Run the next phase of a slice, stopping at checkpoints
sdd-status Report work in progress and what comes next

CLI

.agents/bin/sdd.py owns every status change. Run it with python3, or python on Windows.

Command What it does
init Add the managed block to AGENTS.md and generate the docs index
index [--check] Regenerate the index, or verify it and AGENTS.md are current
status [SLICE] List open slices, or show one slice and its next gate
check SLICE Verify the gate to the next status, running tests when needed
advance SLICE Check the gate and move the slice to the next status
reopen SLICE [--base REF] Send a slice back to draft and unfreeze its tests, if closed only until merged
accept ADR Accept a proposed ADR and supersede the one it replaces
lint Check links, ID references, criterion-to-test traceability and vocabulary
verify [--base REF] [--title T] [--body B] For CI on pull requests: lint, gates still met, slice closed, title in line
next-id {idea,slice,adr} Print the next free ID
pr SLICE [--title|--body] Print the pull request title and body of a closed slice
release [--apply] After merging, tag every slice merged since the last release, with its notes
changelog [--unit U] [--output F] Render CHANGELOG.md from the release tags

Installation

Requirements: git and Python 3.11 or later, on Linux, macOS or Windows. There are no dependencies to install.

  1. Copy the .agents/ folder of this repository into the root of your project. It includes its LICENSE; keep it with the copy.
  2. Point your agent client at .agents/skills/. Client-specific adapters are not provided yet.
  3. Run the sdd-init skill.

In your project, the harness creates its documents under .agents/docs/:

.agents/
  bin/sdd.py        CLI
  skills/           sdd-* skills
  config.toml       tests and release units
  docs/
    index.md        generated map
    overview.md     what the system is
    glossary.md     the system's vocabulary
    ideas/  changes/  archive/  specs/  adr/  runbooks/

Configuration

.agents/config.toml is optional:

[tests]
paths = ["tests"]          # where acceptance tests live
slice = "pytest {files}"   # runs the slice's acceptance tests: {files}, {dirs}, {id} or {ident} select them
full = "pytest"            # runs the full suite
support = ["tests/acceptance/helpers"]   # fixtures and helpers frozen with the acceptance tests
red_exit = [1]             # exit codes of tests that fail on missing behavior (default: any but 0)

[[units]]                  # release units; omit for a single unit tagged vX.Y.Z
name = "api"
paths = ["services/api"]   # tagged api/vX.Y.Z; `sdd.py changelog --unit api` renders its changelog

Development

This repository contains the harness itself. .agents/ is the product; tests/ and .github/ support its development and are not copied into projects.

python3 -m unittest discover -s tests

The CI runs the suite on Linux, macOS and Windows with Python 3.11 and 3.14.

License

MIT

About

Minimalist SDD + TDD harness for AI coding agents: vertical slices from idea to release, with frozen acceptance tests and script-checked gates.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages