ποΈ Interactive Music Sequencer Case B
Build a browser beat-machine: four tracks β drums, vocals, melody, rhythms β that you turn on and off with clear buttons, sliders and switches. Simple to play with, satisfying to demo. You'll build it spec-first.
The seven steps you'll follow
Every case runs the same seven steps, in two phases. The first four happen before a single line of code exists β that's the whole point. How far you push the build is up to you.
- 1Intentwhat problem
- 2Specwhat & why
- 3Plan+ sign-off
- 4Tasksunits of work
- 5Implementagent writes
- 6Verifya check gates it
- 7Reviewa human reads
Guided happy path everyone starts here
Follow the steps in order. Each one ends with a checkpoint β don't move on until you see it.
You decide
Steps 1β4 all happen before a single line of code exists. This is where the thinking lives.
Intent β what problem, is it even worth a spec?
In your workshop folder, start opencode. Ask the facilitator's question: "Could I one-shot this with a single prompt?" Four synced tracks, a loop clock, and on/off controls have enough moving parts that the answer is no. Start by creating agents.md (example) at repo root so rules are explicit: PHP-first where backend/domain logic exists, PSR-aligned standards, minimal JS unless clearly needed, and DDEV for dev/test.
/agents.md exists with project rules.Spec β what & why, as a file
Create spec.md (example) in /.specification/changes/feature-name/ β a file the agent reads every session, not a throwaway prompt. Fill in the skeleton; ask the agent to sharpen it, but you own the decisions.
# spec.md β Sequencer
## Problem
People want to make a beat in seconds, with no music theory.
## Why
A grid of on/off cells is instantly understandable and fun to demo.
## Boundaries
- Four tracks: drums, vocals, melody, rhythms
- Each track toggles on/off with a clear button/switch
- A shared loop plays enabled tracks in time
- One tempo slider
## Done means
Toggling a track on/off is instantly audible in the running loop.spec.md exists in /.specification/changes/feature-name/ and contains only what and why β no implementation.Plan β how, grounded, then signed off
Switch OpenCode to Plan mode (Tab). Ask it to write plan.md (example) in /.specification/changes/feature-name/: which files change, in what order, and the check that proves each part. Keep it grounded and aligned with agents.md: for this case JS is justified for browser audio, but keep it minimal outside that core, and run checks via DDEV.
We're building the app in spec.md. Stay in plan mode.
Write plan.md: files to create, in order, and for each step the
check that proves it works (run checks through DDEV). Use JS for the
audio loop and controls, keep everything else minimal. Do NOT write
code yet.plan.md to a facilitator or a neighbour. "Is this plan right?" Changing your mind here costs a paragraph; after 200 lines it costs a rewrite. This is where review moved to β the moment the whole method is about.plan.md is reviewed, every step names a check, and the DDEV run path is explicit.Tasks β units of work, still no code
The last thing before code exists: turn the signed-off plan into tasks.md (example) in that same /.specification/changes/feature-name/ folder β small, ordered units the agent can execute and you can tick off. Stay in Plan mode.
Still in plan mode β no code yet. Break plan.md into tasks.md
of small tasks, in order, each one something you can verify on its
own. For example:
- [ ] a loop clock ticks at the tempo
- [ ] one track (drums) plays in time
- [ ] toggling a track on/off is audible on the next loop
- [ ] checks run in DDEV and passAgent writes Β· a check gates it Β· a human reads it
Only now does code appear. You already made every decision β the rest is execution and checking.
Implement β the agent writes
Press Tab back to Build mode and let the agent work tasks.md one by one. Keep to agents.md: use JS where it is core to the sequencer, avoid unnecessary JS elsewhere, and run the dev loop in DDEV. Start with the loop clock and one track, then add the rest. Give the agent the acceptance scenario, not a testing lecture:
Add a check for this behaviour:
WHEN the drums track is switched off
THEN the scheduler produces no drum hits on the next loop.
Write it as a runnable test, then implement until it passes.Verify β a check gates it, prose doesn't
Pick one rule that matters and make it a deterministic check, not a polite sentence in the spec. This is the gate the agent has to get past. Run it in DDEV so your check matches the team environment.
Review β a human reads it
You already agreed the plan, so this read is quick β you're checking the agent honoured it, not meeting the design for the first time. Also confirm consistency with your artifacts: agents.md rules followed, spec.md intent preserved, tasks.md executed, and DDEV checks green. This is where you'll often notice the plan was wrong. That's not failure β it's the point, and because you're at review (not release) the fix is a paragraph. A classic one for this case:
plan.mdAmend plan.md and let the agent redo that step. Then record what you couldn't finish β a plan that names its gaps is one a reviewer can trust:
## Done
- four tracks toggle in time, tempo slider works
## Not done, and why
- per-step pattern editing β out of scope for the MVP todayplan.md shows the corrected step and a Done / Not-done block."Waterfall's flaw was never having a plan. It was waiting months to find out the plan was wrong."
Stretch goals finished early? go deeper
All optional. Add each as a new spec requirement + plan step first β keep practising the loop.
- Stop-gate β a check so the agent can't declare itself "done" while any test is red.
- Per-track volume & mute β sliders wired to gain nodes.
- Step grid β a 16-step pattern editor per track instead of a simple on/off.
- Randomise / presets β one-click grooves that fill the grid.
- Save & share a beat β encode the pattern in the URL.
Reflect
You wrote about a page of markdown before any code. Was it worth it here? Would it be worth it for a one-line CSS fix?
Simple tasks need a prompt. Complex ones need a spec. Writing the decision down turns a six-month bet into an experiment you can fail in an afternoon.
Level up β see it as a tool Optional Β· if time permits
Everything you just did by hand, there's a tool for: OpenSpec. Your facilitator may demo this on the beamer β and if the clock beat us to it, no problem, the take-home page below has the whole thing.
/agents.md at root + change files in /.specification/changes/feature-name/ (include the path in session chat)agents.md rules (PHP-first, minimal JS, DDEV)βcarried into proposal.md + design.mdspec.md β what & whyβopenspec propose#### Scenariosplan.md (files, order, checks)βdesign.md implementation plantasks.md checklistβtasks.md in change folder (- [ ] β - [x])openspec applyopenspec archiveopenspec/specs/