Plan

prd

The low-level specification of one feature: the behaviour, the requirements, the data and the work items.

Why this skill exists

A plan says what to build. It does not say when the work is complete. Without written requirements, the agent decides the details while it writes code, and a reviewer cannot tell a defect from a choice. This skill writes each requirement with an acceptance criterion that a test can check. It cites the code of today as path:line, so a reader can see what changes.

When to use it

Use it after the one-pager is approved, or when you ask for a product spec or a requirements document. It has two variants: Standard, for a change to a thing that exists, and Greenfield, for a new product with no code to describe.

  1. Find the one-pager. An approved one-pager is the first source. If it is not approved, the agent tells you and recommends that you wait.
  2. Read. The code that the feature touches, the config, and prior art from other products.
  3. Interview. With an approved one-pager, few questions remain. With no one-pager, a PRD is a large task: 11 to 20 questions.
  4. Make the page. prd new writes a small page and links it with the one-pager, in the two directions.
  5. Write the page. The current state, the proposed state, FR and NFR requirements with Given / When / Then criteria, decisions, diagrams and work items.
  6. Build and check. check finds a placeholder, a diagram element with no explanation, and a cited path that is not in the repo.
  7. Offer a design review. When a decision card has two or more real options, the agent offers a design review. It starts one only with your yes. The card then shows "In review" and a link.
  8. Wait for the review. The PRD stays a Draft while a linked review is not applied. prd check refuses the status In review or later until then. After the close, the agent moves the chosen option on each card, with your approval.
  9. Work items. After approval, the agent can make the issues in your tracker. It asks first.

The interview from a real run

The one-pager answered most questions, so the agent found 16 answers and asked 2. The one-pager was In review and not approved. The task told the agent to continue, so the PRD stays a Draft.

The request

write the PRD

The agent found these answers in the repo. It did not ask these questions.

  • There is no approved one-pager for this feature. Do you want one first?

    A one-pager for the feature exists, with the status In review. It is not approved.

    Source skillsaw/one-pagers/2026-12-02-coverage-command/index.html

  • Is this a change to a thing that exists, or a new thing?

    Standard. coverage() and the CLI exist; the feature adds a command and a file writer to them.

    Source packages/test/src/index.ts:142, packages/cli/src/index.ts:153-166

  • Who owns the PRD and approves it?

    Joe Gaudet, the owner of the one-pager.

    Source earlier interview

  • Which customers is this for?

    Developers who test machines with @switchyard-ts/test.

    Source earlier interview (one-pager section 1)

  • Which persons in the company must review this, or get a change from it?

    None. The project has one maintainer and no company teams.

    Source git log (one author), no CODEOWNERS file

  • What does a reader expect that this PRD does not do?

    The 'Not in scope' answer of the one-pager.

    Source earlier interview

  • Which scenario is most important, and which error case must work?

    Main: run the tests, run switchyard coverage, read the transitions that no test took. Error cases from the code: no report file, and a report whose transitions do not agree with the class of today.

    Source earlier interview (UI detail answer), packages/test/src/index.ts:148-155

  • Where does the new logic go in the code?

    The writer goes in packages/test/src/index.ts next to coverage(); the command goes in packages/cli/src/index.ts with its logic in a new packages/cli/src/coverage/ folder, as design/ does. How the data goes from the test run to the CLI is an architecture decision: the adr skill records it.

    Source packages/cli/src/index.ts, packages/cli/src/design/

  • Which data does the feature add or change, and does old data need a backfill?

    One new JSON report file. No model, no table, no backfill.

    Source earlier interview (one-pager section 6)

  • Which screens change, and what shows them in the PRD?

    The three ui/ mock-ups of the one-pager.

    Source earlier interview

  • Which product or UX standard is the best example for this job?

    nyc (raw files, then a report command that merges), @xstate/test version 4 (testModel.testCoverage() in the test process) and WCAG 2.2 criterion 1.4.1.

    Source https://github.com/istanbuljs/nyc, https://xstate.js.org/docs/packages/xstate-test/, https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html

  • Is there a walkthrough of the flow?

    Not yet. The feature is not built, and docs/walkthroughs/ does not exist. The link stays empty while the PRD is a draft.

    Source repo (no docs/walkthroughs folder)

  • How does the feature go to users, and how do we go back?

    The release steps of the one-pager: each slice is a changeset and an npm release by tag.

    Source earlier interview, CONTRIBUTING.md 'Releasing'

  • What is not known and needs research, and what do we want but not commit to?

    One spike: how a page gives data to testem in testem ci (FW-1). Two stretch goals: the --min gate (FW-2) and tracking with no call (FW-3). QUnit browser runs are in scope after the scope answer.

    Source earlier interview

  • Which decisions in this plan had a second good answer?

    DEC-1 surface, DEC-2 runners, DEC-3 transport (it gets the ADR), DEC-4 count of files, DEC-5 if the command loads the machine module.

    Source SWITCHYARD_PLAN.md:241-243, packages/test/src/index.ts

  • Which risk is the largest, and what decreases it?

    The 'Top risk' answer of the one-pager.

    Source earlier interview

