# github/spec-kit architecture

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

- Interactive diagram: https://gitdiagram.com/github/spec-kit
- Repository: https://github.com/github/spec-kit
- Video tour (about a minute): https://gitdiagram.com/github/spec-kit/video

## Overview

Spec Kit is a Python CLI and toolkit for configuring coding-agent projects and supplying reusable development processes. A user initializes a project with an agent integration, then uses agent-facing commands to run spec-driven development; bug-fixing and idea-assessment processes are optional extensions. The runtime also manages presets, workflows, bundles, catalogs, and artifact discovery, with MCP and lifecycle-event support. Paths follow the supplied tree; some subsystem links are documented capabilities or inferred from the product description, so they are dashed where source excerpts do not establish the call path.

Main entry points: [`src/specify_cli/integrations/base.py`](https://github.com/github/spec-kit/blob/main/src/specify_cli/integrations/base.py) (Agent adapters), [`src/specify_cli/workflows/engine.py`](https://github.com/github/spec-kit/blob/main/src/specify_cli/workflows/engine.py) (Workflows), [`src/specify_cli/__init__.py`](https://github.com/github/spec-kit/blob/main/src/specify_cli/__init__.py) (Specify CLI), [`src/specify_cli/command_init.py`](https://github.com/github/spec-kit/blob/main/src/specify_cli/command_init.py) (Project initialization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and setup"]
  node_cli["Specify CLI<br/>[__init__.py]"]
  node_project_setup["Project initialization<br/>[command_init.py]"]
end

subgraph group_agent["Agent support"]
  node_agent_registry["Integration registry<br/>[__init__.py]"]
  node_agent_adapters["Agent adapters<br/>[base.py]"]
  node_agent_files["Agent command registration<br/>[agents.py]"]
  node_events["Lifecycle events<br/>[__init__.py]"]
end

subgraph group_process["Processes"]
  node_sdd["Spec-driven development"]
  node_workflows["Workflows<br/>[engine.py]"]
  node_workflow_steps["Workflow steps"]
  node_overlays["Workflow overlays"]
end

subgraph group_components["Reusable components"]
  node_extensions["Extensions<br/>[__init__.py]"]
  node_presets["Presets<br/>[_manager.py]"]
  node_bundles["Bundles"]
end

subgraph group_discovery["Discovery and access"]
  node_catalogs["Catalogs<br/>[catalogs.py]"]
  node_artifact_inventory["Artifact inventory<br/>[catalog.py]"]
  node_authentication["Catalog authentication"]
  node_mcp["MCP server<br/>[server.py]"]
end

node_user(("Project author"))
node_external_catalog["Catalog service"]
node_agent_runtime(("Coding agent"))

node_user -->|"runs"| node_cli
node_cli -->|"dispatches"| node_project_setup
node_project_setup -.->|"selects integration"| node_agent_registry
node_agent_registry -->|"resolves adapter"| node_agent_adapters
node_agent_adapters -->|"registers commands"| node_agent_files
node_agent_runtime -->|"invokes skills"| node_sdd
node_user -->|"reviews outcomes"| node_sdd
node_user -->|"installs process"| node_extensions
node_user -->|"customizes process"| node_presets
node_user -->|"automates tasks"| node_workflows
node_workflows -.->|"executes steps"| node_workflow_steps
node_workflows -->|"applies overlays"| node_overlays
node_user -->|"installs setup"| node_bundles
node_user -->|"searches components"| node_catalogs
node_catalogs -.->|"fetches listings"| node_external_catalog
node_user -->|"inspects artifacts"| node_artifact_inventory
node_authentication -.->|"authenticates access"| node_external_catalog
node_user -.->|"connects MCP"| node_mcp
node_agent_adapters -->|"installs hooks"| node_events

click node_cli "https://github.com/github/spec-kit/blob/main/src/specify_cli/__init__.py"
click node_project_setup "https://github.com/github/spec-kit/blob/main/src/specify_cli/command_init.py"
click node_agent_registry "https://github.com/github/spec-kit/blob/main/src/specify_cli/integrations/__init__.py"
click node_agent_adapters "https://github.com/github/spec-kit/blob/main/src/specify_cli/integrations/base.py"
click node_agent_files "https://github.com/github/spec-kit/blob/main/src/specify_cli/agents.py"
click node_events "https://github.com/github/spec-kit/blob/main/src/specify_cli/events/__init__.py"
click node_sdd "https://github.com/github/spec-kit/tree/main/src/specify_cli"
click node_extensions "https://github.com/github/spec-kit/blob/main/src/specify_cli/extensions/__init__.py"
click node_presets "https://github.com/github/spec-kit/blob/main/src/specify_cli/presets/_manager.py"
click node_workflows "https://github.com/github/spec-kit/blob/main/src/specify_cli/workflows/engine.py"
click node_workflow_steps "https://github.com/github/spec-kit/tree/main/src/specify_cli/workflows/step"
click node_overlays "https://github.com/github/spec-kit/tree/main/src/specify_cli/workflows/overlay"
click node_bundles "https://github.com/github/spec-kit/tree/main/src/specify_cli/bundles"
click node_catalogs "https://github.com/github/spec-kit/blob/main/src/specify_cli/catalogs.py"
click node_artifact_inventory "https://github.com/github/spec-kit/blob/main/src/specify_cli/artifacts/catalog.py"
click node_authentication "https://github.com/github/spec-kit/tree/main/src/specify_cli/authentication"
click node_mcp "https://github.com/github/spec-kit/blob/main/src/specify_cli/mcp_server/server.py"

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_project_setup toneBlue
class node_agent_registry,node_agent_adapters,node_agent_files,node_events toneAmber
class node_sdd,node_workflows,node_workflow_steps,node_overlays toneMint
class node_extensions,node_presets,node_bundles toneRose
class node_catalogs,node_artifact_inventory,node_authentication,node_mcp,node_user,node_external_catalog,node_agent_runtime toneIndigo
```

## Components

### CLI and setup

- [Specify CLI](https://github.com/github/spec-kit/blob/main/src/specify_cli/__init__.py): `src/specify_cli/__init__.py`
- [Project initialization](https://github.com/github/spec-kit/blob/main/src/specify_cli/command_init.py): `src/specify_cli/command_init.py`

### Agent support

- [Integration registry](https://github.com/github/spec-kit/blob/main/src/specify_cli/integrations/__init__.py): `src/specify_cli/integrations/__init__.py`
- [Agent adapters](https://github.com/github/spec-kit/blob/main/src/specify_cli/integrations/base.py): `src/specify_cli/integrations/base.py`
- [Agent command registration](https://github.com/github/spec-kit/blob/main/src/specify_cli/agents.py): `src/specify_cli/agents.py`
- [Lifecycle events](https://github.com/github/spec-kit/blob/main/src/specify_cli/events/__init__.py): `src/specify_cli/events/__init__.py`

### Processes

- [Spec-driven development](https://github.com/github/spec-kit/tree/main/src/specify_cli): `src/specify_cli`
- [Workflows](https://github.com/github/spec-kit/blob/main/src/specify_cli/workflows/engine.py): `src/specify_cli/workflows/engine.py`
- [Workflow steps](https://github.com/github/spec-kit/tree/main/src/specify_cli/workflows/step): `src/specify_cli/workflows/step`
- [Workflow overlays](https://github.com/github/spec-kit/tree/main/src/specify_cli/workflows/overlay): `src/specify_cli/workflows/overlay`

### Reusable components

- [Extensions](https://github.com/github/spec-kit/blob/main/src/specify_cli/extensions/__init__.py): `src/specify_cli/extensions/__init__.py`
- [Presets](https://github.com/github/spec-kit/blob/main/src/specify_cli/presets/_manager.py): `src/specify_cli/presets/_manager.py`
- [Bundles](https://github.com/github/spec-kit/tree/main/src/specify_cli/bundles): `src/specify_cli/bundles`

### Discovery and access

- [Catalogs](https://github.com/github/spec-kit/blob/main/src/specify_cli/catalogs.py): `src/specify_cli/catalogs.py`
- [Artifact inventory](https://github.com/github/spec-kit/blob/main/src/specify_cli/artifacts/catalog.py): `src/specify_cli/artifacts/catalog.py`
- [Catalog authentication](https://github.com/github/spec-kit/tree/main/src/specify_cli/authentication): `src/specify_cli/authentication`
- [MCP server](https://github.com/github/spec-kit/blob/main/src/specify_cli/mcp_server/server.py): `src/specify_cli/mcp_server/server.py`

### Other components

- **Project author**
- **Catalog service**
- **Coding agent**

## Connections

- Project author → Specify CLI: runs (evidence: `README.md`)
- Specify CLI → Project initialization: dispatches (evidence: `src/specify_cli/__init__.py`)
- Project initialization → Integration registry: selects integration
- Integration registry → Agent adapters: resolves adapter (evidence: `src/specify_cli/integrations/__init__.py`)
- Agent adapters → Agent command registration: registers commands (evidence: `src/specify_cli/integrations/base.py`)
- Coding agent → Spec-driven development: invokes skills (evidence: `README.md`)
- Project author → Spec-driven development: reviews outcomes (evidence: `README.md`)
- Project author → Extensions: installs process (evidence: `README.md`)
- Project author → Presets: customizes process (evidence: `README.md`)
- Project author → Workflows: automates tasks (evidence: `README.md`)
- Workflows → Workflow steps: executes steps
- Workflows → Workflow overlays: applies overlays (evidence: `src/specify_cli/workflows/engine.py`)
- Project author → Bundles: installs setup (evidence: `README.md`)
- Project author → Catalogs: searches components (evidence: `README.md`)
- Catalogs → Catalog service: fetches listings
- Project author → Artifact inventory: inspects artifacts (evidence: `README.md`)
- Catalog authentication → Catalog service: authenticates access
- Project author → MCP server: connects MCP
- Agent adapters → Lifecycle events: installs hooks (evidence: `src/specify_cli/events/__init__.py`)
