Skip to content
Development
Skill

/testing-strategy

Test pyramid, coverage targets, and unit/integration/E2E patterns. TRIGGER when: planning tests, writing test code, or reviewing coverage. SKIP: quality-gate scoring of plans (use quality-validation); root-causing a failing test (use systematic-debugging); proving a fix works

From plugin
scaffolding
1639 skills13 agents21 commands25 hooks

Claude Code

$ npx -y skills add komluk/scaffolding --skill testing-strategy --agent claude-code

SKILL.md

testing-strategy.SKILL.md
name: testing-strategy
description: "Test pyramid, coverage targets, and unit/integration/E2E patterns. TRIGGER when: planning tests, writing test code, or reviewing coverage. SKIP: quality-gate scoring of plans (use quality-validation); root-causing a failing test (use systematic-debugging); proving a fix works (use verification-before-completion)."

Testing Strategy Skill

Purpose

Comprehensive testing guidelines including test pyramid, coverage targets, and test patterns.

Auto-Invoke Triggers

  • Planning test strategy
  • Writing unit/integration tests
  • Reviewing test coverage
  • Setting up test infrastructure

---

TDD Enforcement (Red -> Green -> Refactor)

For new behavior and bug fixes, the failing test comes **first**. No production code without a test that demanded it.

| Step | Do | Gate | |------|----|------| | 1. Red | Write one small test for the next behavior; run it | It **fails for the expected reason** (not a typo/import error) | | 2. Green | Write the least code that passes | All tests pass; no extra behavior | | 3. Refactor | Clean names, duplication, structure | Tests stay green; no new behavior |

Rules:

  • Never skip the red run - a test that never failed proves nothing.
  • One behavior per cycle; commit-sized steps, not feature-sized.
  • Bug fix = reproduce with a failing test first, then fix (see `systematic-debugging` for root-causing).
  • Code written before its test: delete it and restart from red, or add the test and confirm it fails when the code is reverted.
  • Legitimate exceptions (UI layout, throwaway spikes, generated code): say so explicitly rather than silently skipping.

Evidence of compliance in a report: the failing test output, then the passing output. Proving the final result is `verification-before-completion`'s job.

---

Test Pyramid

        /\
       /  \      E2E Tests (10%)
      /----\     - Critical user flows
     /      \    - Slow, expensive
    /--------\   Integration Tests (20%)
   /          \  - API tests, DB tests
  /------------\ - Medium speed
 /              \ Unit Tests (70%)
/----------------\ - Fast, isolated
                   - Business logic

Distribution Guidelines

| Type | Percentage | Focus | |------|------------|-------| | Unit | 70% | Business logic, utilities | | Integration | 20% | API, database, services | | E2E | 10% | Critical user journeys |

---

Coverage Targets

| Metric | Minimum | Target | |--------|---------|--------| | Line coverage | 70% | 80% | | Branch coverage | 60% | 70% | | Critical paths | 90% | 100% |

What to Cover

  • All public methods
  • Business logic
  • Edge cases
  • Error handling
  • Integration points

What NOT to Cover

  • Generated code
  • Simple getters/setters
  • Framework code
  • Third-party libraries

---

Unit Testing

Principles

  • Test one thing per test
  • Tests should be fast (< 100ms)
  • Tests should be isolated
  • Tests should be deterministic
  • No external dependencies

AAA Pattern

Arrange - Set up test data and mocks
Act     - Execute the method under test
Assert  - Verify the expected outcome

Naming Convention

{Method}_{Scenario}_{ExpectedResult}

CreateUser_ValidData_ReturnsUserId
CreateUser_DuplicateEmail_ThrowsConflict
CalculateTotal_EmptyCart_ReturnsZero

Test Categories

| Category | Purpose | Example | |----------|---------|---------| | Happy path | Normal operation | Valid user creation | | Edge case | Boundary conditions | Empty input, max length | | Error case | Failure scenarios | Invalid data, not found |

---

Integration Testing

Scope

  • API endpoints
  • Database operations
  • External service calls
  • Message queues

Best Practices

  • Use test containers or in-memory DB
  • Seed known test data
  • Clean up after each test
  • Mock external services
  • Test full request/response cycle

API Test Checklist

  • [ ] Correct status code
  • [ ] Response body structure
  • [ ] Headers (content-type, auth)
  • [ ] Validation errors
  • [ ] Authorization rules

---

E2E Testing

When to Use

  • Critical user journeys
  • Payment flows
  • Authentication flows
  • Multi-step workflows

Best Practices

  • Test user perspective, not implementation
  • Use stable selectors (data-testid)
  • Handle async operations properly
  • Keep tests independent
  • Use page object pattern

Critical Paths to Test

  • User registration/login
  • Main feature workflow
  • Payment/checkout
  • Error recovery flows

---

Test Data Management

Strategies

| Strategy | Use Case | |----------|----------| | Fixtures | Static test data | | Factories | Dynamic test data | | Builders | Complex objects | | Seeders | Database state |

Rules

  • Use realistic but fake data
  • Never use production data
  • Reset state between tests
  • Use faker libraries for variety

---

Mocking Guidelines

When to Mock

  • External services (APIs, databases)
  • Time-dependent operations
  • Random values
  • Expensive operations

When NOT to Mock

  • Simple value objects
  • The code under test
  • Everything (over-mocking)

Mock Types

| Type | Purpose | |------|---------| | Stub | Return canned responses | | Mock | Verify interactions | | Spy | Record calls, pass through | | Fake | Simplified implementation |

---

Test Organization

File Structure

tests/
├── unit/
│   ├── services/
│   └── utils/
├── integration/
│   ├── api/
│   └── db/
├── e2e/
├── fixtures/
└── conftest.py / setup.ts

Naming

  • Test files: `{module}_test.py` or `{module}.test.ts`
  • Match source structure
  • Group related tests in describe/class

---

CI/CD Integration

Pipeline Stages

1. **Unit tests** - Run on every commit 2. **Integration tests** - Run on PR/merge 3. **E2E tests** - Run on deploy to staging

Quality Gates

| Gate | Requirement | |------|-------------| | Unit tests | 100% pass | | Coverage | > 70% | | Integration | 100% pass | | E2E (critical) | 100% pass |

---

Performance Testing

Types

| Type | Purpose | |------|---------| | Load | Expecte

Read more
@komluk
Ships withscaffolding

Spec-driven multi-agent orchestration for Claude Code — pure markdown, zero backend, runs on the stock runtime. 13 agents, 39 skills, 21 commands, 20 hooks, per-phase model tiers, opt-in lifecycle hooks, optional cross-device semantic memory.

1639 skills13 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
16
Star history of komluk/scaffolding on GitHub, a chart by star-history.com

Other skills on scaffolding.

agent-comms

agent-comms

SendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against…

@komluk@komlukInstall Skill
agent-memory

agent-memory

Repo-local file memory under .scaffolding/ (shared/agent/conversation tiers). TRIGGER when: reading or writing .scaffolding/…

@komluk@komlukInstall Skill
api-design

api-design

RESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new…

@komluk@komlukInstall Skill
context-engineering

context-engineering

Optimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an…

@komluk@komlukInstall Skill
database-optimization

database-optimization

Schema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a…

@komluk@komlukInstall Skill
distill

distill

Knowledge distillation: candidate extraction, confidence scoring, tier routing. Invoked by /learn and the memory-ingest Stop…

@komluk@komlukInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about testing-strategy.

Which coding agents can use testing-strategy?
testing-strategy installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.