AgentSkillsCN

architecture-doc-auditor

采用188项基于视角的清单,对架构文档进行全面的完整性审计,结合严重程度分级的差距检测、技术债务指标,以及架构反模式扫描。支持TOGAF、C4、arc42,以及IEEE 42010等框架。请主动启用以下场景:(1) 架构评审关口,(2) 实施前的ADR验证,(3) C4图的完整性检查,(4) 技术债务评估,(5) 实施前的验证,(6) 治理合规性审计,(7) 设计文档交接审查。触发指令:“审计架构”“评审ADR”“检查架构文档”“验证设计文档”“架构评审”“审计C4图”“检查系统上下文”“技术债务评估”“架构健康检查”“治理评审”“架构完整性”

SKILL.md
--- frontmatter
name: architecture-doc-auditor
version: "2.0"
description: >
  Systematic completeness audit of Architecture Documentation using
  188-item viewpoint-based checklist, severity-classified gap detection,
  technical debt indicators, and architecture anti-pattern scanning.
  Supports TOGAF, C4, arc42, and IEEE 42010 frameworks.
  PROACTIVELY activate for: (1) Architecture review gates,
  (2) ADR validation before implementation, (3) C4 diagram completeness check,
  (4) Technical debt assessment, (5) Pre-implementation validation,
  (6) Governance compliance audit, (7) Design doc handoff review.
  Triggers: "audit architecture", "review ADR", "check architecture doc",
  "validate design doc", "architecture review", "audit C4 diagrams",
  "check system context", "technical debt assessment", "architecture health check",
  "governance review", "architecture completeness"

Architecture Documentation Auditor

A systematic audit system that evaluates Architecture Documentation against a comprehensive 188-item viewpoint-based checklist, detecting gaps, classifying severity, identifying technical debt signals, scanning for architecture anti-patterns, and generating actionable remediation roadmaps. Implements the GAP-AUDIT pattern (PATTERN-08) to produce CONTRACT-07 compliant GAP-INVENTORY output with Architecture Health Score extensions.


1. Purpose

This skill provides 12 core capabilities:

#CapabilityPhaseDescription
1Framework Detect1Identify architecture framework (TOGAF, C4, arc42, IEEE 42010)
2Document Parse1Extract architecture structure, diagrams, and decision records
3Viewpoint Map2Apply 14-viewpoint coverage framework to document sections
4Item-by-Item Verify3Check each of 188 checklist items against content
5Gap Detect3Identify missing, incomplete, or inconsistent elements
6Classify Gap Type4Categorize gaps using 6-type taxonomy
7Score Severity4Apply RUBRIC-07 (impact, likelihood, detectability)
8Anti-Pattern Scan5Detect 25 architecture anti-patterns
9Debt Signal Detect5Identify 25+ technical debt indicators
10Quality Attribute Validate4Verify ISO 25010 quality attribute coverage
11Remediate Suggest5Generate fix recommendations with effort estimates
12Synthesize Report6Produce GAP-INVENTORY + Health Score + Debt Roadmap

2. When to Use

Ideal for:

  • Architecture review gates before implementation
  • ADR validation before development starts
  • C4 diagram completeness verification
  • Technical debt assessment and tracking
  • Pre-implementation readiness check
  • Governance and compliance audits
  • Design document handoff to development teams
  • Architecture decision board preparation
  • System modernization planning
  • Security architecture review

Avoid when:

  • Document is code, not architecture (use code review)
  • Operational runbook review (use operations auditor)
  • Early ideation phase (architecture not yet defined)
  • Quick clarifying questions (formal audit adds overhead)
  • Infrastructure-as-Code review (use IaC auditor)
  • API specification only (use API spec auditor)

3. Parameters

ParameterTypeRequiredDefaultDescription
documentstringyesArchitecture document content or file reference
document_typeenumnodesign_docadr | design_doc | system_context | container | component | deployment | sequence | data_flow
frameworkenumnoautotogaf | c4 | arc42 | ieee_42010 | custom | auto
audit_depthenumnostandardsurface | standard | exhaustive
viewpointslistnocore_10List of viewpoint IDs (V1-V14) to validate
quality_attributeslistnoallISO 25010 attributes to validate
include_debt_assessmentbooleannotrueWhether to scan for technical debt indicators
include_anti_patternsbooleannotrueWhether to scan for architecture anti-patterns
governance_contextenumnoteamenterprise | team | project
output_formatenumnofullfull | executive | debt_roadmap_only

Document Type Effects

TypePrimary ViewpointsChecklist Focus
adrV10Decision structure, rationale, consequences
design_docV1-V10Full viewpoint coverage
system_contextV1, V6, V7External actors, integrations, boundaries
containerV2, V5, V6Technology choices, communication patterns
componentV3, V6Internal structure, interfaces
deploymentV4, V8Infrastructure, scaling, operations
sequenceV6API flows, interaction patterns
data_flowV5, V7Data stores, flows, security

Audit Depth Effects

