thinkhaven: Command for Claude Code

.claude/commands/BMad/tasks/trace-requirements.md

trace-requirements is a command for Claude Code from hollandkevint/thinkhaven. It costs 0 tokens per session (1,600 once invoked), scanned A, original, Apache-2.0.

A command that maps each requirement in a development story to the tests that cover it. It documents the mapping with Given-When-Then statements, a format that describes a starting situation, an action, and the expected result.

In plain words
What is it for?
Use it to build a requirements traceability matrix from acceptance criteria, user stories, tasks, non-functional requirements, and edge cases. It requires access to the story and relevant test files or test specifications.
Why use it?
It helps expose requirements that have no corresponding test coverage. The Given-When-Then text records the relationship between requirements and tests; it does not create the test code.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is hollandkevint/thinkhaven's own configuration. It tells Claude Code how to work on thinkhaven itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything thinkhaven configures →

Reuse

Borrowing it

Nothing to install: this file belongs to hollandkevint/thinkhaven. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/hollandkevint/thinkhaven/main/.claude/commands/BMad/tasks/trace-requirements.md
Clone the repo
git clone --depth 1 https://github.com/hollandkevint/thinkhaven

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for trace-requirements

README.md
[![agentmods](https://agentmods.dev/badge/commands/hollandkevint/thinkhaven/trace-requirements.svg)](https://agentmods.dev/commands/hollandkevint/thinkhaven/trace-requirements)
Your own site
<a href="https://agentmods.dev/commands/hollandkevint/thinkhaven/trace-requirements"><img src="https://agentmods.dev/badge/commands/hollandkevint/thinkhaven/trace-requirements.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,600 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01600
Opus 5 $0.00000 $0.00800
Sonnet 5 $0.00000 $0.00320
Haiku 4.5 $0.00000 $0.00160

Measured 8d ago against content hash 427033235151, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

trace-requirements scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/BMad/tasks/trace-requirements.md · 271 lines

How it starts

The opening of the file, as written. The whole thing — 271 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/trace-requirements Task

When this command is used, execute the following task:

trace-requirements

Map story requirements to test cases using Given-When-Then patterns for comprehensive traceability.

Purpose

Create a requirements traceability matrix that ensures every acceptance criterion has corresponding test coverage. This task helps identify gaps in testing and ensures all requirements are validated.

IMPORTANT: Given-When-Then is used here for documenting the mapping between requirements and tests, NOT for writing the actual test code. Tests should follow your project's testing standards (no BDD syntax in test code).

Prerequisites

  • Story file with clear acceptance criteria
  • Access to test files or test specifications
  • Understanding of the implementation

Traceability Process

1. Extract Requirements

Identify all testable requirements from:

  • Acceptance Criteria (primary source)
  • User story statement
  • Tasks/subtasks with specific behaviors
  • Non-functional requirements mentioned
  • Edge cases documented

2. Map to Test Cases

For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written):

requirement: 'AC1: User can login with valid credentials'
test_mappings:
  - test_file: 'auth/login.test.ts'
    test_case: 'should successfully login with valid email and password'
    # Given-When-Then describes WHAT the test validates, not HOW it's coded
    given: 'A registered user with valid credentials'
    when: 'They submit the login form'
    then: 'They are redirected to dashboard and session is created'
    coverage: full

  - test_file: 'e2e/auth-flow.test.ts'
    test_case: 'complete login flow'
    given: 'User on login page'
    when: 'Entering valid credentials and submitting'
    then: 'Dashboard loads with user data'
    coverage: integration

3. Coverage Analysis

Evaluate coverage for each requirement:

Read the full file on GitHub · 271 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 271 lines · 0 tokens per session scan A 427033235151

Subscribe to this mod's changes

trace-requirements is a command published in the GitHub repository hollandkevint/thinkhaven (5 stars, last pushed 9d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,600 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.