用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill test-strategy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | test-strategy |
| description | Testing strategy — what, when, how; coverage planning. |
Before writing a test, ask:
/\
/ \ E2E Tests
/ \ (few, slow, high confidence)
/------\
/ \ Integration Tests
/ \ (moderate, medium speed)
/------------\
/ \ Unit Tests
/ \ (many, fast, focused)
/------------------\
skills/testing/test-pyramid/SKILL.mdDo not write tests for:
Watch out for:
Code is testable when:
When writing production code, prefer patterns that make testing natural — but don't over-engineer the production code just to reach testability.
| Context | Coverage Target |
|---|---|
| Business logic / domain layer | 80–90% |
| API controllers | 70–80% (integration level) |
| Infrastructure / repositories | 60–70% |
| UI components | Key paths only |
| Overall | 60–70% is usually healthy |
These are guidelines, not mandates. A 40%-covered codebase with tests on the right things beats a 90%-covered one with tests on the wrong things.
Tests should read like specifications. Use camelCase — no underscores:
given[Context]When[Action]Then[ExpectedResult]
// or simply:
[methodOrFeature][Scenario][ExpectedOutcome]
Examples:
- calculateDiscountWithVIPCustomerApplies15Percent
- createOrderWithOutOfStockItemThrowsUnavailableException
- loginEndpointWithWrongPasswordReturns401
Every test follows Arrange → Act → Assert:
// Arrange — set up the test scenario
// Act — execute the behavior under test
// Assert — verify the outcome
Before finishing, check the new test's path against the runner's actual include/testMatch config (vitest.config.*, jest.config.*, phpunit.xml, etc.), not just the project's stated convention. A test placed outside that glob (e.g. colocated under src/ when the runner only scans tests/) passes silently by never running — it reports success while covering nothing. Run the scoped command from skills/shared/scoped-test-execution/SKILL.md against the new file specifically and confirm it was actually picked up, not skipped.
Add these as comments in tests where the sections aren't obvious.