DepthBehavior
surfaceCritical items only (~60 items), structural gaps, no anti-patterns
standardFull checklist for relevant viewpoints, anti-patterns, standard remediation
exhaustiveAll viewpoints including conditional, deep anti-pattern analysis, debt indicators, detailed remediation

Governance Context Effects

ContextCompliance LevelOutput Focus
enterpriseFull compliance frameworks (SOC2, GDPR, PCI-DSS)Governance reporting, compliance matrix
teamStandard architecture practicesTeam handoff, implementation readiness
projectMinimal viable documentationQuick assessment, critical gaps only

4. Six-Phase Workflow

Phase 1: Document Intake & Framework Detection

Purpose: Load document and establish audit context.

Steps:

  1. Receive architecture document (inline or file reference)
  2. Detect architecture framework:
    • C4: Look for Context/Container/Component/Code levels
    • arc42: Look for 12-section template structure
    • TOGAF: Look for ADM phase artifacts
    • IEEE 42010: Look for formal viewpoint definitions
  3. Load architecture-checklist.md reference
  4. Calibrate checklist based on document_type:
    • Filter items by viewpoint applicability
    • Adjust severity levels for document type
    • Set critical items that must be present
  5. Parse document to identify structure:
    • Extract section headers and hierarchy
    • Identify diagram references and types
    • Note ADRs (Architecture Decision Records)
    • Detect technology stack references
  6. Load viewpoint-catalog.md for structural validation
  7. Initialize gap tracking structure with empty findings

Techniques Used:

  • document_structure_extraction - Parse document hierarchy
  • framework_detection - Identify architecture methodology
  • checklist_calibration - Adjust criteria for context

Quality Gate: Framework identified; checklist calibrated for document type; structure parsed with sections identified

Output: Calibrated checklist (N items) + Document structure map + Detected framework


Phase 2: Viewpoint Mapping & Scope Definition

Purpose: Map document sections to architecture viewpoints and identify structural gaps.

