Requirements Traceability Matrix
Generate a comprehensive traceability matrix that traces requirements through design to implementation and testing.Command
Arguments
- scope (required): Project ID or “FR-xxx only” for filtered scope
Examples
Purpose
Create a comprehensive traceability matrix showing:- Forward Traceability - Requirements → Design → Implementation → Tests
- Backward Traceability - Tests → Implementation → Design → Requirements
- Gap Analysis - Orphan requirements, orphan designs, orphan tests
- Coverage Metrics - Coverage by requirement type and priority
Traceability Chains
Forward Traceability
For each requirement:- Requirement Details - ID, description, priority, category
- Design Mapping - Which HLD components implement this?
- Implementation Mapping - Source code files, APIs, database schemas
- Test Coverage - Unit tests, integration tests, UAT test cases
- Status - ✅ Fully implemented and tested / 🔄 In progress / ⏳ Planned / ❌ Not covered
Backward Traceability
For each test case:- Which requirements does it verify?
- Which design components does it test?
- What’s the expected outcome?
Gap Analysis
- Orphan Requirements - Requirements with NO design references (GAP!)
- Orphan Design Elements - IDs referenced in design but absent from REQ files (scope creep?)
- Orphan Tests - Tests not linked to requirements
- Coverage Gaps - Requirements without adequate test coverage
Coverage Metrics
The command provides:- Overall Coverage - Covered / Total / Percentage
- Breakdown by Category - Business, Functional, Non-Functional, Integration, Data
- Breakdown by Priority - MUST, SHOULD, MAY
- Implementation Coverage - % with implementation evidence
- Test Coverage - % with test references
- MUST requirements: Should be 100% covered
- SHOULD requirements: Should be >80% covered
- MAY requirements: Can be <50% covered
Risk Assessment
Flag high-risk gaps:- CRITICAL - MUST requirements not covered
- HIGH - Security/compliance requirements without tests
- MEDIUM - Performance requirements without validation
- LOW - Optional features not implemented
Output
GeneratesARC-{PROJECT_ID}-TRAC-v{VERSION}.md with:
- Executive summary with traceability score (0-100)
- Coverage by requirement type and priority
- Critical gaps requiring attention
- Detailed traceability matrix table
- Gap analysis (orphan requirements, orphan design, untested requirements)
- Coverage metrics with visual representation
- Action items (blocking gaps, non-blocking gaps, technical debt)
Traceability Matrix Table
| Req ID | Requirement | Priority | HLD Component | DLD Module | Implementation | Tests | Status |
|---|---|---|---|---|---|---|---|
| BR-001 | Business req | MUST | ✅ HLD | ❌ Missing | ❌ Missing | ❌ Missing | ⚠️ Partial |
| FR-001 | Functional | MUST | ✅ HLD, DLD | ✅ API | ✅ code.py | ✅ Tests | ✅ Complete |
| NFR-S-001 | Security | MUST | ❌ Missing | ❌ Missing | ❌ Missing | ❌ Missing | ❌ Not Covered |
Prerequisites
MANDATORY (warn if missing):- REQ (Requirements) - BR/FR/NFR/INT/DR requirements
- Vendor HLD/DLD files - For design mapping
- HLDR/DLDR (Design Reviews) - Design coverage evidence
- BKLG (Product Backlog) - User stories and sprint mapping
- DEVOPS (DevOps Strategy) - Test strategy
Hook Pre-processing
The Traceability Pre-processor Hook pre-extracts:- All requirement IDs with categories, priorities, and descriptions
- All ADR, vendor HLD/DLD, and review file references to requirement IDs
- Coverage analysis: covered vs orphan requirements
- Coverage by category and priority
- Existing TRAC version for version numbering
Version Detection
Before generating:- Check for existing
ARC-{PROJECT_ID}-TRAC-v*.mdfiles - If no existing file: Use VERSION=“1.0”
- If existing file found:
- Minor increment (e.g., 1.0 → 1.1): Same scope — refreshed content
- Major increment (e.g., 1.0 → 2.0): New requirement categories, significantly different coverage
- For v1.1+/v2.0+: Add Revision History entry
Use Cases
Compliance:- ISO, FDA, automotive standards require traceability
- Audit trail for regulatory compliance
- Change requests: which tests/designs affected?
- Scope changes: what’s the ripple effect?
- Go/no-go release decisions
- Test coverage verification
- Completeness checks
- A requirement is only “done” when implemented AND tested
- Missing traceability = missing accountability
Related Commands
arckit analyze- Comprehensive governance analysis (includes traceability)arckit conformance- Architecture conformance (includes ADR traceability)arckit health- Quick artifact health check
Important Notes
- Every MUST requirement MUST be traced to tests (non-negotiable)
- Orphan design elements may indicate scope creep (investigate!)
- Orphan requirements may indicate incomplete design (blocking issue!)
- Traceability matrix should be updated throughout project lifecycle