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

ft-sdd

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

ft-doc-writer-agent

AsciiDoc pages in the product’s docs root

The design of a feature before it is coded

ft-sdd with State: design

The human SDD: one page at one URL, the one you approve before /ft-dev starts. The ft-developer design brief behind it is internal

A letter, a deck, or another Word document in the company template

friendly-branded-docs (skill)

A .docx or .pptx file. ft-sdd uses the same skill to build its document.

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 nav.adoc entry.

audit

The skill runs it first when you ask /ft-docs audit <docs module root>. The skill never stops after the audit alone, unless the module root is dirty.

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, nav.adoc and the repointed inbound links. The agent commits its own files locally.

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?

Audience:

NEEDS_INPUT

I2

Compared with what release?

Baseline:

NEEDS_INPUT

I3

What is delivered, and in which state?

Repo: and State: or Tip:

NEEDS_INPUT

I4

What is in scope?

Scope:

NEEDS_INPUT

I5

What is left out?

Exclude:

Nothing is excluded.

I6

Where do readers test?

Test env:

The document says that no environment was given.

I7

Where is the API described?

API docs:

NEEDS_INPUT

I8

Which config surfaces change?

Config:

The agent derives them from the diff.

I9

Are known issues listed?

Known issues:

list

I10

How long may it be?

Pages:

15 main-body pages

Brief lines

Line Required Meaning

Audience:

yes (I1)

overview (default) for QA and product, or technical for developers and architects, then a dash, the reader and their task. The variant word alone does not answer I1.

Baseline:

yes (I2)

The ref that holds the last release. "Before" means this release. It has no default.

Repo:

yes (I3)

The worktree that the agent reads. It never writes there. It is required in both states. Without it the status is NEEDS_INPUT — I3.

State:

yes (I3), with Tip:

design when the feature is not coded: the agent checks the Today facts at Baseline:. delivered when the code is at Tip:.

Tip:

by State: (I3)

The branch and commit that the facts are checked at, as branch@commit. It must resolve in Repo:, and Baseline..Tip must be a non-empty diff.

Scope:

yes (I4)

The tickets, SOW items or phases that frame the document. The scope always also covers every behaviour change in the diff from Baseline: to Tip:, whatever its ticket. Only Exclude: narrows it.

Exclude:

no (I5)

Features that the document never names, not even as removed.

Test env:

no (I6)

The base URL and the test user names. Never a password, token or key.

API docs:

yes (I7)

The Swagger UI or OpenAPI spec URL, or none. With none, the document states that no description is published.

Config:

no (I8)

The config surfaces that change: config keys, import files, admin UI, tables set by hand.

Known issues:

no (I9)

list (default) lists known issues in the document. omit puts them in the report only.

Pages:

no (I10)

The main-body page cap. Appendices do not count.

Mode:

no

write (default) for a new document or a rewrite. repair verifies and fixes an existing artifact.

Sources:

no

Code paths, run journals, vault notes, real UI captures, spec texts, release notes and README.

Artifact:

for repair

The URL to update in place. Leave it out for a new document. A write run with Artifact: rewrites that document at the same URL.

Feedback:

for repair

The corrections, as a numbered list. The agent checks each one in the code before it applies it.

Golden:

no

Artifact URLs whose structure and depth the document matches.

Pre-show:

no

skip — checkpoint D SOUND <journal path>. The agent verifies the last matching journal block, its verdict form and its sdd: sha before it honours the line. Any other Pre-show: line is not honoured and the check runs. See The pre-show check.

The pair State: and Tip: has these cases:

Brief Result

Tip: and no State:

delivered

State: design, no Tip:

design

State: delivered and Tip:

delivered

State: delivered, no Tip:

NEEDS_INPUT — I3

State: design and Tip:

NEEDS_INPUT — I3: the lines contradict each other

Neither line

NEEDS_INPUT — I3 (a repair reads both from the ledger first)

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

overview

