testing-test-writing
在功能开发期间编写最小化、战略性测试,专注于核心用户流程和关键路径,推迟全面的边缘情况测试。在编写单元测试、集成测试或端到端测试、创建测试文件(*.test.ts, *.spec.js, __tests__/*)、测试关键用户工作流、关注行为而非实现细节、使用描述性测试名称、模拟外部依赖(数据库、API、文件系统)、确保测试快速运行、测试业务关键功能或确定在开发阶段与专用测试阶段之间编写哪些测试时使用此技能。在完成逻辑里程碑、为主要用户流程编写测试或平衡功能开发速度与充分测试覆盖时应用此技能。
📖 中文导读:在功能开发期间编写最小化、战略性测试,专注于核心用户流程和关键路径,推迟全面的边缘情况测试。在编写单元测试、集成测试或端到端测试、创建测试文件(*.test.ts, *.spec.js, __tests__/*)、测试关键用户工作流、关注行为而非实现细节、使用描述性测试名称、模拟外部依赖(数据库、API、文件系统)、确保测试快速运行、测试业务关键功能或确定在开发阶段与专用测试阶段之间编写哪些测试时使用此技能。在完成逻辑里程碑、为主要用户流程编写测试或平衡功能开发速度与充分测试覆盖时应用此技能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Testing Test Writing description: Write minimal, strategic tests focused on core user flows and critical paths during feature development, deferring comprehensive edge case testing. Use this skill when writing unit tests, integration tests, or end-to-end tests, creating test files (*.test.ts, .spec.js, tests/), testing critical user workflows, focusing on behavior rather than implementation details, using descriptive test names, mocking external dependencies (databases, APIs, file systems), ensuring tests run quickly, testing business-critical functionality, or determining which tests to write during development versus dedicated testing phases. Apply this skill when completing features at logical milestones, writing tests for primary user flows, or balancing feature development speed with adequate test coverage.
Testing Test Writing
When to use this skill
- When writing test files (e.g.,
*.test.ts,*.spec.js,*.test.jsx,__tests__/*) - When creating unit tests, integration tests, or end-to-end tests
- When testing core user flows and critical business paths
- When testing behavior rather than implementation details
- When using descriptive test names that explain what's being tested
- When mocking external dependencies (databases, APIs, file systems)
- When ensuring tests run quickly (milliseconds for unit tests)
- When determining which tests to write during feature development
- When focusing on business-critical functionality first
- When reaching logical completion points in feature development
- When deferring edge case and validation testing to dedicated phases
- When balancing test coverage with development velocity
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle testing test writing.
Instructions
For details, refer to the information provided in this file: testing test writing