testing-strategy

A testing-planning guide for choosing test types, setting realistic coverage goals, and matching tests to a project's architecture. TDD, or test-driven development, is a practice of writing tests as part of the development cycle.

In plain words
What is it for?
Use it to create a project-wide or feature-specific testing strategy and test plan. It can guide decisions about unit, integration, and end-to-end tests before implementation.
Why use it?
It prevents test plans that ignore the existing codebase, test setup, integration checks, or end-to-end behaviour. It also helps avoid treating 100% code coverage as a sensible goal for every project.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drafthq/draft/testing-strategy
Any agent
npx skills add drafthq/draft --skill testing-strategy
Clone the repo
git clone --depth 1 https://github.com/drafthq/draft

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,688 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00038 $0.01688
Opus 5 $0.00019 $0.00844
Sonnet 5 $0.00008 $0.00338
Haiku 4.5 $0.00004 $0.00169

Measured 2d ago against content hash e78a17ad9bac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing-strategy 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 2d 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.

skills/testing-strategy/SKILL.md · 204 lines

How it starts

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

Testing Strategy

You are designing a testing strategy and test plan for this project or track.

Red Flags — STOP if you're

  • Writing a strategy without understanding the codebase
  • Setting unrealistic coverage targets (100% is rarely appropriate)
  • Focusing only on unit tests and ignoring integration/E2E
  • Ignoring existing test infrastructure and conventions
  • Not considering the testing pyramid for this project's architecture

A good testing strategy matches the architecture. Not every project needs the same pyramid.


Pre-Check

0. Capture Git Context

Before starting, capture the current git state:

git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash

Store this for the report header. The strategy is scoped to this specific branch/commit.

1. Verify Draft Context

ls draft/ 2>/dev/null

If draft/ doesn't exist, this skill can still run standalone with reduced context.

2. Load Draft Context (if available)

Read and follow the base procedure in core/shared/draft-context-loading.md.

Step 1: Parse Arguments

  • /draft:testing-strategy — Project-wide strategy (default if no active track)
  • /draft:testing-strategy track <id> — Track-scoped strategy
  • /draft:testing-strategy module <name> — Module-scoped strategy

Step 2: Analyze Codebase

  1. Identify component types:

    • APIs (REST, GraphQL, gRPC)
    • Data pipelines (ETL, streaming)
    • Frontend (React, Vue, etc.)
    • Infrastructure (Terraform, K8s configs)
    • Libraries/SDKs
    • CLI tools
  2. Discover existing tests:

    find . -name "*test*" -o -name "*spec*" | head -50
    

    Identify: test frameworks, test directories, existing coverage config, test runners.

  3. Assess current coverage: Check for existing coverage reports or configuration:

    ls coverage/ .nyc_output/ htmlcov/ .coverage 2>/dev/null
    
  4. Read project context:

    • draft/tech-stack.md — Test frameworks, testing conventions
    • draft/workflow.md — TDD preferences (strict/flexible/none)
    • draft/.ai-context.md — INVARIANTS section (critical paths), module boundaries, concurrency model
    • draft/guardrails.md — Anti-patterns that need test coverage
    • draft/product.md — Critical user flows that demand E2E tests

Read the full file on GitHub · 204 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. 2d ago First seen · 204 lines · 38 tokens per session scan A e78a17ad9bac

Subscribe to this mod's changes

testing-strategy is a skill published in the GitHub repository drafthq/draft (40 stars, last pushed 14d ago), licensed MIT. It adds 38 tokens to every session and 1,688 once invoked, about $0.0002 per session on Opus 5. 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-30.