mcp-requirements-traceability
Skill4 starsChanged 28 days agoApache-2.0View on GitHub
Use this skill when adding, updating, mapping, or auditing QBrain.AI FR/TR/TEST requirements and acceptance criteria, or when making ./build.ps1 ValidateTraceability pass; it covers the workflow.requirements.* plugin methods, the requirement ID grammar, and the rule that every FR must map to at least one TR and one TEST and that all IDs appear in docs/Project/*.md.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 0 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
TEST: TEST-<AREA>-### (e.g.
- Very specific: line 51
All requirements work goes through the plugin workflow.requirements.* namespace (the Claude Code plugin wrapper, surfaced over REPL …
- Very specific: line 70
TEST IDs missing from Requirements-Matrix.md (MissingTestInMatrix).
- Very specific: line 81
Read AGENTS-README-FIRST.yaml once per session for the key/endpoints, and ensure the session is bootstrapped per the workspace plugin …
- Very specific: line 87
Create or update records. Use workflow.requirements.createFr (required params: id, title, description, priority, area.
- Very specific: line 99
Create the traceability mapping so coverage is satisfied.
- Very specific: line 107
Use format: wiki with docType: all to refresh docs/Project/wiki/azure and docs/Project/wiki/github.
- Very specific: line 118
Every new FR is reachable as a ## FR-...
- Very specific: line 120
Every new TR is a ## TR-...
- Very specific: line 122
Every new TEST ID appears in Testing-Requirements.md and in Requirements-Matrix.md.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Requirements Traceability
Manage QBrain.AI functional (FR), technical (TR), and test (TEST) requirements,
their FR -> TR/TEST mappings, and structured acceptance criteria. The requirements
database is the source of truth; the Markdown files under docs/Project/ are
import/export projections that ./build.ps1 ValidateTraceability reads. Keep both
in sync so the build stays green.
When to Use
- Adding or editing FR / TR / TEST records, or their acceptance criteria.
- Linking an FR to its TRs and TESTs (the traceability mapping).
- Fixing a failing
./build.ps1 ValidateTraceabilityrun. - Auditing coverage (which FR lacks a TR or a TEST).
- Regenerating the requirements Markdown / wiki projections from the database.
When Not to Use
- Managing TODO items or session logs: use the
todoandsessionskills instead. Requirement IDs are distinct from TODO IDs (PLAN-AREA-###) and Session IDs. - Editing the requirement Markdown files in
docs/Project/by hand. Never hand-editFunctional-Requirements.md,Technical-Requirements.md,Testing-Requirements.md,TR-per-FR-Mapping.md, orRequirements-Matrix.md. Mutate records through the plugin and regenerate the docs.
Inputs
- The workspace marker / API key from
AGENTS-README-FIRST.yaml(read once per session). - A requirement
area(andsubareafor TR), plustitle,description,priority. - For mappings: an
frIdand thetrIds/testIdsto link. - For validation: the five Markdown files under
F:\GitHub\QBrainAi\docs\Project\.
Critical Rules
- The database is authoritative. Markdown under
docs/Project/is a generated projection. After mutating records, regenerate the docs withworkflow.requirements.generateDocumentso the IDs land in the files the validator scans. Do NOT hand-edit those files. - ID grammar (uppercase, validated server-side):
- FR:
FR-<AREA>-###(e.g.FR-MCP-001). Area segment only. - TR:
TR-<AREA>-<SUBAREA>-###(e.g.TR-MCP-ARCH-001). Both area and subarea required. - TEST:
TEST-<AREA>-###(e.g.TEST-MCP-001). Area segment only.
- FR:
- Coverage rule the validator and CI enforce: every FR should map to at least one TR and at least one TEST, and every FR/TR/TEST ID must be present in the matrix.
- All requirements work goes through the plugin
workflow.requirements.*namespace (the Claude Code plugin wrapper, surfaced over REPL YAML/STDIO). Do not substitute raw REST or another agent's plugin for normal requirements work. - Capture requirements as they emerge during a session; do not defer. Record the new IDs in the session log turn tags.
How ValidateTraceability Enforces It
./build.ps1 ValidateTraceability runs the ValidateTraceability Nuke target
(build/Build.ValidateTraceability.cs), which calls TraceabilityValidator.Validate
(build/TraceabilityValidator.cs). It reads exactly five files under
docs/Project/: Functional-Requirements.md, Technical-Requirements.md,
Testing-Requirements.md, TR-per-FR-Mapping.md, and Requirements-Matrix.md.
It extracts IDs and reports four gaps:
- FR heading IDs missing from
TR-per-FR-Mapping.md(MissingFrInMapping). - FR heading IDs missing from
Requirements-Matrix.md(MissingFrInMatrix). - TR heading IDs missing from
Requirements-Matrix.md(MissingTrInMatrix). - TEST IDs missing from
Requirements-Matrix.md(MissingTestInMatrix).
Failure semantics: FR gaps (either of the first two) ALWAYS fail the build.
TR and TEST gaps are warnings only, and fail the build solely when you pass
--strict-tr-and-test-coverage (the StrictTrAndTestCoverage parameter). FR IDs
must appear as ## FR-... headings; TR IDs as ## TR-... headings; TEST IDs are
matched anywhere in Testing-Requirements.md. The matrix supports range tokens
like FR-MCP-001-003, which expand to each ID in the inclusive range.
Workflow
- Read
AGENTS-README-FIRST.yamlonce per session for the key/endpoints, and ensure the session is bootstrapped per the workspace plugin before any state-changing call. Begin a session log turn before mutating requirements. - Discover existing state. List with
workflow.requirements.listFr,workflow.requirements.listTr,workflow.requirements.listTest, filtering byarea(andsubareafor TR). Fetch one withgetFr/getTr/getTest. - Create or update records. Use
workflow.requirements.createFr(required params:id,title,description,priority,area;notesoptional),createTr(also requiressubarea), andcreateTest. UseupdateFr/updateTr/updateTestto changestatus(pending,in_progress,completed,deferred) ornotes. For many records, prefer the atomic batch methodscreateFrBatch/updateFrBatch/createTrBatch/updateTrBatch/createTestBatch/updateTestBatch, or the mixedcreateBatch/updateBatch(includekind: fr|tr|testper record). A batch fails entirely if any record is invalid. - Attach acceptance criteria. Pass an
acceptanceCriteriaarray (each entry hasid,text,isSatisfied, optionalevidence) on create/update, or copy from a TODO withworkflow.requirements.copyAcceptanceCriteriaFromTodo(kind,id,todoId). - Create the traceability mapping so coverage is satisfied. Call
workflow.requirements.createMappingwithfrId,trIds: [...],testIds: [...], and optionalnotes. Ensure each new FR has at least one TR and one TEST linked. Remove a link withworkflow.requirements.deleteMapping. Inspect withworkflow.requirements.listMappings(optionally filtered byfrId). - Regenerate the Markdown projections so the IDs reach the validator's files:
call
workflow.requirements.generateDocumentwithformat: markdownand the relevantdocType(functional,technical,testing,matrix, orall). Useformat: wikiwithdocType: allto refreshdocs/Project/wiki/azureanddocs/Project/wiki/github. - Validate. Run
./build.ps1 ValidateTraceabilityfor FR-gap enforcement, or./build.ps1 ValidateTraceability --strict-tr-and-test-coverageto also fail on TR/TEST gaps. Resolve any reported missing IDs by creating the record/mapping and regenerating, then re-run. - Record the new requirement IDs in the session log turn (tags / requirementsDiscovered) via the session plugin, and complete the turn.
Validation Checklist
- Every new FR is reachable as a
## FR-...heading inFunctional-Requirements.mdand as a row in bothTR-per-FR-Mapping.mdandRequirements-Matrix.md. - Every new TR is a
## TR-...heading inTechnical-Requirements.mdand a row inRequirements-Matrix.md; its ID has area AND subarea segments. - Every new TEST ID appears in
Testing-Requirements.mdand inRequirements-Matrix.md. - Each FR maps to at least one TR and at least one TEST via
createMapping. - The Markdown was regenerated after the last database mutation (no manual edits).
./build.ps1 ValidateTraceabilityreports "Traceability validation passed" (and passes under--strict-tr-and-test-coveragewhen full coverage is required).
Common Pitfalls
- Creating records but forgetting to regenerate the docs: the database is correct yet
the validator (which only reads Markdown) still fails. Always run
generateDocumentbeforeValidateTraceability. - Hand-editing the
docs/Project/*.mdfiles: edits are overwritten on the next generate and drift from the database. Mutate via the plugin instead. - Using a TR ID without a subarea (e.g.
TR-MCP-001): the server rejects it withinvalid_requirement_id. TR requiresTR-<AREA>-<SUBAREA>-###. - Assuming TR/TEST gaps fail the build by default: they are warnings unless
--strict-tr-and-test-coverageis supplied. Missing FR mappings always fail. - Creating a mapping that references a non-existent FR/TR/TEST: returns
invalid_mapping. Create the FR, TR, and TEST records first, then map them. - Confusing requirement IDs with TODO IDs (
PLAN-AREA-###) or Session IDs. They live in separate namespaces and separate plugin methods. - Re-creating an existing ID returns
requirement_already_exists; use the matchingupdate*method instead ofcreate*.
YAML Mutation Rule
When YAML must be changed, deserialize the complete document into an object, mutate the object, serialize the object, and save the result. Do not append YAML snippets, replace YAML lines, remove YAML lines, or build YAML payloads as strings. For PowerShell work, use plugins/core/lib-ps/yaml-object-mutation.ps1 and call Set-McpYamlObjectValue or Update-McpYamlObject.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/mcp-session-logging.mdcCursor rule
- bash-usageSkill
- byrd-tdd-processSkill
- edit-file-usageSkill
- git-usageSkill
- mcp-session-loggingSkill
- mcp-todoSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

