architect-analyze
What this skill does
Performs a read-only architecture consistency analysis between ADRs (Architecture Decision Records) and AD (Architecture Description). It identifies discrepancies, quality issues, and gaps without modifying any files.
Key analysis dimensions:
- ADR Quality — Completeness, clarity, and standards compliance
- ADR to AD Consistency — Bidirectional drift detection
- Internal Consistency — Cross-artifact coherence
- Staleness Detection — Outdated references and placeholders
This skill validates architecture artifacts for consistency, completeness, and quality.
When to use
- After
/architect-implement — Validate generated AD.md
- After
/architect-clarify — Verify ADR refinements
- Before feature development — Ensure architecture is solid
- During architecture review — Quality gate for architecture docs
- Periodically — Detect drift as the codebase evolves
Do not use when no architecture artifacts exist; use /architect-init or /architect-specify first. Do not use to create architecture — this is analysis-only.
Process
User Input
Consider the user input before proceeding (if not empty):
$ARGUMENTS
Examples:
"system" — Focus on root-level AD.md and adr/ directory only
"feature auth" — Focus on specific feature architecture
"adrs" — Focus on ADR quality and inter-ADR consistency
"views" — Focus on AD.md view completeness and internal consistency
- Empty input — Full analysis of all architecture artifacts
Goal
Perform read-only architecture consistency analysis. Identify discrepancies, quality issues, and gaps without modifying any files.
Operating Constraints
STRICTLY READ-ONLY: Do not modify any files. Output a structured analysis report. Offer remediation suggestions (user must explicitly approve before any follow-up editing commands would be invoked manually).
Constitution Authority: The project constitution (memory/constitution.md) is non-negotiable within this analysis scope. Constitution conflicts are automatically CRITICAL.
Role & Context
Act as an Architecture Analyst validating architecture documentation quality:
- Validate ADR completeness against MADR standards
- Detect drift between ADRs and AD.md
- Identify internal inconsistencies across artifacts
- Flag staleness and quality issues
Architecture document hierarchy:
| Document |
Location |
Purpose |
AD.md |
Project root |
Full Architecture Description (Rozanski & Woods) |
adr/ |
{REPO_ROOT}/.adlc/memory/ |
System-level ADRs (individual files) |
constitution.md |
{REPO_ROOT}/.adlc/memory/ |
Governance principles and constraints |
Outline
- Initialize Analysis Context — Load architecture artifacts
- Determine Analysis Scope — System, feature, or full
- Execute Detection Passes — A through G
- Assign Severities — CRITICAL/HIGH/MEDIUM/LOW
- Generate Report — Structured markdown analysis
- Provide Next Actions — Remediation suggestions
Phase 1: Initialize Analysis Context
Objective: Load all architecture artifacts for analysis
Run Setup Script:
- Execute
scripts/bash/setup-architect.sh from repo root
- Parse JSON for file paths and existence status
Load System-Level Artifacts:
- Read
AD.md (project root) if exists
- Read ADRs from all locations (priority order):
{REPO_ROOT}/.adlc/memory/adr/adr.md (canonical — Accepted ADRs)
{REPO_ROOT}/.adlc/drafts/adr/ (working copy — Proposed/Discovered, individual file format)
- Read
{REPO_ROOT}/.adlc/memory/constitution.md if exists
Load Feature-Level Artifacts (if analyzing features):
- Scan
specs/*/AD.md for feature architectures
- Scan
specs/*/adr/ADR-*.md for feature ADRs
Build Artifact Inventory:
| Artifact |
Path |
Status |
| System AD |
AD.md |
Found/Missing |
| System ADRs (canonical) |
{REPO_ROOT}/.adlc/memory/adr/adr.md |
Found/Missing |
| System ADRs (drafts) |
{REPO_ROOT}/.adlc/drafts/adr/ |
Found/Missing |
| Constitution |
{REPO_ROOT}/.adlc/memory/constitution.md |
Found/Missing |
| Feature ADs |
specs/*/AD.md |
Count: N |
| Feature ADRs |
specs/*/adr/ |
Count: N |
Phase 2: Determine Analysis Scope
Objective: Focus analysis based on user input
| User Input |
Scope |
Artifacts Analyzed |
| (empty) |
Full |
All system artifacts |
"system" |
System only |
AD.md, system ADR locations |
"adrs" |
ADR quality |
All ADR files |
"views" |
AD completeness |
AD.md |
Phase 3: Execute Detection Passes
Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
Pass A: ADR Quality Analysis
Objective: Validate each ADR against MADR standards
Quality Dimensions:
| Dimension |
Check |
Severity if Missing |
| Context |
Problem clearly stated, forces documented |
MEDIUM |
| Decision |
Actionable, testable decision statement |
HIGH |
| Positive Consequences |
Benefits documented |
MEDIUM |
| Negative Consequences |
Trade-offs acknowledged |
HIGH |
| Risks |
Identified with mitigations |
MEDIUM |
| Alternatives |
At least 2 options with neutral trade-offs |
HIGH |
| Status |
Valid status (Proposed/Accepted/Deprecated/Superseded/Discovered) |
LOW |
| Constitution Alignment |
MUST principles complied with |
CRITICAL |
ADR Quality Checklist:
For each ADR, verify:
Pass B: Inter-ADR Consistency
Objective: Detect conflicts and inconsistencies between ADRs
Checks:
Conflicting Decisions:
- ADRs that contradict each other (e.g., one chooses PostgreSQL, another assumes MongoDB)
- Technology stack incoherence
Missing Dependencies:
- ADRs that should reference each other but don't
- Implicit assumptions about other decisions
Terminology Drift:
- Same concept named differently across ADRs
- Inconsistent component naming
Technology Stack Coherence:
- Frontend/backend/infrastructure choices align
- No conflicting framework decisions
Pass C: ADR to AD Drift (Forward Sync)
Objective: Detect ADR decisions not reflected in AD.md
Checks:
| ADR Element |
Expected in AD.md |
View/Section |
| System architecture style |
Context View |
3.1 |
| Database choice |
Information View |
3.3 |
| API style |
Functional View |
3.2 |
| Authentication approach |
Security Perspective |
4.1 |
| Deployment platform |
Deployment View |
3.6 |
| CI/CD approach |
Development View |
3.5 |
| Scaling strategy |
Performance Perspective |
4.2 |
| Caching strategy |
Information View |
3.3 |
Detection Logic:
For each ADR:
- Identify the ADR's primary view impact (use mapping table above)
- Search AD.md for reflection of that decision
- Flag if decision is absent or contradicted
Pass D: AD to ADR Drift (Backward Sync)
Objective: Detect AD.md elements without supporting ADRs
Checks:
Components Without ADRs:
- Major components shown in Functional View without decision rationale
- External dependencies in Context View without ADR justification
Patterns Without Rationale:
- Architectural patterns described but not explained via ADR
- Technology choices embedded in views without supporting decision
Infrastructure Decisions:
- Deployment topology without infrastructure ADR
- Scaling approach without performance ADR
Pass E: AD Internal Consistency
Objective: Validate AD.md coherence across views
Checks:
Cross-View Consistency:
- Same components named identically across all views
- Data entities in Information View match Functional View references
- Deployment nodes consistent with Functional components
Diagram-Text Alignment:
- Mermaid diagrams match prose descriptions
- No components in diagrams missing from text
- No components in text missing from diagrams
View Completeness:
- Required sections present (Introduction, Stakeholders, Views, Perspectives)
- Core views included (Context, Functional, Information, Development, Deployment)
- Perspectives addressed (Security, Performance)
Diagram Syntax Validation:
- Mermaid syntax valid (no broken diagrams)
- Consistent styling across diagrams
View File Consistency (DAG State Validation):
Technology Neutrality (Functional View):
- Scan Functional View (§3.2) for product/vendor names in element descriptions and Mermaid diagrams
- Architectural roles (acceptable): Database, Object Storage, Cache, Message Queue, AI Gateway, Workflow Runtime, App Shell, API Gateway, Authentication Service, etc.
- Product names (flag as MEDIUM): PostgreSQL, Neon, Vercel, Next.js, Redis, MongoDB, AWS, Azure, S3, etc.
- Severity: MEDIUM — Not blocking but indicates abstraction violation
- Note: ADR Traceability sections may reference products (that's acceptable); only flag element descriptions and diagram labels
Functional-Development Mapping:
- Verify Development View (§3.5) contains a Technology Stack Mapping table (§3.5.2)
- Check that every element in Functional View's element table (§3.2.1) has at least one corresponding entry in the mapping table
- N:1 mappings (multiple functional elements → one technology) are acceptable
- Severity: MEDIUM if elements are missing; LOW if mapping table is absent
- Cross-check: Technology Architecture diagram (§3.5.3) should mirror Functional View diagram (§3.2.2) structure
Pass F: Staleness Detection
Objective: Identify outdated references and placeholders
Checks:
Deprecated ADRs Still Referenced:
- AD.md references ADRs with status "Deprecated"
- Superseded decisions still implemented
Placeholder Detection:
[TODO], [TBD], [PLACEHOLDER] markers
[SYSTEM_NAME], [STAKEHOLDER_*] unfilled
???, ..., <placeholder> patterns
Date Inconsistencies:
- ADR dates significantly older than AD last-updated
- Feature architecture out of sync with system architecture
Orphaned References:
- ADR IDs mentioned but ADR doesn't exist
- Component names referenced but not defined
Pass G: Feature-System Alignment (if feature architecture exists)
Objective: Validate feature architecture fits within system boundaries
Checks:
Feature ADR Alignment:
- Feature ADRs marked "Aligns with ADR-XXX" reference valid system ADRs
- No VIOLATION flags without documented justification
- Feature decisions consistent with system constraints
Boundary Compliance:
- Feature components fit within system Functional View structure
- Feature data entities align with system Information View
- Feature doesn't exceed system scope (Context View)
Integration Points:
- Feature-to-system interfaces documented
- Data flow across feature boundary consistent
Phase 4: Severity Assignment
Severity Criteria:
| Severity |
Criteria |
Examples |
| CRITICAL |
Constitution violation, security/data integrity gap, missing core ADR |
ADR violates MUST principle, major component undocumented |
| HIGH |
ADR to AD drift affecting implementation, conflicting ADRs, missing alternatives |
Database choice in ADR but wrong DB in AD, two ADRs conflict |
| MEDIUM |
Incomplete consequences, staleness, terminology drift, missing optional views |
ADR lacks negative consequences, TODO placeholders |
| LOW |
Style improvements, minor documentation gaps, optional details |
Inconsistent formatting, minor wording issues |
Phase 5: Generate Analysis Report
Output Format:
## Architecture Analysis Report
### Analysis Summary
| Attribute | Value |
|-----------|-------|
| **Mode** | [Full/System/Feature/ADRs/Views] |
| **Scope** | [Description of what was analyzed] |
| **Files Analyzed** | [List of files] |
| **Analysis Date** | [Current date] |
### Findings
| ID | Pass | Severity | Location | Summary | Recommendation |
|----|------|----------|----------|---------|----------------|
| A1 | ADR Quality | MEDIUM | ADR-003 | Missing negative consequences | Add trade-offs section |
| B1 | Inter-ADR | HIGH | ADR-002, ADR-005 | Conflicting database choices | Resolve PostgreSQL vs MongoDB conflict |
| C1 | ADR->AD Drift | HIGH | ADR-005 | Caching decision not in Information View | Update AD.md 3.3 |
| D1 | AD->ADR Drift | HIGH | AD.md:3.2 | Redis component has no ADR | Create ADR for cache choice |
| E1 | AD Consistency | MEDIUM | AD.md:3.2/3.6 | Component naming mismatch | Standardize "AuthService" naming |
| F1 | Staleness | LOW | AD.md:3.1 | [SYSTEM_NAME] placeholder | Fill in system name |
| G1 | Feature Align | HIGH | specs/auth/adr.md | VIOLATION flag unresolved | Document override justification |
### Coverage Metrics
| Metric | System | Feature: auth | Feature: payments |
|--------|--------|---------------|-------------------|
| ADR Count | 13 | 3 | 2 |
| AD Views Complete | 5/7 | 3/5 | 3/5 |
| ADR->AD Coverage | 85% | 100% | 67% |
| AD->ADR Coverage | 92% | 100% | 100% |
| Quality Score | 78% | 85% | 72% |
### Constitution Alignment
| Status | Count | Details |
|--------|-------|---------|
| Compliant | [N] | ADRs following MUST principles |
| Violations | [N] | ADRs violating MUST principles (CRITICAL) |
| Deviations | [N] | Justified SHOULD principle deviations |
### Issue Distribution
| Severity | Count |
|----------|-------|
| CRITICAL | [N] |
| HIGH | [N] |
| MEDIUM | [N] |
| LOW | [N] |
### Next Actions
Based on findings, recommended actions:
**If CRITICAL issues exist:**
- **Immediate**: Resolve constitution violations before proceeding
- Command: `/architect-clarify` to address ADR compliance
**If HIGH ADR quality issues:**
- **Refine**: Address missing alternatives and consequences
- Command: `/architect-clarify` to improve ADR quality
**If ADR->AD drift detected:**
- **Sync AD**: Update AD.md to reflect ADR decisions
- Command: `/architect-implement` to regenerate views
**If AD->ADR drift detected:**
- **Document**: Create missing ADRs for undocumented decisions
- Command: `/architect-specify` or `/architect-init` to add ADRs
**If feature alignment issues:**
- **Align**: Resolve feature-system boundary violations
- Command: Run `/architect-specify` or `/architect-init` to create missing ADRs
Phase 6: Offer Remediation
After presenting the report, ask:
"Would you like me to suggest specific remediation steps for the top [N] issues? I can provide detailed guidance for each finding, though I will not make any changes automatically."
Key Rules
Analysis Integrity
- NEVER modify files — this is read-only analysis
- NEVER hallucinate missing content — report absences accurately
- Prioritize constitution violations — these are always CRITICAL
- Use evidence-based findings — cite specific locations and content
Consistency Standards
- Cross-reference everything — validate bidirectionally (ADR to AD)
- Check all levels — system and feature architecture must align
- Validate terminology — same concepts must use same names
- Verify diagrams — Mermaid syntax must be valid
Reporting Standards
- Limit to 50 findings — aggregate overflow in summary
- Include location — always cite file:line or section
- Provide actionable recommendations — each finding gets a fix suggestion
- Calculate coverage metrics — quantify completeness
Next Steps
If issues are found:
- Run
/architect-clarify to refine ADRs (quality issues, missing consequences/alternatives, constitution violations).
- Run
/architect-implement to regenerate AD.md when ADR-to-AD drift is detected.
For missing ADRs or feature boundary issues, use /architect-specify or /architect-init as appropriate.
Verification
Concrete outputs of this skill:
- Architecture Analysis Report in structured markdown, including:
- Analysis Summary (mode, scope, files analyzed, analysis date)
- Findings table with ID, pass, severity, location, summary, and recommendation
- Coverage Metrics (ADR count, AD views complete, ADR→AD coverage, AD→ADR coverage, quality score)
- Constitution Alignment summary (compliant, violations, deviations)
- Issue Distribution by severity (CRITICAL, HIGH, MEDIUM, LOW)
- Next Actions tailored to finding types
- No files modified — analysis is strictly read-only.
- User-approved remediation guidance offered after the report.
1---2name: architect-analyze3description: Analyze architecture for consistency between ADRs and AD, completeness, and quality issues. Use when validating generated or refined architecture artifacts, before feature development, during architecture review, or periodically to detect drift.4---56# architect-analyze78## What this skill does910Performs a **read-only** architecture consistency analysis between ADRs (Architecture Decision Records) and AD (Architecture Description). It identifies discrepancies, quality issues, and gaps without modifying any files.1112Key analysis dimensions:13141. **ADR Quality** — Completeness, clarity, and standards compliance152. **ADR to AD Consistency** — Bidirectional drift detection163. **Internal Consistency** — Cross-artifact coherence174. **Staleness Detection** — Outdated references and placeholders1819This skill validates architecture artifacts for consistency, completeness, and quality.2021## When to use2223- After `/architect-implement` — Validate generated AD.md24- After `/architect-clarify` — Verify ADR refinements25- Before feature development — Ensure architecture is solid26- During architecture review — Quality gate for architecture docs27- Periodically — Detect drift as the codebase evolves2829Do **not** use when no architecture artifacts exist; use `/architect-init` or `/architect-specify` first. Do **not** use to create architecture — this is analysis-only.3031## Process3233### User Input3435Consider the user input before proceeding (if not empty):3637```text38$ARGUMENTS39```4041Examples:4243- `"system"` — Focus on root-level AD.md and adr/ directory only44- `"feature auth"` — Focus on specific feature architecture45- `"adrs"` — Focus on ADR quality and inter-ADR consistency46- `"views"` — Focus on AD.md view completeness and internal consistency47- Empty input — Full analysis of all architecture artifacts4849### Goal5051Perform read-only architecture consistency analysis. Identify discrepancies, quality issues, and gaps without modifying any files.5253### Operating Constraints5455**STRICTLY READ-ONLY**: Do not modify any files. Output a structured analysis report. Offer remediation suggestions (user must explicitly approve before any follow-up editing commands would be invoked manually).5657**Constitution Authority**: The project constitution (`memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL.5859### Role & Context6061Act as an **Architecture Analyst** validating architecture documentation quality:6263- Validate ADR completeness against MADR standards64- Detect drift between ADRs and AD.md65- Identify internal inconsistencies across artifacts66- Flag staleness and quality issues6768Architecture document hierarchy:6970| Document | Location | Purpose |71|----------|----------|---------|72| `AD.md` | Project root | Full Architecture Description (Rozanski & Woods) |73| `adr/` | `{REPO_ROOT}/.adlc/memory/` | System-level ADRs (individual files) |74| `constitution.md` | `{REPO_ROOT}/.adlc/memory/` | Governance principles and constraints |7576### Outline77781. **Initialize Analysis Context** — Load architecture artifacts792. **Determine Analysis Scope** — System, feature, or full803. **Execute Detection Passes** — A through G814. **Assign Severities** — CRITICAL/HIGH/MEDIUM/LOW825. **Generate Report** — Structured markdown analysis836. **Provide Next Actions** — Remediation suggestions8485### Phase 1: Initialize Analysis Context8687**Objective**: Load all architecture artifacts for analysis88891. **Run Setup Script**:90 - Execute `scripts/bash/setup-architect.sh` from repo root91 - Parse JSON for file paths and existence status92932. **Load System-Level Artifacts**:94 - Read `AD.md` (project root) if exists95 - Read ADRs from all locations (priority order):96 1. `{REPO_ROOT}/.adlc/memory/adr/adr.md` (canonical — Accepted ADRs)97 2. `{REPO_ROOT}/.adlc/drafts/adr/` (working copy — Proposed/Discovered, individual file format)98 - Read `{REPO_ROOT}/.adlc/memory/constitution.md` if exists991003. **Load Feature-Level Artifacts** (if analyzing features):101 - Scan `specs/*/AD.md` for feature architectures102 - Scan `specs/*/adr/ADR-*.md` for feature ADRs1031044. **Build Artifact Inventory**:105106 | Artifact | Path | Status |107 |----------|------|--------|108 | System AD | `AD.md` | Found/Missing |109 | System ADRs (canonical) | `{REPO_ROOT}/.adlc/memory/adr/adr.md` | Found/Missing |110 | System ADRs (drafts) | `{REPO_ROOT}/.adlc/drafts/adr/` | Found/Missing |111 | Constitution | `{REPO_ROOT}/.adlc/memory/constitution.md` | Found/Missing |112 | Feature ADs | `specs/*/AD.md` | Count: N |113 | Feature ADRs | `specs/*/adr/` | Count: N |114115### Phase 2: Determine Analysis Scope116117**Objective**: Focus analysis based on user input118119| User Input | Scope | Artifacts Analyzed |120|------------|-------|-------------------|121| (empty) | Full | All system artifacts |122| `"system"` | System only | AD.md, system ADR locations |123| `"adrs"` | ADR quality | All ADR files |124| `"views"` | AD completeness | AD.md |125126### Phase 3: Execute Detection Passes127128Focus on high-signal findings. Limit to **50 findings total**; aggregate remainder in overflow summary.129130#### Pass A: ADR Quality Analysis131132**Objective**: Validate each ADR against MADR standards133134**Quality Dimensions**:135136| Dimension | Check | Severity if Missing |137|-----------|-------|---------------------|138| Context | Problem clearly stated, forces documented | MEDIUM |139| Decision | Actionable, testable decision statement | HIGH |140| Positive Consequences | Benefits documented | MEDIUM |141| Negative Consequences | Trade-offs acknowledged | HIGH |142| Risks | Identified with mitigations | MEDIUM |143| Alternatives | At least 2 options with neutral trade-offs | HIGH |144| Status | Valid status (Proposed/Accepted/Deprecated/Superseded/Discovered) | LOW |145| Constitution Alignment | MUST principles complied with | CRITICAL |146147**ADR Quality Checklist**:148149For each ADR, verify:150151- [ ] Clear context explaining the problem/opportunity152- [ ] Explicit, actionable decision statement153- [ ] Positive AND negative consequences documented154- [ ] **Common Alternatives** with neutral trade-offs (not "Rejected because")155- [ ] Risks identified with mitigation strategies156- [ ] Valid status value157- [ ] No conflicts with constitution MUST principles158159#### Pass B: Inter-ADR Consistency160161**Objective**: Detect conflicts and inconsistencies between ADRs162163**Checks**:1641651. **Conflicting Decisions**:166 - ADRs that contradict each other (e.g., one chooses PostgreSQL, another assumes MongoDB)167 - Technology stack incoherence1681692. **Missing Dependencies**:170 - ADRs that should reference each other but don't171 - Implicit assumptions about other decisions1721733. **Terminology Drift**:174 - Same concept named differently across ADRs175 - Inconsistent component naming1761774. **Technology Stack Coherence**:178 - Frontend/backend/infrastructure choices align179 - No conflicting framework decisions180181#### Pass C: ADR to AD Drift (Forward Sync)182183**Objective**: Detect ADR decisions not reflected in AD.md184185**Checks**:186187| ADR Element | Expected in AD.md | View/Section |188|-------------|-------------------|--------------|189| System architecture style | Context View | 3.1 |190| Database choice | Information View | 3.3 |191| API style | Functional View | 3.2 |192| Authentication approach | Security Perspective | 4.1 |193| Deployment platform | Deployment View | 3.6 |194| CI/CD approach | Development View | 3.5 |195| Scaling strategy | Performance Perspective | 4.2 |196| Caching strategy | Information View | 3.3 |197198**Detection Logic**:199200For each ADR:2012021. Identify the ADR's primary view impact (use mapping table above)2032. Search AD.md for reflection of that decision2043. Flag if decision is absent or contradicted205206#### Pass D: AD to ADR Drift (Backward Sync)207208**Objective**: Detect AD.md elements without supporting ADRs209210**Checks**:2112121. **Components Without ADRs**:213 - Major components shown in Functional View without decision rationale214 - External dependencies in Context View without ADR justification2152162. **Patterns Without Rationale**:217 - Architectural patterns described but not explained via ADR218 - Technology choices embedded in views without supporting decision2192203. **Infrastructure Decisions**:221 - Deployment topology without infrastructure ADR222 - Scaling approach without performance ADR223224#### Pass E: AD Internal Consistency225226**Objective**: Validate AD.md coherence across views227228**Checks**:2292301. **Cross-View Consistency**:231 - Same components named identically across all views232 - Data entities in Information View match Functional View references233 - Deployment nodes consistent with Functional components2342352. **Diagram-Text Alignment**:236 - Mermaid diagrams match prose descriptions237 - No components in diagrams missing from text238 - No components in text missing from diagrams2392403. **View Completeness**:241 - Required sections present (Introduction, Stakeholders, Views, Perspectives)242 - Core views included (Context, Functional, Information, Development, Deployment)243 - Perspectives addressed (Security, Performance)2442454. **Diagram Syntax Validation**:246 - Mermaid syntax valid (no broken diagrams)247 - Consistent styling across diagrams2482495. **View File Consistency** (DAG State Validation):250 - Check if `.adlc/architect/state.json` exists and reports views as "completed"251 - Check if `.adlc/architect/views/` directory exists252 - Verify that for each "completed" view in state.json, a corresponding file exists on disk253 - **Flag as HIGH severity if**:254 - state.json reports views "completed" but views/ directory is empty255 - View files exist but are under 20 lines (placeholder/skeleton content)256 - View files cannot be read (corrupted/missing permissions)257 - **Report format**:258 ```259 DAG State Inconsistency Detected:260 - State reports: [N] views completed261 - Files on disk: [M] view files found262 - Missing files: [list of missing views]263 - Recommendation: Regenerate views or reset state.json264 ```2652666. **Technology Neutrality** (Functional View):267 - Scan Functional View (§3.2) for product/vendor names in element descriptions and Mermaid diagrams268 - **Architectural roles** (acceptable): Database, Object Storage, Cache, Message Queue, AI Gateway, Workflow Runtime, App Shell, API Gateway, Authentication Service, etc.269 - **Product names** (flag as MEDIUM): PostgreSQL, Neon, Vercel, Next.js, Redis, MongoDB, AWS, Azure, S3, etc.270 - **Severity**: MEDIUM — Not blocking but indicates abstraction violation271 - **Note**: ADR Traceability sections may reference products (that's acceptable); only flag element descriptions and diagram labels2722737. **Functional-Development Mapping**:274 - Verify Development View (§3.5) contains a Technology Stack Mapping table (§3.5.2)275 - Check that every element in Functional View's element table (§3.2.1) has at least one corresponding entry in the mapping table276 - N:1 mappings (multiple functional elements → one technology) are acceptable277 - **Severity**: MEDIUM if elements are missing; LOW if mapping table is absent278 - **Cross-check**: Technology Architecture diagram (§3.5.3) should mirror Functional View diagram (§3.2.2) structure279280#### Pass F: Staleness Detection281282**Objective**: Identify outdated references and placeholders283284**Checks**:2852861. **Deprecated ADRs Still Referenced**:287 - AD.md references ADRs with status "Deprecated"288 - Superseded decisions still implemented2892902. **Placeholder Detection**:291 - `[TODO]`, `[TBD]`, `[PLACEHOLDER]` markers292 - `[SYSTEM_NAME]`, `[STAKEHOLDER_*]` unfilled293 - `???`, `...`, `<placeholder>` patterns2942953. **Date Inconsistencies**:296 - ADR dates significantly older than AD last-updated297 - Feature architecture out of sync with system architecture2982994. **Orphaned References**:300 - ADR IDs mentioned but ADR doesn't exist301 - Component names referenced but not defined302303#### Pass G: Feature-System Alignment (if feature architecture exists)304305**Objective**: Validate feature architecture fits within system boundaries306307**Checks**:3083091. **Feature ADR Alignment**:310 - Feature ADRs marked "Aligns with ADR-XXX" reference valid system ADRs311 - No VIOLATION flags without documented justification312 - Feature decisions consistent with system constraints3133142. **Boundary Compliance**:315 - Feature components fit within system Functional View structure316 - Feature data entities align with system Information View317 - Feature doesn't exceed system scope (Context View)3183193. **Integration Points**:320 - Feature-to-system interfaces documented321 - Data flow across feature boundary consistent322323### Phase 4: Severity Assignment324325**Severity Criteria**:326327| Severity | Criteria | Examples |328|----------|----------|----------|329| **CRITICAL** | Constitution violation, security/data integrity gap, missing core ADR | ADR violates MUST principle, major component undocumented |330| **HIGH** | ADR to AD drift affecting implementation, conflicting ADRs, missing alternatives | Database choice in ADR but wrong DB in AD, two ADRs conflict |331| **MEDIUM** | Incomplete consequences, staleness, terminology drift, missing optional views | ADR lacks negative consequences, TODO placeholders |332| **LOW** | Style improvements, minor documentation gaps, optional details | Inconsistent formatting, minor wording issues |333334### Phase 5: Generate Analysis Report335336**Output Format**:337338```markdown339## Architecture Analysis Report340341### Analysis Summary342343| Attribute | Value |344|-----------|-------|345| **Mode** | [Full/System/Feature/ADRs/Views] |346| **Scope** | [Description of what was analyzed] |347| **Files Analyzed** | [List of files] |348| **Analysis Date** | [Current date] |349350### Findings351352| ID | Pass | Severity | Location | Summary | Recommendation |353|----|------|----------|----------|---------|----------------|354| A1 | ADR Quality | MEDIUM | ADR-003 | Missing negative consequences | Add trade-offs section |355| B1 | Inter-ADR | HIGH | ADR-002, ADR-005 | Conflicting database choices | Resolve PostgreSQL vs MongoDB conflict |356| C1 | ADR->AD Drift | HIGH | ADR-005 | Caching decision not in Information View | Update AD.md 3.3 |357| D1 | AD->ADR Drift | HIGH | AD.md:3.2 | Redis component has no ADR | Create ADR for cache choice |358| E1 | AD Consistency | MEDIUM | AD.md:3.2/3.6 | Component naming mismatch | Standardize "AuthService" naming |359| F1 | Staleness | LOW | AD.md:3.1 | [SYSTEM_NAME] placeholder | Fill in system name |360| G1 | Feature Align | HIGH | specs/auth/adr.md | VIOLATION flag unresolved | Document override justification |361362### Coverage Metrics363364| Metric | System | Feature: auth | Feature: payments |365|--------|--------|---------------|-------------------|366| ADR Count | 13 | 3 | 2 |367| AD Views Complete | 5/7 | 3/5 | 3/5 |368| ADR->AD Coverage | 85% | 100% | 67% |369| AD->ADR Coverage | 92% | 100% | 100% |370| Quality Score | 78% | 85% | 72% |371372### Constitution Alignment373374| Status | Count | Details |375|--------|-------|---------|376| Compliant | [N] | ADRs following MUST principles |377| Violations | [N] | ADRs violating MUST principles (CRITICAL) |378| Deviations | [N] | Justified SHOULD principle deviations |379380### Issue Distribution381382| Severity | Count |383|----------|-------|384| CRITICAL | [N] |385| HIGH | [N] |386| MEDIUM | [N] |387| LOW | [N] |388389### Next Actions390391Based on findings, recommended actions:392393**If CRITICAL issues exist:**394- **Immediate**: Resolve constitution violations before proceeding395- Command: `/architect-clarify` to address ADR compliance396397**If HIGH ADR quality issues:**398- **Refine**: Address missing alternatives and consequences399- Command: `/architect-clarify` to improve ADR quality400401**If ADR->AD drift detected:**402- **Sync AD**: Update AD.md to reflect ADR decisions403- Command: `/architect-implement` to regenerate views404405**If AD->ADR drift detected:**406- **Document**: Create missing ADRs for undocumented decisions407- Command: `/architect-specify` or `/architect-init` to add ADRs408409**If feature alignment issues:**410- **Align**: Resolve feature-system boundary violations411- Command: Run `/architect-specify` or `/architect-init` to create missing ADRs412```413414### Phase 6: Offer Remediation415416After presenting the report, ask:417418> "Would you like me to suggest specific remediation steps for the top [N] issues? I can provide detailed guidance for each finding, though I will not make any changes automatically."419420### Key Rules421422#### Analysis Integrity423424- **NEVER modify files** — this is read-only analysis425- **NEVER hallucinate missing content** — report absences accurately426- **Prioritize constitution violations** — these are always CRITICAL427- **Use evidence-based findings** — cite specific locations and content428429#### Consistency Standards430431- **Cross-reference everything** — validate bidirectionally (ADR to AD)432- **Check all levels** — system and feature architecture must align433- **Validate terminology** — same concepts must use same names434- **Verify diagrams** — Mermaid syntax must be valid435436#### Reporting Standards437438- **Limit to 50 findings** — aggregate overflow in summary439- **Include location** — always cite file:line or section440- **Provide actionable recommendations** — each finding gets a fix suggestion441- **Calculate coverage metrics** — quantify completeness442443## Next Steps444445If issues are found:446447- Run `/architect-clarify` to refine ADRs (quality issues, missing consequences/alternatives, constitution violations).448- Run `/architect-implement` to regenerate AD.md when ADR-to-AD drift is detected.449450For missing ADRs or feature boundary issues, use `/architect-specify` or `/architect-init` as appropriate.451452## Verification453454Concrete outputs of this skill:455456- **Architecture Analysis Report** in structured markdown, including:457 - Analysis Summary (mode, scope, files analyzed, analysis date)458 - Findings table with ID, pass, severity, location, summary, and recommendation459 - Coverage Metrics (ADR count, AD views complete, ADR→AD coverage, AD→ADR coverage, quality score)460 - Constitution Alignment summary (compliant, violations, deviations)461 - Issue Distribution by severity (CRITICAL, HIGH, MEDIUM, LOW)462 - Next Actions tailored to finding types463- **No files modified** — analysis is strictly read-only.464- **User-approved remediation guidance** offered after the report.