Testing Skill
Comprehensive testing domain for pytest-based projects. Provides test generation, review, execution, and specialized testing workflows with automatic routing based on user intent.
Auto-Activation Keywords
This skill activates automatically when you mention:
- •test, tests, testing
- •coverage, test coverage
- •pytest, unittest
- •integration test, unit test, e2e test
- •performance test, benchmark, load test
- •security test, penetration test
- •test review, test quality
Routing Logic
Based on user intent, this skill routes to appropriate workflows:
Test Generation
Keywords: "generate tests", "create tests", "write tests", "test coverage"
- •Simple test generation → Use
/testing/generateworkflow - •Complex test strategy → Invoke
test-engineeragent
Test Review
Keywords: "review tests", "test quality", "coverage gaps", "improve tests"
- •Review existing tests → Use
/testing/reviewworkflow - •Comprehensive quality audit → Invoke
test-engineeragent
End-to-End Testing
Keywords: "e2e test", "end-to-end", "full workflow", "integration test", "pipeline test"
- •E2E test generation → Use
/testing/e2eworkflow - •Complex multi-component → Invoke
test-engineeragent
Performance Testing
Keywords: "performance test", "benchmark", "load test", "memory usage", "speed test"
- •Performance test creation → Use
/testing/performanceworkflow - •Comprehensive performance analysis → Invoke
test-engineeragent
Security Testing
Keywords: "security test", "vulnerability", "penetration test", "OWASP", "injection"
- •Security test generation → Use
/testing/securityworkflow - •Full security audit → Invoke
security-auditoragent
Test Execution
Keywords: "run tests", "execute tests", "test results", "pytest command"
- •Quick reference → See context/pytest-commands.md
- •Custom test execution → Use bash with pytest commands
Workflow Quick Reference
# Generate comprehensive tests /testing/generate [module-path] # Review test quality /testing/review [test-directory] # Create E2E tests /testing/e2e [workflow-name] # Create performance tests /testing/performance [component] # Create security tests /testing/security [attack-vector]
Complex Task Delegation
For complex multi-step testing tasks, invoke the test-engineer agent via Task tool:
Use test-engineer agent when: - Designing comprehensive test strategy across multiple components - Creating complete test suites from scratch (unit + integration + e2e) - Optimizing test performance and coverage simultaneously - Integrating multiple testing types (functional + performance + security)
Supporting Context
- •Pytest patterns: See
context/pytest-patterns.mdfor common test patterns - •Common commands: See
context/pytest-commands.mdfor frequently used commands - •Coverage standards: Minimum 80% coverage required (see
/standards/python.md)
Integration Points
Agents
- •test-engineer: Comprehensive test strategy and generation
- •security-auditor: Security-focused testing and vulnerability analysis
MCP Tools
- •mcp__zen-core__chat: Multi-model consensus for complex test design decisions
Hooks
- •TDD enforcement: Pre-Write/Edit hook enforces test-first development
Standards
- •Python testing standards:
/standards/python.md(80%+ coverage requirement) - •Linting standards:
/standards/linting.md(pytest configuration)
Testing Standards Summary
Required for all projects:
- •Minimum 80% test coverage
- •Unit tests in
tests/unit/(< 1s each) - •Integration tests in
tests/integration/(< 5s each) - •E2E tests in
tests/e2e/(marked @pytest.mark.e2e) - •Proper pytest markers (@pytest.mark.unit, .integration, .slow, .security, .perf)
- •AAA pattern (Arrange-Act-Assert)
- •Clear test naming (test_should_[expected]when[condition])
Fixture management:
- •Use existing fixtures from conftest.py
- •No hardcoded test data
- •Appropriate fixture scope (function, class, module, session)
Test execution:
# Standard test run with coverage poetry run pytest -v --cov=src --cov-report=html --cov-report=term-missing --cov-fail-under=80 # Fast dev cycle (skip slow tests) poetry run pytest -m "not slow" # Specific test categories poetry run pytest tests/unit/ # Unit tests only poetry run pytest tests/integration/ # Integration tests poetry run pytest -m security # Security tests poetry run pytest -m perf # Performance tests
Examples
Example 1: Generate tests for new module
User: "Generate comprehensive tests for the payment processor module" → Skill routes to /testing/generate workflow → Workflow creates unit, integration, and security tests → Ensures 80%+ coverage for payment processor
Example 2: Review test quality
User: "Review the tests for the authentication system and suggest improvements" → Skill routes to /testing/review workflow → Workflow analyzes coverage, patterns, fixture usage → Provides actionable recommendations
Example 3: Complex test strategy
User: "Design a comprehensive testing strategy for the new RAG pipeline" → Skill invokes test-engineer agent → Agent creates multi-tier testing approach: - Unit tests for embeddings, chunking, retrieval - Integration tests for pipeline flows - E2E tests for complete query-response cycles - Performance tests for large document handling
This skill consolidates test-generator, test-reviewer, e2e-tester, performance-tester, and security-tester into a unified testing domain with intelligent routing.