Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/movebrickschi/harness-engineering-mcp/10-testability-designgit clone --depth 1 https://github.com/movebrickschi/harness-engineering-mcpWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00383 |
| Opus 5 | $0.00000 | $0.00192 |
| Sonnet 5 | $0.00000 | $0.00077 |
| Haiku 4.5 | $0.00000 | $0.00038 |
Grade A, and why
10-testability-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
可测试性设计
覆盖率门槛
| 指标 | 最低要求 |
|---|---|
| 行覆盖率 | > 80% |
| 分支覆盖率 | > 70% |
| 核心业务逻辑 | 100% |
测试金字塔
单元测试 : 集成测试 : E2E测试 = 70 : 20 : 10,禁止Ice-Cream Cone反模式。
Mock策略
// ✅ 外部依赖使用@MockBean,轻量启动
@ExtendWith(MockitoExtension.class)
class OrderServiceTest {
@Mock private PaymentGateway paymentGateway;
@InjectMocks private OrderService orderService;
}
// ❌ 禁止为单元测试加载全Spring上下文
@SpringBootTest
class OrderServiceTest { }
BDD风格
测试方法名描述行为,使用Given-When-Then结构:
@Test
void shouldDecreaseBalanceWhenWithdrawSufficientFunds() {
// Given - 准备测试数据
Account account = Account.builder().balance(1000).build();
// When - 执行被测行为
account.withdraw(200);
// Then - 验证结果
assertThat(account.getBalance()).isEqualTo(800);
}
测试数据管理
- 使用Test Data Builder模式创建复杂对象
- 禁止测试间共享可变状态
- 集成测试使用@Testcontainers,每测试方法独立Schema
- 禁用@Transactional回滚策略(会掩盖真实数据库问题,如约束冲突、触发器行为等)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 58 lines · 383 tokens per session scan A 2d1dd510250a
10-testability-design is a cursor rule published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 383 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
testing-patterns
Паттерны тестирования 1С: YaXUnit, Vanessa.
verify-scope
改完代码要跑验证时读——三档验证阶梯的窄化命令配方(pytest ::/-k/--lf、vitest 点名文件/-t/--related、shoot 场景过滤)、release:gate 五段分拆与失败续跑、反空转与跨包边界。跑 release:gate / 全量 pytest / 全量 vitest / pnpm shoot 前必读。.
300-testing
Comprehensive testing guide covering unit, integration, E2E, test frameworks, patterns, and CI/CD integration.
testing
Testing conventions and Playwright patterns.
testing
Testing strategy for AI developers.
testing-guide
Cursor rule "testing-guide" from HeeGyeong/ComposeSample, covering testing guide, unit tests, ui tests, test coverage and performance testing.