AgentSkillsCN

Chief Of Staff Testing

首席幕僚测试

SKILL.md

Test Generation Skill

This skill provides test generation and management capabilities for the Chief of Staff plugin.

Capabilities

Unit Test Generation

  • Analyze functions and methods
  • Generate comprehensive test cases
  • Include edge cases and error scenarios
  • Create test fixtures and mocks

Integration Test Support

  • Test component interactions
  • Database integration tests
  • API endpoint testing
  • Service layer testing

Coverage Analysis

  • Analyze current test coverage
  • Identify uncovered code paths
  • Suggest additional tests
  • Track coverage trends

Test-Driven Development

  • Write tests before implementation
  • Guide TDD workflow
  • Validate implementations against tests
  • Refactor with confidence

Framework Support

  • Jest/Vitest for JavaScript/TypeScript
  • pytest for Python
  • go test for Go
  • cargo test for Rust

Usage

When generating tests, I will:

  1. Analyze the Code: Understand the function's purpose, inputs, and outputs.

  2. Identify Test Cases: Determine normal cases, edge cases, and error scenarios.

  3. Generate Tests: Create well-structured tests with clear assertions.

  4. Include Mocks: Generate necessary mocks and fixtures.

Triggers

This skill activates when:

  • You request test generation
  • You use /test, /coverage, or /tdd commands
  • You work with test files

Configuration

  • framework: Testing framework (auto, jest, vitest, pytest, etc.)
  • coverageThreshold: Target coverage percentage
  • includeMocks: Generate mocks automatically

Examples

Generate Unit Tests

"Generate tests for this authentication service"

Coverage Analysis

"Analyze test coverage for this module"

TDD Workflow

"Help me implement this feature using TDD"

Add Edge Cases

"Add edge case tests for this validation function"