Steps:

  1. Load viewpoint framework from viewpoint-catalog.md:

    Core Viewpoints (Always Assess):

    • V1: Context & Scope (system boundary, external actors)
    • V2: Container Architecture (major components, technology choices)
    • V3: Component Design (internal structure, interfaces)
    • V4: Deployment Topology (infrastructure, scaling)
    • V5: Data Architecture (data stores, flows, ownership)
    • V6: Integration & APIs (contracts, protocols, versioning)
    • V7: Security Architecture (auth, encryption, compliance)
    • V8: Operational Concerns (monitoring, SLOs, runbooks)
    • V9: Cross-Cutting Concerns (logging, caching, config)
    • V10: Decision Record (ADRs, rationale, consequences)

    Conditional Viewpoints (If Applicable):

    • V11: Multi-tenancy (SaaS/multi-tenant systems)
    • V12: Event Architecture (event-driven systems)
    • V13: Migration Path (legacy modernization)
    • V14: Compliance Matrix (regulated industries)
  2. Map each document section to viewpoints:

    • Assign based on content, not just header
    • Flag orphan sections (don't fit any viewpoint)
    • Flag missing viewpoints (no sections mapped)
  3. Identify structural gaps:

    • Core viewpoint with no coverage = CRITICAL structural gap
    • Core viewpoint with partial coverage = HIGH structural gap
    • Conditional viewpoint missing when applicable = MEDIUM gap
  4. Check for applicable conditional viewpoints:

    • Multi-tenancy: Evidence of tenant-based requirements
    • Event architecture: Event-driven patterns mentioned
    • Migration: Legacy system references
    • Compliance: Regulatory requirements mentioned
  5. Calculate initial coverage score per viewpoint

Techniques Used:

  • completeness_verification (CAT-PR-GA) - Verify all viewpoints addressed
  • viewpoint_mapping - Map sections to architectural concerns

Quality Gate: All applicable viewpoints assessed; structural gaps flagged

Output: Viewpoint coverage map with scores and structural gap list


Phase 3: Systematic Coverage Verification

Purpose: Verify each checklist item against document content.

Steps:

For each checklist item (V1-01 through V10-20):

code
1. LOCATE RELEVANT SECTION
   └─ Based on viewpoint mapping from Phase 2

2. ASSESS PRESENCE
   ├─ PRESENT: Item clearly addressed
   ├─ PARTIAL: Item mentioned but incomplete
   └─ ABSENT: No evidence of item

3. EVALUATE QUALITY (if present)
   ├─ CLEAR: Unambiguous and actionable
   ├─ AMBIGUOUS: Multiple interpretations possible
   ├─ INCONSISTENT: Contradicts other content
   ├─ INCOMPLETE: Missing key details
   └─ OUTDATED: Stale or deprecated references

4. RECORD EVIDENCE
   ├─ Location: Section/diagram reference
   ├─ Quote: Supporting text from document
   └─ Assessment: Pass/fail with rationale

5. FLAG FOR GAP CLASSIFICATION (if needed)
   └─ Any non-PRESENT or non-CLEAR items

Verification Rules by Viewpoint:

ViewpointItemsCritical ItemsVerification Approach
V1: ContextV1-01 to V1-15V1-01, V1-02, V1-03Check boundary definition, external actors
V2: ContainerV2-01 to V2-25V2-01, V2-02, V2-05Verify technology choices documented
V3: ComponentV3-01 to V3-18V3-01, V3-02Check internal structure clarity
V4: DeploymentV4-01 to V4-22V4-01, V4-05, V4-10Verify infrastructure defined
V5: DataV5-01 to V5-18V5-01, V5-02, V5-05Check data stores and flows
V6: IntegrationV6-01 to V6-15V6-01, V6-02, V6-05Verify API contracts exist
V7: SecurityV7-01 to V7-25V7-01, V7-02, V7-05, V7-10Check auth, encryption, audit
V8: OperationsV8-01 to V8-18V8-01, V8-05, V8-10Verify monitoring, SLOs defined
V9: Cross-CuttingV9-01 to V9-12V9-01, V9-05Check logging, config patterns
V10: DecisionsV10-01 to V10-20V10-01, V10-02, V10-05Verify ADR structure and coverage

Techniques Used:

  • completeness_verification (CAT-PR-GA) - Check presence of each item
  • negative_space_analysis (CAT-PR-GA) - Identify what's NOT documented
  • consistency_check (CAT-PR-ECR) - Cross-reference between viewpoints

Quality Gate: 100% of applicable checklist items evaluated

Output: Verification matrix with item-level results and evidence


Phase 4: Quality Attribute Validation

Purpose: Validate coverage of ISO 25010 quality attributes.

Steps:

4.1 Quality Attribute Mapping

Map document content to quality attributes from quality-attributes.md:

Quality AttributePrimary ViewpointsValidation Criteria
PerformanceV4, V5Latency targets, throughput requirements, resource limits
ScalabilityV4, V2Scaling strategy, elasticity approach, capacity planning
SecurityV7, V6Auth mechanisms, encryption, audit logging, compliance
ReliabilityV8, V4Availability targets, fault tolerance, DR strategy
MaintainabilityV3, V10Modularity, testability, decision rationale
InteroperabilityV6, V1API standards, protocol choices, versioning
PortabilityV4, V2Platform dependencies, abstraction layers
UsabilityV6, V10API ergonomics, developer experience

4.2 Coverage Assessment

For each quality attribute:

  1. Identify explicit coverage in primary viewpoints
  2. Check for implicit coverage in secondary viewpoints
  3. Assess coverage level: EXPLICIT / IMPLICIT / MISSING
  4. Note measurement approaches if present

4.3 Gap Identification

Flag quality attribute gaps:

  • MISSING in primary viewpoint = HIGH gap
  • MISSING in all viewpoints = CRITICAL gap for regulated contexts

Techniques Used:

  • quality_attribute_validation - Map concerns to ISO 25010
  • coverage_assessment - Evaluate attribute coverage

Quality Gate: All quality attributes assessed with coverage level

Output: Quality attribute coverage matrix


Phase 5: Technical Debt & Anti-Pattern Detection

Purpose: Identify technical debt signals and architecture anti-patterns.

Steps:

5.1 Gap Classification

For each gap identified in Phases 3-4, apply gap taxonomy (from gap-taxonomy.md):

code
IS ELEMENT PRESENT?
├─ NO → MISSING
└─ YES
    ├─ IS IT COMPLETE?
    │   ├─ NO → INCOMPLETE
    │   └─ YES
    │       ├─ DOES IT CONTRADICT OTHER CONTENT?
    │       │   ├─ YES → INCONSISTENT
    │       │   └─ NO
    │       │       ├─ IS IT CLEAR AND UNAMBIGUOUS?
    │       │       │   ├─ NO → AMBIGUOUS
    │       │       │   └─ YES
    │       │       │       ├─ IS IT TECHNICALLY CORRECT?
    │       │       │       │   ├─ NO → INCORRECT
    │       │       │       │   └─ YES
    │       │       │       │       └─ IS IT CURRENT?
    │       │       │       │           ├─ NO → OUTDATED
    │       │       │       │           └─ YES → No gap

5.2 Severity Scoring

Apply SEVERITY-SCORING (RUBRIC-07) with three dimensions:

DimensionWeightScale
Impact0.51=Low, 2=Medium, 3=High, 4=Critical
Likelihood0.31=Rare, 2=Possible, 3=Likely, 4=Certain
Detectability0.21=Obvious, 2=Moderate, 3=Difficult, 4=Hidden

Calculation:

code
severity_score = (impact × 0.5) + (likelihood × 0.3) + (detectability × 0.2)

CRITICAL: score >= 3.5
HIGH: 2.5 <= score < 3.5
MEDIUM: 1.5 <= score < 2.5
LOW: score < 1.5

5.3 Architecture Anti-Pattern Scan

If include_anti_patterns is true, scan for 25 patterns from anti-patterns-catalog.md:

Structural Anti-Patterns:

IDAnti-PatternSeverityDetection Signal
AA-01Big Ball of MudCRITICALNo clear component boundaries
AA-02Distributed MonolithCRITICALMicroservices with tight coupling
AA-03Database MonolithHIGHAll services sharing single database
AA-04God ServiceHIGHOne service handling everything
AA-05Circular DependenciesCRITICALA depends on B depends on A
AA-06Golden HammerMEDIUMSame tech used regardless of fit
AA-07Vendor Lock-in BlindnessHIGHNo abstraction over proprietary services
AA-08Accidental ComplexityHIGHOver-engineering indicators

Documentation Anti-Patterns:

IDAnti-PatternSeverityDetection Signal
AA-09Diagram DivorceCRITICALDiagrams don't match text
AA-10ADR AmnesiaHIGHDecisions made without records
AA-11Stale BlueprintsHIGHDocs reference deprecated systems
AA-12View VacuumCRITICALMissing entire viewpoint
AA-13C4 ConfusionMEDIUMMixed abstraction levels in diagrams
AA-14Prose OverloadMEDIUMWalls of text, no diagrams
AA-15Technology TourismLOWTech name-dropping without rationale
AA-16Abstraction AllergyMEDIUMOnly code-level detail, no conceptual

Operational Anti-Patterns:

IDAnti-PatternSeverityDetection Signal
AA-17Observability OmissionHIGHNo monitoring/alerting strategy
AA-18SLO SilenceHIGHNo reliability targets
AA-19Deployment DarknessCRITICALNo deployment documentation
AA-20Capacity BlindnessHIGHNo scaling strategy
AA-21Runbook RouletteMEDIUMNo operational procedures

Security Anti-Patterns:

IDAnti-PatternSeverityDetection Signal
AA-22Trust AssumptionCRITICAL"Internal network is secure"
AA-23Auth AfterthoughtHIGHSecurity bolted on later
AA-24Secret ScatterCRITICALCredentials in configs/code
AA-25Compliance ComplacencyHIGHNo compliance mapping

5.4 Technical Debt Detection

If include_debt_assessment is true, scan for indicators from technical-debt-indicators.md:

CategoryIndicatorsSeverity Range
Architectural DebtShared databases, sync coupling, missing abstractionsHIGH-CRITICAL
Documentation DebtStale diagrams, missing rationale, undocumented interfacesMEDIUM-HIGH
Infrastructure DebtManual deployments, missing DR, hardcoded configMEDIUM-HIGH
Security DebtUndocumented auth, missing encryption, no audit strategyHIGH-CRITICAL
API DebtBreaking changes, no versioning, inconsistent contractsMEDIUM-HIGH

5.5 Remediation Matching

Match each gap to remediation pattern:

Gap TypePrimary PatternAction
MISSINGAdd ContentWrite new section using template
INCOMPLETEExpand ContentFill in missing details
INCONSISTENTReconcile ContentResolve contradictions
AMBIGUOUSClarify ContentAdd specificity/metrics
INCORRECTCorrect ContentFix technical errors
OUTDATEDUpdate ContentRefresh stale information

Effort Estimation:

Effort LevelDefinitionTime Range
trivialQuick fix, obvious solution< 30 min
smallClear scope, single viewpoint30 min - 2 hours
mediumMultiple viewpoints or research needed2 - 8 hours
largeSignificant rework or stakeholder input1+ days

Techniques Used:

  • severity_scoring (RUBRIC-07) - Score gaps by impact
  • full_consistency_matrix (CAT-PR-ECR) - Cross-reference for inconsistencies
  • anti_pattern_detection - Match known failure patterns
  • debt_signal_detection - Identify technical debt indicators

Quality Gate: All gaps classified with type and severity; anti-patterns and debt signals detected

Output: Classified gap list + Anti-pattern findings + Debt indicators


Phase 6: Synthesis & Governance Reporting

Purpose: Produce final GAP-INVENTORY artifact with Architecture Health Score.

Steps:

6.1 GAP-INVENTORY Compilation

Compile all findings into CONTRACT-07 compliant structure:

  • Populate source_reference with document identifier
  • Set source_type to "architecture"
  • Build audit_criteria with viewpoint-based checklist
  • Compile gaps array with all classified gaps
  • Add anti_patterns array if detected
  • Add technical_debt section with indicators
  • Calculate summary statistics

6.2 Architecture Health Score

Calculate overall architecture health:

xml
<architecture_health>
  <overall_score>[0-100]</overall_score>
  <by_viewpoint>
    <!-- Score per viewpoint -->
  </by_viewpoint>
  <by_quality_attribute>
    <!-- Coverage per ISO 25010 attribute -->
  </by_quality_attribute>
  <technical_debt_summary>
    <!-- Debt indicator counts by category -->
  </technical_debt_summary>
  <c4_maturity>
    <!-- Completeness of C4 levels if applicable -->
  </c4_maturity>
</architecture_health>

Health Score Calculation:

code
viewpoint_score = (items_passed / items_total) × 100 per viewpoint
overall_score = weighted_average(viewpoint_scores) - severity_penalties

Severity Penalties:
- CRITICAL gap: -10 points
- HIGH gap: -5 points
- Anti-pattern: -3 points
- Debt indicator: -2 points

Health Status Thresholds:

StatusScore RangeInterpretation
HEALTHY80-100Ready for implementation
ADEQUATE60-79Minor gaps, proceed with awareness
AT_RISK40-59Significant gaps, address before proceeding
CRITICAL0-39Major gaps, not ready for implementation

6.3 Summary Statistics

Generate:

  • total_gaps: Count of all gaps
  • by_severity: {critical: N, high: N, medium: N, low: N}
  • by_category: {missing: N, incomplete: N, inconsistent: N, ...}
  • by_viewpoint: Gap count per viewpoint
  • overall_assessment: Based on health score
  • blocking_issues: List of gap IDs that must be fixed
  • coverage_score: Percentage of checklist items passed

Assessment Thresholds:

AssessmentCriteria
critical_issuesAny CRITICAL gap OR overall_score < 40
significant_gapsNo CRITICAL but score 40-59 OR >3 HIGH gaps
minor_issuesScore 60-79, only MEDIUM/LOW gaps
acceptableScore 80-89, few gaps
excellentScore 90+, minimal gaps

6.4 Executive Summary (if requested)

Generate stakeholder-friendly summary:

  • At-a-glance metrics table
  • Viewpoint coverage spider chart data
  • Quality attribute coverage radar chart data
  • Top 3 strengths
  • Top 3 critical issues
  • Risk heat map data
  • Recommended next actions

6.5 Debt Remediation Roadmap (if requested)

Generate prioritized technical debt paydown plan:

  • Priority 1: Immediate (blocking issues)
  • Priority 2: Short-term (before implementation)
  • Priority 3: Medium-term (during implementation)
  • Priority 4: Long-term (continuous improvement)
  • Effort/impact quadrant
  • Quick wins identification
  • Strategic investments

6.6 Output Selection

Based on output_format parameter:

  • full: GAP-INVENTORY + Health Report + Debt Roadmap
  • executive: Executive Summary only
  • debt_roadmap_only: Technical Debt Roadmap only

Techniques Used:

  • artifact_synthesis - Compile structured output
  • health_score_calculation - Compute architecture health
  • stakeholder_communication - Tailor for audience

Quality Gate: Output validates against CONTRACT-07 schema with architecture extensions

Output: GAP-INVENTORY artifact + Architecture Health Score + requested summaries


5. Gap Taxonomy

The 6 Gap Types

#TypeDefinitionArchitecture Detection SignalRemediation
1MISSINGRequired element completely absentNo viewpoint coverage, no ADRs found, deployment undocumentedAdd content
2INCOMPLETEPresent but lacking required detailTBD in diagrams, partial API specs, rationale missingExpand content
3INCONSISTENTContradicts other sectionsContext shows 5 services, container shows 8; ADR contradicts implementationReconcile content
4AMBIGUOUSMultiple interpretations possible"Scalable architecture" without metrics, "secure by design" without controlsClarify content
5INCORRECTTechnically wrong informationReferences deprecated API, shows removed service, wrong technologyCorrect content
6OUTDATEDWas correct but no longer currentShows v1 API when v3 current, references decommissioned databaseUpdate content

Reference: See references/architecture-checklist.md for detailed detection heuristics per checklist item.


6. Output Specifications

6.1 GAP-INVENTORY Format

Aligns with CONTRACT-07 from artifact-contracts.yaml with architecture extensions.

xml
<?xml version="1.0" encoding="UTF-8"?>
<gap_inventory contract="CONTRACT-07" version="1.0">

  <metadata>
    <artifact_id>GI-ARCH-[YYYY-MM-DD]-[5-char-hash]</artifact_id>
    <contract_type>GAP-INVENTORY</contract_type>
    <created_at>[ISO 8601]</created_at>
    <created_by>architecture-doc-auditor</created_by>
    <confidence>[0.0-1.0]</confidence>
    <provenance>
      <source_artifact>[Document identifier]</source_artifact>
      <audit_date>[ISO 8601 date]</audit_date>
      <audit_depth>[surface|standard|exhaustive]</audit_depth>
      <document_type>[adr|design_doc|system_context|...]</document_type>
      <framework_detected>[togaf|c4|arc42|ieee_42010|custom]</framework_detected>
      <checklist_version>1.0</checklist_version>
      <items_checked>[N]</items_checked>
      <viewpoints_assessed>[list]</viewpoints_assessed>
    </provenance>
  </metadata>

  <source_reference>[Document identifier]</source_reference>
  <source_type>architecture</source_type>

  <audit_criteria>
    <checklist_reference>architecture-checklist.md v1.0</checklist_reference>
    <viewpoint_framework>viewpoint-catalog.md v1.0</viewpoint_framework>
    <criteria_list>
      <criterion id="[V1-01]" viewpoint="V1">[Item description]</criterion>
      <!-- All checked items -->
    </criteria_list>
    <coverage_scope>[What this audit covered]</coverage_scope>
  </audit_criteria>

  <gaps>
    <gap id="GAP-001">
      <category>[missing|incomplete|inconsistent|ambiguous|incorrect|outdated]</category>
      <severity>[critical|high|medium|low]</severity>
      <severity_score>
        <impact>[1-4]</impact>
        <likelihood>[1-4]</likelihood>
        <detectability>[1-4]</detectability>
        <composite>[calculated]</composite>
      </severity_score>
      <viewpoint>[V1-V14]</viewpoint>
      <checklist_ref>[V1-01]</checklist_ref>
      <location>[Document section/diagram]</location>
      <description>[Gap description]</description>
      <evidence>[What indicates this gap]</evidence>
      <impact>[Consequence if not addressed]</impact>
      <remediation>
        <recommendation>[How to fix]</recommendation>
        <effort>[trivial|small|medium|large]</effort>
        <priority>[immediate|short_term|medium_term|long_term]</priority>
      </remediation>
    </gap>
  </gaps>

  <anti_patterns>
    <pattern id="AA-02">
      <name>Distributed Monolith</name>
      <severity>CRITICAL</severity>
      <instances>
        <instance location="[section]">[Evidence quote]</instance>
      </instances>
      <remediation>[How to address]</remediation>
    </pattern>
  </anti_patterns>

  <technical_debt>
    <indicator id="TD-A01">
      <category>architectural</category>
      <name>Shared database between services</name>
      <severity>HIGH</severity>
      <evidence>[Where detected]</evidence>
      <remediation_cost>large</remediation_cost>
    </indicator>
  </technical_debt>

  <architecture_health>
    <overall_score>[0-100]</overall_score>
    <overall_status>[HEALTHY|ADEQUATE|AT_RISK|CRITICAL]</overall_status>
    <by_viewpoint>
      <viewpoint id="V1" name="Context & Scope" score="[0-100]" status="[status]"/>
      <viewpoint id="V2" name="Container" score="[0-100]" status="[status]"/>
      <!-- All assessed viewpoints -->
    </by_viewpoint>
    <by_quality_attribute>
      <attribute name="Performance" coverage="[EXPLICIT|IMPLICIT|MISSING]"/>
      <attribute name="Security" coverage="[EXPLICIT|IMPLICIT|MISSING]"/>
      <!-- All quality attributes -->
    </by_quality_attribute>
    <technical_debt_summary>
      <total_indicators>[N]</total_indicators>
      <by_category>
        <architectural>[N]</architectural>
        <documentation>[N]</documentation>
        <infrastructure>[N]</infrastructure>
        <security>[N]</security>
        <api>[N]</api>
      </by_category>
    </technical_debt_summary>
    <c4_maturity>
      <level_1_complete>[true|false]</level_1_complete>
      <level_2_complete>[true|false]</level_2_complete>
      <level_3_complete>[true|false]</level_3_complete>
      <level_4_complete>[true|false]</level_4_complete>
    </c4_maturity>
  </architecture_health>

  <summary>
    <total_gaps>[N]</total_gaps>
    <by_severity>
      <critical>[N]</critical>
      <high>[N]</high>
      <medium>[N]</medium>
      <low>[N]</low>
    </by_severity>
    <by_category>
      <missing>[N]</missing>
      <incomplete>[N]</incomplete>
      <inconsistent>[N]</inconsistent>
      <ambiguous>[N]</ambiguous>
      <incorrect>[N]</incorrect>
      <outdated>[N]</outdated>
    </by_category>
    <by_viewpoint>
      <v1>[N]</v1>
      <v2>[N]</v2>
      <!-- Gap count per viewpoint -->
    </by_viewpoint>
    <anti_patterns_detected>[N]</anti_patterns_detected>
    <debt_indicators_detected>[N]</debt_indicators_detected>
    <overall_assessment>[critical_issues|significant_gaps|minor_issues|acceptable|excellent]</overall_assessment>
    <blocking_issues>
      <issue ref="GAP-001">[Brief description]</issue>
    </blocking_issues>
    <coverage_score>
      <items_passed>[N]</items_passed>
      <items_total>[N]</items_total>
      <percentage>[X%]</percentage>
    </coverage_score>
  </summary>

</gap_inventory>

6.2 Executive Summary Format

See templates/architecture-health-report.md for complete template.

6.3 Debt Remediation Roadmap Format

See templates/debt-remediation-roadmap.md for complete template.


7. Quality Gates

#GateCriterionPhase
1Framework DetectedArchitecture methodology identified or marked as custom1
2Checklist CalibratedChecklist adjusted for document type with applicable items1
3Document ParsedAll sections identified with structure map created1
4Viewpoints MappedAll applicable viewpoints assessed with scores2
5Items Verified100% of applicable checklist items evaluated3
6Quality Attributes CheckedAll ISO 25010 attributes assessed for coverage4
7Gaps ClassifiedAll gaps assigned type from 6-type taxonomy5
8Severity ScoredAll gaps scored using 3-dimension RUBRIC-075
9Anti-Patterns ScannedAll 25 anti-patterns checked (if enabled)5
10Debt Indicators ScannedAll debt categories checked (if enabled)5
11Health Score CalculatedOverall architecture health score computed6
12Output ValidatedGAP-INVENTORY conforms to CONTRACT-07 schema6

8. Workflow Integration

This skill serves as a quality gate in the architecture development workflow:

code
┌─────────────────────────────────────┐
│   ARCHITECTURE DOC AUDITOR          │  ◀── THIS SKILL
│                                     │
└────────────────┬────────────────────┘
                 │
                 │ Input: Architecture Document
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 1: Intake & Framework        │
│  • Detect framework (C4/arc42/...)  │
│  • Load architecture-checklist      │
│  • Parse document structure         │
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 2: Viewpoint Mapping         │
│  • Apply 14-viewpoint framework     │
│  • Map sections to viewpoints       │
│  • Flag structural gaps             │
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 3: Coverage Verification     │  ◀── Perfect Recall techniques
│  • Check 188 checklist items        │      completeness_verification
│  • Record presence and quality      │      consistency_check
│  • Cite evidence locations          │      negative_space_analysis
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 4: Quality Attributes        │  ◀── ISO 25010 validation
│  • Map to 8 quality attributes      │
│  • Assess coverage level            │
│  • Flag quality gaps                │
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 5: Debt & Anti-Patterns      │  ◀── RUBRIC-07 severity scoring
│  • Classify gaps (6 types)          │
│  • Score severity (3 dimensions)    │
│  • Scan 25 anti-patterns            │
│  • Detect 25+ debt indicators       │
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  Phase 6: Synthesis                 │  ◀── CONTRACT-07 + Health Score
│  • Compile GAP-INVENTORY            │
│  • Calculate Architecture Health    │
│  • Generate remediation roadmap     │
└────────────────┬────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────┐
│  OUTPUT: GAP-INVENTORY              │
│  + Architecture Health Score        │
│  + Technical Debt Roadmap           │
└─────────────────────────────────────┘

Artifact Flow

This Skill ProducesConsumed By
GAP-INVENTORY (CONTRACT-07)Architecture review board, governance
Architecture Health ScoreExecutive reporting, readiness gates
Debt Remediation RoadmapTechnical leadership, sprint planning

Integration Points

UpstreamThis SkillDownstream
Architecture authoringAuditImplementation
ADR creationValidateDevelopment sprint
C4 diagram creationCheck completenessTechnical design
Design doc draftingQuality gateGovernance approval

9. Behavioral Guidelines

  • Systematic not judgmental: Report gaps objectively, not as criticism
  • Evidence-based: Every gap must have cited evidence from the document
  • Constructive: Focus on remediation, not just problems
  • Calibrated: Severity reflects actual implementation impact
  • Complete: Check every applicable item, don't skip viewpoints
  • Framework-aware: Respect the architecture methodology being used
  • Debt-conscious: Surface technical debt signals for proactive management
  • Actionable: Every gap should have a clear path to resolution

10. References

FilePurpose
references/architecture-standards.mdTOGAF, C4, arc42, IEEE 42010 frameworks
references/architecture-checklist.md188 checklist items organized by viewpoint
references/viewpoint-catalog.md14 viewpoint definitions with concerns
references/quality-attributes.mdISO 25010 quality model with validation
references/technical-debt-indicators.md25+ debt signals with detection
references/anti-patterns-catalog.md25 architecture anti-patterns
references/compliance-frameworks.mdSOC2, GDPR, PCI-DSS requirements

External References

FilePurpose
@core/artifact-contracts.yamlCONTRACT-07 (GAP-INVENTORY) schema
@core/scoring-rubrics.yamlRUBRIC-07 (SEVERITY-SCORING) specification
@core/technique-taxonomy.yamlPerfect Recall techniques (CAT-PR-GA)
@core/skill-patterns.yamlGAP-AUDIT pattern (PATTERN-08)

11. Templates

FilePurpose
templates/gap-inventory-output.mdCONTRACT-07 compliant XML template with architecture extensions
templates/architecture-health-report.mdExecutive dashboard with viewpoint scores
templates/debt-remediation-roadmap.mdPrioritized technical debt paydown plan

12. Examples

Example 1: ADR Audit

yaml
input:
  document: "[ADR-047: Adopt Event-Driven Architecture for Order Processing]"
  document_type: adr
  framework: auto
  audit_depth: standard
  include_anti_patterns: true

flow:
  phase_1:
    - Framework: Custom (MADR-like structure detected)
    - Loaded ADR-focused checklist (V10: 20 items)
    - Parsed: Title, Status, Context, Decision, Consequences
  phase_2:
    - Primary viewpoint: V10 (Decision Record)
    - Secondary viewpoints assessed: V2 (Container), V6 (Integration)
    - Structural gap: No explicit alternatives section
  phase_3:
    - Verified 20 ADR items + 15 related items
    - 28 PRESENT + CLEAR
    - 4 PARTIAL
    - 3 ABSENT
  phase_4:
    - Quality attributes: Performance EXPLICIT, Scalability IMPLICIT, Reliability MISSING
  phase_5:
    - 7 gaps classified
    - 0 CRITICAL
    - 2 HIGH: Missing rollback strategy (V10-15), No SLO impact assessment (V10-18)
    - 3 MEDIUM: Vague consequences (V10-10), Missing stakeholder sign-off (V10-20)
    - 2 LOW: No review date (V10-19)
    - Anti-patterns: AA-10 (partial - alternatives not documented)
  phase_6:
    - Architecture Health Score: 72 (ADEQUATE)
    - ADR ready with minor gaps

output:
  total_gaps: 7
  by_severity: { critical: 0, high: 2, medium: 3, low: 2 }
  health_score: 72
  health_status: ADEQUATE
  overall_assessment: minor_issues
  recommendation: "Address rollback strategy and SLO impact before implementation."

Example 2: C4 System Context Audit

yaml
input:
  document: "[System Context Diagram + Description for Payment Gateway]"
  document_type: system_context
  framework: c4
  audit_depth: standard
  viewpoints: [V1, V6, V7]

flow:
  phase_1:
    - Framework: C4 (Level 1 - System Context)
    - Loaded Context-focused checklist (52 items)
    - Parsed: Diagram, external actors, integrations
  phase_2:
    - V1 (Context): Full coverage
    - V6 (Integration): Partial coverage
    - V7 (Security): Minimal coverage
    - Structural gap: Trust boundaries not defined
  phase_3:
    - Verified 52 items
    - 38 PRESENT
    - 8 PARTIAL
    - 6 ABSENT
  phase_4:
    - Security: MISSING (trust boundaries undefined)
    - Interoperability: EXPLICIT
    - Reliability: IMPLICIT
  phase_5:
    - 14 gaps classified
    - 2 CRITICAL: No trust boundaries (V1-09), External auth flow missing (V7-01)
    - 4 HIGH: SLA dependencies undocumented (V1-13), API versioning unclear (V6-05)
    - 5 MEDIUM
    - 3 LOW
    - Anti-patterns: AA-22 (Trust Assumption)
  phase_6:
    - Architecture Health Score: 58 (AT_RISK)
    - C4 Level 1 incomplete for security context

output:
  total_gaps: 14
  by_severity: { critical: 2, high: 4, medium: 5, low: 3 }
  health_score: 58
  health_status: AT_RISK
  c4_maturity: { level_1_complete: false }
  blocking_issues: 2
  overall_assessment: significant_gaps
  recommendation: "CRITICAL: Define trust boundaries and external auth flows before container design."

Example 3: Comprehensive Design Document Audit

yaml
input:
  document: "[Design Doc: Inventory Management Service Redesign - 12,000 words]"
  document_type: design_doc
  framework: arc42
  audit_depth: exhaustive
  include_debt_assessment: true
  governance_context: enterprise

flow:
  phase_1:
    - Framework: arc42 (11 of 12 sections present)
    - Loaded full checklist (188 items)
    - Parsed: 24 sections, 8 diagrams, 5 ADRs inline
  phase_2:
    - All 10 core viewpoints assessed
    - Conditional V11 (Multi-tenancy) applicable
    - V8 (Operations) weakest coverage
    - V10 (Decisions) strong with 5 ADRs
  phase_3:
    - Verified 188 items
    - 142 PRESENT
    - 28 PARTIAL
    - 18 ABSENT
  phase_4:
    - All 8 quality attributes assessed
    - Security: EXPLICIT
    - Performance: EXPLICIT
    - Reliability: IMPLICIT (needs SLOs)
    - Operability: MISSING
  phase_5:
    - 46 gaps classified
    - 1 CRITICAL: No disaster recovery strategy (V4-20)
    - 8 HIGH: Missing monitoring strategy (V8-01), SLOs undefined (V8-05)
    - 22 MEDIUM
    - 15 LOW
    - Anti-patterns: AA-17 (Observability Omission), AA-18 (SLO Silence)
    - Technical debt: 8 indicators detected
      - TD-D01: Diagrams >6 months stale
      - TD-A03: No bounded contexts defined
      - TD-I02: Manual deployment steps
  phase_6:
    - Architecture Health Score: 64 (ADEQUATE)
    - Compliance gap: SOC2 monitoring requirements not met

output:
  total_gaps: 46
  by_severity: { critical: 1, high: 8, medium: 22, low: 15 }
  anti_patterns_detected: 2
  debt_indicators_detected: 8
  health_score: 64
  health_status: ADEQUATE
  by_viewpoint:
    V1: 2 gaps, V2: 4 gaps, V3: 3 gaps, V4: 6 gaps
    V5: 4 gaps, V6: 5 gaps, V7: 3 gaps, V8: 12 gaps
    V9: 4 gaps, V10: 2 gaps, V11: 1 gap
  blocking_issues: 1
  overall_assessment: significant_gaps
  recommendation: "Address DR strategy (CRITICAL) and operability gaps before architecture review board."
  debt_remediation:
    immediate: ["DR strategy", "Monitoring strategy"]
    short_term: ["SLO definition", "Deployment automation"]
    medium_term: ["Diagram refresh", "Bounded context documentation"]

Quick Start

code
/architecture-doc-auditor
document: "[Paste architecture document or provide file path]"
document_type: design_doc
audit_depth: standard