Six chapters: Change list · Requirements coverage · New and changed API · How to configure · Flows · Limits. The rules of each chapter are in deploy/templates/sdd/overview.md; this page does not repeat them.

technical

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 Baseline: to Tip:, numbered C-01 to C-NN. The agent builds it from the code diff, never from journals or earlier documents. An index table (ID, area, change, source) comes first. Each entry then gives Before, Now, where QA sees it (REST path, port, config key, DB table, log line or device CoAP path), how to trigger it, the source tag and the proof (file:line or commit). The chapter ends with a reconciliation against the repo’s release notes and README, whether or not the diff touched them, one row per mismatch. Later sections cite the change ids.

New and changed API

The Swagger or OpenAPI link, or the sentence that none is published. The base URL and test users from Test env:. The auth flow, an endpoint table, the envelope and error codes, and every removed or moved endpoint. The agent checks a spec against the controllers and lists each mismatch.

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

OWNER

The owner or the ticket asked for it. The tag names the item, for example [OWNER SOW 1.3].

SPEC

A spec text says it. The tag names the document and section, and the agent read that text in this run.

SPEC-INFERRED

It follows from a spec but no sentence says it. The tag names the sections, and the sentence says that it is an inference.

DESIGN

The team or the run chose it. The tag names the decision id, and the sentence says it is a design choice.

LEGACY

Unchanged old behaviour that readers will meet. The tag names file:line.

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 technical document. 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 draft overview.

  • An overview does 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 write mode the agent cuts 25 to 30 percent of the words of the first draft and keeps every fact. repair mode 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:

  1. It builds the .docx in 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.

  2. It runs the structure check of the skill. The check must pass.

  3. 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.

  4. It stages the artifact with ~/.claude/ft-sdd/html-page.py: the page renders doc.md as text with a contents rail, numbered sections, links resolved by heading text, tables and code that scroll in place, and .docx and PDF download buttons. It also stages source/doc.md with its figures, which the next update rebuilds from.

  5. It renders the page source with the pinned marked and 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 technical document 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. An overview opens with its title, a kicker line, one subtitle sentence, the > Draft: note if the status is DRAFT, 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 Tip:. If the branch moves during the run, it checks against the new head and says so. A journal or a vault note is only a lead. If the agent cannot confirm a fact, it marks the fact as unverified and lists it under "Open items and unverified facts".

Before means the release

It checks every "before" or "previously" claim at Baseline: with git show <baseline>:<path>. A state that existed only on a development branch never shipped, so it is not a "before".

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 claim → file:line @ <tip> in ~/.local/state/ft-ai-toolkit/sdd/<artifact id>/facts.md. The first run checks every fact. A later run on the same artifact re-checks only the facts whose files changed since their tip (git diff). A changed fact gets a new line that supersedes the old one.

Security

The document has no serials, MACs, IP addresses, device values, customer names or credentials. The only addresses allowed are the Test env: and API docs: URLs. The agent never opens raw customer traces or customer spreadsheets.

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.

  1. Shape check (overview). shape-check.py checks an overview against the rules H1 to H15 of overview.md and prints each break. The check always runs. Without exit 0, nothing is published. A break that needs you comes back as NEEDS_INPUT — shape H<n>; its Design questions: line ends (shape H<n>), and your yes becomes the Feedback: item N. override H<n> — <owner words>. H2 and H15 are never overridable.

  2. Reader test. A fresh general-purpose agent reads only doc.md and does tasks. It runs on Sonnet at medium effort. For overview it 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. For technical the 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.

  3. Source-tag self-check (technical). Every normative rule carries a tag. An untagged rule is a defect.

  4. Pre-show check. See The pre-show check.

  5. Word render. word-pages.py builds and checks the .docx and 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 in doc.md and runs the command again. The same run must report every link resolved.

  6. 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 into doc.md. It runs word-pages.py again, so the page, source/doc.md and the PDF carry the decided doc.md. Then shape-check.py runs a second time with the decided status and must exit 0.

  7. Grep. The agent searches doc.md for 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: design in write mode. It runs on a repair whose feedback changes a design statement: a mechanism, a check, a table read or write, an API answer or a limit. It runs when a Feedback: item says run the pre-show check.

  • When it does not run. A wording-only repair after a checked revision skips it. A Pre-show: skip line skips it, if the agent verifies the journal. The skip matches the SOUND evidence lines block that ft-developer writes. No Pre-show: line turns the check off for a delivered document.

  • Cap. At most 3 checks per ledger. The ledger file preshow.md counts them. run the pre-show check on a lost preshow.md starts a new ledger at check 1 of 3. The owner is asked only on cap 3 reached: a Feedback: item extend the pre-show cap by 1 allows 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