A skip rule of the question bank removed these questions.

  • Which endpoints change, and who can call them?

    Skip when the feature has no API: it is a CLI command and a library function.

  • Which teams do the work, and what is the unit of the estimates?

    Skip when the repo has one team: one maintainer.

  • For each regime in the config: does it apply to this change?

    Skip when the answer about sensitive data decides each regime: no sensitive data, and prd.regimes is empty, so the PRD has no compliance section.

The maintainer saw these questions. The first option is the recommended one.

Metric Question 1 of 2

Which result shows, with a number, that the switchyard coverage command of switchyard works?

  • Same counts Recommended Chosen

    For each machine in the test suite of switchyard, the command prints the same state and transition counts as coverage().report() in the test process: 100% agreement, and a test can prove it.

  • Used in the gate

    The gate of switchyard runs the command on its own packages and the guide machines, and the count of machines with a report is the number.

  • No number is known

    The PRD records the metric as an open question and the goals stay in words.

Limit Question 2 of 2

Which limit must the switchyard coverage feature of switchyard keep?

  • Test time Recommended Chosen

    The writer adds 5% or less to the time of pnpm test, measured on the test suite of switchyard; a slow recorder makes people turn it off.

  • Command time

    switchyard coverage finishes in 2 seconds or less for 50 machine classes, measured in a CLI test with fixtures.

  • No new dependency

    @switchyard-ts/test and @switchyard-ts/core get no new runtime dependency; the limit is a count of 0 in each package.json.

  • No limit is known

    The PRD has one NFR with an open question, and the limit is decided before approval.

The agent recorded these assumptions. Nobody answered them.

  • The one-pager has the status In review, not Approved. The skill says: tell the user, recommend approval, and the user can tell the agent to continue. The task of this run told the agent to continue. The PRD stays a Draft.
  • Which personal or sensitive data does the feature touch? None (the recommended option). prd.regimes is empty by default, so the PRD has no compliance section: its security section says that the feature touches no personal data. Nobody asked the maintainer.
  • Prior art: nyc, @xstate/test (version 4) and WCAG 2.2 criterion 1.4.1, from a web search by the agent on 2026-12-02.
  • The walkthrough link is empty: the feature is not built. This is permitted only while the status is Draft.
  • The names toJSON, writeCoverage, CoverageData, switchyardCoverage, SWITCHYARD_COVERAGE_DIR, the file name pattern, the 5 MB limit and the --clean option are proposals of the agent.
  • The error case "no report files" (FR-7) is a choice of the agent from the code.
  • DEC-4 (one file for each process) and DEC-5 (the command does not load the machine module) are choices of the agent from the code.
  • Estimates are points, and the team is "Maintainer".

The artifact from that run

The PRD has 6 diagrams with a Current / Proposed control, and it shows three mock-ups of the one-pager in frames. It links the ADR of its decision DEC-3. Its decision DEC-4 shows "In review": it links the open design review, so the PRD stays a Draft.

The page is 159 kB. It loads the diagram library from one shared file, _assets/mermaid.min.js. Each mock-up frame opens in the state that its title names.

The PRD, liveOpen the full page · The index of the PRDs
The PRD in the light theme at 1280 px
Light, 1280 px
The PRD in the dark theme at 1280 px
Dark, 1280 px
The PRD on a phone at 390 px
Phone, 390 px

The commands

npx @skillsaw/cli prd new coverage-command --title "Switchyard Coverage Command" --owner "Joe Gaudet" --one-pager skillsaw/one-pagers/2026-12-02-coverage-command
npx @skillsaw/cli prd build skillsaw/prd/2026-12-02-coverage-command/index.html
npx @skillsaw/cli prd check skillsaw/prd/2026-12-02-coverage-command/index.html
npx @skillsaw/cli prd build skillsaw/prd/2026-12-02-coverage-command/index.html
npx @skillsaw/cli prd check skillsaw/prd/2026-12-02-coverage-command/index.html

What we learned from this run

The run took 13 minutes of agent time. check passed the first time. The run also found these problems:

Config keys

All keys are optional. The livery keys apply to each page.

KeyDefaultMeaningWho reads it
docs.prddocs/prdThe folder of the PRD pages.CLI
prd.audiences[]The customer groups. With a list, #customers needs data-customers.CLI: src/prd/check-base.ts
prd.regimes[]The compliance regimes of the repo, for example ["HIPAA", "GDPR"]: one row each in #compliance. With no regime, a PRD has no compliance section.CLI: src/prd/check-base.ts, src/prd/new.ts