Skip to content

Architecture: Domain Model

Language: English | 日本語 Last updated: 2026-04-30 Update history:

  • 2026-04-30: Expand to 5-domain model — add Doc Flow (#54)
  • 2026-04-25: split from Architecture.md; #42 Audience: Agent developers

This page is one of three pages split from the original Architecture.md (#42). It covers Aphelion’s conceptual domain model: the five-domain model, session isolation strategy, and PRODUCT_TYPE branching. See the sibling pages for protocols and operational rules: Protocols, Operational Rules.


Aphelion divides the software development lifecycle into five independent domains:

flowchart LR
    DR["DISCOVERY_RESULT.md"]
    DLR["DELIVERY_RESULT.md"]
    OPR["OPS_RESULT.md"]
    MR["MAINTENANCE_RESULT.md\n(Major only)"]
    DCR["DOC_FLOW_RESULT.md\n+ deliverables/{slug}/*.md"]

    Discovery["Discovery Flow\n(6 agents)"] -->|generates| DR
    DR -->|input for| Delivery["Delivery Flow\n(12 agents)"]
    Delivery -->|generates| DLR
    DLR -->|input for| Ops["Operations Flow\n(4 agents)\nservice only"]
    Ops -->|generates| OPR

    Maintenance["Maintenance Flow\n(3 new agents + reuse)"] -->|Major| MR
    MR -.->|handoff| Delivery

    Doc["Doc Flow\n(1 orchestrator + 6 authors)\non demand"] -->|generates| DCR

Discovery explores and structures requirements, producing DISCOVERY_RESULT.md.

Delivery designs, implements, tests, and reviews, producing DELIVERY_RESULT.md.

Operations builds infrastructure, database operations, and operations plans, producing OPS_RESULT.md. Only runs for PRODUCT_TYPE: service.

Maintenance (fourth flow, independent) triggers on bugs, CVE alerts, performance regressions, or small feature requests for existing projects. Performs Patch / Minor / Major triage via change-classifier. Patch and Minor complete independently; Major generates MAINTENANCE_RESULT.md and hands off to Delivery Flow as a pre-processing stage. See Maintenance Flow Triage for details.

Doc (fifth flow, on-demand) generates customer-deliverable documents (HLD, LLD, API reference, ops manual, end-user manual, handover) from existing Aphelion artifacts. Invoked manually via /doc-flow at any point after SPEC.md and ARCHITECTURE.md are available — no automatic chaining from other flows. Produces DOC_FLOW_RESULT.md and files under docs/deliverables/{slug}/. See Doc Flow Triage and Agents Reference: Doc Domain for details.

PrincipleDescription
Domain separationEach domain runs in an independent Claude Code session
File handoffDomains connect through .md files, not automatic API calls
No automatic chainingEach domain must be started by the user after reviewing the previous domain’s output
Triage adaptationEach flow orchestrator assesses project scale and selects a plan tier
Independent invocationAny agent can be invoked standalone if its input files are available
flowchart LR
    D["Discovery<br/>(6 agents)<br/>interviewer → ... → scope-planner"]
    DV["Delivery<br/>(12 agents)<br/>spec-designer → ... → releaser"]
    O["Operations<br/>(4 agents)<br/>infra-builder → ... → ops-planner"]
    M["Maintenance<br/>(3 agents + reuse)<br/>change-classifier → impact-analyzer → analyst → ..."]
    DC["Doc<br/>(1 orchestrator + 6 authors)<br/>doc-flow → hld-author → ... → handover-author"]
    S["Standalone<br/>analyst / codebase-analyzer / sandbox-runner"]

    D -->|DISCOVERY_RESULT.md| DV
    DV -->|DELIVERY_RESULT.md| O
    M -.->|MAINTENANCE_RESULT.md<br/>Major only| DV
    DC -.->|on demand<br/>no chaining| DC
    S -.optional.-> DV

Per-domain details: Discovery · Delivery · Operations · Maintenance · Doc · Standalone

Maintenance is a fourth flow independent from the primary Discovery → Delivery → Operations pipeline, invoked via /maintenance-flow for existing-project maintenance tasks. Patch and Minor plans complete standalone; only Major plans hand off to Delivery via MAINTENANCE_RESULT.md. See Agents Reference → Maintenance and Triage System → Maintenance Flow Triage for full specs.

Doc is a fifth flow independent from all other flows, invoked manually via /doc-flow at any stage of the project lifecycle after SPEC.md and ARCHITECTURE.md exist. It does not participate in automatic chaining from Discovery / Delivery / Operations / Maintenance flows. See Agents Reference → Doc Domain and Triage System → Doc Flow Triage for full specs.


Each domain runs in a separate Claude Code session. This is a deliberate design choice:

  • Prevents context window overflow: A full project lifecycle can involve thousands of lines of context. Running everything in one session risks hitting token limits.
  • Enables specialization: Each orchestrator loads only the rules and agents relevant to its domain.
  • Forces explicit checkpoints: Users must review each domain’s output before launching the next, ensuring quality gates are not skipped.

The five flow orchestrators — discovery-flow, delivery-flow, operations-flow, maintenance-flow, doc-flow — are the entry points for each session.


The PRODUCT_TYPE field determined during Discovery controls which domains run:

PRODUCT_TYPEDiscoveryDeliveryMaintenanceOperationsDoc
serviceRunRunRun (as needed)RunRun (on demand)
toolRunRunRun (as needed)SkipRun (user-manual / ops-manual auto-skip)
libraryRunRunRun (as needed)SkipRun (user-manual / ops-manual auto-skip)
cliRunRunRun (as needed)SkipRun (user-manual / ops-manual auto-skip)

Only service products require infrastructure, database operations, and deployment procedures. Maintenance applies to all product types whenever an existing project needs post-release changes. Doc Flow runs on demand for all product types — user-manual-author and ops-manual-author auto-skip when UI_SPEC.md or infra artifacts are absent (typical for tool / library / cli).