← Software design practices guides

How to compare SpecDD specs vs architecture docs

How-To Software design practices Beginner 1101015HOWTO-1101015

HOWTO-1101015Software design practicesBeginner

This guide shows you how to compare SpecDD specs with architecture docs for a spec-driven development workflow.

Architecture docs are useful for explaining broad decisions, tradeoffs, diagrams, migration plans, and historical context. SpecDD specs are useful for making accepted behavior and boundaries operational near the code. They serve different purposes, and a mature project can use both.

The failure mode is duplication. If the architecture doc says one thing and the local spec says another, humans and agents have to guess which source to trust. The practical pattern is: discuss broadly in architecture docs or design reviews, then encode durable implementation rules in the specs that own them.

Short answer

Use architecture docs for narrative context, tradeoffs, diagrams, and decision history. Use SpecDD specs for durable source-adjacent contracts: ownership, behavior, non-goals, dependencies, forbidden access, tasks, and completion criteria. When an architecture decision is accepted, update the owning specs so future implementation can follow it.

When to use this guide

Use this guide when:

What architecture docs are good at

Use architecture docs for:

Architecture docs are good at explaining why a decision was made.

What SpecDD specs are good at

Use specs for:

Specs are good at making accepted decisions enforceable during implementation.

Steps

1. Use architecture docs for broad context

An architecture doc might say:

Trip planning should keep domain rules independent of UI and storage so future clients can reuse the same behavior.

That is useful context. It explains the design motivation.

2. Use specs for local authority

The accepted rule should also appear in the owning spec:

Spec: Trips Module Architecture

Purpose:
  Keep trip planning behavior separated across UI, services, domain rules, and adapters.

Must:
  Domain rules remain independent of UI, API, and storage frameworks.

Forbids:
  domain importing ./ui/*
  domain importing ./adapters/*

Now the decision can guide implementation and review.

3. Move accepted decisions into owning specs

After a design review, ask:

Do not leave accepted architecture only in meeting notes or an RFC.

4. Avoid duplicating documents

Do not copy a full architecture document into .sdd files. Specs should be concise and operational.

Bad spec content:

Purpose:
  This module exists because after evaluating four alternatives in a multi-quarter migration plan, the team decided...

Better:

Purpose:
  Keep trip planning behavior separated across UI, services, domain rules, and adapters.

The architecture doc can keep the long rationale. The spec carries the rule that implementation must follow.

If a spec needs to point to background material, use References:

References:
  /docs/adr/trip-layering.md

References provides context. It does not grant broad write authority and should not replace local behavior rules.

6. Review drift

When docs and specs disagree, decide which one is stale. Then update it.

Common drift examples:

Drift is dangerous because it makes the source of truth ambiguous.

Decision guide

Put it in an architecture doc when:

Put it in a SpecDD spec when:

Common mistakes

How to verify the result

Architecture docs and specs are working together when:

← Software design practices guides