Skip to main content
SPEC FILE · TWO FLAVOURS · SPEC KIT + OPENSPEC

spec.md

One filename, two documents: a Spec Kit feature specification, or an OpenSpec delta for a single capability.

DEFINITION // GEO SNIPPETENTITY EXTRACT

spec.md is the requirements file of two methodologies. In Spec Kit it is a feature specification: prioritised user stories with acceptance scenarios, technology-neutral FR- requirements, key entities, and measurable SC- success criteria. In OpenSpec it is a delta spec for one capability: ADDED, MODIFIED, REMOVED, and RENAMED requirements, each with WHEN / THEN scenarios, that merge into a long-lived baseline on apply.

THINK OF IT AS - A FEATURE BRIEF VS. A DIFF FOR REQUIREMENTS

Spec Kit's spec.md is a brief for one new room: who uses it, in what order the jobs matter (P1 first), and how you will know it worked. OpenSpec's spec.md is a redline on the existing drawings: this requirement is added, that one changes to read as follows, this one is struck. Same filename, opposite starting points - a blank room versus a standing building.

SECTION 01 SPEC KIT

The feature specification

Written by the Spec Kit workflow's specify stage to specs/<NNN-feature>/spec.md, mirroring GitHub Spec Kit's spec-template.md. Spec Kit is feature-scoped: one numbered feature directory per session, so the interview stays focused on a single feature rather than a roadmap.

specs/001-photo-albums/spec.md markdown
# Feature Specification: Photo Albums

**Feature Branch**: `001-photo-albums`
**Created**: 2026-06-13
**Status**: Draft
**Input**: User description: "Organise photos into albums with drag-and-drop"

## User Scenarios & Testing *(mandatory)*

### User Story 1 - Create an album (Priority: P1)
A user groups existing photos into a named album from the library view.
**Why this priority**: Every other story depends on an album existing.
**Independent Test**: Create an album with three photos; it appears in the sidebar.
**Acceptance Scenarios**:
1. **Given** a library with photos, **When** the user selects three and chooses "New album",
   **Then** an album containing exactly those photos is created and listed.

### User Story 2 - Reorder photos (Priority: P2)
…

### Edge Cases
- What happens when an album is deleted while another tab is viewing it?

## Requirements *(mandatory)*
### Functional Requirements
- **FR-001**: System MUST let a user create an album from a selection of photos
- **FR-002**: System MUST persist album ordering across sessions
### Key Entities
- **Album**: name, cover photo, ordered list of photos

## Success Criteria *(mandatory)*
- **SC-001**: Users create an album in under 30 seconds
- **SC-002**: Reordering 200 photos completes without visible lag

## Assumptions
- Photos are already uploaded; this feature does not cover ingestion.
  • User stories are ranked P1 / P2 / P3, each with Why this priority, an Independent Test (a viable MVP slice on its own), and one to three Given / When / Then acceptance scenarios. Later, tasks.md gets one phase per story.
  • FR-### and SC-### numbering is sequential and zero-padded. FRs say what, never which stack; SCs are numbers, times, percentages, or binary outcomes.
  • [NEEDS CLARIFICATION: …] markers are allowed inline - at most three per file, each a specific answerable question.
  • Edge Cases and Assumptions stay short: three to six bullets each.
SECTION 02 OPENSPEC

The delta spec

Written by the OpenSpec workflow's specs stage, one file per capability the proposal named, at openspec/changes/<change-id>/specs/<capability>/spec.md - the path the OpenSpec CLI reads. Only the delta headers that apply are included.

openspec/changes/add-session-rename/specs/platform/spec.md markdown
## ADDED Requirements

### Requirement: Session rename
The system SHALL let the session owner replace the AI-generated session summary
with a user-supplied one of at most 500 characters.

#### Scenario: Owner renames a session
- **WHEN** the owner submits a new name from the session menu
- **THEN** the session list and chat header show the new name
- **AND** other open clients receive the update in real time

## MODIFIED Requirements

### Requirement: Session summary generation
The system SHALL generate a summary when a session starts and SHALL NOT overwrite
a summary the user has set manually.

#### Scenario: Agent regenerates a summary
- **WHEN** the agent proposes a new summary for a manually renamed session
- **THEN** the manual name is kept

## RENAMED Requirements
- FROM: `### Requirement: Session title`
- TO: `### Requirement: Session summary generation`
  • Exact headers: ## ADDED Requirements, ## MODIFIED Requirements, ## REMOVED Requirements, ## RENAMED Requirements. The OpenSpec validator enforces them.
  • Every ADDED / MODIFIED requirement has SHALL / MUST text and at least one #### Scenario: with - **WHEN** / - **THEN** (and optional - **AND**) bullets.
  • MODIFIED describes the post-change behaviour in full, not just the diff; REMOVED states the requirement and why; RENAMED uses - FROM: / - TO: pairs of backtick-quoted headers, never an arrow.
  • One capability per file. On openspec archive (or /opsx:archive), the delta merges into openspec/specs/<capability>/spec.md, the capability's living baseline.
SECTION 03 COMPARED

How they map to MySpec's requirements.md

MySpec requirements.mdSpec Kit spec.mdOpenSpec delta spec.md
ScopeWhole product (greenfield) or change delta (brownfield)One featureOne capability of one change
Requirement unitFR-/NFR- with EARS+ ACs; AR-/BR-/CR- deltasUser stories + FR-/SC-ADDED / MODIFIED / REMOVED / RENAMED Requirement + Scenario
Criteria syntaxWHEN / WHILE / IF … THEN … SHALLGiven / When / ThenWHEN / THEN / AND
Non-functionalNFR- with Target and PrioritySC- measurable outcomesFolded into requirements or design.md
DiagramsRequirement diagrams--
SECTION 04 RULES

Review rules

✓ PASSES REVIEW
  • Spec Kit: stories in priority order with tests and scenarios; FRs technology-neutral; SCs measurable; ≤3 clarification markers.
  • OpenSpec: exact delta headers; every requirement has SHALL / MUST text and a scenario; grounded in the explored codebase for MODIFIED / REMOVED / RENAMED.
✗ SENT BACK
  • A stack choice inside an FR; a success criterion that cannot be measured.
  • Two capabilities bundled in one delta file; a MODIFIED entry that shows only the diff.
  • A whole-document code fence or a metadata footer.
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.