# ai-sdlc-framework/ai-sdlc architecture

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

- Interactive diagram: https://gitdiagram.com/ai-sdlc-framework/ai-sdlc
- Repository: https://github.com/ai-sdlc-framework/ai-sdlc

## Overview

1. **Overall shape**
   This is a multi-package monorepo for an AI workflow governance/execution framework. The repository is organized around a normative **specification layer**, a **runtime/orchestration layer**, a **Claude Code plugin surface**, several **language SDKs**, a **reference implementation**, and supporting **docs/CI**. The central architectural idea is: spec-first contracts are admitted, executed by agents, reviewed, attested, and monitored.

2. **Normative spec and schemas**
   `spec/` is the source of truth for the domain model: pipelines, agent roles, quality gates, autonomy policy, adapter bindings, decisions, attestation envelopes, dispatch sessions, DOR config, embeddings, journeys, and related resources. `spec/rfcs/` captures the architectural decisions and the evolution path; `spec/schemas/` contains JSON Schemas that define the wire format and validation boundary for the rest of the system. Everything else in the repo is effectively an implementation, adapter, or operationalization of this spec.

3. **Primary runtime: orchestrator**
   `orchestrator/` is the main control-plane library/CLI for admission, dispatch, state, policy, and runtime coordination. It contains:
   - task and backlog adapters
   - admission/compliance/priority evaluation
   - dependency and multi-repo analysis
   - worktree and parallelism management
   - runner registries for agent harnesses
   - state store, telemetry, audit, and notification plumbing
   - CLI commands for init/run/status/validate and related workflows  
   This is the place where “what should happen next?” is decided and where tasks are filtered before agent execution.

4. **Pipeline execution engine**
   `pipeline-cli/` is the stepwise execution engine for the task lifecycle. It exposes many CLI entrypoints, but its core flow is the Step 0–13 pipeline: sweep, validate, compute branch, create worktree, flip status, build prompts, parse agent return, collect reviewer verdicts, iterate, finalize, late rebase, push/PR, sibling PR handling, and cleanup. It also contains dedicated subsystems for:
   - attestation signing/verifying
   - definition-of-ready checks
   - incremental review
   - orchestrator loop and filters
   - dispatch supervision and worker/session tracking
   - terminal TUI and analytics  
   This package is the “execution plane” beneath the orchestrator.

5. **Claude Code plugin and MCP integration**
   `ai-sdlc-plugin/` is the user-facing integration layer for Claude Code. It provides slash commands, hooks, agent role definitions, and an MCP server. Its job is to connect the framework to the interactive assistant environment: enforce pre/post actions, route task edits/completions through the right MCP tools, and expose governance-aware commands like execute, triage, rebase, review, and init-signing-key. This is the main boundary between human/operator interaction and the framework’s internal control plane.

6. **Agent harnesses and multi-runner support**
   The system is explicitly agent-agnostic. Runtime code in `orchestrator/src/runners/` and `pipeline-cli/src/runtime/spawners/` supports multiple execution harnesses such as Claude, Codex, Copilot, Cursor, and generic LLM backends. The architecture treats the agent harness as a pluggable execution substrate, while the framework itself owns admission, prompt construction, output parsing, and verification. Cross-harness review is a first-class boundary: different harnesses are intentionally used for implementation vs. review to preserve independence.

7. **Worktree isolation and git-backed execution**
   Task execution is isolated through git worktrees and branch management. The pipeline/orchestrator create per-task workspaces, track active runs, manage parallelism, and clean up or recover interrupted work. This repo is heavily concerned with avoiding cross-task contamination, stale state, and branch/rebase failure modes. In diagrams, this is a critical boundary between the canonical repo checkout and ephemeral task-specific execution worktrees.

8. **Proof, attestation, and security chain**
   DSSE attestations are a major architectural subsystem. The framework signs reviewer outcomes and execution results, and verification is enforced in CI and supporting scripts. The attestation flow is tied to PR gating and to “proof of execution” semantics: work is not just produced, it is cryptographically sealed and later validated. Security-related support includes secret redaction, trust-chain checks, reviewer independence, and GitHub workflow enforcement.