~/.local/state/ft-ai-toolkit/sdd/<artifact id>/

The ledger. It lasts across runs. The id is the last path segment of the artifact URL. It holds facts.md (each checked fact with its source tag, append only), intake.md (the intake answers, State: and Tip:), limits.md (each limit as proposed, accepted or rejected) and preshow.md (one line per pre-show check).

~/.local/state/ft-ai-toolkit/run/<date>-sdd-<slug>/doc.md

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 PUBLISHED <url> <version> line in its state.md), and reads the artifact’s source/doc.md once only when no such directory exists; a read that returns nothing ends as NEEDS_INPUT — base. It reads the whole document once and again only after a real change of pass.

~/.local/state/ft-ai-toolkit/run/<date>-sdd-<slug>/render/

The .docx build’s page images and PDF from Word or LibreOffice: the agent’s layout check, not published.

~/.local/state/ft-ai-toolkit/run/<date>-sdd-<slug>/state.md

The skills digest, the progress, the reader-test record and the handoff.

~/.claude/ft-sdd/

The mirror of deploy/templates/sdd/ that the installer writes. It holds word-pages.py, html-page.py, shape-check.py and the templates that the agent reads when it needs them: overview.md, pre-show.md, intake.md, qa-chapters.md and source-tags.md.

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

friendly-branded-docs (it builds the document), technical-writing (style, truth)

every run

artifact-diagramming, documentation-writer (Diátaxis), doc-coauthoring (refinement and reader testing)

write mode

writing-design-docs

write mode, technical audience

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

PUBLISHED

All gates ran and the page is at the URL.

DRAFT — <gate> not run

The page is published, but the named gate could not run. An overview carries the > Draft: note. The one exception is no PDF renderer at all: nothing is published.

NEEDS_INPUT — <ids>

A required intake answer is missing, for example NEEDS_INPUT — I1, I7. The ids can also be shape H<n>: NEEDS_INPUT — shape H<n> means a shape break that the agent cannot fix without you. Nothing is published, and each break returns as a Design questions: line.

CONTEXT_RESET — <path>

The context passed about 200K tokens. The path is the state.md handoff.

The other fields, in order:

Field Holds

URL, State:, mode, audience, baseline

The artifact URL, design or delivered, write or repair, the variant and the baseline ref.

Sections, words, intake

The section list, the words before and after (in write mode), and each intake answer marked brief or default.

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.

Shape:

ok, ok with the allowed rules, or the number of breaks and their ids.

Pre-show:

ran with the check number out of 3, both verdicts before fixes, and the counts of objections, applied fixes and questions to the owner. Or skipped with the reason. Or NOT RUN with the reason. Each ignored Pre-show: line is added as ignored: <line>.

Word

Pages, renderer, check result, link check.

Corrected facts:

What was wrong in the previous version, with the code that proves it (repair mode).

Design questions:

One yes or no line each, or none.

Limit questions:

One yes or no line each for a proposed limit, or none.

Brief vs code:

A claim in the brief that the code contradicts, with file:line, or none. The document does not write it.

Unverified:

Each fact the agent could not confirm and what would confirm it, or none.

Migrated:

legacy shape when a repair moved an older overview into the six chapters, otherwise no.

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.