plugins/tracing-requirements-to-code/skills/tracing-requirements-to-code/SKILL.md
Builds and maintains bidirectional traceability between requirements and the tests that verify them: extracts a matrix from an existing codebase, annotates tests with requirement IDs, finds orphan tests and uncovered requirements, verifies that each link is real, and enforces linkage in CI. Use when a suite exists but nobody can say what it proves, when an auditor or stakeholder asks which tests cover a requirement, when a traceability matrix has gone stale, or when a requirement changes and its blast radius must be found.
npx skillsauth add jaktestowac/awesome-copilot-for-testers tracing-requirements-to-codeInstall 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.
Use this skill when the tests already exist and the question is what they actually verify.
Traceability is usually taught forward: take a specification, derive requirements, plan tests. That is requirements-test-coverage-mapper, and it is the right skill when you start from a document. This skill handles the other and more common situation: a live codebase, hundreds of tests, requirements scattered across a tracker and three documents, and no reliable statement of which test proves what.
The insistence that makes this worth doing: a traceability link is a claim, not a record. A test tagged @req REQ-014 claims to verify REQ-014, and nothing about writing the tag makes that true. An unverified matrix is worse than no matrix, because it converts ignorance into documented confidence, and it is exactly the artifact people reach for when deciding what not to test.
Before touching tests, fix what a requirement is in this project and where the authoritative list lives:
PROJ-1234)Record the ID scheme, and whether IDs are stable. An ID that changes when a ticket moves project is not usable as a link target, and discovering that after annotating 400 tests is expensive.
./resources/id-and-annotation-conventions.md covers choosing a scheme that survives.
Work through ./resources/extracting-an-rtm.md. The method, in short:
stated (the test or its commit names the requirement), inferred (the behaviour clearly matches), guessed (it plausibly relates).Do not silently promote a guess. A matrix that distinguishes stated from guessed is honest and usable; one that flattens them is a document nobody should trust and everybody will.
Move each defensible link into the code, next to the test it describes.
test('rejects a card that expired last month @req:REQ-014', async ({ page }) => { ... });
Per-runner spellings, the machine-readable formats, and the trade-offs between tags, annotations, and comments are in ./resources/id-and-annotation-conventions.md.
Rules that decide whether this survives:
The phase that separates this from bookkeeping. For each link, and at minimum for every link on a high-risk requirement:
A link that survives step 3 with a passing test is a false claim in the matrix. Fix the test or remove the link; do not leave it as documented coverage.
This is the same standard unslop-tests and migrating-tests-to-playwright apply, for the same reason: a test that has never been observed failing has unmeasured value, and a matrix built on such tests inherits that.
Verifying every link in a large suite is not affordable. Verify by risk, record the coverage of the verification itself, and state what was taken on trust.
Cross the two directions and take all four quadrants seriously. ./resources/orphan-and-drift-detection.md has the triage.
| | Has a test | No test | | --- | --- | --- | | Has a requirement | Covered, verify the link | Coverage gap | | No requirement | Orphan test | Out of scope |
designing-functional-tests or requirements-test-coverage-mapper.unslop-tests should judge.Reporting orphan tests as a single count wastes them. Classify each one.
A matrix maintained by hand is a matrix that is true once. ./resources/traceability-automation.md has a generator that parses annotations and emits the matrix, plus the CI gate.
Enforce, in increasing order of strictness, and adopt them in this order:
Introduce a gate against changed files first. A gate that fails on a pre-existing backlog of 300 unannotated tests gets disabled in a week, and then nothing is enforced at all.
When a requirement changes, the matrix is what tells you what to revisit. The procedure is in ./resources/traceability-automation.md:
Requirement changes are the main source of drift, and they are the moment traceability pays for itself. Hand the wider retest question to analyzing-regression-scope.
./resources/traceability-automation.md has the report shape. It states:
./resources/id-and-annotation-conventions.md - choosing a stable ID scheme, per-runner annotation spellings for Playwright, Vitest, Jest, and Cucumber, and the many-to-many cases./resources/extracting-an-rtm.md - building the matrix from an existing codebase: reading assertions rather than titles, confidence labels, and a worked extraction./resources/orphan-and-drift-detection.md - the four quadrants, orphan-test classification, the ways links rot, and the triage table./resources/traceability-automation.md - a generator script, the staged CI gate, the change-impact procedure, and the report templaterequirements-test-coverage-mapper - the forward direction: designing coverage from a PRD before the tests exist. Use that one to plan, this one to verify what was built.verifying-acceptance-criteria - when the question is whether a specific build meets its criteria, rather than which test covers whatanalyzing-regression-scope - when a requirement change needs its full retest blast radius, beyond the linked testsunslop-tests - when an orphan test needs judging on whether it proves anythingdesigning-functional-tests - when an uncovered requirement needs its tests designeddocumenting-test-suites - where the ID convention and the matrix's location belong permanentlyassessing-release-readiness - which consumes the uncovered-requirement list as release evidenceThis skill is complete when:
testing
Tests the customization assets themselves - skills, prompts, custom agents, instructions - the way a product is tested: activation cases that check an asset fires when it should and stays quiet when it should not, output-contract cases, safety cases, collision cases between assets competing for the same trigger, a weighted rubric scored blind, and a baseline-versus-candidate gate before an edit ships. Use when a skill is edited and nobody knows whether behaviour changed, when two skills fight over the same request, when a description is being tuned for discoverability, when a collection has grown past manual spot-checking, or when the request mentions skill evals, prompt regression, or "does this skill actually work".
development
Shapes QA output for the person who has to act on it: result and blocker in the first two lines, one decision per report, findings ordered by what they cost, the long artifact in a file and the decisions in the message, and magnitude stated in units the reader can count. Use when a report is accurate but nobody acts on it, when a finding set is too long to read under time pressure, when the same findings must be retold for a developer, a release manager, and an on-call engineer, or when the request mentions "too long", "make this readable", "just tell me what to do", "so what", or "summarize this for stakeholders". Pairs with unslop-answers, which makes the same report honest.
testing
Verifies that the lines and branches a change actually touched are executed by tests, using LCOV or Cobertura diff coverage instead of whole-repo percentages, and escalates uncovered high-risk changes into a blocking finding. Use when a pull request needs a coverage gate that unrelated tests cannot satisfy, when total coverage looks healthy but the diff is untested, when wiring diff coverage into CI, or when someone claims a change is covered because the suite is green.
development
Cuts AI tells from test code: tests that pass without proving anything, tautological assertions, mock-only tests, hardcoded waits, coverage theater, vague names, swallowed errors, retries used as fixes. Use whenever test code is written, changed, or reviewed, including tests produced as a side effect of a feature task, and when the request mentions "review these tests", "are these tests any good", "this test always passes", "this suite is flaky", or "clean up these tests". Must always apply to test code.