9. **State, artifacts, and event streams**
   The system persists a mix of structured and semi-structured artifacts:
   - JSONL event logs under `.ai-sdlc/`, `pipeline-cli/_artifacts/`, and related capture directories
   - backlog tasks and decisions as markdown/YAML
   - attestation envelopes as DSSE JSON
   - TUI analytics and operator decision records
   - state store and snapshot data inside runtime packages  
   The main data flow is from spec/backlog/task inputs → orchestration events/captures → agent outputs/reviews → attestation and state updates → dashboards/TUI/CI gates.

10. **Operator-facing surfaces**
   There are two main operator surfaces: the Claude Code plugin commands/hooks and the operator TUI in `pipeline-cli/src/tui/`. The TUI aggregates live state from backlog files, orchestrator events, dependency snapshots, PR cache, and analytics readers into panes for decisions, blockers, PRs, critical path, configuration, and metrics. This is not just observability; it is the control surface for governance and triage.

11. **SDKs and portability layer**
   `sdk-typescript/`, `sdk-python/`, and `sdk-go/` provide portable API surfaces that mirror the same core concepts: adapters, agents, audit, builders, compliance, core validation, metrics, policy, reconciler, security, and telemetry. `sdk-go/operator/` also includes Kubernetes-style CRDs and controller code, which makes the architecture deployable in operator-managed environments. These SDKs are the cross-language embodiment of the spec and are useful diagram nodes for consumers who embed the framework rather than use the monorepo directly.

12. **Reference implementation and examples**
   `reference/` is a large TypeScript reference implementation spanning adapters, agents, audit, policy, reconciler, security, metrics, and telemetry. It appears to serve as a canonical design playground and comparison layer for the spec. `conformance/` contains language-agnostic behavioral tests and fixtures that validate implementations against the spec. Together, they define the compatibility boundary for any adapter, policy engine, or agent runtime.

13. **External integrations and ecosystem**
   The repo integrates with GitHub Actions, Slack/Teams notifications, issue trackers, CI systems, and multiple developer tools. The `contrib/adapters/` tree shows the framework’s intended adapter ecosystem for systems like Jira, GitLab, Bitbucket, HubSpot, Salesforce, Zendesk, SonarQube, and Semgrep. Operational scripts and workflows enforce branch protection, issue-link requirements, backlog drift checks, attestation verification, release signing, and auto-rebase behaviors.

14. **How the main end-to-end flow fits together**
   The cleanest architecture diagram is a left-to-right flow:
   - **Spec and backlog inputs** enter through schemas, RFCs, tasks, and DOR checks.
   - **Orchestrator admission** filters work by readiness, dependency state, in-flight status, and policy.
   - **Pipeline execution** creates an isolated worktree, dispatches a developer harness, runs reviewers, and iterates.
   - **Attestation and verification** seal the result and gate merge/PR progression.
   - **Monitoring/analytics/TUI** consume events, captures, and state snapshots for operator oversight.
   - **SDKs/reference/conformance** define the portable contract and keep implementations aligned.  
   That is the core architecture this repository implements.

