architecture-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArchitecture Review
架构评审
The architecture review validates that the complete body of architectural decisions
covers all game design requirements, is internally consistent, and correctly targets
the project's pinned engine version. It is the quality gate between Technical Setup
and Pre-Production.
Argument modes:
- No argument / : Full review — all phases
full - : Traceability only — which GDD requirements have no ADR
coverage - : Cross-ADR conflict detection only
consistency - : Engine compatibility audit only
engine - : Review architecture coverage for one specific GDD
single-gdd [path] - : Requirements Traceability Matrix — extends the standard matrix to include story file paths and test file paths; outputs
rtmwith the full GDD requirement → ADR → Story → Test chain. Use in Production phase when stories and tests exist.docs/architecture/requirements-traceability.md
架构评审用于验证完整的架构决策集是否覆盖所有游戏设计需求、内部是否一致,以及是否正确适配项目锁定的引擎版本。它是技术搭建阶段与预生产阶段之间的质量关卡。
参数模式:
- 无参数 / :全面评审 —— 所有阶段
full - :仅追溯性检查 —— 哪些GDD需求没有对应的ADR
coverage - :仅检测跨ADR冲突
consistency - :仅进行引擎兼容性审计
engine - :针对特定GDD评审架构覆盖情况
single-gdd [path] - :需求可追溯矩阵 —— 扩展标准矩阵,包含故事文件路径和测试文件路径;将完整的GDD需求→ADR→故事→测试链路输出到
rtm。在故事和测试已存在的生产阶段使用。docs/architecture/requirements-traceability.md
Phase 1: Load Everything
阶段1:加载所有内容
Phase 1a — L0: Summary Scan (fast, low tokens)
阶段1a —— L0:摘要扫描(快速、低 token 消耗)
Before reading any full document, use Grep to extract sections
from all GDDs and ADRs:
## SummaryGrep pattern="## Summary" glob="design/gdd/*.md" output_mode="content" -A 4
Grep pattern="## Summary" glob="docs/architecture/adr-*.md" output_mode="content" -A 3For mode: use the target GDD's summary to identify which
ADRs reference the same system (Grep ADRs for the system name), then full-read
only those ADRs. Skip full-reading unrelated GDDs entirely.
single-gdd [path]For mode: only full-read ADRs — GDDs are not needed for engine checks.
engineFor or mode: proceed to full-read everything below.
coveragefull在读取任何完整文档之前,使用Grep从所有GDD和ADR中提取部分:
## SummaryGrep pattern="## Summary" glob="design/gdd/*.md" output_mode="content" -A 4
Grep pattern="## Summary" glob="docs/architecture/adr-*.md" output_mode="content" -A 3对于模式:使用目标GDD的摘要识别哪些ADR引用了相同系统(通过Grep搜索ADR中的系统名称),然后仅完整读取这些ADR。完全跳过读取无关的GDD。
single-gdd [path]对于模式:仅完整读取ADR —— 引擎检查不需要GDD。
engine对于或模式:继续读取以下所有完整内容。
coveragefullPhase 1b — L1/L2: Full Document Load
阶段1b —— L1/L2:完整文档加载
Read all inputs appropriate to the mode:
读取与当前模式匹配的所有输入:
Design Documents
设计文档
- All in-scope GDDs in — read every file completely
design/gdd/ - — the authoritative list of systems
design/gdd/systems-index.md
- 中所有范围内的GDD —— 完整读取每个文件
design/gdd/ - —— 权威的系统列表
design/gdd/systems-index.md
Architecture Documents
架构文档
- All in-scope ADRs in — read every file completely
docs/architecture/ - if it exists
docs/architecture/architecture.md
- 中所有范围内的ADR —— 完整读取每个文件
docs/architecture/ - 若存在则读取
docs/architecture/architecture.md
Engine Reference
引擎参考
docs/engine-reference/[engine]/VERSION.mddocs/engine-reference/[engine]/breaking-changes.mddocs/engine-reference/[engine]/deprecated-apis.md- All files in
docs/engine-reference/[engine]/modules/
docs/engine-reference/[engine]/VERSION.mddocs/engine-reference/[engine]/breaking-changes.mddocs/engine-reference/[engine]/deprecated-apis.md- 中的所有文件
docs/engine-reference/[engine]/modules/
Project Standards
项目标准
.claude/docs/technical-preferences.md
Report a count: "Loaded [N] GDDs, [M] ADRs, engine: [name + version]."
Also read if it exists. Extract entries with
Domain matching the systems under review (Architecture, Engine, or any GDD domain
being covered). Surface recurring patterns as a "Known conflict-prone areas" note
at the top of the Phase 4 conflict detection output.
docs/consistency-failures.md.claude/docs/technical-preferences.md
报告统计:"已加载 [N] 个GDD、[M] 个ADR,引擎:[名称 + 版本]。"
若存在也需读取。提取与评审系统(架构、引擎或任何被覆盖的GDD领域)匹配的条目。在阶段4冲突检测输出顶部,将重复出现的模式作为"已知易冲突区域"提示展示。
docs/consistency-failures.mdPhase 2: Extract Technical Requirements from Every GDD
阶段2:从每个GDD中提取技术需求
Pre-load the TR Registry
预加载TR注册表
Before extracting any requirements, read
if it exists. Index existing entries by and by normalized
text (lowercase, trimmed). This prevents ID renumbering across review runs.
docs/architecture/tr-registry.yamlidrequirementFor each requirement you extract, the matching rule is:
- Exact/near match to an existing registry entry for the same system →
reuse that entry's TR-ID unchanged. Update the text in the registry only if the GDD wording changed (same intent, clearer phrasing) — add a
requirementfield.revised: [date] - No match → assign a new ID: next available for that system, starting from the highest existing sequence + 1.
TR-[system]-NNN - Ambiguous (partial match, intent unclear) → ask the user:
"Does '[new requirement text]' refer to the same requirement as, or is it a new requirement?" User answers: "Same requirement" (reuse ID) or "New requirement" (new ID).
TR-[system]-NNN: [existing text]'
For any requirement with in the registry — skip it.
It was removed from the GDD intentionally.
status: deprecatedFor each GDD, read it and extract all technical requirements — things the
architecture must provide for the system to work. A technical requirement is any
statement that implies a specific architectural decision.
Categories to extract:
| Category | Example |
|---|---|
| Data structures | "Each entity has health, max health, status effects" → needs a component/data schema |
| Performance constraints | "Collision detection must run at 60fps with 200 entities" → physics budget ADR |
| Engine capability | "Inverse kinematics for character animation" → IK system ADR |
| Cross-system communication | "Damage system notifies UI and audio simultaneously" → event/signal architecture ADR |
| State persistence | "Player progress persists between sessions" → save system ADR |
| Threading/timing | "AI decisions happen off the main thread" → concurrency ADR |
| Platform requirements | "Supports keyboard, gamepad, touch" → input system ADR |
For each GDD, produce a structured list:
GDD: [filename]
System: [system name]
Technical Requirements:
TR-[GDD]-001: [requirement text] → Domain: [Physics/Rendering/etc]
TR-[GDD]-002: [requirement text] → Domain: [...]This becomes the requirements baseline — the complete set of what the
architecture must cover.
在提取任何需求之前,若存在则读取。通过和标准化的文本(小写、去除首尾空格)对现有条目建立索引。这可避免评审运行期间ID重新编号。
docs/architecture/tr-registry.yamlidrequirement对于每个提取的需求,匹配规则如下:
- 精确/近似匹配同一系统的现有注册表条目 → 重复使用该条目的TR-ID。仅当GDD措辞变更(意图相同、表述更清晰)时更新注册表中的文本 —— 添加
requirement字段。revised: [日期] - 无匹配项 → 分配新ID:该系统下的下一个可用,从现有最高序号+1开始。
TR-[system]-NNN - 模糊匹配(部分匹配、意图不明确) → 询问用户:
"'[新需求文本]'是否指的是与相同的需求,还是新需求?" 用户回答:"相同需求"(重复使用ID)或"新需求"(分配新ID)。
TR-[system]-NNN: [现有文本]
对于注册表中标记为的需求 —— 跳过。它已被有意从GDD中移除。
status: deprecated读取每个GDD并提取所有技术需求 —— 架构必须提供的、确保系统正常运行的内容。技术需求是任何暗示特定架构决策的陈述。
需提取的类别:
| 类别 | 示例 |
|---|---|
| 数据结构 | "每个实体拥有生命值、最大生命值、状态效果" → 需要组件/数据 schema |
| 性能约束 | "200个实体时碰撞检测必须以60fps运行" → 物理预算ADR |
| 引擎能力 | "角色动画的反向运动学" → IK系统ADR |
| 跨系统通信 | "伤害系统同时通知UI和音频" → 事件/信号架构ADR |
| 状态持久化 | "玩家进度在会话间保持" → 存档系统ADR |
| 线程/时序 | "AI决策在主线程外执行" → 并发ADR |
| 平台需求 | "支持键盘、游戏手柄、触摸" → 输入系统ADR |
为每个GDD生成结构化列表:
GDD: [文件名]
System: [系统名称]
Technical Requirements:
TR-[GDD]-001: [需求文本] → Domain: [Physics/Rendering/etc]
TR-[GDD]-002: [需求文本] → Domain: [...]这将成为需求基线 —— 架构必须覆盖的完整需求集合。
Phase 3: Build the Traceability Matrix
阶段3:构建可追溯矩阵
For each technical requirement extracted in Phase 2, search the ADRs:
- Read every ADR's "GDD Requirements Addressed" section
- Check if it explicitly references the requirement or its GDD
- Check if the ADR's decision text implicitly covers the requirement
- Mark coverage status:
| Status | Meaning |
|---|---|
| ✅ Covered | An ADR explicitly addresses this requirement |
| ⚠️ Partial | An ADR partially covers this, or coverage is ambiguous |
| ❌ Gap | No ADR addresses this requirement |
Build the full matrix:
undefined针对阶段2中提取的每个技术需求,搜索ADR:
- 读取每个ADR的"GDD Requirements Addressed"部分
- 检查是否明确引用了该需求或其所属GDD
- 检查ADR的决策文本是否隐含覆盖了该需求
- 标记覆盖状态:
| 状态 | 含义 |
|---|---|
| ✅ 已覆盖 | 有ADR明确处理该需求 |
| ⚠️ 部分覆盖 | ADR部分覆盖该需求,或覆盖情况不明确 |
| ❌ 缺口 | 无ADR处理该需求 |
构建完整矩阵:
undefinedTraceability Matrix
Traceability Matrix
| Requirement ID | GDD | System | Requirement | ADR Coverage | Status |
|---|---|---|---|---|---|
| TR-combat-001 | combat.md | Combat | Hitbox detection < 1 frame | ADR-0003 | ✅ |
| TR-combat-002 | combat.md | Combat | Combo window timing | — | ❌ GAP |
| TR-inventory-001 | inventory.md | Inventory | Persistent item storage | ADR-0005 | ✅ |
Count the totals: X covered, Y partial, Z gaps.
---| Requirement ID | GDD | System | Requirement | ADR Coverage | Status |
|---|---|---|---|---|---|
| TR-combat-001 | combat.md | Combat | Hitbox detection < 1 frame | ADR-0003 | ✅ |
| TR-combat-002 | combat.md | Combat | Combo window timing | — | ❌ GAP |
| TR-inventory-001 | inventory.md | Inventory | Persistent item storage | ADR-0005 | ✅ |
统计总数:X个已覆盖,Y个部分覆盖,Z个缺口。
---Phase 3b: Story and Test Linkage (RTM mode only)
阶段3b:故事与测试关联(仅RTM模式)
Skip this phase unless the argument is or with stories present.
rtmfullThis phase extends the Phase 3 matrix to include the story that implements
each requirement and the test that verifies it — producing the full
Requirements Traceability Matrix (RTM).
除非参数为或存在故事的模式,否则跳过此阶段。
rtmfull此阶段扩展阶段3的矩阵,添加实现每个需求的故事和验证它的测试 —— 生成完整的需求可追溯矩阵(RTM)。
Step 3b-1 — Load stories
步骤3b-1 —— 加载故事
Glob (excluding EPIC.md index files). For each
story file:
production/epics/**/*.md- Extract from the story's Context section
TR-ID - Extract story file path, title, Status
- Extract section — the stated test file path
## Test Evidence
遍历(排除EPIC.md索引文件)。对于每个故事文件:
production/epics/**/*.md- 从故事的Context部分提取
TR-ID - 提取故事文件路径、标题、状态
- 提取部分 —— 指定的测试文件路径
## Test Evidence
Step 3b-2 — Load test files
步骤3b-2 —— 加载测试文件
Glob and .
Build an index: system → [test file paths].
tests/unit/**/*_test.*tests/integration/**/*_test.*For each test file path from Step 3b-1, confirm via Glob whether the file
actually exists. Note MISSING if the stated path does not exist.
遍历和。构建索引:系统 → [测试文件路径]。
tests/unit/**/*_test.*tests/integration/**/*_test.*针对步骤3b-1中的每个测试文件路径,通过遍历确认文件是否实际存在。若指定路径不存在则标记为MISSING。
Step 3b-3 — Build the extended RTM
步骤3b-3 —— 构建扩展RTM
For each TR-ID in the Phase 3 matrix, add:
- Story: the story file path(s) that reference this TR-ID (may be multiple)
- Test File: the test file path stated in the story's Test Evidence section
- Test Status: COVERED (test file exists) / MISSING (path stated but not found) / NONE (no test path stated, story type may be Visual/Feel/UI) / NO STORY (requirement has no story yet — pre-production gap)
Extended matrix format:
undefined针对阶段3矩阵中的每个TR-ID,添加:
- Story:引用该TR-ID的故事文件路径(可能多个)
- Test File:故事的Test Evidence部分中指定的测试文件路径
- Test Status:COVERED(测试文件存在)/ MISSING(指定路径但未找到)/ NONE(未指定测试路径,故事类型可能为Visual/Feel/UI)/ NO STORY(需求尚无对应故事 —— 预生产阶段缺口)
扩展矩阵格式:
undefinedRequirements Traceability Matrix (RTM)
Requirements Traceability Matrix (RTM)
| TR-ID | GDD | Requirement | ADR | Story | Test File | Test Status |
|---|---|---|---|---|---|---|
| TR-combat-001 | combat.md | Hitbox < 1 frame | ADR-0003 | story-001-hitbox.md | tests/unit/combat/hitbox_test.gd | COVERED |
| TR-combat-002 | combat.md | Combo window | — | story-002-combo.md | — | NONE (Visual/Feel) |
| TR-inventory-001 | inventory.md | Persistent storage | ADR-0005 | — | — | NO STORY |
RTM coverage summary:
- COVERED: [N] — requirements with ADR + story + passing test
- MISSING test: [N] — story exists but test file not found
- NO STORY: [N] — requirements with ADR but no story yet
- NO ADR: [N] — requirements without architectural coverage (from Phase 3 gaps)
- Full chain complete (COVERED): [N/total] ([%])
---| TR-ID | GDD | Requirement | ADR | Story | Test File | Test Status |
|---|---|---|---|---|---|---|
| TR-combat-001 | combat.md | Hitbox < 1 frame | ADR-0003 | story-001-hitbox.md | tests/unit/combat/hitbox_test.gd | COVERED |
| TR-combat-002 | combat.md | Combo window | — | story-002-combo.md | — | NONE (Visual/Feel) |
| TR-inventory-001 | inventory.md | Persistent storage | ADR-0005 | — | — | NO STORY |
RTM覆盖总结:
- COVERED: [N] —— 需求具备ADR + 故事 + 通过测试
- MISSING test: [N] —— 故事存在但未找到测试文件
- NO STORY: [N] —— 需求有ADR但尚未实现
- NO ADR: [N] —— 无架构覆盖的需求(来自阶段3的缺口)
- 完整链路完成(COVERED): [N/total] ([%])
---Phase 4: Cross-ADR Conflict Detection
阶段4:跨ADR冲突检测
Compare every ADR against every other ADR to detect contradictions. A conflict
exists when:
- Data ownership conflict: Two ADRs claim exclusive ownership of the same data
- Integration contract conflict: ADR-A assumes System X has interface Y, but ADR-B defines System X with a different interface
- Performance budget conflict: ADR-A allocates N ms to physics, ADR-B allocates N ms to AI, together they exceed the total frame budget
- Dependency cycle: ADR-A says System X initialises before Y; ADR-B says Y initialises before X
- Architecture pattern conflict: ADR-A uses event-driven communication for a subsystem; ADR-B uses direct function calls to the same subsystem
- State management conflict: Two ADRs define authority over the same game state (e.g. both Combat ADR and Character ADR claim to own the health value)
For each conflict found:
undefined将每个ADR与其他所有ADR进行比较,以检测矛盾。当出现以下情况时存在冲突:
- 数据所有权冲突:两个ADR声称拥有同一数据的独占所有权
- 集成契约冲突:ADR-A假设系统X具有接口Y,但ADR-B定义的系统X具有不同接口
- 性能预算冲突:ADR-A为物理分配N毫秒,ADR-B为AI分配N毫秒,两者总和超过总帧预算
- 依赖循环:ADR-A表示系统X在Y之前初始化;ADR-B表示Y在X之前初始化
- 架构模式冲突:ADR-A对子系统使用事件驱动通信;ADR-B对同一子系统使用直接函数调用
- 状态管理冲突:两个ADR定义了对同一游戏状态的控制权(例如,Combat ADR和Character ADR都声称拥有生命值)
针对每个发现的冲突:
undefinedConflict: [ADR-NNNN] vs [ADR-MMMM]
Conflict: [ADR-NNNN] vs [ADR-MMMM]
Type: [Data ownership / Integration / Performance / Dependency / Pattern / State]
ADR-NNNN claims: [...]
ADR-MMMM claims: [...]
Impact: [What breaks if both are implemented as written]
Resolution options:
- [Option A]
- [Option B]
undefinedType: [Data ownership / Integration / Performance / Dependency / Pattern / State]
ADR-NNNN claims: [...]
ADR-MMMM claims: [...]
Impact: [如果按书面实现两者会导致什么问题]
Resolution options:
- [选项A]
- [选项B]
undefinedADR Dependency Ordering
ADR依赖排序
After conflict detection, analyse the dependency graph across all ADRs:
- Collect all fields from every ADR's "ADR Dependencies" section
Depends On - Topological sort: Determine the correct implementation order — ADRs with no dependencies come first (Foundation), ADRs that depend on those come next, etc.
- Flag unresolved dependencies: If ADR-A's "Depends On" field references an ADR
that is still or does not exist, flag it:
Proposed⚠️ ADR-0005 depends on ADR-0002 — but ADR-0002 is still Proposed. ADR-0005 cannot be safely implemented until ADR-0002 is Accepted. - Cycle detection: If ADR-A depends on ADR-B and ADR-B depends on ADR-A (directly
or transitively), flag it as a :
DEPENDENCY CYCLE🔴 DEPENDENCY CYCLE: ADR-0003 → ADR-0006 → ADR-0003 This cycle must be broken before either can be implemented. - Output recommended implementation order:
### Recommended ADR Implementation Order (topologically sorted) Foundation (no dependencies): 1. ADR-0001: [title] 2. ADR-0003: [title] Depends on Foundation: 3. ADR-0002: [title] (requires ADR-0001) 4. ADR-0005: [title] (requires ADR-0003) Feature layer: 5. ADR-0004: [title] (requires ADR-0002, ADR-0005)
冲突检测后,分析所有ADR之间的依赖关系图:
- 收集所有ADR的"Depends On"字段 从每个ADR的"ADR Dependencies"部分
- 拓扑排序:确定正确的实现顺序 —— 无依赖的ADR优先(基础层),依赖这些ADR的后续进行,以此类推
- 标记未解决的依赖:如果ADR-A的"Depends On"字段引用了仍处于状态或不存在的ADR,则标记:
Proposed⚠️ ADR-0005依赖ADR-0002 —— 但ADR-0002仍处于Proposed状态。 在ADR-0002被Accept之前,ADR-0005无法安全实现。 - 循环检测:如果ADR-A依赖ADR-B且ADR-B依赖ADR-A(直接或间接),则标记为:
DEPENDENCY CYCLE🔴 DEPENDENCY CYCLE: ADR-0003 → ADR-0006 → ADR-0003 在实现其中任何一个之前必须打破此循环。 - 输出推荐的实现顺序:
### Recommended ADR Implementation Order (topologically sorted) Foundation (no dependencies): 1. ADR-0001: [标题] 2. ADR-0003: [标题] Depends on Foundation: 3. ADR-0002: [标题] (requires ADR-0001) 4. ADR-0005: [标题] (requires ADR-0003) Feature layer: 5. ADR-0004: [标题] (requires ADR-0002, ADR-0005)
Phase 5: Engine Compatibility Cross-Check
阶段5:引擎兼容性交叉检查
Across all ADRs, check for engine consistency:
在所有ADR中检查引擎一致性:
Version Consistency
版本一致性
- Do all ADRs that mention an engine version agree on the same version?
- If any ADR was written for an older engine version, flag it as potentially stale
- 所有提及引擎版本的ADR是否都同意使用同一版本?
- 如果任何ADR是针对旧引擎版本编写的,标记为可能过时
Post-Cutoff API Consistency
截止后API一致性
- Collect all "Post-Cutoff APIs Used" fields from all ADRs
- For each, verify against the relevant module reference doc
- Check that no two ADRs make contradictory assumptions about the same post-cutoff API
- 收集所有ADR中的"Post-Cutoff APIs Used"字段
- 针对每个字段,对照相关模块参考文档进行验证
- 检查是否有两个ADR对同一截止后API做出矛盾假设
Deprecated API Check
废弃API检查
- Grep all ADRs for API names listed in
deprecated-apis.md - Flag any ADR referencing a deprecated API
- 在所有ADR中搜索中列出的API名称
deprecated-apis.md - 标记任何引用废弃API的ADR
Missing Engine Compatibility Sections
缺失引擎兼容性部分
- List all ADRs that are missing the Engine Compatibility section entirely
- These are blind spots — their engine assumptions are unknown
Output format:
undefined- 列出所有完全缺失Engine Compatibility部分的ADR
- 这些是盲区 —— 它们的引擎假设未知
输出格式:
undefinedEngine Audit Results
Engine Audit Results
Engine: [name + version]
ADRs with Engine Compatibility section: X / Y total
Deprecated API References:
- ADR-0002: uses [deprecated API] — deprecated since [version]
Stale Version References:
- ADR-0001: written for [older version] — current project version is [version]
Post-Cutoff API Conflicts:
- ADR-0004 and ADR-0007 both use [API] with incompatible assumptions
---Engine: [name + version]
ADRs with Engine Compatibility section: X / Y total
Deprecated API References:
- ADR-0002: uses [deprecated API] — deprecated since [version]
Stale Version References:
- ADR-0001: written for [older version] — current project version is [version]
Post-Cutoff API Conflicts:
- ADR-0004 and ADR-0007 both use [API] with incompatible assumptions
---Engine Specialist Consultation
引擎专家咨询
After completing the engine audit above, spawn the primary engine specialist via Task for a domain-expert second opinion:
- Read
.claude/docs/technical-preferences.mdsection to get the primary specialistEngine Specialists - If no engine is configured, skip this consultation
- Spawn with: all ADRs that contain engine-specific decisions or
subagent_type: [primary specialist]fields, the engine reference docs, and the Phase 5 audit findings. Ask them to:Post-Cutoff APIs Used- Confirm or challenge each audit finding — specialists may know of engine nuances not captured in the reference docs
- Identify engine-specific anti-patterns in the ADRs that the audit may have missed (e.g., using the wrong Godot node type, Unity component coupling, Unreal subsystem misuse)
- Flag ADRs that make assumptions about engine behaviour that differ from the actual pinned version
Incorporate additional findings under in the Phase 5 output. These feed into the final verdict — specialist-identified issues carry the same weight as audit-identified issues.
### Engine Specialist Findings完成上述引擎审计后,通过Task调用主引擎专家获取领域专家的二次意见:
- 读取的
.claude/docs/technical-preferences.md部分获取主专家信息Engine Specialists - 如果未配置引擎,则跳过此咨询
- 调用,传入:所有包含引擎特定决策或
subagent_type: [primary specialist]字段的ADR、引擎参考文档以及阶段5的审计结果。要求他们:Post-Cutoff APIs Used- 确认或质疑每个审计发现 —— 专家可能了解参考文档未涵盖的引擎细节
- 识别ADR中可能被审计遗漏的引擎特定反模式(例如,使用错误的Godot节点类型、Unity组件耦合、Unreal子系统误用)
- 标记对引擎行为做出与实际锁定版本不符假设的ADR
将额外发现整合到阶段5输出的下。这些发现将纳入最终结论 —— 专家识别的问题与审计识别的问题权重相同。
### Engine Specialist FindingsPhase 5b: Design Revision Flags (Architecture → GDD Feedback)
阶段5b:设计修订标记(架构→GDD反馈)
For each HIGH RISK engine finding from Phase 5, check whether any GDD makes an
assumption that the verified engine reality contradicts.
Specific cases to check:
-
Post-cutoff API behaviour differs from training-data assumptions: If an ADR records a verified API behaviour that differs from the default LLM assumption, check all GDDs that reference the related system. Look for design rules written around the old (assumed) behaviour.
-
Known engine limitations in ADRs: If an ADR records a known engine limitation (e.g. "Jolt ignores HingeJoint3D damp", "D3D12 is now the default backend"), check GDDs that design mechanics around the affected feature.
-
Deprecated API conflicts: If Phase 5 flagged a deprecated API used in an ADR, check whether any GDD contains mechanics that assume the deprecated API's behaviour.
For each conflict found, record it in the GDD Revision Flags table:
undefined针对阶段5中每个高风险引擎发现,检查是否有GDD做出与已验证引擎实际情况矛盾的假设。
需检查的特定情况:
-
截止后API行为与训练数据假设不同:如果ADR记录的已验证API行为与默认LLM假设不同,检查所有引用相关系统的GDD。查找围绕旧(假设)行为编写的设计规则。
-
ADR中的已知引擎限制:如果ADR记录了已知引擎限制(例如,"Jolt忽略HingeJoint3D阻尼"、"D3D12现为默认后端"),检查围绕受影响功能设计机制的GDD。
-
废弃API冲突:如果阶段5标记了ADR中使用的废弃API,检查是否有GDD包含假设该废弃API行为的机制。
针对每个发现的冲突,记录在GDD修订标记表中:
undefinedGDD Revision Flags (Architecture → Design Feedback)
GDD Revision Flags (Architecture → Design Feedback)
These GDD assumptions conflict with verified engine behaviour or accepted ADRs.
The GDD should be revised before its system enters implementation.
| GDD | Assumption | Reality (from ADR/engine-reference) | Action |
|---|---|---|---|
| combat.md | "Use HingeJoint3D damp for weapon recoil" | Jolt ignores damp — ADR-0003 | Revise GDD |
If no revision flags are found, write: "No GDD revision flags — all GDD assumptions
are consistent with verified engine behaviour."
Before asking, display the proposed change inline — show the current systems-index row for each flagged GDD and the proposed updated row side by side so the user can see exactly what will change.
Then use `AskUserQuestion`:
- "I found [N] GDD revision flag(s). May I update the systems index?"
- [A] Yes — apply all [N] updates to the systems index now
- [B] Show me the full diff first, then ask again
- [C] No — leave the systems index unchanged for now
If [A]: apply the updates. Status field must be exactly `Needs Revision` — no parentheticals
(other skills match that exact string and parentheticals break the match).
If [B]: display the complete proposed systems-index section, then re-ask with `AskUserQuestion`.
---这些GDD假设与已验证的引擎行为或已接受的ADR冲突。
在其系统进入实现之前,应修订GDD。
| GDD | Assumption | Reality (from ADR/engine-reference) | Action |
|---|---|---|---|
| combat.md | "使用HingeJoint3D阻尼实现武器后坐力" | Jolt忽略阻尼 —— ADR-0003 | 修订GDD |
如果未发现修订标记,写入:"无GDD修订标记 —— 所有GDD假设与已验证的引擎行为一致。"
询问前,在对话中内联显示拟议变更 —— 并排展示每个标记GDD的当前systems-index行和拟议更新行,以便用户准确看到将发生的变化。
然后使用`AskUserQuestion`:
- "我发现了[N]个GDD修订标记。是否可以更新系统索引?"
- [A] 是 —— 立即将所有[N]项更新应用到系统索引
- [B] 先显示完整差异,然后再次询问
- [C] 否 —— 暂时保持系统索引不变
如果选[A]:应用更新。Status字段必须精确为`Needs Revision` —— 不能有括号(其他技能匹配该精确字符串,括号会破坏匹配)。
如果选[B]:显示完整的拟议systems-index部分,然后使用`AskUserQuestion`重新询问。
---Phase 6: Architecture Document Coverage
阶段6:架构文档覆盖验证
If exists, validate it against GDDs:
docs/architecture/architecture.md- Does every system from appear in the architecture layers?
systems-index.md - Does the data flow section cover all cross-system communication defined in GDDs?
- Do the API boundaries support all integration requirements from GDDs?
- Are there systems in the architecture doc that have no corresponding GDD (orphaned architecture)?
如果存在,验证其是否符合GDD:
docs/architecture/architecture.md- 中的每个系统是否都出现在架构层中?
systems-index.md - 数据流部分是否覆盖了GDD中定义的所有跨系统通信?
- API边界是否支持GDD中的所有集成需求?
- 架构文档中是否存在没有对应GDD的系统(孤立架构)?
Phase 7: Output the Review Report
阶段7:输出评审报告
undefinedundefinedArchitecture Review Report
Architecture Review Report
Date: [date]
Engine: [name + version]
GDDs Reviewed: [N]
ADRs Reviewed: [M]
Date: [date]
Engine: [name + version]
GDDs Reviewed: [N]
ADRs Reviewed: [M]
Traceability Summary
Traceability Summary
Total requirements: [N]
✅ Covered: [X]
⚠️ Partial: [Y]
❌ Gaps: [Z]
Total requirements: [N]
✅ Covered: [X]
⚠️ Partial: [Y]
❌ Gaps: [Z]
Coverage Gaps (no ADR exists)
Coverage Gaps (no ADR exists)
For each gap:
❌ TR-[id]: [GDD] → [system] → [requirement]
Suggested ADR: "/architecture-decision [suggested title]"
Domain: [Physics/Rendering/etc]
Engine Risk: [LOW/MEDIUM/HIGH]
针对每个缺口:
❌ TR-[id]: [GDD] → [system] → [requirement]
Suggested ADR: "/architecture-decision [suggested title]"
Domain: [Physics/Rendering/etc]
Engine Risk: [LOW/MEDIUM/HIGH]
Cross-ADR Conflicts
Cross-ADR Conflicts
[List all conflicts from Phase 4]
[列出阶段4中的所有冲突]
ADR Dependency Order
ADR Dependency Order
[Topologically sorted implementation order from Phase 4 — dependency ordering section]
[Unresolved dependencies and cycles if any]
[阶段4中的拓扑排序实现顺序 —— 依赖排序部分]
[若有未解决的依赖和循环则列出]
GDD Revision Flags
GDD Revision Flags
[GDD assumptions that conflict with verified engine behaviour — from Phase 5b]
[Or: "None — all GDD assumptions consistent with verified engine behaviour"]
[与已验证引擎行为冲突的GDD假设 —— 来自阶段5b]
[或:"无 —— 所有GDD假设与已验证引擎行为一致"]
Engine Compatibility Issues
Engine Compatibility Issues
[List all engine issues from Phase 5]
[列出阶段5中的所有引擎问题]
Architecture Document Coverage
Architecture Document Coverage
[List missing systems and orphaned architecture from Phase 6]
[列出阶段6中缺失的系统和孤立架构]
Verdict: [PASS / CONCERNS / FAIL]
Verdict: [PASS / CONCERNS / FAIL]
PASS: All requirements covered, no conflicts, engine consistent
CONCERNS: Some gaps or partial coverage, but no blocking conflicts
FAIL: Critical gaps (Foundation/Core layer requirements uncovered),
or blocking cross-ADR conflicts detected
PASS: 所有需求已覆盖,无冲突,引擎一致
CONCERNS: 存在一些缺口或部分覆盖,但无阻塞性冲突
FAIL: 关键缺口(基础/核心层需求未覆盖),
或检测到阻塞性跨ADR冲突
Blocking Issues (must resolve before PASS)
Blocking Issues (must resolve before PASS)
[List items that must be resolved — FAIL verdict only]
[列出必须解决的项 —— 仅FAIL结论时]
Required ADRs
Required ADRs
[Prioritised list of ADRs to create, most foundational first]
---[按优先级排序的待创建ADR列表,基础层优先]
---Phase 8: Write and Update Traceability Index
阶段8:编写并更新可追溯索引
Use for the write approval:
AskUserQuestion- "Review complete. What would you like to write?"
- [A] Write all three files (review report + traceability index + TR registry)
- [B] Write review report only —
docs/architecture/architecture-review-[date].md - [C] Don't write anything yet — I need to review the findings first
使用获取写入权限:
AskUserQuestion- "评审完成。您希望写入哪些内容?"
- [A] 写入所有三个文件(评审报告 + 可追溯索引 + TR注册表)
- [B] 仅写入评审报告 ——
docs/architecture/architecture-review-[date].md - [C] 暂时不写入任何内容 —— 我需要先查看结果
RTM Output (rtm mode only)
RTM输出(仅rtm模式)
For mode, use :
rtmAskUserQuestion- "May I write the full Requirements Traceability Matrix?"
- [A] Yes — write to
docs/architecture/requirements-traceability.md - [B] Not yet — show me the full RTM data first, then ask again
- [A] Yes — write to
RTM file format:
markdown
undefined对于模式,使用:
rtmAskUserQuestion- "是否可以写入完整的需求可追溯矩阵?"
- [A] 是 —— 写入到
docs/architecture/requirements-traceability.md - [B] 暂时不 —— 先向我展示完整的RTM数据,然后再次询问
- [A] 是 —— 写入到
RTM文件格式:
markdown
undefinedRequirements Traceability Matrix (RTM)
Requirements Traceability Matrix (RTM)
Last Updated: [date] Mode: /architecture-review rtm Coverage: [N]% full chain complete (GDD → ADR → Story → Test)
Last Updated: [date] Mode: /architecture-review rtm Coverage: [N]% full chain complete (GDD → ADR → Story → Test)
How to read this matrix
How to read this matrix
| Column | Meaning |
|---|---|
| TR-ID | Stable requirement ID from tr-registry.yaml |
| GDD | Source design document |
| ADR | Architectural decision governing implementation |
| Story | Story file that implements this requirement |
| Test File | Automated test file path |
| Test Status | COVERED / MISSING / NONE / NO STORY |
| Column | Meaning |
|---|---|
| TR-ID | tr-registry.yaml中的稳定需求ID |
| GDD | 源设计文档 |
| ADR | 指导实现的架构决策 |
| Story | 实现此需求的故事文件 |
| Test File | 自动化测试文件路径 |
| Test Status | COVERED / MISSING / NONE / NO STORY |
Full Traceability Matrix
Full Traceability Matrix
| TR-ID | GDD | Requirement | ADR | Story | Test File | Status |
|---|---|---|---|---|---|---|
| [Full matrix rows from Phase 3b] |
| TR-ID | GDD | Requirement | ADR | Story | Test File | Status |
|---|---|---|---|---|---|---|
| [阶段3b中的完整矩阵行] |
Coverage Summary
Coverage Summary
| Status | Count | % |
|---|---|---|
| COVERED — full chain complete | [N] | [%] |
| MISSING test — story exists, no test | [N] | [%] |
| NO STORY — ADR exists, not yet implemented | [N] | [%] |
| NO ADR — architectural gap | [N] | [%] |
| Total requirements | [N] | 100% |
| Status | Count | % |
|---|---|---|
| COVERED — full chain complete | [N] | [%] |
| MISSING test — story exists, no test | [N] | [%] |
| NO STORY — ADR exists, not yet implemented | [N] | [%] |
| NO ADR — architectural gap | [N] | [%] |
| Total requirements | [N] | 100% |
Uncovered Requirements (Priority Fix List)
Uncovered Requirements (Priority Fix List)
Requirements where the full chain is broken, prioritised by layer:
完整链路中断的需求,按层优先级排序:
Foundation layer gaps
Foundation layer gaps
[list with suggested action per gap]
[列出每个缺口的建议操作]
Core layer gaps
Core layer gaps
[list]
[列表]
Feature / Presentation layer gaps
Feature / Presentation layer gaps
[list — lower priority]
[列表 —— 优先级较低]
History
History
| Date | Full Chain % | Notes |
|---|---|---|
| [date] | [%] | Initial RTM |
undefined| Date | Full Chain % | Notes |
|---|---|---|
| [date] | [%] | Initial RTM |
undefinedTR Registry Update
TR注册表更新
Also ask: "May I update with new requirement
IDs from this review?"
docs/architecture/tr-registry.yamlIf yes:
- Append any new TR-IDs that weren't in the registry before this review
- Update text and
requirementdate for any entries whose GDD wording changed (ID stays the same)revised - Mark for any registry entries whose GDD requirement no longer exists (confirm with user before marking deprecated)
status: deprecated - Never renumber or delete existing entries
- Update the and
last_updatedfields at the topversion
This ensures all future story files can reference stable TR-IDs that persist
across every subsequent architecture review.
同时询问:"是否可以使用本次评审中的新需求ID更新?"
docs/architecture/tr-registry.yaml如果同意:
- 追加任何本次评审前未在注册表中的新TR-ID
- 更新任何GDD措辞变更条目的文本和
requirement日期(ID保持不变)revised - 标记任何GDD需求已不存在的注册表条目为(标记前需与用户确认)
status: deprecated - 绝不重新编号或删除现有条目
- 更新顶部的和
last_updated字段version
这确保所有未来的故事文件可以引用稳定的TR-ID,这些ID在每次后续架构评审中都保持不变。
Reflexion Log Update
Reflexion Log更新
After writing the review report, append any 🔴 CONFLICT entries found in Phase 4
to (if the file exists):
docs/consistency-failures.mdmarkdown
undefined写入评审报告后,将阶段4中发现的所有🔴 CONFLICT条目追加到(如果文件存在):
docs/consistency-failures.mdmarkdown
undefined[YYYY-MM-DD] — /architecture-review — 🔴 CONFLICT
[YYYY-MM-DD] — /architecture-review — 🔴 CONFLICT
Domain: Architecture / [specific domain e.g. State Ownership, Performance]
Documents involved: [ADR-NNNN] vs [ADR-MMMM]
What happened: [specific conflict — what each ADR claims]
Resolution: [how it was or should be resolved]
Pattern: [generalised lesson for future ADR authors in this domain]
Only append CONFLICT entries — do not log GAP entries (missing ADRs are expected
before the architecture is complete). Do not create the file if missing — only
append when it already exists.Domain: Architecture / [特定领域如State Ownership, Performance]
Documents involved: [ADR-NNNN] vs [ADR-MMMM]
What happened: [具体冲突 —— 每个ADR的主张]
Resolution: [如何解决或应如何解决]
Pattern: [针对此领域未来ADR作者的通用经验教训]
仅追加CONFLICT条目 —— 不记录GAP条目(架构完成前缺少ADR是预期情况)。如果文件不存在则不创建 —— 仅在已存在时追加。Session State Update
Session State更新
After writing all approved files, silently append to
:
production/session-state/active.md## Session Extract — /architecture-review [date]
- Verdict: [PASS / CONCERNS / FAIL]
- Requirements: [N] total — [X] covered, [Y] partial, [Z] gaps
- New TR-IDs registered: [N, or "None"]
- GDD revision flags: [comma-separated GDD names, or "None"]
- Top ADR gaps: [top 3 gap titles from the report, or "None"]
- Report: docs/architecture/architecture-review-[date].mdIf does not exist, create it with this block as the initial content.
Confirm in conversation: "Session state updated."
active.mdThe traceability index format:
markdown
undefined写入所有批准的文件后,静默追加到:
production/session-state/active.md## Session Extract — /architecture-review [date]
- Verdict: [PASS / CONCERNS / FAIL]
- Requirements: [N] total — [X] covered, [Y] partial, [Z] gaps
- New TR-IDs registered: [N, or "None"]
- GDD revision flags: [逗号分隔的GDD名称, or "None"]
- Top ADR gaps: [报告中的前3个缺口标题, or "None"]
- Report: docs/architecture/architecture-review-[date].md如果不存在,以此块作为初始内容创建它。在对话中确认:"Session state updated."
active.md可追溯索引格式:
markdown
undefinedArchitecture Traceability Index
Architecture Traceability Index
Last Updated: [date]
Engine: [name + version]
Last Updated: [date]
Engine: [name + version]
Coverage Summary
Coverage Summary
- Total requirements: [N]
- Covered: [X] ([%])
- Partial: [Y]
- Gaps: [Z]
- Total requirements: [N]
- Covered: [X] ([%])
- Partial: [Y]
- Gaps: [Z]
Full Matrix
Full Matrix
[Complete traceability matrix from Phase 3]
[阶段3中的完整可追溯矩阵]
Known Gaps
Known Gaps
[All ❌ items with suggested ADRs]
[所有带建议ADR的❌项]
Superseded Requirements
Superseded Requirements
[Requirements whose GDD was changed after the ADR was written]
---[ADR编写后GDD已变更的需求]
---Phase 9: Handoff
阶段9:交接
After completing the review and writing approved files, present:
- Immediate actions: List the top 3 ADRs to create (highest-impact gaps first, Foundation layer before Feature layer)
- Pre-gate checklist: Check whether these exist via Glob and mark each ✅ or ❌:
- and
tests/unit/directories — if ❌: runtests/integration//test-setup - — if ❌: run
.github/workflows/tests.yml/test-setup - — if ❌: run
design/accessibility-requirements.md/ux-design - — if ❌: run
design/ux/interaction-patterns.mdPresent ❌ items as required steps before gate-check. Do not offer/ux-designas an option if any item is ❌ — offer the missing skill to run instead./gate-check
- Rerun trigger: "Re-run after each new ADR is written to verify coverage improves"
/architecture-review
Then close with tailored to the pre-gate checklist state:
AskUserQuestion- If ADR gaps remain or any pre-gate item is ❌:
- "Architecture review complete. What would you like to do next?"
- [A] Write a missing ADR — open a fresh session and run
/architecture-decision [system] - [B] Run — required before gate-check (only show if test infrastructure is ❌)
/test-setup - [C] Run — required before gate-check (only show if UX/accessibility files are ❌)
/ux-design - [D] Stop here for this session
- [A] Write a missing ADR — open a fresh session and run
- "Architecture review complete. What would you like to do next?"
- If all pre-gate checklist items are ✅ and no blocking ADR gaps remain:
- "Architecture review complete. All pre-gate items confirmed. What would you like to do next?"
- [A] Run
/gate-check pre-production - [B] Write a missing ADR — open a fresh session and run
/architecture-decision [system] - [C] Stop here for this session
- [A] Run
- "Architecture review complete. All pre-gate items confirmed. What would you like to do next?"
完成评审并写入批准的文件后,展示:
- 立即行动:列出前3个待创建的ADR(影响最高的缺口优先,基础层先于功能层)
- 预关卡检查清单:通过遍历检查以下内容是否存在,并标记每个为✅或❌:
- 和
tests/unit/目录 —— 如果❌:运行tests/integration//test-setup - —— 如果❌:运行
.github/workflows/tests.yml/test-setup - —— 如果❌:运行
design/accessibility-requirements.md/ux-design - —— 如果❌:运行
design/ux/interaction-patterns.md将❌项展示为关卡检查前的必要步骤。如果有任何项为❌,则不提供/ux-design选项 —— 改为提供需运行的缺失技能。/gate-check
- 重新运行触发条件:"每次编写新ADR后重新运行,以验证覆盖范围是否改善"
/architecture-review
然后根据预关卡检查清单的状态,使用收尾:
AskUserQuestion- 如果仍存在ADR缺口或任何预关卡项为❌:
- "架构评审完成。接下来您想做什么?"
- [A] 编写缺失的ADR —— 开启新会话并运行
/architecture-decision [system] - [B] 运行—— 关卡检查前必需(仅当测试基础设施为❌时显示)
/test-setup - [C] 运行—— 关卡检查前必需(仅当UX/无障碍文件为❌时显示)
/ux-design - [D] 本次会话到此结束
- [A] 编写缺失的ADR —— 开启新会话并运行
- "架构评审完成。接下来您想做什么?"
- 如果所有预关卡检查清单项均为✅且无阻塞性ADR缺口:
- "架构评审完成。所有预关卡项已确认。接下来您想做什么?"
- [A] 运行
/gate-check pre-production - [B] 编写缺失的ADR —— 开启新会话并运行
/architecture-decision [system] - [C] 本次会话到此结束
- [A] 运行
- "架构评审完成。所有预关卡项已确认。接下来您想做什么?"
Error Recovery Protocol
错误恢复协议
If any spawned agent returns BLOCKED, errors, or fails to complete:
- Surface immediately: Report "[AgentName]: BLOCKED — [reason]" before continuing
- Assess dependencies: If the blocked agent's output is required by a later phase, do not proceed past that phase without user input
- Offer options via AskUserQuestion with three choices:
- Skip this agent and note the gap in the final report
- Retry with narrower scope (fewer GDDs, single-system focus)
- Stop here and resolve the blocker first
- Always produce a partial report — output whatever was completed so work is not lost
如果任何调用的代理返回BLOCKED、错误或未完成:
- 立即展示:在继续之前报告"[AgentName]: BLOCKED — [原因]"
- 评估依赖:如果被阻塞代理的输出是后续阶段所需的,在未获得用户输入前不要继续该阶段之后的内容
- 提供选项 通过AskUserQuestion提供三个选择:
- 跳过此代理并在最终报告中注明缺口
- 缩小范围重试(更少的GDD、单系统聚焦)
- 在此停止并先解决阻塞问题
- 始终生成部分报告 —— 输出已完成的内容,避免工作丢失
Collaborative Protocol
协作协议
- Read silently — do not narrate every file read
- Show the matrix — present the full traceability matrix before asking for anything; let the user see the state
- Don't guess — if a requirement is ambiguous, ask: "Is [X] a technical requirement or a design preference?"
- Draft before approval — always show the content that will be written (the report, the updated ADR section, the systems-index row) inline in the conversation before requesting approval. Never ask to write something the user has not yet seen.
- Use for write approvals — plain text "May I?" is not sufficient. Use the structured tool with labeled options [A]/[B]/[C] so the user can choose between "write now", "show full draft first", and "not yet". Multi-file changesets must list every file and what changes, then ask once with grouped options — not a separate plain-text question per file.
AskUserQuestion - Non-blocking — the verdict is advisory; the user decides whether to continue despite CONCERNS or even FAIL findings
- 静默读取 —— 不要叙述每个文件的读取过程
- 展示矩阵 —— 在请求任何操作前先展示完整的可追溯矩阵;让用户了解当前状态
- 不要猜测 —— 如果需求不明确,询问:"[X]是技术需求还是设计偏好?"
- 先起草再批准 —— 在请求批准前,始终在对话中内联展示将要写入的内容(报告、更新的ADR部分、systems-index行)。绝不要请求写入用户尚未看到的内容。
- 使用获取写入批准 —— 纯文本"可以吗?"不够。使用带标签选项[A]/[B]/[C]的结构化工具,让用户可以选择"立即写入"、"先显示完整草稿"和"暂时不"。多文件变更集必须列出每个文件及其变更内容,然后一次性询问分组选项 —— 不要对每个文件单独使用纯文本问题。
AskUserQuestion - 非阻塞性 —— 结论仅为建议;用户可以决定是否忽略CONCERNS甚至FAIL结果继续进行