agentleFS
dtsongdtsong/agentic-council/skills/craftsman-testing-strategy/SKILL.md

testing-strategy

Skill0 starsChanged 6 months agoApache-2.0View on GitHub

Use when designing test plans for new features or improving existing test coverage. Covers test pyramid design, coverage targets, quality gates, and test file specifications. Do not use for codebase pattern audits or convention enforcement (use pattern-analysis).

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use react-patterns, observability and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • benshapyroSkill

    react-patterns

    Modern React patterns for TypeScript applications including hooks, state management, and component composition. Use when building React components, managing state, or implementing React best practices.

    Also in 4 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 5 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 6 projects that use this

  • MicrosoftSkill

    error-handling

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

    Also in 3 projects that use this

  • CloudAI-XSkill

    database-design

    Designs database schemas, indexing strategies, query optimization, and migration patterns for SQL and NoSQL databases. Use when designing tables, optimizing queries, fixing N+1 problems, planning migrations, or when asked about database performance, normalization, ORMs, or data modeling.

    Also in 3 projects that use this

  • OpenAISkill

    verification-before-completion

    Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

    Also in 6 projects that use this

  • +4 more from openai

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Does not cover codebase pattern auditing or convention enforcement — hand off to pattern-analysis.

    line 28
  2. Distinctive:

    Does not cover architectural decisions about system boundaries — hand off to architect department.

    line 29
  3. Distinctive:

    No user-provided values are used in commands or file paths.

    line 41
  4. Distinctive:

    Test framework (Jest, Vitest, Playwright, Cypress, etc.)

    line 56
  5. Distinctive:

    Test runner and configuration

    line 57
  6. Very specific:

    Location: Follow existing convention (co-located __tests__/, top-level tests/, or .test.ts suffix)

    line 99
  7. Distinctive:

    If pattern inconsistencies are discovered in test file structure or naming conventions, hand off to pattern-analysis for a full codebase …

    line 133
  8. Distinctive:

    If test boundaries reveal unclear architectural boundaries or service decomposition issues, hand off to architect department for structural …

    line 134

“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Testing Strategy

Purpose

Design comprehensive test strategies with test pyramid coverage, test file structure, and quality gates.

Scope Constraints

  • Covers test plan design, pyramid layering, coverage targets, and CI quality gates.
  • Does not cover codebase pattern auditing or convention enforcement — hand off to pattern-analysis.
  • Does not cover architectural decisions about system boundaries — hand off to architect department.

Inputs

  • Feature description and scope
  • Existing test infrastructure (framework, runner, coverage tools)
  • CI/CD pipeline details (if relevant)
  • Existing test conventions in the codebase
  • Coverage targets or requirements (if any)

Input Sanitization

No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.

Procedure

Progress Checklist

  • Step 1: Audit existing test infrastructure
  • Step 2: Identify testable units
  • Step 3: Design test pyramid
  • Step 4: Write test specifications
  • Step 5: Define coverage targets
  • Step 6: Plan quality gates

Step 1: Audit Existing Test Infrastructure

  • Test framework (Jest, Vitest, Playwright, Cypress, etc.)
  • Test runner and configuration
  • Coverage tools (Istanbul, c8, etc.)
  • CI integration (GitHub Actions, etc.)
  • Existing test patterns (file location, naming, describe/it structure)
  • Existing mocking patterns (jest.mock, vi.mock, MSW, etc.)

Step 2: Identify Testable Units

From the feature, extract:

  • Pure functions and utilities — deterministic, no side effects, easiest to test
  • Data transformations — input/output mapping, validation logic
  • API handlers/endpoints — request/response contracts, error handling
  • UI components — render output, interaction behavior, state changes
  • Integration points — database queries, external API calls, file I/O
  • Business logic — rules, calculations, conditional flows

Step 3: Design the Test Pyramid

        /  E2E  \        <- Few: critical user paths only (expensive, slow)
       /----------\
      / Integration \    <- Some: cross-boundary, API contracts, DB queries
     /----------------\
    /    Unit Tests     \ <- Many: fast, isolated, 80%+ of test count
   /--------------------\
  • Unit tests (base): Fast, isolated, test one thing. Target 80%+ of total test count.
  • Integration tests (middle): Cross-boundary tests. Database interactions, API contracts, service-to-service.
  • E2E tests (top): Critical user paths only. Expensive to write and maintain, keep count low.

Step 4: Write Test Specifications

For each layer, specify:

LayerTest FileTest CasesMocks NeededPriority
Unit............
Integration............
E2E............

For each test case:

  • Location: Follow existing convention (co-located __tests__/, top-level tests/, or .test.ts suffix)
  • Description: describe('ModuleName', () => { it('should ...') }) format
  • Key assertions: What exactly are we verifying?
  • Mock strategy: What to mock (external deps), what to keep real (internal logic)
  • Edge cases: Boundary values, empty inputs, error conditions

Step 5: Define Coverage Targets

  • Line coverage: Pragmatic target (70-90%, not 100%)
  • Branch coverage: Focus on critical paths and business logic branches
  • Not worth testing: Glue code, framework boilerplate, simple pass-through, type-only files
  • Must test: Business rules, data transformations, error handling, security-sensitive code

Step 6: Plan Quality Gates

  • Pre-commit:
    • Lint (ESLint, Biome)
    • Type check (tsc --noEmit)
    • Affected unit tests (if tooling supports)
  • CI pipeline:
    • Full test suite
    • Coverage threshold check
    • Build verification
  • Manual review checklist:
    • New business logic has unit tests
    • Error paths are tested
    • No snapshot tests for logic (only for stable UI)
    • Mocks don't hide real bugs
    • Test descriptions read as documentation

Compaction resilience: If context is compacted mid-task, check the Progress Checklist for completed steps, re-read this Procedure section, and continue from the next incomplete step.

Handoff

  • If pattern inconsistencies are discovered in test file structure or naming conventions, hand off to pattern-analysis for a full codebase convention audit.
  • If test boundaries reveal unclear architectural boundaries or service decomposition issues, hand off to architect department for structural analysis.

Output Format

Test Pyramid Summary

LayerCountRun TimeMock Strategy
Unit.........
Integration.........
E2E.........

Test Specifications

For each test file:

File: src/__tests__/feature.test.ts
Layer: Unit

describe('FeatureName')
  it('should handle the happy path')
    - Input: ...
    - Expected: ...
  it('should handle invalid input')
    - Input: ...
    - Expected: throws/returns error
  it('should handle edge case')
    - Input: ...
    - Expected: ...

Mocks: ExternalService (return mock data)

Coverage Targets

CategoryTargetRationale
Business logic90%+Core value, must be correct
API handlers80%+Contract compliance
UI components70%+Render + key interactions
Utilities90%+Pure functions, easy to test
Glue/configSkipNot worth testing

Quality Gate Checklist

  • Pre-commit hooks configured
  • CI runs full test suite
  • Coverage thresholds enforced
  • New code has corresponding tests

Quality Checks

  • Every business logic function has a unit test spec
  • Critical user paths have integration tests
  • At least 1 E2E test for the main happy-path flow
  • Mock strategy documented and doesn't hide real bugs
  • Test file locations follow existing project conventions
  • Edge cases and error paths included in test specs
  • Coverage targets are pragmatic (not aspirational 100%)

Evolution Notes

<!-- Observations appended after each use -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.