The code shows what a team chose. It does not show what the team did not choose, or why. An
agent that reads the code a year later can undo a decision, because nothing told it the
reason. This skill writes the reason next to the code. An ADR has two options or more, with
the cost of each, so a reader sees that the team made a choice.
When to use it
Use it for a decision about architecture: a runtime, storage, a boundary, a protocol or a
library. One decision is one ADR. A decision about product design goes into the
PRD.
Read. The request, the ADRs near the decision, and the code. The agent collects path:line references.
Interview. One decision is a medium task: 4 to 10 questions, and fewer when a PRD gives the context.
Make the page.adr new gives the next number, from 0001. With --prd, it links the PRD in the two directions.
Write the page. The context, the drivers, the options with advantages and disadvantages, a matrix of drivers and options, the decision, the consequences, and how the team confirms it.
Build and check.check finds fewer than two options, an option with no disadvantage, and a matrix cell with no score.
Status. Proposed, then Accepted or Rejected. A later decision gets a new ADR that supersedes this one.
An ADR starts no review of its own. When a closed design review
compared the options, the agent cites it as evidence: the link in the Related cell, and the
result in the drivers or the matrix. ADR-0001 below has no review: the maintainer chose its
option in the interview.
The interview from a real run
This ADR is for decision DEC-3 of the PRD. Look at the first two questions. The recommended
option that the maintainer saw is not the first option of the list. An earlier free-text
answer, in the one-pager interview, changed it.
The request
record the architecture decision on how coverage data gets from a test run to the CLI
The agent found these answers in the repo. It did not ask these questions.
Is this ADR for a PRD?
Yes: the PRD of the switchyard coverage feature, from the planning chain. adr new gets --prd.
Source task brief, earlier interview
What makes the decision necessary now?
The plan deferred the command because it 'needs reports serialized from test runs'. coverage() keeps its data in two Set objects in the test process and writes no file.
D-1 works in each runner (3 of 3 cases). D-2 no change to tests (0 new lines). D-3 no new code in core (0 lines). D-4 correct counts with parallel workers.
OPT-1 explicit write call in the tests. OPT-2 a Vitest setup file and reporter with automatic tracking. OPT-3 the CLI runs the test command and sets an environment variable. Today: no file at all (the report is in memory).
The costs that the agent found for each option (for example: OPT-2 adds a process-wide hook to core and supports Vitest only; OPT-1 needs a call in each test file). Recorded as an assumption that the user can correct.
Source code (assumption)
How does the team confirm that the code obeys the decision?
A test: a CLI test in packages/cli/tests/ runs a fixture test run and reads the report, as the repo does for each phase (TDD, fixtures in packages/cli/tests/fixtures).
A skip rule of the question bank removed these questions.
Is this an architecture decision or a product decision?
Skip when a PRD links the decision as a technical one: DEC-3 of the PRD.
Who decides?
Skip when the user is the only maintainer.
Does this ADR replace an older one?
Skip when no ADR is near the decision: this is the first ADR of the repo.
The maintainer saw these questions. The first option is the recommended one.
Top driverQuestion 1 of 3
For the switchyard decision on how coverage data goes from a test run to switchyard coverage: which property is most important when two properties disagree?
No change to tests
Tests that exist need no new call; the plan deferred the command because the report step was missing, so the step must cost the user nothing.
Works in each runnerRecommendedChosen
The same method works for Vitest, QUnit in a browser and other runners; it costs an explicit call in the tests.
No new code in core
@switchyard-ts/core gets no process-wide tracking hook; all new code stays in the test package and the CLI.
No order
All properties have the same weight, and the decision text says what each option gives away.
Note. The maintainer saw this question after the scope answer "Should support all test runners": "Works in each runner" was then the first and recommended option. The options here are the ones of the read-first phase.
DecisionQuestion 2 of 3
Which option does switchyard choose to get coverage data from a test run to switchyard coverage?
Vitest setup and reporter
A setup file tracks each machine automatically and a reporter merges the workers into one file; best on 'no change to tests', but it supports Vitest only and adds a hook to core.
Explicit write callRecommendedChosen
The test code calls a write function after the run; it works in each Node runner and adds nothing to core, but each test file needs the call.
The CLI runs the tests
switchyard coverage -- <test command> sets a variable and merges the files of each process; no reporter is necessary, but core or the test package must write a file when a process stops.
Note. Asked as: the test code calls a write function after the run; in Node it writes a file, in a browser it gives the JSON to the reporter of the runner.
RevisitQuestion 3 of 3
After switchyard publishes the coverage report format, what makes you look at this decision again?
A runner requestRecommendedChosen
A signal that you can count: the first GitHub issue that asks for coverage from a runner that the chosen option does not support.
A date
You review the decision at the next minor release of @switchyard-ts/cli, with or without a signal.
Not possible to go back
The report file format is a public contract after the release; the ADR says that only a major version can change it.
The agent recorded these assumptions. Nobody answered them.
The four drivers and their measures are what the agent found in the code and the PRD.
The costs of each option are what the agent found in the code. Nobody asked the maintainer.
Confirmation is by tests (the recommended option). Nobody asked the maintainer.
The status is Proposed. The maintainer chose the option in the interview but did not read the page.
How testem gives the JSON to its Node side is not known. The spike FW-1 of the PRD finds it.
The artifact from that run
ADR-0001 compares three options against four drivers. Its status is Proposed: the maintainer
chose the option in the interview but did not read the page.
The page is 101 kB. The first copy was 3.7 MB, for the same reason as the PRD example.
After the ADR, the agent built the PRD and the one-pager again, because the links between the three pages changed.
$ npx @skillsaw/cli adr new coverage-data-transport --title "Coverage Data Goes to the CLI Through an Explicit Write Call" --owner "Joe Gaudet" --prd skillsaw/prd/2026-12-02-coverage-command --decision DEC-3
$ npx @skillsaw/cli adr build skillsaw/adr/0001-coverage-data-transport/index.html
$ npx @skillsaw/cli adr check skillsaw/adr/0001-coverage-data-transport/index.html
$ npx @skillsaw/cli adr build skillsaw/adr/0001-coverage-data-transport/index.html
$ npx @skillsaw/cli adr check skillsaw/adr/0001-coverage-data-transport/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
$ npx @skillsaw/cli one-pager build skillsaw/one-pagers/2026-12-02-coverage-command
$ npx @skillsaw/cli one-pager check skillsaw/one-pagers/2026-12-02-coverage-command
$ npx @skillsaw/cli index all
What we learned from this run
The run took 3 minutes of agent time, because most content came from the decision card of the PRD.
Fixed: a diagram that cited a requirement of the PRD made adr check fail.
The check gave 7 lines such as "links unknown requirement FR-2". Now the check reads the
requirement IDs of the linked PRD. The diagram of this example has no such citation: the
first run removed them, and nobody put them back.
Fixed: the chain had no order for a decision that needs an ADR.
The PRD needs a chosen option, but the user chooses it in the ADR interview, which comes
later. The agent went back to the PRD by hand. Now adr new --prd <dir> --decision DEC-n
writes the link on the decision card.
Fixed: the title rule and its example did not agree.
The skill said "a short name, not a sentence", and its example was a sentence. The skill
now says that the title states the decision in a few words.
Config keys
All keys are optional. The livery keys apply to each page.
Key
Default
Meaning
Who reads it
docs.adr
docs/adr
The folder of the ADR pages.
CLI: src/core/config.ts. Write the six folders with docs set.