AgentSkillsCN

Testing Test Writing

为核心用户流程与关键路径编写精简而有策略的测试,同时避免过早测试边缘案例或非关键的辅助功能。在为关键业务逻辑与主要用户工作流编写测试时,可运用此技能;在决定在功能开发过程中测试什么时,可运用此技能;在测试行为而非实现细节时,可运用此技能;在编写能说明预期结果的描述性测试名称时,可运用此技能;在模拟数据库、API 与文件系统等外部依赖时,可运用此技能;在保持单元测试的快速执行(毫秒级)以方便频繁运行时,可运用此技能;在除非对业务至关重要,否则暂缓测试边缘案例与错误状态时,可运用此技能;在专注于核心用户流程而非次要工作流时,可运用此技能;在以逻辑上的完成点作为测试节点,而非每个中间步骤时,可运用此技能;或在制定测试覆盖率策略时,兼顾开发速度与质量保证,可运用此技能。

SKILL.md
--- frontmatter
name: Testing Test Writing
description: Write minimal, strategic tests for core user flows and critical paths while avoiding premature testing of edge cases or non-critical utilities. Use this skill when writing tests for critical business logic and primary user workflows; when deciding what to test during feature development; when testing behavior rather than implementation details; when writing descriptive test names that explain expected outcomes; when mocking external dependencies like databases, APIs, and file systems; when keeping unit tests fast (milliseconds) for frequent execution; when deferring edge case and error state testing unless business-critical; when focusing on core user flows rather than secondary workflows; when testing at logical completion points rather than every intermediate step; or when establishing test coverage strategies that balance development speed with quality assurance.

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 minimal tests during development (not every change or intermediate step)
  • When testing only core user flows and critical business paths
  • When deferring edge case testing unless business-critical
  • When testing behavior rather than implementation details
  • When writing descriptive test names that explain expected outcomes
  • When mocking external dependencies (databases, APIs, file systems)
  • When keeping unit tests fast (milliseconds) for frequent developer execution
  • When deciding what level of testing is required for feature completion
  • When establishing test coverage strategies for the project

Instructions

For details, refer to the information provided in this file: testing test writing