A spec-first workflow
for Claude Code
theway writes a spec and an ordered task list before any code, then implements the tasks in your session or through agents that open a reviewed, CI-green pull request.
npx --yes @pixelfactoryio/theway@latest installHow it works
Write the spec before the code
/theway:engineeringinvestigates the request, then writesspec.mdandchange.yaml, and critic agents review them. No code is written in this step: it is the shippedengineeringworkflow, whose steps and prompts you can change.claude — my-api > /theway:engineering add rate limiting to the public API ● Bash(theway context engineering)● Read(src/api/ router.ts) ● Write(~/.theway/ projects/ -home-you-code-my-api/ changes/ add-rate-limit/ spec.md) ● Write(~/.theway/ projects/ -home-you-code-my-api/ changes/ add-rate-limit/ change.yaml) ● Spec and tasks written. Review them before developing.>Facts first
Questions the design depends on are investigated and written into the spec as findings.
Medium and High risks across Time, Autonomy, Mastery and Machine, each with countermeasures.
Ordered tasks
change.yamllists the work as ordered tasks (a light change: 1 to 3 tasks).
Implement task by task
/theway:workflowruns the steps of a YAML workflow: by default it works through the tasks in your session; theagentsworkflow hands them to agents that implement and review locally, then opens a pull request.change.yaml - [x] 1. Add the limiter middleware- [x] 2. Read limits from config- [ ] 3. Return 429 with Retry-Afterclaude — my-api > /theway:workflow --workflow agents add-rate-limit ● Agent(implement add-rate-limit)⎿ committed on add-rate-limit● Agent(review add-rate-limit)⎿ 2 findings, 2 confirmed● Agent(fix add-rate-limit)⎿ 2 resolved● Bash(gh pr create)⎿ PR #42 opened● Bash(gh pr checks 42)⎿ test pass● PR #42 is ready for you to merge.Verified against the spec
Each Success Criterion is reported with the command or test that verified it, or flagged as unverified.
Adversarial review
Reviewer agents try to break the diff; a fix agent addresses confirmed findings, and a fix check confirms them.
CI driven to green
Failed runs are diagnosed from the real error line, within a set number of attempts.
Compose your own workflow
Write a workflow as a YAML file of steps. Each step uses one of your Markdown prompts, and runs in your session or through agents.
/theway:workflow --workflow <name>runs it.workflows/develop-secure.yaml version: theway.workflow/v1beta description: Implement, review with a security lens, audit and open the PRinputs:change: {description: The change to implement, required: true, type: change}runs-on: agentssteps:- uses: prompts/implement.md runs-on: sessionwith:change: ${{ inputs.change }}- uses: prompts/review.md matrix: {lens: [prompts/correctness.md, prompts/ security.md]} with:change: ${{ inputs.change }}lens: ${{ matrix.lens }}- uses: prompts/security-audit.md with:change: ${{ inputs.change }}- uses: prompts/open-pr.md with:change: ${{ inputs.change }}Inline or through agents
Each step runs in your session, where you can steer it, or through subagents. Mix them: implement it yourself, have agents review it, and open the PR.
Steps and prompts you write
A workflow is a flat list of steps, each using a Markdown prompt that answers pass, fail or blocked, with on-fail to fix and retry and matrix to run copies at once. Add a security-audit step, or a security.md lens to the review, and every change that workflow runs gets it.
Your conventions, your git host
Commit messages, branch names and the git host commands live in commits.md and git-host.md, which you replace per project.
Keep the history
/theway:archivemoves a finished change tochanges/archive/, dated, and only when you ask for it by name.claude — my-api > /theway:archive add-rate-limit ● Bash(theway archive add-rate-limit)⎿ Archived: ~/.theway/ projects/ -home-you-code-my-api/ changes/ archive/ 2026-10-28-add-rate-limit Explicit only
"It's merged" or "ship it" never archives a change: you name the change and ask.
No open tasks
Archiving refuses while a task in
change.yamlis not done, unless you accept the open tasks.Dated archive
Every archived change keeps its spec and tasks under a dated folder.
Five commands
- engineeringWrite the spec and ordered tasks for a change, without code; with --light, a short spec and 1 to 3 tasks for a small change with nothing to decide
- workflowRun a workflow of prompt steps, inline or through agents, with the inputs it declares
- documentWrite architecture docs for the project in docs/architecture/
- listList the active and archived changes of the current project
- archiveMove a finished change to changes/archive/ under a dated folder