Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
description: Deliver a docs/plans plan end to end — settle open questions, implement with the changed specs green locally and the full suite on CI, two code reviews plus a simplify pass, a migrated and seeded QA environment ready to start, schema review, and an open, monitored pull request on spree/spree. argument-hint:
Implement a plan from docs/plans/ end to end — from reading it to an open,
monitored pull request on spree/spree with an environment prepared for manual QA.
Plan: $ARGUMENTS (a plan filename or slug; if empty, list the plans in
docs/plans/ whose status shows unbuilt work and ask which one)
How this run works
The goal is to deliver the plan autonomously and hand the user a finished result: a migrated and seeded worktree the user can start with one command, a reviewed and tested branch, an open pull request, and QA instructions — all in one run, without the user steering it. Do not leave servers running: the user starts them when they sit down to test, and an idle Rails, Vite and Next stack per worktree is what exhausts the machine when several runs are active.
- Stage 2 (open questions) is the only point where you stop to ask. After the answers are recorded, run every remaining stage without checking in. Routine judgment calls (a column name, a spec's shape, which sample records to seed) are yours to make; note them for the final report instead of asking.
- Stop early only for a destructive action the plan does not call for, or a blocker only the user can clear (missing credentials, a permission error, a CI failure you cannot reproduce locally). Say what blocked you and what you finished before it.
- Do every stage in order and do not skip one because it looks unnecessary. Each stage has a clear "done" condition; move on only when it is met.
- Work happens in a git worktree (
wt switch -c <branch>), never onmain. The branch name is the one Linear generates for the plan's issue (gitBranchNameon the issue, shaped likefeature/v-1234-b2b-order-documents), so Linear attaches the branch and the pull request to the issue on its own. Without a Linear issue, fall back to afeature/,fix/orchore/branch named after the plan. - The plan's trackers move with the run: the Linear issue goes to In Progress when implementation starts and to In Review when the pull request is open; the pull request carries the Linear id in its title.
- Keep servers running at the end. The user opens the URLs from the report; shutting the environment down is their call, not yours.
1. Read the plan carefully
- Read the plan file in full. Then read every plan it links to or names
and the dated entries in
docs/plans/decisions.mdthat touch it. - Work out exactly what is still unbuilt: which phases are marked implemented, which are pending, what "6.0 scope" versus "6.1 scope" means for this run. Confirm claims of "shipped" against the code — grep for the classes and migrations the plan says exist.
- Collect every constraint that applies: the plan's own Constraints on Current Work, plus the constraints of other plans that mention the same models, tables or endpoints (a plan is bound by its neighbours' rulings too).
- Write down, in your own words, the list of deliverables before touching code. If the plan has phases, say which ones this run covers. The default is everything the plan targets for the current release.
- Read the plan's
**Tracking:**header and note the Linear issue id (V-NNNN) and the GitHub issue number: every later stage refers to them. If the line is missing or saysLinear —/GitHub —, open the missing tracker now following "Tracking the plan in Linear and GitHub" in/project:create-planand write it into the header — the branch name in stage 3 comes from the Linear issue. If the Linear MCP tools are not available in this session, carry on without the Linear steps and list them in the final report as work left for the user.
2. Settle open questions interactively
If the plan's Open Questions section is not empty, or the reading raised a
decision the plan does not make, resolve them before implementation with
the AskUserQuestion tool:
- Ask them together in one call where possible (up to 4 per call), each with
2–4 concrete options, your recommendation first and marked
(Recommended), and the cost of each option in its description. Usepreviewto show the code, schema or config shape an option implies. - Record the answers the way
/project:update-plandoes: move each resolved question into Key Decisions with today's date and the reasoning, add accepted trade-offs to Constraints on Current Work if they bind other code, add a dated entry todocs/plans/decisions.mdfor anything other plans will need to reference, and updateLast updated.
Do not pick answers silently and do not defer a question you could ask now. A question that genuinely cannot be answered yet stays in Open Questions with the reason.
3. Implement
- Before the first commit, set the Linear issue's status to In Progress
(
save_issuewithstate: "In Progress") and set the plan's own status line toIn Progressnaming what this run builds, so the plan, the tracker and the branch agree about what is underway. Create the worktree on the issue'sgitBranchName(read it withget_issue). - Start with
/goalso the run has a stated goal to check itself against: the deliverables from stage 1 plus green changed specs and green CI. - Follow the plan's phase order and every convention in the
AGENTS.mdfiles (models, migrations, API controllers, serializers, dashboard, translations in every locale, type generation pipeline when serializers change, OpenAPI regenerated from the integration specs — never edited by hand). - Test in two passes, always before moving on:
- Affected code first, locally.
pnpm test:changedruns the specs for the files this branch changed, engine by engine, at low priority (pnpm test:rspec <engine> <paths>for a hand-picked set;pnpm test/pnpm exec tsc -bin a package). Iterate here until green — this is the fast loop. Read the "changed without a matching spec" list it prints: a factory, a migration or a base class touches everything and is what the next pass is for. - Then the full suite, on CI. Push the branch and watch the checks
(
gh pr checks --watchonce the PR exists, orgh run watch). The laptop runs many sessions at once; a full local suite is only for reproducing a CI failure, and then it goes throughpnpm test:rspec <engine>, which queues behind the other sessions' suites. Re-run any failing example on its own before investigating — confirm it really fails. For the TypeScript packages:pnpm turbo lint typecheck test build --forcefrom the repo root (the--forcematters — a cached run reads the SDK's staledist). If the dashboard changed, run the affected Playwright specs withpnpm wt:e2e <spec>.
- Affected code first, locally.
- Commit as you go in logical units. The commit body says what and why, never
how; use
git commit --fixupfor follow-ups to a change and squash them before opening the PR. NoCo-Authored-Byor "generated with" trailers.
Done when: every deliverable from stage 1 exists, the changed specs are green locally and CI is green on the pushed branch.
4. Code review — first round
Run /code-review on the branch. Fix every confirmed finding, re-run the
affected specs, commit. A finding you disagree with gets a one-line reason in
your notes for the final report, not silence.
5. Simplify
Run /simplify on the changed code. Apply the cleanups it proposes that keep
behaviour identical; re-run pnpm test:changed after, push, and let CI cover
the rest of every engine or package the simplification touched.
6. Code review — second round
Run /code-review again on the result. Fix what it finds. Done when a review
round comes back clean or with findings you have explicitly decided not to act
on (and can justify).
7. Prepare the application for manual QA
Get this worktree's environment ready so the user can start it and try the feature by hand. Prepare it; do not leave it running:
- If the change added migrations:
cd server && bin/rails spree:install:migrations db:migrate, thenpnpm wt:templateso future worktrees inherit the schema. - Seed whatever the feature needs to be visible. Sample products and images:
cd server && bin/rails spree:load_sample_data. Sellers:bin/rails spree:sellers:sample_data. Anything feature-specific (a company, a catalog, a price list, a delivery method) — create it through the Admin API or abin/rails runnerscript so the QA path starts from real records, and note what you created. - Prove the environment boots without leaving a server behind:
cd server && bin/rails db:abort_if_pending_migrationsand abin/rails runnerthat reads one of the records you seeded. A worktree you did not check is not ready. - Do not start
pnpm wt:dev,wt:dashboard,wt:storefrontorwt:sellerfor the handover. If you started one earlier to check something in a browser, stop it before moving on; the user starts the servers when they come to test.
8. Schema review
Run /schema-review for the branch. It publishes the ERD and lifecycle
artifact for the reviewer; keep the URL for the report. If the change touched
no migrations the review will say so — run it anyway, "no schema change" is a
useful thing for a reviewer to have verified.
9. Report for manual QA
Print, in one block the user can act on directly:
- How to start it — the exact commands for this worktree (
pnpm wt:dev,pnpm wt:dashboard, pluspnpm wt:storefront/pnpm wt:sellerwhen the plan touches them) and the URLs they will serve (scripts/worktree/lib.shhasrails_url,dashboard_url,storefront_url,seller_url). Also Mailpit (http://localhost:8025) when the feature sends email. - Credentials — admin
[email protected]/spree123unless the seed was run with other values; any seller, customer or company account you created for the QA path, with its password. - QA instructions — a numbered walkthrough per deliverable: where to click, what to enter, what the expected result is, and what would count as a failure. Include the negative cases the plan cares about (a cross-store id must 404, an invalid quantity must be refused with a message, and so on). Skip this only when the change has no user-facing surface, and say so.
- The schema-review artifact URL.
10. Open the pull request and monitor it
- Squash fixups, then run
/open-pr. It runs the security review, records the reviewed commit, opens the PR and starts monitoring it. The title ends with the Linear id in parentheses, the way the repository already does it:Add order stages to the dashboard (V-1234). The body: what the change does and why, which plan it implements and which phases, the decisions settled in stage 2, how it was tested, and the QA walkthrough from stage 9. Link the plan file. Reference the trackers on their own lines:Linear: V-1234andCloses #NNNNwhen this PR completes everything the plan targets for the release, orPart of #NNNNwhen later phases remain, so GitHub does not close the issue early. Keep implementation detail out of it. - With the PR open, move the Linear issue to In Review and attach the PR
URL to it through
save_issuelinks(Linear usually picks the PR up from the branch name, so check the issue first and add the link only if it is not already there). Comment the PR URL on the GitHub issue so a reader coming from the Roadmap finds the code. When the PR merges, the plan's status becomesImplementedthrough/project:update-plan, which moves the trackers to Done and closes the GitHub issue. /open-prends by running/autofix-pr, which watches review comments (humans, Bugbot, CodeRabbit) and CI. Stop and report clearly if something needs the user — a required review, a failing check you cannot reproduce locally, a permission error.
Final report
End with a summary that stands on its own: the PR URL, the Linear and GitHub issue links with the status each is in, what was built (by deliverable), the decisions recorded, the review findings acted on and the ones deliberately skipped, the QA block from stage 9, and anything left for a follow-up with the reason.