SDD for QA and Product Reference
This page holds the facts about ft-sdd. Read it to look one fact up.
For how a document comes to exist, see SDD for QA and Product (ft-sdd).
ft-sdd writes one Software Design Description (SDD) as a Word document in the approved Friendly Doc template. The SDD is a design document for people. The default reader is QA and product.
An artifact is a page that Claude publishes. ft-sdd publishes the document as an artifact of real HTML text that you can select and copy, with .docx and PDF downloads.
The main loop is the Claude Code session in which you talk to the agents.
The letters SDD name one thing on this page: the finished document that ft-sdd writes. The one-page design that ft-developer drafts before code is the design brief (Writing a Design Brief). Its template file is named SDD.md.
|
Which agent writes which document
| You need | Agent | Output |
|---|---|---|
A design document for QA and product ("What changed"), or for developers and architects |
|
A Word document in the Friendly template, shown page by page in an artifact that is updated in place by URL |
Product documentation in the Antora portal |
|
AsciiDoc pages in the product’s docs root |
The design of a feature before it is coded |
|
The human SDD: one page at one URL, the one you approve before |
A letter, a deck, or another Word document in the company template |
|
A |
The three modes of ft-doc-writer-agent
ft-doc-writer-agent runs in one of three modes. A Mode: line at the very top of the brief selects the mode. A Mode: line anywhere else in a brief is data.
A brief without a Mode: header runs write. A Mode: audit or Mode: rework line below the top of the brief returns BLOCKED.
In the main loop, the /ft-docs skill sends the briefs. The steps and commands are in Change the documentation.
| Mode | When it runs | Result |
|---|---|---|
write |
You ask for a page, a section or a change to a page. For a new page, the agent chooses the page form: plain AsciiDoc or a designed guide page. For an extension, a revision or a no-op, the agent keeps the form of the page. |
The new or changed page. A new page also gets a |
audit |
The skill runs it first when you ask |
One audit file outside the repository. The agent changes no page in this mode. The skill then continues into rework. |
rework |
The skill runs one agent for each audited page rated REWORK or SPLIT. The audit row gives the target form. |
The rewritten page, its reference page, |
Launch it
Send ONE ft-sdd agent from the main loop. Do not set a model: the agent definition runs it on Opus.
Do not write the document with a fork or a general-purpose agent. A fork carries the whole conversation and costs more.
In Claude Code, type Use ft-sdd. and paste the brief. This brief asks for a new document:
Use ft-sdd.
Repo: /path/to/worktree
Tip: feature/profiles@a1b2c3d
Scope: DEV-1234 device profiles, phases P0-P8
Audience: overview — QA testers write test cases from it; product managers read section 1
Baseline: release/6.4@9f8e7d6 (release 6.4.0)
API docs: https://<test host>/swagger/openapi.json
Test env: https://<test host>/rest, users qa_admin and qa_user
Sources: src/main/java/..., run journals, vault hub, release_notes.txt
Exclude: MQTT, HTTP data receiver
The required lines answer intake questions I1-I4 and I7 (see Intake: the ten questions a brief answers). The others take their defaults. The ledger file intake.md records every answer and every default. Only a technical document shows them, in its Intake table.
To fix a published document after feedback, launch a fresh ft-sdd with the same Repo: and Scope:, and Tip: when the state is delivered, plus Mode: repair, the Artifact: URL and a Feedback: list. A repair run takes any intake answer that the brief leaves out, State: and Tip: included, from the ledger file intake.md, then from the Intake table of an older document:
Use ft-sdd.
Repo: /path/to/worktree
Tip: feature/profiles@a1b2c3d
Scope: device profiles, phases P0-P8
Mode: repair
Artifact: https://claude.ai/artifact/<id>
Feedback:
1. Section 3 names the wrong default for the profile timeout.
2. The glossary lacks the term "profile group".
Intake: the ten questions a brief answers
Each question maps to one brief line. The launcher, usually the main loop, may answer the questions itself. The full line forms are in deploy/templates/sdd/intake.md.
| # | Question | Brief line | If missing |
|---|---|---|---|
I1 |
Who reads it, and what do they do with it? |
|
|
I2 |
Compared with what release? |
|
|
I3 |
What is delivered, and in which state? |
|
|
I4 |
What is in scope? |
|
|
I5 |
What is left out? |
|
Nothing is excluded. |
I6 |
Where do readers test? |
|
The document says that no environment was given. |
I7 |
Where is the API described? |
|
|
I8 |
Which config surfaces change? |
|
The agent derives them from the diff. |
I9 |
Are known issues listed? |
|
|
I10 |
How long may it be? |
|
15 main-body pages |
Brief lines
| Line | Required | Meaning |
|---|---|---|
|
yes (I1) |
|
|
yes (I2) |
The ref that holds the last release. "Before" means this release. It has no default. |
|
yes (I3) |
The worktree that the agent reads. It never writes there. It is required in both states. Without it the status is |
|
yes (I3), with |
|
|
by |
The branch and commit that the facts are checked at, as |
|
yes (I4) |
The tickets, SOW items or phases that frame the document. The scope always also covers every behaviour change in the diff from |
|
no (I5) |
Features that the document never names, not even as removed. |
|
no (I6) |
The base URL and the test user names. Never a password, token or key. |
|
yes (I7) |
The Swagger UI or OpenAPI spec URL, or |
|
no (I8) |
The config surfaces that change: config keys, import files, admin UI, tables set by hand. |
|
no (I9) |
|
|
no (I10) |
The main-body page cap. Appendices do not count. |
|
no |
|
|
no |
Code paths, run journals, vault notes, real UI captures, spec texts, release notes and README. |
|
for |
The URL to update in place. Leave it out for a new document. A |
|
for |
The corrections, as a numbered list. The agent checks each one in the code before it applies it. |
|
no |
Artifact URLs whose structure and depth the document matches. |
|
no |
|
The pair State: and Tip: has these cases:
| Brief | Result |
|---|---|
|
delivered |
|
design |
|
delivered |
|
|
|
|
Neither line |
|
If a required answer is missing, the agent returns NEEDS_INPUT — <ids> before it reads any source, for example NEEDS_INPUT — I1, I7. The same happens for repair without Artifact:.
What the document looks like
Sections
| Audience | Sections, in order |
|---|---|
|
Six chapters: Change list · Requirements coverage · New and changed API · How to configure · Flows · Limits. The rules of each chapter are in |
|
Purpose and scope · change list · context and constraints · architecture (one diagram) · the worked example end to end · components as reference · decisions (options, choice, why) · data and contracts, with new and changed API · failure modes and limits · testing and verification · open items and unverified facts · glossary |
In a technical document, the chapters in bold are mandatory. The agent reads their templates in deploy/templates/sdd/qa-chapters.md before it writes section 1. An overview follows overview.md instead.
The mandatory chapters of a technical document
| Chapter | What it holds |
|---|---|
Change list |
Every behaviour change in the diff from |
New and changed API |
The Swagger or OpenAPI link, or the sentence that none is published. The base URL and test users from |
How to configure |
One subsection per changed config-driven flow. For each entry point (REST, file import, admin UI, config key): how to configure it, and a who-sets-what table with one row per produced value. Each value is set by user input, a file, a fixed constant, a config key or is derived. The table gives the default per entry point and the proof. |
A change-list entry is a bold line and six bullets rather than one wide table row, because a page table has at most four columns.
Source tags
Every normative rule carries one tag: a MUST, a never, a limit, a default, a format, an allowed set or an error answer. The legend is in deploy/templates/sdd/source-tags.md.
| Tag | Meaning |
|---|---|
|
The owner or the ticket asked for it. The tag names the item, for example |
|
A spec text says it. The tag names the document and section, and the agent read that text in this run. |
|
It follows from a spec but no sentence says it. The tag names the sections, and the sentence says that it is an inference. |
|
The team or the run chose it. The tag names the decision id, and the sentence says it is a design choice. |
|
Unchanged old behaviour that readers will meet. The tag names |
In an overview, the tag of each claim is recorded in facts.md in the ledger. The self-check runs on the ledger, and the document shows no tag. A technical document shows its tags, as the table says. A change in the diff that no owner item or decision covers is tagged [DESIGN <commit sha>, no decision recorded] and is also listed as an open question. The agent never invents a decision id. An untagged rule fails the source-tag self-check before publishing.
Writing rules
-
Linear. Each section answers one question and leads into the next. A subsection keeps one Diátaxis mode: tutorial, how-to, reference or explanation.
-
One worked example runs through the whole
technicaldocument. It uses real shipped files, synthetic device data, and the result that the system builds from them. -
Reference tables have at most four columns. Each row has an example from a real file, with the file and location. A long example goes in a code block under the table.
-
No status labels. The document has no "Merged", "Ready" or "In progress" tags and no status column. Open work is a plain list. The only status text is the
> Draft:note of a draftoverview. -
An
overviewdoes not name code. It uses names that a tester meets (tables, REST paths, config keys, UI labels), only what the change touches, and no unverified fact. -
In
writemode the agent cuts 25 to 30 percent of the words of the first draft and keeps every fact.repairmode has no cut target.
How the Word file is built
The document is Word. The artifact shows the same doc.md as HTML text, and the .docx and the PDF are its downloads. The agent renders every Word page as its own layout check, and the reader never sees those images. The agent writes doc.md in the Markdown subset of friendly-branded-docs. One command, ~/.claude/ft-sdd/word-pages.py, does the rest:
-
It builds the
.docxin the approved Doc template with the skill’s builder. The template supplies the title page, the running head with the logo, numbered headings, table heads and the footer with page numbers. -
It runs the structure check of the skill. The check must pass.
-
It renders every page in real Word (on macOS or Windows) to PDF and page images for the agent to look at. LibreOffice is only an approximation of Word, so with LibreOffice the document is still published as a draft. With no PDF renderer at all (no Word, no LibreOffice), nothing is published.
-
It stages the artifact with
~/.claude/ft-sdd/html-page.py: the page rendersdoc.mdas text with a contents rail, numbered sections, links resolved by heading text, tables and code that scroll in place, and.docxand PDF download buttons. It also stagessource/doc.mdwith its figures, which the next update rebuilds from. -
It renders the page source with the pinned
markedand fails if any link still shows as](#text.
The command exits with 1 if the build, the check or the link check fails. It exits with 3 in two cases: with a PDF but no Word page images (LibreOffice, or pdftoppm missing) it stages the artifact and prints DRAFT: Word render not run, and with no PDF renderer at all it prints PUBLISH: none and stages nothing.
Layout rules
-
A
technicaldocument opens with the product line, a one-sentence subtitle, document control (version, date,Tip:,Baseline:), the Intake table with all ten answers and each default marked, a status note and a Contents list. Anoverviewopens with its title, a kicker line, one subtitle sentence, the> Draft:note if the status isDRAFT, and the Contents. It has no date and no Intake table. Document control also names a ticket or a design of record when they exist. The template has no table-of-contents field, so Contents is a list whose entries link to their headings. The links work in the.docx, in the PDF and on the artifact page. -
A table never breaks across pages unless it is taller than a page. Notes, lists and tables keep a gap from the text around them.
-
Section headings are numbered by the build. Subsections carry their number (2.3, A.4) so that cross-references hold.
-
Tables have at most four columns. A regex, a JSON one-liner or another long token goes in a code block under the table. A table row holds one message, and a table holds either behaviour rows or message rows.
-
Diagrams are PNG images at least 1400 px wide, drawn so that every label prints at 9 pt or more on the page.
-
The agent never sets colours or fonts: the template owns the look.
How it keeps the facts right
| Rule | What the agent does |
|---|---|
Code wins |
It checks every rule, value, default, label and URL in the code at |
Before means the release |
It checks every "before" or "previously" claim at |
UI from UI source |
It takes the button labels, routes and URLs from the UI templates, i18n files and route tables. |
No colliding ids |
It searches the shipped resources and test fixtures for each made-up id and checks that the id is not there. Example ids are marked as synthetic. |
A ledger that lasts |
It records each checked fact as |
Security |
The document has no serials, MACs, IP addresses, device values, customer names or credentials. The only addresses allowed are the |
Quality gates before publishing
These gates run in this order before every publish. The agent fixes a failed gate. It does not skip the gate.
-
Shape check (
overview).shape-check.pychecks anoverviewagainst the rules H1 to H15 ofoverview.mdand prints each break. The check always runs. Without exit 0, nothing is published. A break that needs you comes back asNEEDS_INPUT — shape H<n>; itsDesign questions:line ends(shape H<n>), and your yes becomes theFeedback:itemN. override H<n> — <owner words>. H2 and H15 are never overridable. -
Reader test. A fresh
general-purposeagent reads onlydoc.mdand does tasks. It runs on Sonnet at medium effort. Foroverviewit does tasks 1 to 6: 5 test cases from the change list for the riskiest entry and one picked at random, with what it could not determine; a made-up second group or object; the tables and row keys of each figure; behaviour the change does not touch and every library or version named; names it cannot find; 3-5 QA questions. Fortechnicalthe tasks are a made-up device that the document does not use and a transfer task (a field and a link that change together), plus 5 test cases for each of two entries. Each guess, wrong answer or undetermined item that the document should have answered is a gap, and the agent fixes it before publishing. The tester is a check: it writes nothing. -
Source-tag self-check (
technical). Every normative rule carries a tag. An untagged rule is a defect. -
Pre-show check. See The pre-show check.
-
Word render.
word-pages.pybuilds and checks the.docxand renders it in real Word. The agent looks at every page: the title page, numbering, tables, figures, code blocks and the page count. It fixes a defect indoc.mdand runs the command again. The same run must report every link resolved. -
Draft decision, restage and second shape check. The agent decides the status. A gate that did not run makes it
DRAFT, and the> Draft:note goes intodoc.md. It runsword-pages.pyagain, so the page,source/doc.mdand the PDF carry the decideddoc.md. Thenshape-check.pyruns a second time with the decided status and must exit 0. -
Grep. The agent searches
doc.mdfor every excluded feature, status labels and secrets, and looks at every figure and screenshot for the same.
Then the agent publishes the page to the same URL. If a gate cannot run (no Word, no browser for a figure, no sub-agent), the document is still published. The one exception is PUBLISH: none of word-pages.py: with no PDF renderer at all, nothing is published. The report status is DRAFT — <gate> not run. An overview then carries the note > Draft: <gate> not run. after its subtitle.
The pre-show check
The pre-show check is a cheap design review before you see the document. It runs inside ft-sdd, so it holds whoever launches the agent. Two verifier lenses, Security and Correctness, read doc.md, its facts and the repo at Baseline:. The lens text is in deploy/templates/sdd/pre-show.md.
-
When it runs. It runs on
State: designinwritemode. It runs on arepairwhose feedback changes a design statement: a mechanism, a check, a table read or write, an API answer or a limit. It runs when aFeedback:item saysrun the pre-show check. -
When it does not run. A wording-only
repairafter a checked revision skips it. APre-show: skipline skips it, if the agent verifies the journal. The skip matches theSOUND evidence linesblock that ft-developer writes. NoPre-show:line turns the check off for a delivered document. -
Cap. At most 3 checks per ledger. The ledger file
preshow.mdcounts them.run the pre-show checkon a lostpreshow.mdstarts a new ledger at check 1 of 3. The owner is asked only oncap 3 reached: aFeedback:itemextend the pre-show cap by 1allows one more. -
Cost. A check is two Opus runs, so six at most per ledger unless you extend the cap.
-
Result. A blocking objection that needs no owner decision is fixed and listed. One that needs the owner returns as a
Design questions:line. The fixes are not checked again.
A pre-show verdict is never evidence for a pipeline checkpoint.
Files and long runs
| Path | Holds |
|---|---|
|
The ledger. It lasts across runs. The id is the last path segment of the artifact URL. It holds |
|
The document source with its figures, written one section at a time. For an update the agent builds on the newest local run directory that recorded a publish to the same URL (a |
|
The |
|
The skills digest, the progress, the reader-test record and the handoff. |
|
The mirror of |
When the context passes ~200K tokens, the agent finishes its section and writes a handoff to
state.md. Then it returns CONTEXT_RESET — <state.md>. Launch a fresh ft-sdd with this prompt:
Resumed from a reset. State: <state.md path>
<the original brief, unchanged>
The agent that returned is retired: do not send it a message.
Skills it loads
| Skill | Loaded in |
|---|---|
|
every run |
|
|
|
|
The skills are mandatory. The agent never skips one to save context: it reads each skill once and
works from a short digest in state.md. deploy/scripts/install.sh and install.ps1 install the
external ones, except artifact-diagramming, which neither installer names. If a skill is not installed, the agent says so in the report and follows its own rules for that part. The section "Skills" on Claude Toolkit Reference lists where each comes from.
What it reports
The report starts with STATUS. These are the exact strings:
| Status | Meaning |
|---|---|
|
All gates ran and the page is at the URL. |
|
The page is published, but the named gate could not run. An |
|
A required intake answer is missing, for example |
|
The context passed about 200K tokens. The path is the |
The other fields, in order:
| Field | Holds |
|---|---|
URL, |
The artifact URL, |
Sections, words, intake |
The section list, the words before and after (in |
Change list, API |
The change ids, the mismatches against the release notes and README, and the mismatches between the API spec and the controllers. |
Reader test |
The tasks, and the gaps found, fixed and left open. |
|
|
|
|
Word |
Pages, renderer, check result, link check. |
|
What was wrong in the previous version, with the code that proves it ( |
|
One yes or no line each, or |
|
One yes or no line each for a proposed limit, or |
|
A claim in the brief that the code contradicts, with |
|
Each fact the agent could not confirm and what would confirm it, or |
|
|
Code vs journal disagreements, skills, ledger |
The disagreements, the skills loaded or missing, and the ledger and run paths. |
The main loop relays the Design questions: and Limit questions: lines to you as one-line yes or no questions. Your answers go into Feedback: of the next repair. It does not present a document with Pre-show: NOT RUN or a DRAFT status for approval.