npx skills add https://github.com/pproenca/dot-skills --skill tdd面向 AI 代理和 LLM 设计的测试驱动开发实践综合指南。包含 8 个类别共 42 条规则,按影响程度排序,以指导测试编写、重构和代码生成。
在以下情况下参考本指南:
| 优先级 | 类别 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 红-绿-重构循环 | 关键 | cycle- |
| 2 | 测试设计原则 | 关键 | design- |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 3 | 测试隔离与依赖 | 高 | isolate- |
| 4 | 测试数据管理 | 高 | data- |
| 5 | 断言与验证 | 中 | assert- |
| 6 | 测试组织与结构 | 中 | org- |
| 7 | 测试性能与可靠性 | 中 | perf- |
| 8 | 测试金字塔与策略 | 低 | strat- |
cycle-write-test-first - 先写测试后写实现cycle-minimal-code-to-pass - 仅编写足够通过测试的代码cycle-refactor-after-green - 测试通过后立即重构cycle-verify-test-fails-first - 在编写代码前验证测试会失败cycle-small-increments - 采取小步增量cycle-maintain-test-list - 维护测试清单design-test-behavior-not-implementation - 测试行为而非实现design-one-assertion-per-test - 每个测试一个逻辑断言design-descriptive-test-names - 使用描述性测试名称design-aaa-pattern - 遵循 Arrange-Act-Assert 模式design-test-edge-cases - 测试边界情况和边缘情况design-avoid-logic-in-tests - 避免在测试中使用逻辑isolate-mock-external-dependencies - 模拟外部依赖isolate-no-shared-state - 避免测试间共享可变状态isolate-deterministic-tests - 编写确定性测试isolate-prefer-stubs-over-mocks - 对于查询,优先使用桩而非模拟isolate-use-dependency-injection - 使用依赖注入以提高可测试性data-use-factories - 使用工厂创建测试数据data-minimal-setup - 保持测试设置最小化data-avoid-mystery-guests - 避免神秘访客data-unique-identifiers - 每个测试使用唯一标识符data-builder-pattern - 对复杂对象使用构建器模式assert-specific-assertions - 使用具体的断言assert-error-messages - 对错误消息和类型进行断言assert-no-assertions-antipattern - 每个测试都必须有断言assert-custom-matchers - 为领域断言创建自定义匹配器assert-snapshot-testing - 审慎使用快照测试org-group-by-behavior - 按行为而非方法分组测试org-file-structure - 遵循一致的测试文件结构org-setup-teardown - 适当使用设置和拆卸钩子org-test-utilities - 提取可重用的测试工具org-parameterized-tests - 对变体使用参数化测试perf-fast-unit-tests - 保持单元测试在 100 毫秒以内perf-avoid-network-calls - 消除单元测试中的网络调用perf-fix-flaky-tests - 立即修复不稳定的测试perf-parallelize-tests - 并行化独立的测试perf-avoid-sleep - 避免任意的休眠调用strat-test-pyramid - 遵循测试金字塔strat-mutation-testing - 使用变异测试验证测试质量strat-coverage-targets - 设定有意义的覆盖率目标strat-integration-boundaries - 在服务边界进行集成测试strat-e2e-critical-paths - 将端到端测试限制在关键用户路径阅读各个参考文件以获取详细解释和代码示例:
vitest 技能msw 技能获取包含所有规则详细说明的完整指南:AGENTS.md
每周安装次数
138
代码仓库
GitHub 星标数
85
首次出现
2026年1月22日
安全审计
安装于
opencode113
claude-code112
gemini-cli111
codex108
github-copilot100
cursor98
Comprehensive guide to Test-Driven Development practices, designed for AI agents and LLMs. Contains 42 rules across 8 categories, prioritized by impact to guide test writing, refactoring, and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Red-Green-Refactor Cycle | CRITICAL | cycle- |
| 2 | Test Design Principles | CRITICAL | design- |
| 3 | Test Isolation & Dependencies | HIGH | isolate- |
| 4 | Test Data Management | HIGH | data- |
| 5 | Assertions & Verification | MEDIUM | assert- |
| 6 | Test Organization & Structure | MEDIUM | org- |
| 7 | Test Performance & Reliability | MEDIUM | perf- |
| 8 | Test Pyramid & Strategy | LOW | strat- |
cycle-write-test-first - Write the Test Before the Implementationcycle-minimal-code-to-pass - Write Only Enough Code to Pass the Testcycle-refactor-after-green - Refactor Immediately After Greencycle-verify-test-fails-first - Verify the Test Fails Before Writing Codecycle-small-increments - Take Small Incremental Stepscycle-maintain-test-list - Maintain a Test Listdesign-test-behavior-not-implementation - Test Behavior Not Implementationdesign-one-assertion-per-test - One Logical Assertion Per Testdesign-descriptive-test-names - Use Descriptive Test Namesdesign-aaa-pattern - Follow the Arrange-Act-Assert Patterndesign-test-edge-cases - Test Edge Cases and Boundariesdesign-avoid-logic-in-tests - Avoid Logic in Testsisolate-mock-external-dependencies - Mock External Dependenciesisolate-no-shared-state - Avoid Shared Mutable State Between Testsisolate-deterministic-tests - Write Deterministic Testsisolate-prefer-stubs-over-mocks - Prefer Stubs Over Mocks for Queriesisolate-use-dependency-injection - Use Dependency Injection for Testabilitydata-use-factories - Use Factories for Test Data Creationdata-minimal-setup - Keep Test Setup Minimaldata-avoid-mystery-guests - Avoid Mystery Guestsdata-unique-identifiers - Use Unique Identifiers Per Testdata-builder-pattern - Use Builder Pattern for Complex Objectsassert-specific-assertions - Use Specific Assertionsassert-error-messages - Assert on Error Messages and Typesassert-no-assertions-antipattern - Every Test Must Have Assertionsassert-custom-matchers - Create Custom Matchers for Domain Assertionsassert-snapshot-testing - Use Snapshot Testing Judiciouslyorg-group-by-behavior - Group Tests by Behavior Not Methodorg-file-structure - Follow Consistent Test File Structureorg-setup-teardown - Use Setup and Teardown Hooks Appropriatelyorg-test-utilities - Extract Reusable Test Utilitiesorg-parameterized-tests - Use Parameterized Tests for Variationsperf-fast-unit-tests - Keep Unit Tests Under 100msperf-avoid-network-calls - Eliminate Network Calls in Unit Testsperf-fix-flaky-tests - Fix Flaky Tests Immediatelyperf-parallelize-tests - Parallelize Independent Testsperf-avoid-sleep - Avoid Arbitrary Sleep Callsstrat-test-pyramid - Follow the Test Pyramidstrat-mutation-testing - Use Mutation Testing to Validate Test Qualitystrat-coverage-targets - Set Meaningful Coverage Targetsstrat-integration-boundaries - Test Integration at Service Boundariesstrat-e2e-critical-paths - Limit E2E Tests to Critical User PathsRead individual reference files for detailed explanations and code examples:
vitest skillmsw skillFor the complete guide with all rules expanded: AGENTS.md
Weekly Installs
138
Repository
GitHub Stars
85
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode113
claude-code112
gemini-cli111
codex108
github-copilot100
cursor98
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
118,000 周安装