The SDLC pipeline
SDS: design
Architecture, design components, decisions, APIs and data model, with the diagrams that explain them.
16 min read7 sections
The SDS step designs the system on top of the approved Technical Architecture. The agent, working as an architect, breaks the system into design components, splits each one into ticket-sized implementation units, records the architecture decisions, and writes the Software Design Specification with the diagrams that explain it. Before the run ends, the bridge checks that every requirement is implemented by a component and one of its units. The API Contract is written from this design, and the STS, Tasks, Threat Model and Traceability all refer back to its ids.
What you get
A Markdown document titled Software Design Specification. The bridge adds the title block on top, and after the architect's text it adds two tables built from the checked design, then the version history:
| Order | Section | Written by |
|---|---|---|
| 1 | Title block: project, client, version, date | Bridge |
| 2 | 1. Architecture Overview: a stakeholders and concerns table, the style and why it fits, and an architecture flowchart | Agent |
| 3 | 2. Design Components: one sub-section per DC-NNN with its purpose, responsibilities, interfaces, data stores, requirements, dependencies and a table of its implementation units | Agent |
| 4 | 3. Architecture Decisions: context, options considered, decision, consequences | Agent |
| 5 | 4. Data Design: an entity-relationship diagram with attributes, the tables, integrity and capacity rules, and a data-flow diagram | Agent |
| 6 | 5. Interface Design: the endpoints table, error responses, sequence diagrams, integrations | Agent |
| 7 | 6. Deployment: environments, hosting, observability, release and rollback, and a deployment diagram | Agent |
| 8 | 7. Security Design: authentication, authorization, tenant isolation, data protection, audit logging | Agent |
| 9 | 8. Open Questions | Agent |
| 10 | Design Component Catalogue: id, component, type, interfaces, requirements, number of units | Bridge |
| 11 | Requirements Traceability: each requirement, its title, its priority, the components that implement it and its coverage status | Bridge |
| 12 | Version History | Bridge |
The bridge looks for the headings Architecture Overview, Design Components, Architecture Decisions, Data Design, Interface, Deployment and Security, at least three Mermaid diagrams, and a mention of every design component id. A section that genuinely does not apply (no database in a client-only app, for example) should say so in one sentence rather than invent content.
The Catalogue and Traceability tables are the implementation-level truth. They are built from the design that went through the coverage check, not from the architect's prose, so the document cannot claim a mapping no component implements. Editing the draft leaves them as the bridge wrote them.
Before you run it
- The TAD must be approved. Until it is,
/sdsis locked with "Approve Technical Architecture to unlock this". A project whose SDS predates the TAD step keeps its SDS, see How the pipeline works. - The project state must hold the SRS and a non-empty requirement list. Otherwise the run stops with a message that starts "artifacts.srs missing" or "requirements[] is empty" and ends "run /srs first."
Spend a few minutes on the inputs, because the design can only be as good as they are:
- Requirements. Every requirement the design must cover needs a clear title and testable acceptance criteria. A requirement you do not want designed should carry the priority "won't have" (ideally with a reason) or the status deferred or rejected, so the coverage check excludes it on purpose instead of reporting it as a gap.
- Constraints. Hosting, mandated technology and licence limits belong in the SRS constraints and in the TAD. The architect reads both.
- Team roles. Each component is assigned a role from the roles Scope defined (by default
architect,seniorDevandjuniorDev). Check Scope's roles before you run if your team uses different ones. - The TAD. Read it once more. The SDS builds on it, and anything you want changed in the stack or the service boundaries is cheaper to change there than here.
How the SDS relates to the TAD
The SDS reads the approved TAD as a source document, exactly as people reviewed and edited it, together with the approved Scope and SRS. It does not read the TAD's typed decisions or UI surfaces, only the text. The architect is told to design on the TAD's decisions: components sit inside its deployable units, use its data stores and integrate its third-party services, and the SDS decisions refine the TAD rather than reopen it. It is told never to contradict the TAD, and where the TAD leaves something open, to decide it in the SDS and say so. If you approve a changed TAD after the SDS exists, the SDS is flagged stale and you re-run it, see How the pipeline works.
How it works
The step calls the sdlc-architect skill for the design alone, as JSON, and checks it. Only then does it ask for the document, in three parts that are written together. A correction therefore rewrites only the design, never the whole document. The architect gets one attempt at the design by default (ALARA_CORRECTION_MAX_ATTEMPTS, 1 to 5): a design that fails a check is kept with the problems listed, and Fix failed checks sends a revision that shows the architect the components the checks name in full and the others only as an index, and returns only what changes.
- Requirements, constraints, assumptions and approved TAD to sdlc-architect, design only
- sdlc-architect, design only to Repair enum spellings and requirement ids
- Repair enum spellings and requirement ids to Contract checks and document checks
- Contract checks and document checks to Any problem?
- Any problem? to Write the document in three parts, No
- Any problem? to Send every problem back as a patch, Yes, attempts left
- Send every problem back as a patch to sdlc-architect, design only
- Any problem? to Contract problem left?, Yes, out of attempts
- Contract problem left? to Run fails, Yes
- Contract problem left? to Write the document in three parts, No, document problems only
- Write the document in three parts to Markdown checks, one more pass if needed
- Markdown checks, one more pass if needed to Write sds-vN.md and save the design to state
The architect receives every validated requirement (with priority and acceptance criteria), the SRS constraints and assumptions, the project and client names, and, on a Request changes run, your change list. For a project built on an existing repository (or a new system once its repository holds code) it also receives a summary of the indexed repository and a map of its services, data stores and routes. It is told outright that every requirement not marked "won't have" must be listed on a component and implemented by one of that component's units, and that mentioning a requirement only in the text does not count.
It returns design components, architecture decisions, API endpoints, database tables and open questions. Before any check, the bridge maps loose spellings onto the allowed values ("REST" becomes api, "Medium" becomes average) and widens each component's requirement list to include every requirement its units carry, so a unit's requirement is never silently lost.
On a correction the architect is given its own previous design and every located problem, and returns only what changes. The bridge lays that patch on the previous design.
The checks on every attempt
There are two kinds. Contract checks guard the data later steps read (the design's shape, its units and the requirement coverage). If one fails, the design is kept with the problems listed, and you approve it as it is or press Fix failed checks; only a reply with no design at all stops the run. Document checks are quality checks. If one fails, the design is accepted and the problem is listed above Approve for you to judge.
| Kind | Check | What it enforces |
|---|---|---|
| Contract | Component shape | Every component matches the design-component schema: id DC-NNN, at least one REQ id, type, complexity and interface kinds from the allowed lists, risks written as risk and mitigation pairs. |
| Contract | Implementation units | Every component has at least one unit. A unit's requirements are a subset of its component's, and together they cover all of them. Unit ids are globally unique and prefixed by their component. Every dependsOn resolves. The unit dependency graph has no cycle. |
| Contract | Dependencies | Component-level dependencies are derived from the unit edges. The agent does not author them. |
| Document | Component graph | The component dependencies those unit edges collapse to have no cycle. |
| Document | Assigned roles | Every component names a role that exists in the project's team roles. |
| Document | Architecture decisions | Every decision cites at least one existing requirement id and has exactly one selected option. |
| Document | Coverage | Every requirement is covered, see below. |
| Document | Markdown | Required headings, three diagrams, every component id cited, diagrams that start with a diagram type, closed code fences, a size limit of 600 KB, and no sign-in, password or mail design built into the product when Poly-X provides it. |
The skill asks for at least three options per decision, each with a rejection reason. The bridge enforces only the requirement ids and the single selected option, so read the options yourself.
The coverage check sorts each requirement into one of four states:
| Status | Meaning |
|---|---|
| Covered | A component lists it and one of that component's units implements it. |
| Partial | A component claims it but none of its units implements it, or a unit implements it but its component does not list it. |
| Uncovered | Nothing in the design references it. |
| Excluded | Deliberately outside the design: priority "won't have", or status deferred or rejected. Not counted against the design. |
The design is complete when nothing is partial or uncovered and nothing references a requirement the SRS does not define. The one-line summary, "Requirements Coverage: X/Y Covered, U Uncovered, P Partially Covered", is part of the run's completion message, and the Requirements Traceability table shows each requirement's status. The reason for an excluded requirement is kept with the coverage record in the project state. The table itself shows only the status.
Once the design has passed, the document is written in three parts at the same time: the overview, the design components, and sections 3 to 8. Each part is given the whole approved design, so names, ids and endpoints agree. If the joined text fails a Markdown check, one more pass runs with the problems named, and the better of the two texts is kept.
After the document is written, the bridge saves the design into the project state and confirms every unit and dependency survived the save unchanged. It then fills in, on each requirement, the list of components that implement it.
The run panel shows: Checking project state, Designing components, Writing the design document, Validating the design, Checking requirements coverage, Writing the Markdown document, Persisting to project state.
Ids this step owns
| Id | Meaning |
|---|---|
DC-NNN | A design component: a service, module, API, database, job, integration, UI and so on. Becomes an epic in Tasks. |
DC-NNN-MM | An implementation unit inside component DC-NNN: a table, endpoint, worker, event handler, UI component or module. Becomes one ticket. |
A unit carries a contract (the interface or schema it exposes) and may depend on other units, in the same component or another. This is one unit as it is stored, using the shape the schema allows:
{
"id": "DC-001-03",
"type": "endpoint",
"title": "POST /v1/invoices",
"description": "Creates a draft invoice for the caller's organization",
"requirementIds": ["REQ-FUNC-001"],
"dependsOn": ["DC-001-01", "DC-001-02"],
"contract": "request {customerId, lineItems[], currency} plus Idempotency-Key, response 201 {invoice} | 401 | 403 | 422"
}
The document shows each unit as a row of its component's table (id, type, title, contract). dependsOn is the build order: this endpoint waits for the invoices table and the token middleware.
Where the ids go next
- REQ ids from the SRS to DC-NNN design component
- DC-NNN design component to DC-NNN-MM implementation unit
- DC-NNN design component to API Contract operation, x-design-component
- DC-NNN design component to STS test case, linked components
- DC-NNN design component to Tasks epic, one epic each
- DC-NNN-MM implementation unit to Tasks ticket, one ticket each
- DC-NNN design component to Threat Model, cited by id
- DC-NNN design component to Traceability, requirement links
| Step | What it takes from the SDS |
|---|---|
| API Contract | The components with their interfaces. It writes one operation for every interface of kind "api" and names the implementing DC-NNN on each operation in x-design-component. A DC-NNN that is not in the SDS is a problem there. |
| STS | The requirements and the design components. Test cases link to the components that implement the requirement they verify. |
| Tasks | The saved design data. Each component becomes an epic with its own id, each unit becomes a ticket that records its DC-NNN-MM, and the unit dependsOn edges become ticket dependencies. |
| Threat Model | The components and decisions. The threats and controls name components by DC-NNN. |
| Traceability | The requirement-to-component links the SDS step wrote, laid beside the STS test cases. |
| Delivery Plan | One epic per component, scheduled into sprints. |
Because the interface names feed the API Contract, name each interface the way a client would call it ("POST /v1/invoices") and give it kind api. An interface recorded under a vaguer name or the wrong kind is easy to lose there.
Reviewing it
The SDS is a chain step: it finishes as Awaiting your review, and /api stays locked until you approve it. Check that:
- the architecture fits the constraints the SRS recorded and agrees with the TAD: same stack, same data stores, same environments;
- each component has a clear responsibility, and its units are genuinely buildable pieces with concrete contracts. They become tickets on the delivery board, so a unit that would take weeks or a contract that says "handles invoices" needs fixing now;
- every interface the clients will call is listed on a component with kind
api, because the API Contract is written from those; - the Requirements Traceability table shows no partial or uncovered row, and every excluded requirement is excluded for the reason you expect;
- each architecture decision weighs real options and says what the choice costs;
- every component has a role that fits the work, since the role is carried onto that component's tickets;
- failure is designed: timeouts, retries and what happens when a dependency is down;
- the notes above Approve, if any, are ones you accept.
A good result has a component for each real responsibility rather than one per requirement, a handful of units in each, every must requirement traced, no sign-in or mail design that Poly-X already provides, and a diagram of the whole system in which every component also appears in section 2. A small application may correctly have only one or two components.
You can edit the draft while it is under review.
When you approve the SDS, every design component's status moves from draft to approved, and the API Contract unlocks. The Threat Model and Traceability need only the SDS to exist.
Request changes sends the architect the design and the three document parts it wrote, with your change list, and asks for only what changes. The bridge lays that on the previous draft, then runs every check again, including coverage. Name components, units and ids. In a new project version the existing ids are kept, and anything new takes the next free id. If you edited the draft by hand first, saving the edit discards the stored reply the patch is applied to, so Request changes writes the whole design again from the agent's data and your edit is not kept. Ask for changes first, edit last.
| Reason | Wording that works |
|---|---|
| A component is too broad | "Split DC-004 into a notification service and a report generator. Move DC-004-03 and DC-004-04 to the notification service." |
| A unit is not ticket-sized or its contract is vague | "DC-002-03 covers the whole import. Split it into parse, validate and persist, and give each a contract with its failure responses." |
| The design contradicts the TAD | "DC-003 stores files in MongoDB, but TAD-004 selected PostgreSQL. Use PostgreSQL and add the table to DC-003." |
| An interface the API needs is missing | "Add an interface POST /invoices/{invoiceId}/approve, kind api, to DC-003." |
| A table or entity is missing | "Add an audit_log table to DC-002 and show it in the data design." |
| A requirement is partial or uncovered | "REQ-FUNC-012 is partial. Add it to DC-005 and give DC-005-02 the unit that implements it." |
| The wrong role is assigned | "Set the assigned role of DC-001 to architect and DC-006 to juniorDev." |
| The design rebuilds sign-in or mail | "Remove the login endpoint from DC-001. Use Poly-X token introspection and the Poly-X notification service." |
| A decision lacks real options | "The caching decision lists only Redis. Add Memcached and in-process caching, with reasons tied to REQ-NFUNC-003." |
| Failure handling is missing | "DC-004 calls the payment gateway with no timeout. Add a timeout, a retry rule and the behaviour when the gateway is down." |
When it fails
| What you see | Why | What to do |
|---|---|---|
/sds locked: "Approve Technical Architecture to unlock this" | The TAD is not approved yet. | Approve the TAD. |
| A message starting "artifacts.srs missing" or "requirements[] is empty" | The project state has no SRS or no requirements. | Run /srs first. |
| "The agent did not return a usable reply." | No attempt produced readable output. | Run it again. |
| "The agent's reply still fails N check(s) the next step depends on, after M attempt(s)." | After the last attempt a contract check still failed, for example a component with no units, a unit that does not belong to its component, a dependency cycle between units, or an empty design. The listed problems say which. | Run it again. If it repeats, request changes on the TAD if the platform leaves the architect no consistent design, or check that the requirement it fails on is clear in the SRS. |
| "The agent returned no SDS document." | The design passed but the document came back empty. | Run it again. |
| A draft with "N checks were left unresolved after M attempts" above Approve | Document checks failed: coverage, roles, the component graph, decisions or the Markdown. The draft is kept. | Read the list. Approve if the gaps do not matter, or request changes naming them. |
Nothing is written to the project state until the design has passed the contract checks, so a run that fails in the correction loop leaves the previous design untouched. Three guards run after the document is written and are rare: "ECC script failed: scripts/write-sdlc-state.js" (the endpoints, tables and decisions could not be saved), "ECC script failed: scripts/sdlc/verify-units-survived.js" (a unit changed on its way into the state) and "ECC script failed: scripts/traceability-update.js" (the saved state did not pass its schema check). Run the step again if you see one.
Under the hood
- The driver is
bridge/src/services/sdsPipeline.service.ts, the skill issdlc-architect, and the headings and diagram minimum are inbridge/src/lib/documentSpecs.ts. The coverage matrix comes frombridge/sdlc-engine/scripts/sdlc/utils/requirements-coverage.js, and the loop that sends problems back is described in Document checks and versioning. - The gate sits in
bridge/sdlc-engine/lib/sdlc/gate-rules.js:/sdsrequires the TAD and its approval, and/apirequires the SDS and its approval. - Written to the project state:
designComponents(with units and derived dependencies),architectureDecisions,apiContracts(the endpoints list from this step, separate from the API step'sapiContract),databaseSchema, each requirement's links to its components, andtraceabilityMatrix. The phase moves to test planning. - The document is
.sdlc/artifacts/sds-vN.md, registered asartifacts.sdstogether with the coverage matrix it passed and any checks left unresolved. The draft and the design it was built from are kept in.sdlc/tmpwhile under review, so Request changes can patch them. - The three document parts run at the same time. An operator whose model provider limits concurrent requests can set
SDS_NARRATIVE_SEQUENTIAL=1to run them one after another.