Generate requirements traceability matrix from requirements to design to tests
Generates comprehensive traceability matrices mapping requirements to design, implementation, and tests with automated gap analysis.
npx claudepluginhub tractorjuice/arc-kit<project ID or scope, e.g. '001', 'FR-xxx only'>You are helping an enterprise architect create a comprehensive traceability matrix that traces requirements through design to implementation and testing.
$ARGUMENTS
Note: The ArcKit Project Context hook has already detected all projects, artifacts, external documents, and global policies. Use that context below — no need to scan directories manually.
Identify the project: The user should specify a project name or number
Artifacts pre-extracted by hook:
Note: The Traceability Pre-processor Hook has already:
- Extracted all requirement IDs with categories, priorities, and descriptions from REQ files
- Scanned all ADRs, vendor HLD/DLD files, and HLDR/DLDR reviews for requirement ID references
- Computed coverage analysis: covered vs orphan requirements, coverage by category and priority
- Detected existing TRAC version for version numbering
Use the hook's pre-extracted data directly. Do NOT re-read REQ, ADR, or review files for requirement IDs.
You may still need to Read vendor HLD/DLD files for component/module names (the hook extracted req ID references but not detailed component descriptions).
If the hook data is not present, fall back to reading all artifacts manually.
Read the template (with user override support):
.arckit/templates/traceability-matrix-template.md exists in the project root${CLAUDE_PLUGIN_ROOT}/templates/traceability-matrix-template.md (default)Tip: Users can customize templates with
/arckit:customize traceability
Read external documents (if needed):
projects/000-global/external/ if relevantBuild the traceability matrix:
For each requirement (BR, FR, NFR, INT, DR) from the hook's requirements table:
Step 1: Requirement Details (pre-extracted by hook)
Step 2: Design Mapping
Step 3: Implementation Mapping
Step 4: Test Coverage
Step 5: Status
For each test case:
Use the hook's pre-computed data directly:
Analyze coverage metrics:
Use the hook's COVERAGE SUMMARY table directly — it already provides:
Do NOT recalculate these metrics. Enrich them with additional context:
Apply these thresholds when flagging gaps:
Risk Assessment:
Flag high-risk gaps:
Generate Traceability Report:
Create comprehensive report with:
Executive Summary:
Detailed Traceability Matrix: Large table with columns: | Req ID | Requirement | Priority | HLD Component | DLD Module | Implementation | Tests | Status |
Gap Analysis:
Coverage Metrics:
Action Items:
Before writing the file, read ${CLAUDE_PLUGIN_ROOT}/references/quality-checklist.md and verify all Common Checks plus the TRAC per-type checks pass. Fix any failures before proceeding.
Write output:
projects/{project-dir}/ARC-{PROJECT_ID}-TRAC-v${VERSION}.md - Full traceability matrix including coverage metrics and gap analysis (all in one document)CRITICAL - Show Summary Only: After writing the file, show ONLY a brief summary with coverage metrics and key gaps. Do NOT output the full traceability matrix content in your response, as matrices can be 800+ lines with detailed requirement-to-test mappings.
CRITICAL - Auto-Populate Document Control Fields:
Before completing the document, populate ALL document control fields in the header:
The hook provides the existing TRAC version and a suggested next version. Use these directly:
ARC-{PROJECT_ID}-TRAC-v{VERSION} (e.g., ARC-001-TRAC-v1.0)Auto-populated fields (populate these automatically):
[PROJECT_ID] → Extract from project path (e.g., "001" from "projects/001-project-name")[VERSION] → Determined version from Step 0[DATE] / [YYYY-MM-DD] → Current date in YYYY-MM-DD format[DOCUMENT_TYPE_NAME] → "Requirements Traceability Matrix"ARC-[PROJECT_ID]-TRAC-v[VERSION] → Construct using format from Step 1[COMMAND] → "arckit.traceability"{ARCKIT_VERSION} → Use the ArcKit Version from the hook's Project section (do NOT search for VERSION files)User-provided fields (extract from project metadata or user input):
[PROJECT_NAME] → Full project name from project metadata or user input[OWNER_NAME_AND_ROLE] → Document owner (prompt user if not in metadata)[CLASSIFICATION] → Default to "OFFICIAL" for UK Gov, "PUBLIC" otherwise (or prompt user)Calculated fields:
[YYYY-MM-DD] for Review Date → Current date + 30 days (requirements, research, risks)[YYYY-MM-DD] for Review Date → Phase gate dates (Alpha/Beta/Live for compliance docs)Pending fields (leave as [PENDING] until manually updated):
[REVIEWER_NAME] → [PENDING][APPROVER_NAME] → [PENDING][DISTRIBUTION_LIST] → Default to "Project Team, Architecture Team" or [PENDING]| 1.0 | {DATE} | ArcKit AI | Initial creation from `/arckit:traceability` command | [PENDING] | [PENDING] |
The footer should be populated with:
**Generated by**: ArcKit `/arckit:traceability` command
**Generated on**: {DATE} {TIME} GMT
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Use actual model name, e.g., "claude-sonnet-4-5-20250929"]
**Generation Context**: [Brief note about source documents used]
## Document Control
| Field | Value |
|-------|-------|
| **Document ID** | ARC-001-TRAC-v1.0 |
| **Document Type** | {Document purpose} |
| **Project** | Windows 10 to Windows 11 Migration (Project 001) |
| **Classification** | OFFICIAL-SENSITIVE |
| **Status** | DRAFT |
| **Version** | 1.0 |
| **Created Date** | 2025-10-29 |
| **Last Modified** | 2025-10-29 |
| **Review Date** | 2025-11-30 |
| **Owner** | John Smith (Business Analyst) |
| **Reviewed By** | [PENDING] |
| **Approved By** | [PENDING] |
| **Distribution** | PM Team, Architecture Team, Dev Team |
## Revision History
| Version | Date | Author | Changes | Approved By | Approval Date |
|---------|------|--------|---------|-------------|---------------|
| 1.0 | 2025-10-29 | ArcKit AI | Initial creation from `/arckit:traceability` command | [PENDING] | [PENDING] |
User: /arckit:traceability Generate traceability matrix for payment gateway project
You should:
projects/001-payment-gateway/ARC-001-TRAC-v1.0.md< or > (e.g., < 3 seconds, > 99.9% uptime) to prevent markdown renderers from interpreting them as HTML tags or emoji