testing-test-writing
为核心用户流程和关键业务逻辑编写专注的测试,测试行为而非实现,使用清晰的名称和快速执行。在编写单元测试、集成测试或端到端测试时使用此技能。测试关键用户工作流程和主要应用程序功能。创建专注于代码做什么而非如何做的测试。模拟数据库、API或文件系统等外部依赖。命名测试以清晰描述场景和预期结果。保持测试快速且独立。完成功能实现并在逻辑完成点添加战略测试。处理测试文件或测试框架。
📖 中文导读:为核心用户流程和关键业务逻辑编写专注的测试,测试行为而非实现,使用清晰的名称和快速执行。在编写单元测试、集成测试或端到端测试时使用此技能。测试关键用户工作流程和主要应用程序功能。创建专注于代码做什么而非如何做的测试。模拟数据库、API或文件系统等外部依赖。命名测试以清晰描述场景和预期结果。保持测试快速且独立。完成功能实现并在逻辑完成点添加战略测试。处理测试文件或测试框架。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Testing Test Writing description: Write focused tests for core user flows and critical business logic, testing behavior rather than implementation, with clear names and fast execution. Use this skill when writing unit tests, integration tests, or end-to-end tests. When testing critical user workflows and primary application features. When creating tests that focus on what code does rather than how it does it. When mocking external dependencies like databases, APIs, or file systems. When naming tests to clearly describe the scenario and expected outcome. When keeping tests fast and independent. When completing feature implementation and adding strategic tests at logical completion points. When working with test files or test frameworks.
Testing Test Writing
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.
When to use this skill
- When writing unit tests for functions, methods, or modules
- When writing integration tests for multiple components working together
- When writing end-to-end tests for critical user workflows
- When testing core user flows and primary business-critical features
- When completing feature implementation and adding tests at logical completion points
- When creating tests that focus on behavior (what code does) rather than implementation (how it does it)
- When writing descriptive test names that explain the scenario and expected outcome
- When mocking external dependencies (databases, APIs, file systems, network calls)
- When ensuring tests run fast (milliseconds for unit tests)
- When working with test frameworks (Jest, pytest, RSpec, Rust's test framework, etc.)
Instructions
For details, refer to the information provided in this file: testing test writing