Main entry points: [`orchestrator/src/orchestrator.ts`](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/orchestrator.ts) (Orchestrator), [`spec/spec.md`](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/spec/spec.md) (Spec core), [`pipeline-cli/src/execute-pipeline.ts`](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/pipeline-cli/src/execute-pipeline.ts) (Pipeline CLI), [`spec/schemas`](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/spec/schemas) (Schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spec["Spec"]
  node_spec_core["Spec core<br/>normative model<br/>[spec.md]"]
  node_spec_schemas["Schemas<br/>wire format"]
  node_spec_rfc["RFCs<br/>architecture history"]
end

subgraph group_runtime["Runtime"]
  node_orchestrator["Orchestrator<br/>control plane<br/>[orchestrator.ts]"]
  node_admission_filters["Admission<br/>readiness gate<br/>[admission.ts]"]
  node_analysis_layer["Analysis"]
  node_runner_layer["Runners<br/>agent harnesses"]
  node_worktree_runtime["Worktrees<br/>git isolation<br/>[worktree-pool.ts]"]
  node_pipeline_cli["Pipeline CLI<br/>execution engine"]
  node_pipeline_steps["Pipeline steps<br/>lifecycle stages"]
  node_pipeline_dispatch["Dispatch<br/>supervision"]
  node_attestation_chain[("Attestation<br/>proof chain")]
  node_dor_gate["DoR gate<br/>definition of ready"]
end

subgraph group_surface["Surfaces"]
  node_tui["Operator TUI<br/>control surface"]
  node_plugin["Claude plugin<br/>assistant integration"]
  node_dashboard["Dashboard<br/>web console"]
end

subgraph group_packages["SDKs"]
  node_sdk_ts["TypeScript SDK<br/>portable SDK"]
  node_sdk_py["Python SDK<br/>portable SDK"]
  node_sdk_go["Go SDK<br/>portable SDK"]
  node_reference_impl["Reference impl<br/>canonical implementation"]
  node_conformance["Conformance<br/>behavioral tests"]
end

subgraph group_ops["Ops"]
  node_scripts_ci["Scripts & CI<br/>governance automation"]
  node_backlog_state["Backlog & state<br/>task ledger"]
end

node_spec_core -->|"defines"| node_spec_schemas
node_spec_rfc -->|"evolves"| node_spec_core
node_spec_core -->|"admitted by"| node_orchestrator
node_spec_schemas -->|"validates"| node_plugin
node_spec_schemas -->|"validates"| node_pipeline_cli
node_backlog_state -->|"feeds"| node_dor_gate
node_dor_gate -->|"primes"| node_admission_filters
node_analysis_layer -->|"scores"| node_admission_filters
node_admission_filters -->|"routes"| node_orchestrator
node_orchestrator -->|"dispatches"| node_runner_layer
node_orchestrator -->|"isolates"| node_worktree_runtime
node_orchestrator -->|"invokes"| node_pipeline_cli
node_pipeline_cli -->|"executes"| node_pipeline_steps
node_pipeline_cli -->|"supervises"| node_pipeline_dispatch
node_pipeline_steps -->|"seals"| node_attestation_chain
node_attestation_chain -->|"gated by"| node_scripts_ci
node_pipeline_cli -->|"reports"| node_tui
node_orchestrator -->|"observed by"| node_tui
node_plugin -->|"drives"| node_pipeline_cli
node_plugin -->|"queries"| node_orchestrator
node_dashboard -->|"reads"| node_backlog_state
node_dashboard -->|"shows"| node_attestation_chain
node_sdk_ts -->|"mirrors"| node_spec_core
node_sdk_py -->|"mirrors"| node_spec_core
node_sdk_go -->|"mirrors"| node_spec_core
node_reference_impl -->|"implements"| node_spec_core
node_conformance -->|"checks"| node_spec_schemas
node_conformance -->|"compares"| node_reference_impl
node_scripts_ci -->|"enforces"| node_spec_rfc
node_scripts_ci -->|"maintains"| node_backlog_state

click node_spec_core "https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/spec/spec.md"
click node_spec_schemas "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/spec/schemas"
click node_spec_rfc "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/spec/rfcs"
click node_orchestrator "https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/orchestrator.ts"
click node_admission_filters "https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/admission.ts"
click node_analysis_layer "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/orchestrator/src/analysis"
click node_runner_layer "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/orchestrator/src/runners"
click node_worktree_runtime "https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/runtime/worktree-pool.ts"
click node_pipeline_cli "https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/pipeline-cli/src/execute-pipeline.ts"
click node_pipeline_steps "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/steps"
click node_pipeline_dispatch "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/dispatch"
click node_attestation_chain "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/attestation"
click node_dor_gate "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/dor"
click node_tui "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/tui"
click node_plugin "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/ai-sdlc-plugin"
click node_dashboard "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/dashboard/src/app"
click node_sdk_ts "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-typescript/src"
click node_sdk_py "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-python/src/ai_sdlc"
click node_sdk_go "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-go"
click node_reference_impl "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/reference/src"
click node_conformance "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/conformance/tests"
click node_scripts_ci "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/scripts"
click node_backlog_state "https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/backlog"

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_spec_core,node_spec_schemas,node_spec_rfc toneBlue
class node_orchestrator,node_admission_filters,node_analysis_layer,node_runner_layer,node_worktree_runtime,node_pipeline_cli,node_pipeline_steps,node_pipeline_dispatch,node_attestation_chain,node_dor_gate toneAmber
class node_tui,node_plugin,node_dashboard toneMint
class node_sdk_ts,node_sdk_py,node_sdk_go,node_reference_impl,node_conformance toneRose
class node_scripts_ci,node_backlog_state toneIndigo
```

## Components

### Spec

Normative contracts, schemas, and RFCs.

- [Spec core](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/spec/spec.md): normative model · Source-of-truth domain model for pipelines, roles, policy, DOR, dispatch, attestation, and journeys. · `spec/spec.md`
- [Schemas](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/spec/schemas): wire format · JSON Schemas defining validation boundaries and artifact contracts. · `spec/schemas`
- [RFCs](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/spec/rfcs): architecture history · Design decisions and evolution path for the framework. · `spec/rfcs`

### Runtime

Admission, orchestration, execution, attestation, and control loops.

- [Orchestrator](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/orchestrator.ts): control plane · Admissions, policy, dependency analysis, state, runners, notifications, and CLI coordination. · `orchestrator/src/orchestrator.ts`
- [Admission](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/admission.ts): readiness gate · Readiness, dependency, in-flight, blocked, and DOR-based filtering before dispatch. · `orchestrator/src/admission.ts`
- [Analysis](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/orchestrator/src/analysis): repo analysis · Diff, dependency, hotspot, pattern, and context analysis used by scoring and dispatch. · `orchestrator/src/analysis`
- [Runners](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/orchestrator/src/runners): agent harnesses · Pluggable execution harnesses for Claude, Codex, Copilot, Cursor, and generic LLM backends. · `orchestrator/src/runners`
- [Worktrees](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/orchestrator/src/runtime/worktree-pool.ts): git isolation · Per-task worktree, branch, and parallelism management for isolated execution. · `orchestrator/src/runtime/worktree-pool.ts`
- [Pipeline CLI](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/pipeline-cli/src/execute-pipeline.ts): execution engine · Stepwise Step 0–13 task lifecycle engine for dispatch, review, attestation, and cleanup. · `pipeline-cli/src/execute-pipeline.ts`
- [Pipeline steps](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/steps): lifecycle stages · Sweep, validate, branch, worktree, prompt, parse, review, iterate, finalize, rebase, push, sibling PRs, cleanup. · `pipeline-cli/src/steps`
- [Dispatch](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/dispatch): supervision · Session tracking, worker recommendation, supervisor loop, and active run management. · `pipeline-cli/src/dispatch`
- [Attestation](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/attestation): proof chain · DSSE signing, Merkle/transcript capture, envelope verification, and PR gating. · `pipeline-cli/src/attestation`
- [DoR gate](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/dor): definition of ready · Entry checks that evaluate issue/task readiness, scope, references, done-state, and dependencies. · `pipeline-cli/src/dor`

### Surfaces

Human and assistant-facing entry points.

- [Operator TUI](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/pipeline-cli/src/tui): control surface · Terminal dashboard for blockers, PRs, critical path, configuration, and analytics. · `pipeline-cli/src/tui`
- [Claude plugin](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/ai-sdlc-plugin): assistant integration · Slash commands, hooks, roles, and MCP server for Claude Code governance workflows. · `ai-sdlc-plugin`
- [Dashboard](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/dashboard/src/app): web console · Web-based analytics and operator pages for runs, DOR, audit, autonomy, codebase, and cost. · `dashboard/src/app`

### SDKs

Portable language bindings and reference implementations.

- [TypeScript SDK](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-typescript/src): portable SDK · Cross-language TypeScript surface mirroring adapters, agents, policy, compliance, reconciler, and telemetry. · `sdk-typescript/src`
- [Python SDK](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-python/src/ai_sdlc): portable SDK · Python bindings for the same core concepts and validation model. · `sdk-python/src/ai_sdlc`
- [Go SDK](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/sdk-go): portable SDK · Go bindings plus operator-oriented APIs and CRDs for deployment-managed environments. · `sdk-go`
- [Reference impl](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/reference/src): canonical implementation · Large TypeScript reference architecture spanning adapters, agents, policy, security, metrics, and reconciliation. · `reference/src`
- [Conformance](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/conformance/tests): behavioral tests · Language-agnostic behavioral fixtures and runner validating implementations against the spec. · `conformance/tests`

### Ops

Governance, docs, CI, and supporting automation.

- [Scripts & CI](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/scripts): governance automation · Pre-push, attestation, drift, DOR, release, and workflow enforcement scripts plus GitHub Actions. · `scripts`
- [Backlog & state](https://github.com/ai-sdlc-framework/ai-sdlc/tree/main/backlog): task ledger · Backlog tasks, decisions, captures, state artifacts, and attestation/event stores used by the runtime. · `backlog`

## Connections

- Spec core → Schemas: defines · Spec materializes as JSON schemas and wire contracts.
- RFCs → Spec core: evolves · RFCs explain and extend the normative model.
- Spec core → Orchestrator: admitted by · Orchestrator consumes the spec to decide what can run.
- Schemas → Claude plugin: validates · Plugin/MCP payloads are shaped by schema contracts.
- Schemas → Pipeline CLI: validates · Pipeline artifacts and envelopes are validated against schemas.
- Backlog & state → DoR gate: feeds · Tasks and captured state are checked for readiness.
- DoR gate → Admission: primes · DoR output becomes an admission signal.
- Analysis → Admission: scores · Dependency and complexity analysis informs readiness and priority.
- Admission → Orchestrator: routes · Only admissible work enters orchestration.
- Orchestrator → Runners: dispatches · Orchestrator selects a harness and agent role.
- Orchestrator → Worktrees: isolates · Task execution is placed into worktree/branch sandboxes.
- Orchestrator → Pipeline CLI: invokes · Orchestrator can hand off to the stepwise execution engine.
- Pipeline CLI → Pipeline steps: executes · Core lifecycle is implemented as ordered pipeline steps.
- Pipeline CLI → Dispatch: supervises · Dispatch board, sessions, and worker coordination live here.
- Pipeline steps → Attestation: seals · Execution and reviewer outcomes are signed and verified.
- Attestation → Scripts & CI: gated by · CI and helper scripts enforce attestation verification.
- Pipeline CLI → Operator TUI: reports · Live state and analytics are surfaced to operators.
- Orchestrator → Operator TUI: observed by · Operator TUI consumes orchestrator events and snapshots.
- Claude plugin → Pipeline CLI: drives · Claude commands and MCP tools initiate execution workflows.
- Claude plugin → Orchestrator: queries · Plugin surfaces governance-aware status and triage context.
- Dashboard → Backlog & state: reads · Web UI aggregates backlog, run, and decision data.
- Dashboard → Attestation: shows · Dashboard exposes proof and audit state.
- TypeScript SDK → Spec core: mirrors · TypeScript SDK embodies the same core concepts.
- Python SDK → Spec core: mirrors · Python SDK embodies the same core concepts.
- Go SDK → Spec core: mirrors · Go SDK embodies the same core concepts.
- Reference impl → Spec core: implements · Reference code is a canonical implementation playground.
- Conformance → Schemas: checks · Fixtures validate implementations against schema and behavior.
- Conformance → Reference impl: compares · Reference implementation serves as a conformance target.
- Scripts & CI → RFCs: enforces · Repo automation checks RFC/docs and lifecycle rules.
- Scripts & CI → Backlog & state: maintains · Scripts manage drift, task movement, and release hygiene.
