Skip to main content
SPEC FILE · OPTIONAL · OPENSPEC (LEGACY NAME IN MYSPEC)

design.md

OpenSpec's decisions record for one change: context, goals and non-goals, decisions with alternatives, risks with mitigations.

DEFINITION // GEO SNIPPETENTITY EXTRACT

design.md is an optional file in an OpenSpec change folder that records the relevant current state of the codebase (Context), what the change must and must not achieve (Goals / Non-Goals), the key technical decisions with rationale and alternatives, and the risks and trade-offs with their mitigations. In older MySpec bundles the same filename was the technical solution, now called solution.md.

THINK OF IT AS - AN ARCHITECT'S DECISION LOG

Not the full drawing set - the page in the site diary that says "we ran the new duct through the old chase because the joists could not take a second penetration; the alternative was a bulkhead, which the client rejected; risk: the chase is shared with the sprinkler feed, so it gets pressure-tested first." Short, specific, and the first thing the next engineer reads when something looks odd.

SECTION 01 WHERE & WHEN

Where it lives and when it is worth writing

The OpenSpec workflow writes it in its design stage - labelled "Solution" in the stepper, because the platform normalises the legacy design stage id to solution - to openspec/changes/<change-id>/design.md, after the delta specs and before the tasks. It is optional in OpenSpec: write it when the change carries non-trivial technical decisions or trade-offs; keep it brief for small changes. Decisions must stay traceable to the proposal and the delta specs - it never introduces a capability the proposal did not name.

SECTION 02 ANATOMY

Four sections, in order

openspec/changes/<change-id>/design.md - skeleton markdown
## Context
The relevant current state of the codebase - modules, data flow, constraints - the change
operates within, anchored in what was read during explore. Cite real modules / files.

## Goals / Non-Goals
**Goals:**
- What this change must achieve.
**Non-Goals:**
- What is explicitly out of scope, to bound the change.

## Decisions
- **Decision**: <what> - Rationale: <why>. Alternatives: <what was rejected>.

## Risks / Trade-offs
- **Risk / Trade-off**: <what> - Mitigation: <how>.
openspec/changes/add-session-rename/design.md markdown
## Context
Session summaries are written only by the ai-agent (SessionService.setSummary) and
surfaced by the webapp from context.sessionSummary. There is no user-facing write path.

## Goals / Non-Goals
**Goals:**
- Let the owner rename a session without touching the agent's summary generation.
**Non-Goals:**
- Renaming from the MCP server (already covered by rename_spec_session).

## Decisions
- **Decision**: store the manual name in the same context.sessionSummary key with a
  `summaryLockedByUser` flag - Rationale: no schema migration; every reader already
  uses that key. Alternatives: a new column (rejected: migration + dual reads).

## Risks / Trade-offs
- **Risk**: an older agent build overwrites a locked summary - Mitigation: the platform
  ignores agent writes when the flag is set.
SECTION 03 LEGACY

design.md in MySpec bundles

MySpec's technical solution file was originally named design.md. It was renamed solution.md, and the platform treats the two as the same solution file type. Consequences worth knowing:

  • An old bundle downloaded through the MCP server may still contain design.md; match on file_type, not the filename.
  • The stepper shows OpenSpec's design stage as "Solution": the platform rewrites the legacy design stage id to solution one way, and the same alias maps the design file type to solution.
  • A MySpec design.md is a full solution document (architecture, data model, API design, diagrams); an OpenSpec design.md is the short decisions record described above. Do not expect one to look like the other.
SECTION 04 RULES

Review rules

✓ PASSES REVIEW
  • Context cites real modules and files from the explore stage.
  • Goals and Non-Goals bound the change; every decision has a rationale and a rejected alternative; every risk has a mitigation.
  • Nothing here widens the scope beyond the proposal's capabilities.
✗ SENT BACK
  • A greenfield architecture essay for a two-file change.
  • Decisions without alternatives, risks without mitigations, or a whole-document code fence.
SPEC FILES FIELD GUIDE

Related spec files

WORKFLOWS MYSPEC · SPEC KIT · OPENSPEC

Workflows that write it

Let the AI Architect write it for you

MySpec interviews you, then drafts every spec file with collect → generate → review gates. Free during Open Beta.