# fission-ai/openspec architecture

> Architecture diagram of the GitHub repository fission-ai/openspec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fission-ai/openspec
- Repository: https://github.com/fission-ai/openspec
- Video tour (about a minute): https://gitdiagram.com/fission-ai/openspec/video

## Overview

OpenSpec is a CLI for spec-driven development with AI coding assistants. The documented workflow moves from exploring an idea to proposing a change, implementing it, and archiving updated specs; users can also initialize projects, validate changes, configure workflows, and plan in shared stores. The graph preserves those stages and key supporting capabilities. Relationships are based on README statements and the supplied source excerpts or index references; some command internals and unsampled subsystems are represented without inferred call paths.

Main entry points: [`src/cli/index.ts`](https://github.com/fission-ai/openspec/blob/main/src/cli/index.ts) (CLI entry), [`src/commands/workflow/instructions.ts`](https://github.com/fission-ai/openspec/blob/main/src/commands/workflow/instructions.ts) (Workflow instructions), [`src/core/validation/validator.ts`](https://github.com/fission-ai/openspec/blob/main/src/core/validation/validator.ts) (Validate change), [`src/core/root-selection.ts`](https://github.com/fission-ai/openspec/blob/main/src/core/root-selection.ts) (Root selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and workflows"]
  node_cli["CLI entry<br/>[index.ts]"]
  node_explore["Explore<br/>[explore.ts]"]
  node_propose["Propose change<br/>[new-change.ts]"]
  node_instructions["Workflow instructions<br/>[instructions.ts]"]
  node_sharedoutput["Shared output<br/>[shared-output.ts]"]
  node_completions["Shell completions"]
end

subgraph group_planning["Planning and validation"]
  node_apply["Apply specs<br/>[specs-apply.ts]"]
  node_archive["Archive change<br/>[archive.ts]"]
  node_validate["Validate change<br/>[validator.ts]"]
  node_markdown["Markdown parsing<br/>[markdown-parser.ts]"]
  node_delta["Change parsing<br/>[change-parser.ts]"]
  node_requirements["Requirement parsing"]
  node_taskprogress["Task progress<br/>[task-progress.ts]"]
end

subgraph group_stores["Stores and configuration"]
  node_root["Root selection<br/>[root-selection.ts]"]
  node_registry[("Store registry<br/>[registry.ts]")]
  node_projectconfig["Project configuration<br/>[project-config.ts]"]
  node_planninghome["Planning home<br/>[planning-home.ts]"]
  node_context["Project context<br/>[context.ts]"]
  node_storeservice[("Shared stores<br/>[operations.ts]")]
end

subgraph group_agents["Agent integrations"]
  node_adapters["Agent command adapters"]
  node_init["Project initialization<br/>[init.ts]"]
end

node_user(("Developer"))

node_user -->|"runs commands"| node_cli
node_cli -.->|"starts exploration"| node_explore
node_cli -.->|"starts proposal"| node_propose
node_propose -.->|"requests instructions"| node_instructions
node_instructions -->|"guides implementation"| node_apply
node_user -->|"archives change"| node_archive
node_cli -.->|"validates changes"| node_validate
node_validate -->|"parses specs"| node_markdown
node_validate -->|"parses changes"| node_delta
node_markdown -->|"parses requirements"| node_requirements
node_delta -->|"parses deltas"| node_requirements
node_validate -->|"resolves task files"| node_taskprogress
node_cli -.->|"resolves project root"| node_root
node_root -->|"reads registry"| node_registry
node_instructions -->|"resolves root"| node_root
node_instructions -->|"reads snapshot"| node_registry
node_instructions -->|"reads config"| node_projectconfig
node_instructions -->|"uses planning home"| node_planninghome
node_context -->|"resolves root"| node_root
node_context -->|"emits failures"| node_sharedoutput
node_cli -->|"uses output helpers"| node_sharedoutput
node_cli -.->|"supports completion"| node_completions
node_user -->|"initializes project"| node_init
node_init -.->|"installs tool commands"| node_adapters
node_user -->|"plans in store"| node_storeservice

click node_cli "https://github.com/fission-ai/openspec/blob/main/src/cli/index.ts"
click node_explore "https://github.com/fission-ai/openspec/blob/main/src/core/templates/workflows/explore.ts"
click node_propose "https://github.com/fission-ai/openspec/blob/main/src/commands/workflow/new-change.ts"
click node_instructions "https://github.com/fission-ai/openspec/blob/main/src/commands/workflow/instructions.ts"
click node_apply "https://github.com/fission-ai/openspec/blob/main/src/core/specs-apply.ts"
click node_archive "https://github.com/fission-ai/openspec/blob/main/src/core/archive.ts"
click node_validate "https://github.com/fission-ai/openspec/blob/main/src/core/validation/validator.ts"
click node_markdown "https://github.com/fission-ai/openspec/blob/main/src/core/parsers/markdown-parser.ts"
click node_delta "https://github.com/fission-ai/openspec/blob/main/src/core/parsers/change-parser.ts"
click node_requirements "https://github.com/fission-ai/openspec/blob/main/src/core/parsers/requirement-blocks.ts"
click node_taskprogress "https://github.com/fission-ai/openspec/blob/main/src/utils/task-progress.ts"
click node_root "https://github.com/fission-ai/openspec/blob/main/src/core/root-selection.ts"
click node_registry "https://github.com/fission-ai/openspec/blob/main/src/core/store/registry.ts"
click node_projectconfig "https://github.com/fission-ai/openspec/blob/main/src/core/project-config.ts"
click node_planninghome "https://github.com/fission-ai/openspec/blob/main/src/core/planning-home.ts"
click node_context "https://github.com/fission-ai/openspec/blob/main/src/commands/context.ts"
click node_sharedoutput "https://github.com/fission-ai/openspec/blob/main/src/commands/shared-output.ts"
click node_completions "https://github.com/fission-ai/openspec/blob/main/src/core/completions/command-registry.ts"
click node_adapters "https://github.com/fission-ai/openspec/tree/main/src/core/command-generation/adapters"
click node_init "https://github.com/fission-ai/openspec/blob/main/src/core/init.ts"
click node_storeservice "https://github.com/fission-ai/openspec/blob/main/src/core/store/operations.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_explore,node_propose,node_instructions,node_sharedoutput,node_completions toneBlue
class node_apply,node_archive,node_validate,node_markdown,node_delta,node_requirements,node_taskprogress toneAmber
class node_root,node_registry,node_projectconfig,node_planninghome,node_context,node_storeservice toneMint
class node_adapters,node_init toneRose
class node_user toneIndigo
```

## Components

### CLI and workflows

- [CLI entry](https://github.com/fission-ai/openspec/blob/main/src/cli/index.ts): `src/cli/index.ts`
- [Explore](https://github.com/fission-ai/openspec/blob/main/src/core/templates/workflows/explore.ts): `src/core/templates/workflows/explore.ts`
- [Propose change](https://github.com/fission-ai/openspec/blob/main/src/commands/workflow/new-change.ts): `src/commands/workflow/new-change.ts`
- [Workflow instructions](https://github.com/fission-ai/openspec/blob/main/src/commands/workflow/instructions.ts): `src/commands/workflow/instructions.ts`
- [Shared output](https://github.com/fission-ai/openspec/blob/main/src/commands/shared-output.ts): `src/commands/shared-output.ts`
- [Shell completions](https://github.com/fission-ai/openspec/blob/main/src/core/completions/command-registry.ts): `src/core/completions/command-registry.ts`

### Planning and validation

- [Apply specs](https://github.com/fission-ai/openspec/blob/main/src/core/specs-apply.ts): `src/core/specs-apply.ts`
- [Archive change](https://github.com/fission-ai/openspec/blob/main/src/core/archive.ts): `src/core/archive.ts`
- [Validate change](https://github.com/fission-ai/openspec/blob/main/src/core/validation/validator.ts): `src/core/validation/validator.ts`
- [Markdown parsing](https://github.com/fission-ai/openspec/blob/main/src/core/parsers/markdown-parser.ts): `src/core/parsers/markdown-parser.ts`
- [Change parsing](https://github.com/fission-ai/openspec/blob/main/src/core/parsers/change-parser.ts): `src/core/parsers/change-parser.ts`
- [Requirement parsing](https://github.com/fission-ai/openspec/blob/main/src/core/parsers/requirement-blocks.ts): `src/core/parsers/requirement-blocks.ts`
- [Task progress](https://github.com/fission-ai/openspec/blob/main/src/utils/task-progress.ts): `src/utils/task-progress.ts`

### Stores and configuration

- [Root selection](https://github.com/fission-ai/openspec/blob/main/src/core/root-selection.ts): `src/core/root-selection.ts`
- [Store registry](https://github.com/fission-ai/openspec/blob/main/src/core/store/registry.ts): `src/core/store/registry.ts`
- [Project configuration](https://github.com/fission-ai/openspec/blob/main/src/core/project-config.ts): `src/core/project-config.ts`
- [Planning home](https://github.com/fission-ai/openspec/blob/main/src/core/planning-home.ts): `src/core/planning-home.ts`
- [Project context](https://github.com/fission-ai/openspec/blob/main/src/commands/context.ts): `src/commands/context.ts`
- [Shared stores](https://github.com/fission-ai/openspec/blob/main/src/core/store/operations.ts): `src/core/store/operations.ts`

### Agent integrations

- [Agent command adapters](https://github.com/fission-ai/openspec/tree/main/src/core/command-generation/adapters): `src/core/command-generation/adapters`
- [Project initialization](https://github.com/fission-ai/openspec/blob/main/src/core/init.ts): `src/core/init.ts`

### Other components

- **Developer**

## Connections

- Developer → CLI entry: runs commands (evidence: `README.md`)
- CLI entry → Explore: starts exploration
- CLI entry → Propose change: starts proposal (evidence: `src/cli/index.ts`)
- Propose change → Workflow instructions: requests instructions
- Workflow instructions → Apply specs: guides implementation (evidence: `README.md`)
- Developer → Archive change: archives change (evidence: `README.md`)
- CLI entry → Validate change: validates changes
- Validate change → Markdown parsing: parses specs (evidence: `src/core/validation/validator.ts`)
- Validate change → Change parsing: parses changes (evidence: `src/core/validation/validator.ts`)
- Markdown parsing → Requirement parsing: parses requirements (evidence: `src/core/parsers/markdown-parser.ts`)
- Change parsing → Requirement parsing: parses deltas (evidence: `src/core/parsers/change-parser.ts`)
- Validate change → Task progress: resolves task files (evidence: `src/core/validation/validator.ts`)
- CLI entry → Root selection: resolves project root (evidence: `src/cli/index.ts`)
- Root selection → Store registry: reads registry (evidence: `src/core/root-selection.ts`)
- Workflow instructions → Root selection: resolves root (evidence: `src/commands/workflow/instructions.ts`)
- Workflow instructions → Store registry: reads snapshot (evidence: `src/commands/workflow/instructions.ts`)
- Workflow instructions → Project configuration: reads config (evidence: `src/commands/workflow/instructions.ts`)
- Workflow instructions → Planning home: uses planning home (evidence: `src/commands/workflow/instructions.ts`)
- Project context → Root selection: resolves root (evidence: `src/commands/context.ts`)
- Project context → Shared output: emits failures (evidence: `src/commands/context.ts`)
- CLI entry → Shared output: uses output helpers (evidence: `src/cli/index.ts`)
- CLI entry → Shell completions: supports completion
- Developer → Project initialization: initializes project (evidence: `README.md`)
- Project initialization → Agent command adapters: installs tool commands
- Developer → Shared stores: plans in store (evidence: `README.md`)
