Files
Claude-Code-Game-Studios/.claude/skills/architecture-decision/SKILL.md
Donchitos 8ba9e736a5 Add gate intensity modes: full, lean, and solo review control
Adds a --review flag to all 13 gate-using skills and a global
production/review-mode.txt config (set during /start). Full runs all
director gates, lean skips per-skill gates but keeps phase gates, solo
skips all directors. Documents modes in director-gates.md, WORKFLOW-GUIDE.md,
and README.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 19:38:20 +11:00

14 KiB

name, description, argument-hint, user-invocable, allowed-tools
name description argument-hint user-invocable allowed-tools
architecture-decision Creates an Architecture Decision Record (ADR) documenting a significant technical decision, its context, alternatives considered, and consequences. Every major technical choice should have an ADR. [title] [--review full|lean|solo] true Read, Glob, Grep, Write, Task

When this skill is invoked:

0. Parse Arguments — Detect Retrofit Mode

Extract --review [full|lean|solo] if present and store as the review mode override for this run (see .claude/docs/director-gates.md).

If the argument starts with retrofit followed by a file path (e.g., /architecture-decision retrofit docs/architecture/adr-0001-event-system.md):

Enter retrofit mode:

  1. Read the existing ADR file completely.
  2. Identify which template sections are present by scanning headings:
    • ## StatusBLOCKING if missing: /story-readiness cannot check ADR acceptance
    • ## ADR Dependencies — HIGH if missing: dependency ordering breaks
    • ## Engine Compatibility — HIGH if missing: post-cutoff risk unknown
    • ## GDD Requirements Addressed — MEDIUM if missing: traceability lost
  3. Present to the user:
    ## Retrofit: [ADR title]
    File: [path]
    
    Sections already present (will not be touched):
    ✓ Status: [current value, or "MISSING — will add"]
    ✓ [section]
    
    Missing sections to add:
    ✗ Status — BLOCKING (stories cannot validate ADR acceptance without this)
    ✗ ADR Dependencies — HIGH
    ✗ Engine Compatibility — HIGH
    
  4. Ask: "Shall I add the [N] missing sections? I will not modify any existing content."
  5. If yes:
    • For Status: ask the user — "What is the current status of this decision?" Options: "Proposed", "Accepted", "Deprecated", "Superseded by ADR-XXXX"
    • For ADR Dependencies: ask — "Does this decision depend on any other ADR? Does it enable or block any other ADR or epic?" Accept "None" for each field.
    • For Engine Compatibility: read the engine reference docs (same as Step 0 below) and ask the user to confirm the domain. Then generate the table with verified data.
    • For GDD Requirements Addressed: ask — "Which GDD systems motivated this decision? What specific requirement in each GDD does this ADR address?"
    • Append each missing section to the ADR file using the Edit tool.
    • Never modify any existing section. Only append or fill absent sections.
  6. After adding all missing sections, update the ADR's ## Date field if it is absent.
  7. Suggest: "Run /architecture-review to re-validate coverage now that this ADR has its Status and Dependencies fields."

If NOT in retrofit mode, proceed to Step 0 below (normal ADR authoring).

No-argument guard: If no argument was provided (title is empty), ask before running Phase 0:

"What technical decision are you documenting? Please provide a short title (e.g., event-system-architecture, physics-engine-choice)."

Use the user's response as the title, then proceed to Step 0.


0. Load Engine Context (ALWAYS FIRST)

Before doing anything else, establish the engine environment:

  1. Read docs/engine-reference/[engine]/VERSION.md to get:

    • Engine name and version
    • LLM knowledge cutoff date
    • Post-cutoff version risk levels (LOW / MEDIUM / HIGH)
  2. Identify the domain of this architecture decision from the title or user description. Common domains: Physics, Rendering, UI, Audio, Navigation, Animation, Networking, Core, Input, Scripting.

  3. Read the corresponding module reference if it exists: docs/engine-reference/[engine]/modules/[domain].md

  4. Read docs/engine-reference/[engine]/breaking-changes.md — flag any changes in the relevant domain that post-date the LLM's training cutoff.

  5. Read docs/engine-reference/[engine]/deprecated-apis.md — flag any APIs in the relevant domain that should not be used.

  6. Display a knowledge gap warning before proceeding if the domain carries MEDIUM or HIGH risk:

    ⚠️  ENGINE KNOWLEDGE GAP WARNING
    Engine: [name + version]
    Domain: [domain]
    Risk Level: HIGH — This version is post-LLM-cutoff.
    
    Key changes verified from engine-reference docs:
    - [Change 1 relevant to this domain]
    - [Change 2]
    
    This ADR will be cross-referenced against the engine reference library.
    Proceed with verified information only — do NOT rely solely on training data.
    

    If no engine has been configured yet, prompt: "No engine is configured. Run /setup-engine first, or tell me which engine you are using."


