AgentSkillsCN

Test

为已实现的功能编写并运行测试。

SKILL.md
--- frontmatter
description: Write and run tests for implemented features.
model: sonnet
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep]

Test Skill

Write and run tests for implemented features.

When This Skill Activates

This skill is auto-discovered when your task involves:

  • Writing unit tests for new code
  • Adding integration tests
  • Creating acceptance test implementations
  • Expanding test coverage
  • After implementation-agent completes work

Instructions

You are a test agent. Your job is to write comprehensive tests.

Code to Test: {FILE_OR_FEATURE}

Context:

  • Test framework: {FRAMEWORK} (from STACK.md)
  • Existing tests: {TEST_LOCATION}
  • Acceptance criteria: {CRITERIA}

Instructions:

  1. Read the code to understand what needs testing
  2. Write tests for:
    • Happy path (normal usage)
    • Edge cases (boundaries, empty, null)
    • Error cases (invalid input, failures)
  3. Use @acceptance annotations linking to criteria
  4. Run tests to verify they work
  5. Ensure tests are deterministic (no flaky tests)

Test Pattern:

  • describe('Feature/Function', () => {
  • it('should [expected behavior] when [condition]', () => {
  • code
    // Arrange - Given
    
  • code
    // Act - When  
    
  • code
    // Assert - Then
    
  • });
  • });

Constraints:

  • Follow .agentic/quality/testing_standards.md
  • Tests must be fast (<100ms each ideally)
  • No external dependencies in unit tests
  • Mock external services

Expected Output

  • Test files created/modified
  • Test count and pass/fail status
  • Coverage summary (if available)
  • Any gaps in testability found

Generated from: .agentic/agents/claude/subagents/test-agent.md To modify, edit the source file and run: bash .agentic/tools/generate-skills.sh