# chan4lk/specclaw architecture

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

- Interactive diagram: https://gitdiagram.com/chan4lk/specclaw
- Repository: https://github.com/chan4lk/specclaw

## Overview

SpecClaw is a plugin-based spec-driven development workflow for Claude Code and Codex. A user proposes a change, reviews a browser-openable mock, plans and builds the approved change, verifies it, then opens a pull request; project change records provide the paper trail. Add-ons extend this with brownfield rebuilds, issue/PR synchronization, review and learning tools, fleet execution, and a dashboard. The workflow and add-on capabilities are documented in the README; internal edges are limited to relationships visible in sampled source. Some add-on implementations were not sampled, so their internal links are omitted.

Main entry points: [`plugins/specclaw/skills`](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw/skills) (Lifecycle commands), [`plugins/specclaw/hooks/core/gate.ts`](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/gate.ts) (Propose gate), [`plugins/specclaw-dash/hooks/read.ts`](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/read.ts) (Dashboard refresh), [`.specclaw/changes`](https://github.com/chan4lk/specclaw/tree/main/.specclaw/changes) (Change records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Change lifecycle"]
  node_commands["Lifecycle commands"]
  node_mock["Living mock"]
  node_change_records["Change records<br/>[changes]"]
  node_project_state[("Project state<br/>[.specclaw]")]
end

subgraph group_guards["Project hooks"]
  node_gate["Propose gate<br/>[gate.ts]"]
  node_hook_registration["Hook registration<br/>[register.tsx]"]
  node_state_parser["Change state parser<br/>[state.ts]"]
  node_status_view["Status views<br/>[view.ts]"]
end

subgraph group_addons["Workflow add-ons"]
  node_brownfield["Brownfield rebuild"]
  node_sync["Issue and PR sync"]
  node_extras["Learning tools"]
end

subgraph group_fleet["Fleet execution"]
  node_fleet_commands["Fleet commands"]
  node_fleet_report["Fleet report parser<br/>[report.ts]"]
  node_fleet_view["Fleet dashboard view<br/>[view.ts]"]
end

subgraph group_observability["Dashboard and review"]
  node_review_core["Review engine<br/>[review_core.py]"]
  node_review_memory[("Review memory<br/>[review_memory.py]")]
  node_review_server["Review MCP server<br/>[server.py]"]
  node_dash_refresh["Dashboard refresh<br/>[read.ts]"]
  node_dash_scan["Transcript scanner<br/>[scan.ts]"]
  node_dash_actions["Dashboard actions<br/>[actions.ts]"]
  node_dash_view["Dashboard view<br/>[view.ts]"]
  node_dash_register["Dashboard registration<br/>[register.tsx]"]
  node_dash_act["Dashboard action hook<br/>[act.ts]"]
  node_dash_loops["Loop parsing<br/>[loops.ts]"]
end

node_user(("Developer"))

node_user -->|"starts workflow"| node_commands
node_commands -->|"draws mock"| node_mock
node_commands -->|"records change"| node_change_records
node_commands -->|"updates lifecycle"| node_project_state
node_hook_registration -->|"checks edits"| node_gate
node_hook_registration -->|"renders status"| node_status_view
node_gate -->|"reads snapshot"| node_state_parser
node_gate -->|"checks approval"| node_status_view
node_brownfield -->|"rebuilds legacy app"| node_change_records
node_sync -.->|"syncs issues and PRs"| node_change_records
node_extras -.->|"extends workflows"| node_commands
node_fleet_commands -.->|"produces report"| node_fleet_report
node_fleet_view -->|"formats report"| node_fleet_report
node_review_core -->|"queries lessons"| node_review_memory
node_review_server -->|"invokes engine"| node_review_core
node_review_server -->|"uses memory"| node_review_memory
node_dash_refresh -->|"scans transcripts"| node_dash_scan
node_dash_refresh -->|"parses fleet"| node_dash_loops
node_dash_register -->|"refreshes data"| node_dash_refresh
node_dash_register -->|"renders dashboard"| node_dash_view
node_dash_act -->|"runs actions"| node_dash_actions

click node_commands "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw/skills"
click node_mock "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw/templates"
click node_change_records "https://github.com/chan4lk/specclaw/tree/main/.specclaw/changes"
click node_project_state "https://github.com/chan4lk/specclaw/tree/main/.specclaw"
click node_gate "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/gate.ts"
click node_hook_registration "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/register.tsx"
click node_state_parser "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/state.ts"
click node_status_view "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/view.ts"
click node_brownfield "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-bf/skills"
click node_sync "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-sync/skills"
click node_extras "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-extras/skills"
click node_fleet_commands "https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-fleet/skills"
click node_fleet_report "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-fleet/hooks/core/report.ts"
click node_fleet_view "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-fleet/hooks/core/view.ts"
click node_review_core "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/lib/review_core.py"
click node_review_memory "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/lib/review_memory.py"
click node_review_server "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/mcp/server.py"
click node_dash_refresh "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/read.ts"
click node_dash_scan "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/scan.ts"
click node_dash_actions "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/actions.ts"
click node_dash_view "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/view.ts"
click node_dash_register "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/register.tsx"
click node_dash_act "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/act.ts"
click node_dash_loops "https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/loops.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_commands,node_mock,node_change_records,node_project_state toneBlue
class node_gate,node_hook_registration,node_state_parser,node_status_view toneAmber
class node_brownfield,node_sync,node_extras toneMint
class node_fleet_commands,node_fleet_report,node_fleet_view toneRose
class node_review_core,node_review_memory,node_review_server,node_dash_refresh,node_dash_scan,node_dash_actions,node_dash_view,node_dash_register,node_dash_act,node_dash_loops,node_user toneIndigo
```

## Components

### Change lifecycle

- [Lifecycle commands](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw/skills): `plugins/specclaw/skills`
- [Living mock](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw/templates): `plugins/specclaw/templates`
- [Change records](https://github.com/chan4lk/specclaw/tree/main/.specclaw/changes): `.specclaw/changes`
- [Project state](https://github.com/chan4lk/specclaw/tree/main/.specclaw): `.specclaw`

### Project hooks

- [Propose gate](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/gate.ts): `plugins/specclaw/hooks/core/gate.ts`
- [Hook registration](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/register.tsx): `plugins/specclaw/hooks/register.tsx`
- [Change state parser](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/state.ts): `plugins/specclaw/hooks/core/state.ts`
- [Status views](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw/hooks/core/view.ts): `plugins/specclaw/hooks/core/view.ts`

### Workflow add-ons

- [Brownfield rebuild](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-bf/skills): `plugins/specclaw-bf/skills`
- [Issue and PR sync](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-sync/skills): `plugins/specclaw-sync/skills`
- [Learning tools](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-extras/skills): `plugins/specclaw-extras/skills`

### Fleet execution

- [Fleet commands](https://github.com/chan4lk/specclaw/tree/main/plugins/specclaw-fleet/skills): `plugins/specclaw-fleet/skills`
- [Fleet report parser](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-fleet/hooks/core/report.ts): `plugins/specclaw-fleet/hooks/core/report.ts`
- [Fleet dashboard view](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-fleet/hooks/core/view.ts): `plugins/specclaw-fleet/hooks/core/view.ts`

### Dashboard and review

- [Review engine](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/lib/review_core.py): `plugins/specclaw-review/lib/review_core.py`
- [Review memory](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/lib/review_memory.py): `plugins/specclaw-review/lib/review_memory.py`
- [Review MCP server](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-review/mcp/server.py): `plugins/specclaw-review/mcp/server.py`
- [Dashboard refresh](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/read.ts): `plugins/specclaw-dash/hooks/read.ts`
- [Transcript scanner](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/scan.ts): `plugins/specclaw-dash/hooks/core/scan.ts`
- [Dashboard actions](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/actions.ts): `plugins/specclaw-dash/hooks/core/actions.ts`
- [Dashboard view](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/view.ts): `plugins/specclaw-dash/hooks/core/view.ts`
- [Dashboard registration](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/register.tsx): `plugins/specclaw-dash/hooks/register.tsx`
- [Dashboard action hook](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/act.ts): `plugins/specclaw-dash/hooks/act.ts`
- [Loop parsing](https://github.com/chan4lk/specclaw/blob/main/plugins/specclaw-dash/hooks/core/loops.ts): `plugins/specclaw-dash/hooks/core/loops.ts`

### Other components

- **Developer**

## Connections

- Developer → Lifecycle commands: starts workflow (evidence: `README.md`)
- Lifecycle commands → Living mock: draws mock (evidence: `README.md`)
- Lifecycle commands → Change records: records change (evidence: `README.md`)
- Lifecycle commands → Project state: updates lifecycle (evidence: `README.md`)
- Hook registration → Propose gate: checks edits (evidence: `plugins/specclaw/hooks/register.tsx`)
- Hook registration → Status views: renders status (evidence: `plugins/specclaw/hooks/register.tsx`)
- Propose gate → Change state parser: reads snapshot (evidence: `plugins/specclaw/hooks/core/gate.ts`)
- Propose gate → Status views: checks approval (evidence: `plugins/specclaw/hooks/core/gate.ts`)
- Brownfield rebuild → Change records: rebuilds legacy app (evidence: `README.md`)
- Issue and PR sync → Change records: syncs issues and PRs (evidence: `README.md`)
- Learning tools → Lifecycle commands: extends workflows (evidence: `README.md`)
- Fleet commands → Fleet report parser: produces report
- Fleet dashboard view → Fleet report parser: formats report (evidence: `plugins/specclaw-fleet/hooks/core/view.ts`)
- Review engine → Review memory: queries lessons (evidence: `plugins/specclaw-review/lib/review_core.py`)
- Review MCP server → Review engine: invokes engine (evidence: `plugins/specclaw-review/mcp/server.py`)
- Review MCP server → Review memory: uses memory (evidence: `plugins/specclaw-review/mcp/server.py`)
- Dashboard refresh → Transcript scanner: scans transcripts (evidence: `plugins/specclaw-dash/hooks/read.ts`)
- Dashboard refresh → Loop parsing: parses fleet (evidence: `plugins/specclaw-dash/hooks/read.ts`)
- Dashboard registration → Dashboard refresh: refreshes data (evidence: `plugins/specclaw-dash/hooks/register.tsx`)
- Dashboard registration → Dashboard view: renders dashboard (evidence: `plugins/specclaw-dash/hooks/register.tsx`)
- Dashboard action hook → Dashboard actions: runs actions (evidence: `plugins/specclaw-dash/hooks/act.ts`)
