Files
Claude-Code-Workflow/.claude/workflows/cli-templates/prompts/development/02-generate-tests.txt
catlog22 854464b221 refactor: 重组CLI模板系统,采用优先级前缀命名
主要变更:
- 模板重命名:采用优先级前缀(01-通用, 02-专用, 03-领域特定)
- 目录调整:bug-diagnosis从development移至analysis
- 引用更新:5个命令文件中21处模板引用更新为新路径
- 路径统一:所有引用统一使用完整路径格式

模板变更详情:
- analysis/:8个模板(01-trace-code-execution, 01-diagnose-bug-root-cause等)
- development/:5个模板(02-implement-feature, 02-refactor-codebase等)
- planning/:5个模板(01-plan-architecture-design, 02-breakdown-task-steps等)
- memory/:1个模板(02-document-module-structure)

命令文件更新:
- cli/mode/bug-diagnosis.md(6处引用)
- cli/mode/code-analysis.md(6处引用)
- cli/mode/plan.md(6处引用)
- task/execute.md(1处引用)
- workflow/tools/test-task-generate.md(2处引用)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 10:57:17 +08:00

62 lines
2.1 KiB
Plaintext

Create comprehensive tests for the codebase.
## CORE CHECKLIST ⚡
□ Analyze existing test coverage and identify gaps
□ Follow project testing frameworks and conventions
□ Include unit, integration, and end-to-end tests
□ Ensure tests are reliable and deterministic
## IMPLEMENTATION PHASES
### Test Strategy Phase
1. Analyze existing test coverage and identify gaps
2. Study codebase architecture and critical paths
3. Identify edge cases and error scenarios
4. Review testing frameworks and conventions used
### Unit Testing Phase
1. Write tests for individual functions and methods
2. Test all branches and conditional logic
3. Cover edge cases and boundary conditions
4. Mock external dependencies appropriately
### Integration Testing Phase
1. Test interactions between components and modules
2. Verify API endpoints and data flow
3. Test database operations and transactions
4. Validate external service integrations
### End-to-End Testing Phase
1. Test complete user workflows and scenarios
2. Verify critical business logic and processes
3. Test error handling and recovery mechanisms
4. Validate performance under load
### Quality Assurance
1. Ensure tests are reliable and deterministic
2. Make tests readable and maintainable
3. Add proper test documentation and comments
4. Follow testing best practices and conventions
### Test Data Management
1. Create realistic test data and fixtures
2. Ensure test isolation and cleanup
3. Use factories or builders for complex objects
4. Handle sensitive data appropriately in tests
## OUTPUT REQUIREMENTS
- Comprehensive test suite with high coverage
- Performance benchmarks where relevant
- Testing strategy and conventions documentation
- Test coverage metrics and quality improvements
- File:line references for tested code
## VERIFICATION CHECKLIST ✓
□ Test coverage gaps identified and filled
□ All test types included (unit + integration + e2e)
□ Tests are reliable and deterministic (no flaky tests)
□ Test data properly managed (isolation + cleanup)
□ Testing conventions followed consistently
Focus: High-quality, reliable test suite with comprehensive coverage.