Moonshot Architecture
Use When
Use when a PRD or brownfield objective needs architecture decisions before planning.
Route Away
Use product-orchestrator when intent is unresolved and moonshot-plan-writer after architecture acceptance.
Role
Create an evidence-grounded design package between product definition and execution.
Modes
greenfield_prd: start from a PRD and produce architecture decisions before implementation planning.
brownfield_codebase: recover the current architecture from repository evidence, then produce fit-gap and migration guidance.
hybrid_prd_plus_existing_repo: combine PRD normalization with Brownfield constraints and produce SPEC_DELTA.
meta_harness_design: design Moonshot Relay harness changes and hand them off to moonshot-plan-writer.
Procedure
- Classify the mode.
- Build
projectKnowledgeContext with the current stage and preserve status-only metadata.
- Inspect project-local
knowledgeAnchors declared in the target root AGENTS.md, if present. Select only anchors whose mustConsultFor/keywords match the current architecture scope, then read the smallest referenced agreement documents needed for evidence.
- Build compact architecture context through
scripts/architecture-context-build.mjs when available.
- Normalize requirements into
REQUIREMENT_INVENTORY.md.
- Extract ASRs and quality attribute scenarios.
- Build domain model, capability map, and data/integration flow.
- For Brownfield/Hybrid work, recover current architecture and existing constraints from repository evidence.
8.1. Apply
docs/public/guidelines/retrieval-and-recency-policy.md and docs/public/guidelines/research-evidence-policy.md when architecture inputs include current product, dependency, platform, model, pricing, legal, or security facts.
- Generate at least two architecture options for non-trivial work.
- Run trade-off review.
- Write C4 model and ADRs for significant decisions.
- Produce
SPEC.md or SPEC_DELTA.md.
- Produce
PLAN.md and TRACEABILITY_MATRIX.md.
- Run
architecture-gate-reviewer and write ARCHITECTURE_REVIEW.md.
- Hand off to
moonshot-plan-writer, moonshot-orchestrator, or moonshot-phase-runner with explicit owned/read-only/staged paths and verification signals.
Internal stage-owner mapping is loaded conditionally from references/architecture-flow.md.
Internal Stage Owners
Owners: asr-extractor, architecture-option-generator, architecture-tradeoff-reviewer, adr-c4-writer, architecture-gate-reviewer, and codebase-architecture-recovery. architecture-gate-reviewer supplies ARCHITECTURE_REVIEW.md readiness evidence; load the reference for artifact routing.
Hard Stops
- Do not skip ASR extraction for non-trivial PRDs.
- In
greenfield_prd mode, do not require Brownfield current-architecture evidence.
- Do not claim architecture readiness without ADRs for significant decisions.
- Do not produce a Greenfield implementation
PLAN.md unless every accepted requirement maps to a quality scenario, ASR, ADR, task owner, and verification signal.
- Do not hand off to implementation without traceability from accepted requirements to owners and verification signals.
- Do not hand off to implementation without
architecture-gate-reviewer readiness evidence.
- Do not invent Brownfield current architecture without repository evidence.
- Do not inline raw MemoryGraph records, KG edge dumps, ontology dumps, runtime logs, transcripts, browser scrapes, or secret-like strings.
- Do not mutate live
.claude/**, .codex/**, account-root state, or runtime profiles during architecture design.
- Do not replace
moonshot-phase-runner completion authority or scripts/runtime-state.mjs assess-completion.
Output Contract
- Mode classification and input source path.
- Architecture package path.
- Project-local knowledge anchor disposition: consulted anchor IDs, consumed agreement paths, and skipped-anchor rationale when anchors were present.
- Retrieval/research evidence for current or volatile external facts, plus context relevance disposition for project knowledge anchors.
- Requirement inventory and ASR catalog.
- Domain/capability model or Brownfield current architecture evidence.
- Option comparison and trade-off review.
- ADR/C4 outputs for significant decisions.
- Architecture gate review status.
- Traceability matrix linking requirement IDs to implementation owners and verification signals.
- Handoff target and rationale.
Public Surface Boundary
This is the public entrypoint; stage helpers stay internal. Executable deepReferences remain skill-local for package resolution.
1---2name: moonshot-architecture3description: Convert a PRD or existing codebase objective into an evidence-grounded architecture design package before implementation planning.4---56# Moonshot Architecture78## Use When910Use when a PRD or brownfield objective needs architecture decisions before planning.1112## Route Away1314Use `product-orchestrator` when intent is unresolved and `moonshot-plan-writer` after architecture acceptance.1516## Role1718Create an evidence-grounded design package between product definition and execution.1920## Modes2122- `greenfield_prd`: start from a PRD and produce architecture decisions before implementation planning.23- `brownfield_codebase`: recover the current architecture from repository evidence, then produce fit-gap and migration guidance.24- `hybrid_prd_plus_existing_repo`: combine PRD normalization with Brownfield constraints and produce `SPEC_DELTA`.25- `meta_harness_design`: design Moonshot Relay harness changes and hand them off to `moonshot-plan-writer`.2627## Procedure28291. Classify the mode.302. Build `projectKnowledgeContext` with the current stage and preserve status-only metadata.313. Inspect project-local `knowledgeAnchors` declared in the target root `AGENTS.md`, if present. Select only anchors whose `mustConsultFor`/keywords match the current architecture scope, then read the smallest referenced agreement documents needed for evidence.324. Build compact architecture context through `scripts/architecture-context-build.mjs` when available.335. Normalize requirements into `REQUIREMENT_INVENTORY.md`.346. Extract ASRs and quality attribute scenarios.357. Build domain model, capability map, and data/integration flow.368. For Brownfield/Hybrid work, recover current architecture and existing constraints from repository evidence.378.1. Apply `docs/public/guidelines/retrieval-and-recency-policy.md` and `docs/public/guidelines/research-evidence-policy.md` when architecture inputs include current product, dependency, platform, model, pricing, legal, or security facts.389. Generate at least two architecture options for non-trivial work.3910. Run trade-off review.4011. Write C4 model and ADRs for significant decisions.4112. Produce `SPEC.md` or `SPEC_DELTA.md`.4213. Produce `PLAN.md` and `TRACEABILITY_MATRIX.md`.4314. Run `architecture-gate-reviewer` and write `ARCHITECTURE_REVIEW.md`.4415. Hand off to `moonshot-plan-writer`, `moonshot-orchestrator`, or `moonshot-phase-runner` with explicit owned/read-only/staged paths and verification signals.4546Internal stage-owner mapping is loaded conditionally from `references/architecture-flow.md`.4748## Internal Stage Owners4950Owners: `asr-extractor`, `architecture-option-generator`, `architecture-tradeoff-reviewer`, `adr-c4-writer`, `architecture-gate-reviewer`, and `codebase-architecture-recovery`. `architecture-gate-reviewer` supplies `ARCHITECTURE_REVIEW.md` readiness evidence; load the reference for artifact routing.5152## Hard Stops5354- Do not skip ASR extraction for non-trivial PRDs.55- In `greenfield_prd` mode, do not require Brownfield current-architecture evidence.56- Do not claim architecture readiness without ADRs for significant decisions.57- Do not produce a Greenfield implementation `PLAN.md` unless every accepted requirement maps to a quality scenario, ASR, ADR, task owner, and verification signal.58- Do not hand off to implementation without traceability from accepted requirements to owners and verification signals.59- Do not hand off to implementation without `architecture-gate-reviewer` readiness evidence.60- Do not invent Brownfield current architecture without repository evidence.61- Do not inline raw MemoryGraph records, KG edge dumps, ontology dumps, runtime logs, transcripts, browser scrapes, or secret-like strings.62- Do not mutate live `.claude/**`, `.codex/**`, account-root state, or runtime profiles during architecture design.63- Do not replace `moonshot-phase-runner` completion authority or `scripts/runtime-state.mjs assess-completion`.6465## Output Contract6667- Mode classification and input source path.68- Architecture package path.69- Project-local knowledge anchor disposition: consulted anchor IDs, consumed agreement paths, and skipped-anchor rationale when anchors were present.70- Retrieval/research evidence for current or volatile external facts, plus context relevance disposition for project knowledge anchors.71- Requirement inventory and ASR catalog.72- Domain/capability model or Brownfield current architecture evidence.73- Option comparison and trade-off review.74- ADR/C4 outputs for significant decisions.75- Architecture gate review status.76- Traceability matrix linking requirement IDs to implementation owners and verification signals.77- Handoff target and rationale.7879## Public Surface Boundary8081This is the public entrypoint; stage helpers stay internal. Executable `deepReferences` remain skill-local for package resolution.