Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

fixture-project

specwright's runnable non-.NET example: a tiny, dependency-free in-memory todo-list library (plain JavaScript, Node.js built-in test runner). It exists to prove two things by demonstration rather than assertion:

  1. /sd:setup and /sd:feature work the same way on a non-.NET stack as they do on .NET.
  2. A committed .specs/ tree, generated by real workflow runs, is a better worked example than a fictional walkthrough (see ../../docs/walkthrough.md for that narrative version).

Layout

src/domain/todo.js               - pure validation + entity shape, no I/O, no imports from outer layers
src/application/todo-service.js  - orchestrates Domain, receives its store via constructor injection
src/infrastructure/store.js      - in-memory storage adapter
src/demo.js                      - tiny CLI demo wiring the three layers together
tests/                           - one test file per source file, using node:test + node:assert/strict

.claude/project-config.json and CLAUDE.md were generated by /sd:setup; .specs/constitution.md declares this project's real architectural rules (not a copy-pasted template). .specs/FEAT-todo-priority/ is a complete, real /sd:feature run - spec through verify - kept as the worked example.

Try it yourself

node --test              # run the test suite (zero dependencies, uses Node's built-in runner)
node src/demo.js          # see the library in action

To run a new spec-driven change against this fixture:

# from the specwright repo root, install the engine somewhere first if you haven't:
#   ./install/install.sh --base-path ~/.claude          (or install.ps1 -BasePath ...)
cd examples/fixture-project
claude
# then, inside the session:
#   /sd:feature <slug>

/sd:setup will report "already set up" here since CLAUDE.md, .specs/, and .claude/ are already committed - that's intentional, so this fixture also serves as a reference for what a filled-in Layer 2 looks like.

Read the worked example

Start at .specs/FEAT-todo-priority/00-spec.md and follow the numbered files through to 06-verify.md - a small, real, layer-crossing change (adding a validated priority field) taken from a one-line ask to a closed-out, reviewed, tested spec.