1. Determine the next ADR number

Scan docs/architecture/ for existing ADRs to find the next number.


2. Gather context

Read related code, existing ADRs, and relevant GDDs from design/gdd/.

2a: Architecture Registry Check (BLOCKING gate)

Read docs/registry/architecture.yaml. Extract entries relevant to this ADR's domain and decision (grep by system name, domain keyword, or state being touched).

Present any relevant stances to the user before the collaborative design begins, as locked constraints:

## Existing Architectural Stances (must not contradict)

State Ownership:
  player_health → owned by health-system (ADR-0001)
  Interface: HealthComponent.current_health (read-only float)
  → If this ADR reads or writes player health, it must use this interface.

Interface Contracts:
  damage_delivery → signal pattern (ADR-0003)
  Signal: damage_dealt(amount, target, is_crit)
  → If this ADR delivers or receives damage events, it must use this signal.

Forbidden Patterns:
  ✗ autoload_singleton_coupling (ADR-0001)
  ✗ direct_cross_system_state_write (ADR-0000)
  → The proposed approach must not use these patterns.

If the user's proposed decision would contradict any registered stance, surface the conflict immediately:

"⚠️ Conflict: This ADR proposes [X], but ADR-[NNNN] established that [Y] is the accepted pattern for this purpose. Proceeding without resolving this will produce contradictory ADRs and inconsistent stories. Options: (1) Align with the existing stance, (2) Supersede ADR-[NNNN] with an explicit replacement, (3) Explain why this case is an exception."

Do not proceed to Step 3 (collaborative design) until any conflict is resolved or explicitly accepted as an intentional exception.


3. Guide the decision collaboratively

Ask clarifying questions if the title alone is not sufficient. For each major section, present 2-4 options with pros/cons before drafting. Do not generate the ADR until the key decision is confirmed by the user.

Key questions to ask:

  • What problem are we solving? What breaks if we don't decide this now?
  • What constraints apply (engine version, platform, performance budget)?
  • What alternatives have you already considered?
  • Which post-cutoff engine features (if any) does this decision depend on?
  • Which GDD systems motivated this decision? For each, what specific requirement (rule, formula, performance constraint, integration point) in that GDD cannot be satisfied without this architectural decision?

If the decision is foundational (no GDD drives it directly), ask:

  • Which GDD systems will this decision constrain or enable?

This GDD linkage becomes a mandatory "GDD Requirements Addressed" section in the ADR. Do not skip it.

Does this ADR have ordering constraints? Ask:

  • Does this decision depend on any other ADR that isn't yet Accepted? (If so, this ADR cannot be safely implemented until that one is resolved.)
  • Does accepting this ADR unlock or unblock any other pending decisions?
  • Does this ADR block any specific epic or story from starting?

Record the answers in the ADR Dependencies section. If no ordering constraints exist, write "None" in each field.


4. Generate the ADR

Following this format:

# ADR-[NNNN]: [Title]

## Status
[Proposed | Accepted | Deprecated | Superseded by ADR-XXXX]

## Date
[Date of decision]

## Engine Compatibility

| Field | Value |
|-------|-------|
| **Engine** | [e.g. Godot 4.6] |
| **Domain** | [Physics / Rendering / UI / Audio / Navigation / Animation / Networking / Core / Input] |
| **Knowledge Risk** | [LOW / MEDIUM / HIGH — from VERSION.md] |
| **References Consulted** | [List engine-reference docs read, e.g. `docs/engine-reference/godot/modules/physics.md`] |
| **Post-Cutoff APIs Used** | [Any APIs from post-LLM-cutoff versions this decision depends on, or "None"] |
| **Verification Required** | [Specific behaviours to test before shipping, or "None"] |

## ADR Dependencies

