skills/architecture-traceability/SKILL.md
Use this skill for requirements deviation checks, requirements traceability, and PO Spec coverage analysis. Compares PO Spec use cases against architecture documentation to detect coverage gaps. Generates a markdown traceability report (TRACEABILITY_REPORT.md) showing Covered, Partial, or Not Covered status per requirement. Invoke when checking for requirements deviations, running a requirements coverage check, verifying PO Spec coverage, generating a traceability matrix, or checking if architecture covers all business requirements.
npx skillsauth add shadowx4fox/solutions-architect-skills architecture-traceabilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill compares PO Spec use cases against architecture documentation to produce a portable markdown traceability report. It answers: "Did the architecture team cover everything the PO asked for?"
Output: TRACEABILITY_REPORT.md at the project root — a markdown file designed for tickets, emails, Confluence, GitHub issues, and external platforms.
/skill architecture-traceabilityDo NOT invoke for:
architecture-readiness skillarchitecture-docs skillarchitecture-compliance skillarchitecture-peer-review skill| File | Purpose |
|------|---------|
| SKILL.md | This file — entry point and workflow |
Search for the Product Owner Specification:
Search order:
1. PRODUCT_OWNER_SPEC.md at project root
2. PO_SPEC.md at project root
3. Glob **/PRODUCT_OWNER_SPEC.md, **/PO_SPEC.md
4. Glob **/po-spec*, **/product-owner*
5. Ask user for path
If no PO Spec found, abort with: "No Product Owner Specification found. Use /skill architecture-readiness to create one first."
Search for ARCHITECTURE.md at the project root. Detect multi-file vs monolithic structure.
Build the arch_files list:
ARCHITECTURE.md (navigation index or monolithic)docs/01-system-overview.md (S1+S2)docs/03-architecture-layers.md (S4)docs/components/*.md or docs/components/*/*.md (S5)docs/04-data-flow-patterns.md (S6)docs/05-integration-points.md (S7)docs/06-technology-stack.md (S8)docs/07-security-architecture.md (S9)docs/08-scalability-and-performance.md (S10)docs/09-operational-considerations.md (S11)Only include files that exist. If no ARCHITECTURE.md found, abort with: "No ARCHITECTURE.md found. Use /skill architecture-docs to create one first."
Also extract the Architecture Version from ARCHITECTURE.md:
<!-- ARCHITECTURE_VERSION: X.Y.Z --> comment at the top of the fileunversionedRead the PO Spec file. Locate the Use Cases section by searching for heading patterns:
## N. Use Cases (e.g., ## 4. Use Cases, ## 3. Use Cases)## Use CasesFor each use case found (identified by ### UC-NNN:, ### N.N UC-NNN:, ### Use Case N:, or ### N.N sub-headings), extract:
| Field | Pattern | Required |
|-------|---------|----------|
| id | Parse from heading (e.g., UC-01) or generate sequentially | Yes |
| name | Text after the colon in the heading | Yes |
| actor | **Actor:** or **Actors:** field | No |
| description | **Description:** field or first paragraph after heading | No |
| primaryFlow | **Primary Flow:** numbered steps | No |
| alternativeFlows | **Alternative Flows:** sub-items | No |
| edgeCases | **Edge Cases:** items | No |
| preconditions | **Preconditions:** items | No |
| postconditions | **Postconditions:** items | No |
| successMetrics | **Success Metrics:** items | No |
Phase detection: Search the PO Spec for phase references:
**Phase N:** sections in Section 8 (Next Steps / Roadmap)Phase 1Requirement extraction: Each use case yields N traceable requirements:
| Requirement Source | What becomes a requirement | |--------------------|---------------------------| | Primary Flow | Each step that implies system behavior (skip pure UI navigation) | | Alternative Flows | Each alternative scenario | | Edge Cases | Each edge case with its handling | | Preconditions | Authentication, role, or system state requirements | | Postconditions | System state changes that must be supported | | Success Metrics | Performance, quality, or UX targets |
For simplified PO Specs (bullet-point format without formal UC structure), each bullet under the Use Cases section becomes one requirement.
Extraction filter — strip "how" from PO Spec requirements: When the PO Spec mentions specific technologies, integration paths, or implementation details (e.g., "integrate with Push Notification Gateway via FCM"), extract only the business capability ("push notification delivery with status tracking") as the traceable requirement. The architecture team decides the "how" — the traceability check validates the "what."
For each requirement from Step 3, search the architecture files for coverage evidence. Map requirement types to architecture sections:
| Requirement Type | Primary Search Targets |
|-----------------|----------------------|
| Functional behavior (flow steps) | S1+S2 (docs/01-system-overview.md), S5 (docs/components/*.md) |
| Data operations (CRUD, storage) | S6 (docs/04-data-flow-patterns.md), S5 |
| External integrations | S7 (docs/05-integration-points.md) |
| Authentication / authorization | S9 (docs/07-security-architecture.md) |
| Performance / latency targets | S10 (docs/08-scalability-and-performance.md) |
| Error handling / edge cases | S5, S11 (docs/09-operational-considerations.md) |
| Monitoring / operations | S11 (docs/09-operational-considerations.md) |
Coverage classification:
Important: Coverage matching is semantic, not lexical. The PO Spec may say "User configures schedule" while the architecture says "Cron-based scheduling." Use architectural understanding to determine coverage — grep is a locating hint, classification is judgment.
PO Spec Scope Rule — "What" vs "How":
The PO Spec defines what the business needs (capabilities, outcomes, constraints). It does not define how the architecture implements those needs (technology choices, integration paths, component decomposition). When evaluating coverage:
"Covered via [component/path] (differs from PO Spec's expected [path])"Before generating the report, compute:
Percentage rounding rule (largest-remainder / Hamilton method) — apply to any table where multiple integer percentages must sum to 100% (e.g., the global Summary table's Covered / Partial / Not Covered rows, or any per-UC / per-phase / per-source breakdown rendered as integer percents):
pᵢ = 100 × countᵢ / total.fᵢ = floor(pᵢ). Track each remainder rᵢ = pᵢ − fᵢ.D = 100 − Σ fᵢ (an integer in 0..N, where N is the number of rows).rᵢ descending; add +1 to the top D rows.rᵢ equal): larger countᵢ first, then row order in the table (Covered → Partial → Not Covered).For single-value cells (per-phase Coverage column, per-UC N/N (X%) cell, any standalone percentage), use plain round() — there is no sum constraint.
Per-UC / per-phase integer-% breakdowns — if the report decomposes a single UC, phase, or source into integer percentages across Covered / Partial / Not Covered (e.g., UC-03 — 73% / 18% / 9%), apply the largest-remainder rule per row, not just to the global Summary. Each such row is its own 100%-budget.
Self-check checklist — run before writing TRACEABILITY_REPORT.md:
Covered% + Partial% + NotCovered% == 100.N/N (X%), per-phase Coverage) are exempt — round() is fine, no sum constraint.Covered + Partial + NotCovered == Total (catches off-by-one classification bugs the %-sum check alone cannot detect — largest-remainder will produce 100% even if the underlying counts are wrong).If any check fails, recompute the offending row with the largest-remainder method before writing the report. Do not paper over a count mismatch by forcing percentages to 100 — that masks a real classification bug. Never ship a table whose integer-% rows sum to 99% or 101%.
Write TRACEABILITY_REPORT.md at the project root using this format:
# PO Spec Use Cases vs Architecture Coverage
**PO Spec**: [filename]
**Architecture**: ARCHITECTURE.md
**Architecture Version**: [ARCHITECTURE_VERSION from `<!-- ARCHITECTURE_VERSION: -->` comment, or "unversioned"]
**Date**: YYYY-MM-DD
## Summary
| Metric | Count | % |
|--------|-------|---|
| Total Requirements | N | — |
| ✅ Covered | N | N% |
| ⚠️ Partial | N | N% |
| ❌ Not Covered | N | N% |
### Coverage by Phase
| Phase | Requirements | Covered | Partial | Gaps | Coverage |
|-------|-------------|---------|---------|------|----------|
| Phase 1 | N | N | N | N | N% |
| Phase 2 | N | N | N | N | N% |
---
## UC-01: [Name] — [Phase]
**Actor**: [actor]
**Coverage**: N/N requirements (N%)
| PO Spec Requirement | Architecture Coverage | Status |
|---------------------|----------------------|--------|
| [requirement text] | [evidence: section + quote] | ✅ Covered |
| [requirement text] | [evidence] | ⚠️ Partial |
| [requirement text] | — | ❌ Not Covered |
(repeat for each use case)
---
## Gap Report
Requirements that need architecture documentation attention:
### ❌ Not Covered
| UC | Requirement | Source | Suggested Section |
|----|-------------|--------|-------------------|
| [UC-id] | [text] | [Primary Flow / Alt Flow / Edge Case / etc.] | [S-number (section name)] |
### ⚠️ Partial
| UC | Requirement | Evidence | Gap |
|----|-------------|----------|-----|
| [UC-id] | [text] | [what's documented] | [what's missing] |
Overwrite policy: TRACEABILITY_REPORT.md is regenerated fresh on each run (not date-stamped).
Show summary to the user:
Traceability report generated.
PO Spec: [filename] → Architecture: ARCHITECTURE.md v[ARCHITECTURE_VERSION]
Coverage: N% (N/N requirements covered)
✅ N covered · ⚠️ N partial · ❌ N gaps
Report: TRACEABILITY_REPORT.md
Copy the Gap Report section to address coverage gaps using /skill architecture-docs.
| Skill | Relationship |
|-------|-------------|
| architecture-readiness | Prerequisite: PO Spec must exist. If not found, direct user to create one. |
| architecture-docs | Prerequisite: ARCHITECTURE.md + docs/ must exist. Gap Report output guides users to update architecture using this skill. |
| architecture-peer-review | Complementary: peer review validates architecture quality; traceability validates business requirement coverage. |
| architecture-compliance | Complementary: compliance validates organizational standards; traceability validates PO Spec coverage. |
/skill architecture-traceability
→ Locates PO Spec and architecture docs, generates coverage report
"Requirements deviation check"
→ Compares PO Spec requirements against architecture, generates traceability report
"Check requirements coverage"
→ Same as above
"Generate a traceability matrix"
→ Same as above
"PO spec coverage check"
→ Generates report highlighting gaps and partial coverage
A successful traceability report produces:
TRACEABILITY_REPORT.md renders correctly in GitHub/external platformsdevelopment
Run risk and design-characteristics analyses over ARCHITECTURE.md documentation. Produces date-stamped reports in analysis/ covering ten lenses across two groups: HIGH-priority runtime/security — SPOF (single points of failure), Blast Radius (downstream cascade impact), Bottleneck (throughput chokepoints), Cost Hotspots (Pareto cost concentration), STRIDE (per-trust-boundary security threats); Strategic/sustainability — Vendor Lock-in (portability risk and exit cost), Latency Budget (per-hop SLO decomposition), Tech Debt/EOL (currency and deprecated tech), Coupling (fan-in/fan-out and cycles), Data Sensitivity (PII flow and encryption gaps). Each analysis can be requested individually, as a group, or all ten run in parallel. A consolidated Security Posture option (analysis 12) merges the STRIDE and Data Sensitivity reports into a single reviewer-fillable validation checklist of every security control to validate (markdown-only; exportable to a Word worksheet via architecture-docs-export). Output: analysis/<TYPE>-<YYYY-MM-DD>.md (default) OR analysis/<TYPE>-<YYYY-MM-DD>.html (interactive d3.js report; format is selected at runtime — Step 2.4). Requires ARCHITECTURE.md to exist (created by architecture-docs skill). Do NOT invoke for compliance contracts (use architecture-compliance), peer quality review (use architecture-peer-review), or ADR management (use architecture-definition-record).
development
On-demand export of architecture documents to professional Word (.docx) files. Exports are never automatic — invoke explicitly when ready to produce deliverables. Solution Architecture mode synthesizes an Executive Summary from docs/01-system-overview.md, the component index, and the compliance manifest (if present), then exports individual ADR docs. Handoff mode exports selected component development handoffs from handoffs/. Compliance mode exports selected compliance contracts from compliance-docs/. Security Posture mode exports the consolidated security validation checklist (analysis/SECURITY-POSTURE-<date>.md, from architecture-analysis) as a reviewer-fillable worksheet. IMPORTANT — this skill ONLY produces Word .docx files. It does NOT handle releasing, publishing, tagging, freezing, bumping, or finalizing an architecture version. For the Draft → Released lifecycle (git tag architecture-v{version}, archive snapshot, semver bump), use the `architecture-docs` skill (Workflow 10) instead. Do NOT invoke this skill when the user says "release my architecture", "release architecture", "publish architecture", "ship architecture", "tag architecture version", "freeze architecture", "bump architecture version", or "finalize architecture" — those route to `architecture-docs`.
testing
Generate Compliance Contracts (Contratos de Adherencia) from ARCHITECTURE.md files
testing
Use this skill whenever the user mentions deferred work, known compromises, shortcuts taken, "we'll fix this later," temporary workarounds, missing controls, or any architectural trade-off that should be made visible and tracked. Also trigger when arc42 Section 11 (Risks and Technical Debt) is being authored or updated, when a TDR / Technical Debt Record is requested by name, or when an ADR documents a decision that intentionally accepts debt. Do NOT use for general bug reports, feature requests, or backlog items — TDRs are for architectural or systemic compromises, not ordinary defects.