AgentSkillsCN

tester

在实现新功能、修复缺陷、进行代码重构后,或为确保项目整体测试覆盖率,需对代码变更进行测试验证时使用,也可选择“all”对全项目进行测试审计。

SKILL.md
--- frontmatter
name: tester
description: Use when code changes need test coverage verification, after implementing features, fixing bugs, refactoring, or with "all" for project-wide test audit

Tester

Overview

Dispatch the tester agent to verify, create, or update test coverage. The agent analyzes code and ensures comprehensive testing.

When to Use

  • After implementing new features
  • After fixing bugs (add regression tests)
  • After refactoring existing code
  • When test coverage needs verification
  • With "all" for full project test audit
  • With specific scope for targeted testing

Invocation Modes

Default: /tester

Tests current or recent changes. Agent identifies recently modified files and ensures test coverage.

code
Task tool with subagent_type="tester"
prompt: "Review recent code changes and ensure test coverage.
Identify modified files, verify existing tests, add missing tests."

Scoped: /tester <scope>

Tests only the specified scope (file, module, feature).

code
Task tool with subagent_type="tester"
prompt: "Review and ensure test coverage for: [scope]
Focus only on this area. Verify existing tests, add missing coverage."

Scope examples:

  • /tester src/auth - test authentication module
  • /tester utils/parser.ts - test specific file
  • /tester API endpoints - test all API routes
  • /tester UserService - test specific class/service

Comprehensive: /tester all

Planned, modular test audit covering every aspect of the repository.

CRITICAL: Do not skip any aspect. Continue until ALL areas are reviewed.

Execution Flow

  1. Explore repository structure - Identify all testable code areas
  2. Create TodoWrite plan - One todo item per testing aspect
  3. Process sequentially - Complete each aspect before moving to next
  4. Mark progress - Update todos as each section completes

Testing Aspects to Review

Process each area one-by-one:

AspectWhat to Test
Unit testsIndividual functions, methods, utilities
Integration testsModule interactions, service connections
API testsEndpoints, request/response, error handling
Component testsUI components, rendering, user interactions
Model testsData models, validation, relationships
Service testsBusiness logic, service layer
Middleware testsAuth, validation, error handling middleware
Utility testsHelper functions, formatters, parsers
Edge casesBoundary conditions, null handling, errors
Error handlingException paths, error responses
ConfigurationConfig loading, environment handling
DatabaseQueries, transactions, migrations

Example: Full Audit

code
/tester all

Creates todos like:

  • Audit and test utility functions
  • Audit and test data models
  • Audit and test service layer
  • Audit and test API endpoints
  • Audit and test middleware
  • Audit and test components
  • Audit and test integration points
  • Audit and test error handling paths
  • Audit and test edge cases
  • Verify overall test coverage

Then dispatches tester agent for each aspect sequentially, marking complete as each finishes.

What the Agent Does

  • Analyzes code for testable logic
  • Identifies missing test coverage
  • Creates new test files/cases
  • Updates existing tests after refactoring
  • Runs test suite and reports results
  • Adds regression tests for bug fixes

Examples

After adding a feature:

code
/tester
→ Reviews recent changes, adds tests for new functionality

Test specific module:

code
/tester src/services/payment
→ Focuses only on payment service tests

Full project audit:

code
/tester all
→ Creates plan, systematically tests every aspect