| Field | Value |
|-------|-------|
| **Depends On** | [ADR-NNNN (must be Accepted before this can be implemented), or "None"] |
| **Enables** | [ADR-NNNN (this ADR unlocks that decision), or "None"] |
| **Blocks** | [Epic/Story name — cannot start until this ADR is Accepted, or "None"] |
| **Ordering Note** | [Any sequencing constraint that isn't captured above] |

## Context

### Problem Statement
[What problem are we solving? Why does this decision need to be made now?]

### Constraints
- [Technical constraints]
- [Timeline constraints]
- [Resource constraints]
- [Compatibility requirements]

### Requirements
- [Must support X]
- [Must perform within Y budget]
- [Must integrate with Z]

## Decision

[The specific technical decision made, described in enough detail for someone
to implement it.]

### Architecture Diagram
[ASCII diagram or description of the system architecture this creates]

### Key Interfaces
[API contracts or interface definitions this decision creates]

## Alternatives Considered

### Alternative 1: [Name]
- **Description**: [How this would work]
- **Pros**: [Advantages]
- **Cons**: [Disadvantages]
- **Rejection Reason**: [Why this was not chosen]

### Alternative 2: [Name]
- **Description**: [How this would work]
- **Pros**: [Advantages]
- **Cons**: [Disadvantages]
- **Rejection Reason**: [Why this was not chosen]

## Consequences

### Positive
- [Good outcomes of this decision]

### Negative
- [Trade-offs and costs accepted]

### Risks
- [Things that could go wrong]
- [Mitigation for each risk]

## GDD Requirements Addressed

| GDD System | Requirement | How This ADR Addresses It |
|------------|-------------|--------------------------|
| [system-name].md | [specific rule, formula, or performance constraint from that GDD] | [how this decision satisfies it] |

## Performance Implications
- **CPU**: [Expected impact]
- **Memory**: [Expected impact]
- **Load Time**: [Expected impact]
- **Network**: [Expected impact, if applicable]

## Migration Plan
[If this changes existing code, how do we get from here to there?]

## Validation Criteria
[How will we know this decision was correct? What metrics or tests?]

## Related Decisions
- [Links to related ADRs]
- [Links to related design documents]

4.5. Engine Specialist Validation — Before saving, spawn the primary engine specialist via Task to validate the drafted ADR:

  • Read .claude/docs/technical-preferences.md Engine Specialists section to get the primary specialist
  • If no engine is configured ([TO BE CONFIGURED]), skip this step
  • Spawn subagent_type: [primary specialist] with: the ADR's Engine Compatibility section, Decision section, Key Interfaces, and the engine reference docs path. Ask them to:
    1. Confirm the proposed approach is idiomatic for the pinned engine version
    2. Flag any APIs or patterns that are deprecated or changed post-training-cutoff
    3. Identify engine-specific risks or gotchas not captured in the current ADR draft
  • If the specialist identifies a blocking issue (wrong API, deprecated approach, engine version incompatibility): revise the Decision and Engine Compatibility sections accordingly, then confirm the changes with the user before proceeding
  • If the specialist finds minor notes only: incorporate them into the ADR's Risks subsection

4.6. Technical Director Strategic Review — After the engine specialist validation, spawn technical-director via Task using gate TD-ADR (.claude/docs/director-gates.md):

  • Pass: the ADR file path (or draft content), engine version, domain, any existing ADRs in the same domain
  • The TD validates architectural coherence (is this decision consistent with the whole system?) — distinct from the engine specialist's API-level check
  • If CONCERNS or REJECT: revise the Decision or Alternatives sections accordingly before proceeding
  1. Ask: "May I write this ADR to docs/architecture/adr-[NNNN]-[slug].md?"

If yes, write the file, creating the directory if needed.

  1. Update Architecture Registry

Scan the written ADR for new architectural stances that should be registered:

  • State it claims ownership of
  • Interface contracts it defines (signal signatures, method APIs)
  • Performance budget it claims
  • API choices it makes explicitly
  • Patterns it bans (Consequences → Negative or explicit "do not use X")

Present candidates:

Registry candidates from this ADR:
  NEW state ownership:      player_stamina → stamina-system
  NEW interface contract:   stamina_depleted signal
  NEW performance budget:   stamina-system: 0.5ms/frame
  NEW forbidden pattern:    polling stamina each frame (use signal instead)
  EXISTING (referenced_by update only): player_health → already registered ✅

Ask: "May I update docs/registry/architecture.yaml with these [N] new stances?"

If yes: append new entries. Never modify existing entries — if a stance is changing, set the old entry to status: superseded_by: ADR-[NNNN] and add the new entry.

Next Steps: Run /architecture-review to validate coverage after the ADR is saved. Update any stories that were Status: Blocked pending this ADR to Status: Ready.