plugins/sdlc/skills/check-traceability/SKILL.md
Verify the full refinement chain from use cases through behavioral specs, pseudo-code specs, code, and tests — report coverage at each layer and identify gaps
npx skillsauth add jmagly/aiwg check-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.
Verify the full specification-to-code refinement chain and report coverage at each layer. The traceability chain has 5 layers:
Layer 1: Use Cases (UC-NNN)
└── Layer 2: Behavioral Specs (DES-UCR-NNN, DES-SM-NNN, DES-DT-NNN, DES-MIC-NNN)
└── Layer 3: Pseudo-Code Specs (DES-PSC-NNN)
└── Layer 4: Source Code (src/*)
└── Layer 5: Tests (test/*)
Users may say:
Check a specific layer or all layers:
all — full chain (default)uc — use cases only (are they well-formed?)behavioral — UC → behavioral spec coveragepseudo — behavioral → pseudo-code coveragecode — pseudo-code → source code coveragetest — code → test coverageOutput format: table (markdown), csv, or json.
Focus traceability on specific areas:
--guidance "Focus on authentication module"
--guidance "Only check high-priority use cases"
--guidance "Exclude test layer, just check specs"
Ask questions before starting:
Scan .aiwg/ for artifacts at each layer:
Layer 1 — Use Cases:
Glob: .aiwg/requirements/UC-*.md
Glob: .aiwg/requirements/use-case-*.md
Layer 2 — Behavioral Specs:
Glob: .aiwg/requirements/realizations/DES-UCR-*.md
Glob: .aiwg/architecture/state-machines/DES-SM-*.md
Glob: .aiwg/architecture/decision-tables/DES-DT-*.md
Glob: .aiwg/architecture/method-contracts/DES-MIC-*.md
Glob: .aiwg/architecture/activity-diagrams/DES-ACT-*.md
Glob: .aiwg/architecture/data-flows/DES-DFS-*.md
Layer 3 — Pseudo-Code Specs:
Glob: .aiwg/architecture/pseudo-code/DES-PSC-*.md
Also check: Traceability section of DES-MIC files for PSC references
Layer 4 — Source Code:
Read pseudo-code spec Traceability sections for "Source Code:" references
Grep source files for traceability comments (e.g., @spec DES-PSC-NNN)
Layer 5 — Tests:
Read pseudo-code spec Traceability sections for "Tests:" references
Grep test files for traceability comments (e.g., @spec DES-PSC-NNN)
For each use case found, trace forward through all layers:
UC-001 (Place Order)
├── DES-UCR-001 (realization) ✓
│ ├── DES-SM-001 (Order state machine) ✓
│ ├── DES-DT-001 (Discount calculation) ✓
│ ├── DES-MIC-010 (calculateOrderTotal) ✓
│ │ ├── DES-PSC-010 (pseudo-code) ✓
│ │ │ ├── src/order/pricing.ts ✓
│ │ │ └── test/order/pricing.test.ts ✓
│ │ └── DES-PSC-011 (pseudo-code) ✗ MISSING
│ └── DES-MIC-013 (submitOrder) ✓
│ └── DES-PSC-013 (pseudo-code) ✓
│ ├── src/order/service.ts ✓
│ └── test/order/service.test.ts ✗ MISSING
└── DES-ACT-001 (activity diagram) ✓
Report coverage percentage at each layer:
| Layer | Total | Covered | Coverage | Status | |-------|-------|---------|----------|--------| | UC → Behavioral | 12 UCs | 10 have realizations | 83% | PASS (≥80%) | | Behavioral → Pseudo-code | 25 methods | 20 have specs | 80% | PASS (≥80%) | | Pseudo-code → Code | 20 specs | 18 have source | 90% | PASS | | Code → Test | 18 modules | 15 have tests | 83% | PASS (≥80%) |
For each gap, report:
Output to .aiwg/reports/traceability-report.md:
# Traceability Report
**Date**: YYYY-MM-DD
**Scope**: All use cases / filtered set
**Overall Status**: PASS | GAPS | FAIL
## Coverage Summary
| Layer Transition | Total | Covered | Gaps | Coverage | Threshold | Status |
|-----------------|-------|---------|------|----------|-----------|--------|
| UC → Behavioral | N | N | N | N% | 80% | PASS/FAIL |
| Behavioral → Pseudo-code | N | N | N | N% | 80% | PASS/FAIL |
| Pseudo-code → Code | N | N | N | N% | — | INFO |
| Code → Test | N | N | N | N% | 80% | PASS/FAIL |
## Gap Details
### Missing Behavioral Specs
| Use Case | Priority | Expected Artifact | Status |
|----------|----------|-------------------|--------|
| UC-NNN | High | DES-UCR-NNN | MISSING |
### Missing Pseudo-Code Specs
| Interface Contract | Method | Expected Artifact | Status |
|-------------------|--------|-------------------|--------|
| DES-MIC-NNN | methodName | DES-PSC-NNN | MISSING |
### Missing Tests
| Source File | Pseudo-Code Spec | Expected Test | Status |
|-------------|-----------------|---------------|--------|
| src/path.ts | DES-PSC-NNN | test/path.test.ts | MISSING |
## Direct-Jump Detection
Use cases that skip specification layers (jump from UC directly to code):
| Use Case | Has Behavioral? | Has Pseudo-code? | Has Code? | Has Tests? | Issue |
|----------|-----------------|------------------|-----------|------------|-------|
| UC-NNN | NO | NO | YES | YES | Skips Layer 2+3 |
## Recommendations
- Priority 1: Create behavioral specs for high-priority UCs missing them
- Priority 2: Create pseudo-code specs for methods in critical paths
- Priority 3: Add tests for untested code files
Projects without the specification-complete layer (no behavioral or pseudo-code specs) continue to work:
.aiwg/requirements/realizations/ directory exists, skip Layer 2 check.aiwg/reports/traceability-report.md — full traceability report with coverage and gapsdata-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.