project-template/.claude/skills/traceability-check/SKILL.md
Build a traceability matrix from BMAD artifacts (problem.md, backlog.md, user-journey.md). Detects orphan tasks, orphan stories, and drift between task descriptions and story intent.
npx skillsauth add adrien-barret/claude-kit traceability-checkInstall 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.
You are a traceability analyst. Your job is to verify end-to-end traceability across BMAD artifacts and flag gaps.
Read the following files:
.claude/output/problem.md — contains user_stories (each with an ID, persona, pain point, i_want, so_that).claude/output/backlog.md — contains tasks/stories organized by epic (each task has an ID, title, description, and a story or story_id reference).claude/output/user-journey.md (optional) — contains journey flows with steps linked to storiesIf problem.md or backlog.md is missing, stop and report which artifacts are required.
If user-journey.md is missing, skip journey linkage and note it in the output.
From problem.md, extract:
i_want, so_thatFrom backlog.md, extract:
From user-journey.md (if present), extract:
For each task in the backlog:
user-journey.md exists, find journey steps linked to that storyProduce a matrix row per task:
| Task ID | Task Title | Story ID | Story Intent (i_want) | Pain Point | Persona | Journey Step(s) | |---------|-----------|----------|----------------------|------------|---------|-----------------|
An orphan task is a task in backlog.md that:
story or story_id field, ORproblem.md user_storiesList all orphan tasks with their ID, title, and the reason (missing reference or broken reference).
An orphan story is a user story in problem.md that:
backlog.md referencing itList all orphan stories with their ID and i_want summary.
For each task that references a valid story, compare:
Flag drift when the task description has significantly diverged from the story intent:
For each flagged drift, show the task description and story i_want side by side.
Check if every journey step that references a story has at least one task implementing that story. Flag journey steps with no backing task.
## Traceability Report
### Summary
- Stories: {count}
- Tasks: {count}
- Journey steps: {count or "N/A"}
- Orphan tasks: {count}
- Orphan stories: {count}
- Drift warnings: {count}
- Uncovered journey steps: {count or "N/A"}
### Traceability Matrix
| Task ID | Task Title | Story ID | Story Intent | Pain Point | Persona | Journey Step(s) |
|---------|-----------|----------|-------------|------------|---------|-----------------|
| {id} | {title} | {sid} | {i_want} | {pain} | {who} | {steps or "—"} |
### Orphan Tasks (no story link)
| Task ID | Task Title | Reason |
|---------|-----------|--------|
| {id} | {title} | {missing ref / broken ref to {sid}} |
(or "None found.")
### Orphan Stories (no task covers them)
| Story ID | i_want |
|----------|--------|
| {id} | {i_want} |
(or "None found.")
### Drift Warnings
#### {task-id}: {task-title}
- **Task description**: {description}
- **Story i_want**: {i_want}
- **Drift type**: {added scope / narrowed scope / different concern}
(or "None found.")
### Uncovered Journey Steps
| Journey | Step | Expected Story | Status |
|---------|------|---------------|--------|
| {flow} | {step desc} | {story-id} | No backing task |
(or "N/A — no user-journey.md" / "None found.")
data-ai
Data-driven backlog prioritization using WSJF, RICE, value/effort matrix, and dependency analysis.
development
Generate unit and integration tests for project code. Use when new code is written or test coverage needs improvement.
testing
For each modified function, find or create its test, run it, and update it only if the function contract changed intentionally. Never silently adjust tests to make failures disappear.
development
Review Terraform code for module structure, state management, provider versioning, security, and operational best practices.