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/mywand/cusrsor-do-it/testinggit clone --depth 1 https://github.com/mywand/cusrsor-do-itWhat 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.03518 |
| Opus 5 | $0.00000 | $0.01759 |
| Sonnet 5 | $0.00000 | $0.00704 |
| Haiku 4.5 | $0.00000 | $0.00352 |
Grade A, and why
testing scanned grade A with 1 finding 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 yesterday.
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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
response = requests.post( How it starts
The opening of the file, as written. The whole thing — 515 lines — stays where its author put it; the contents beside it link to each section on GitHub.
最近更新: 2025-10-10
测试策略与最佳实践
1. 测试金字塔
1.1 测试层级
/\
/ \
/ UI \ <- 少量 E2E 测试
/______\
/ \
| 集成测试 | <- 适量集成测试
|________|
| |
| 单元测试 | <- 大量单元测试
|________|
1.2 测试比例建议
- 单元测试: 70% - 快速、稳定、易维护
- 集成测试: 20% - 测试组件间交互
- 端到端测试: 10% - 测试完整用户流程
2. 单元测试
2.1 测试命名规范
// 格式: 方法名_测试场景_期望结果
describe('UserService', () => {
describe('getUserById', () => {
it('should return user when valid id provided', () => {
// 测试逻辑
})
it('should throw error when invalid id provided', () => {
// 测试逻辑
})
it('should return null when user not found', () => {
// 测试逻辑
})
})
})
2.2 AAA 模式 (Arrange-Act-Assert)
def test_calculate_discount_with_valid_inputs():
# Arrange - 准备测试数据
price = 100
discount_rate = 0.1
expected_discount = 10
# Act - 执行被测试的方法
actual_discount = calculate_discount(price, discount_rate)
# Assert - 验证结果
assert actual_discount == expected_discount
2.3 Mock 和 Stub 使用
@Test
public void shouldCreateUserSuccessfully() {
// Arrange
CreateUserRequest request = new CreateUserRequest("张三", "[email protected]");
User expectedUser = new User(1, "张三", "[email protected]");
// Mock 外部依赖
when(userRepository.save(any(User.class))).thenReturn(expectedUser);
when(emailService.sendWelcomeEmail(anyString())).thenReturn(true);
// Act
User actualUser = userService.createUser(request);
// Assert
assertEquals(expectedUser.getName(), actualUser.getName());
assertEquals(expectedUser.getEmail(), actualUser.getEmail());
// 验证交互
verify(userRepository).save(any(User.class));
verify(emailService).sendWelcomeEmail("[email protected]");
}
2.4 边界测试
describe('validateAge', () => {
it('should accept minimum valid age', () => {
expect(validateAge(0)).toBe(true)
})
it('should accept maximum valid age', () => {
expect(validateAge(150)).toBe(true)
})
it('should reject negative age', () => {
expect(() => validateAge(-1)).toThrow('年龄不能为负数')
})
it('should reject age over limit', () => {
expect(() => validateAge(151)).toThrow('年龄不能超过150岁')
})
it('should handle null input', () => {
expect(() => validateAge(null)).toThrow('年龄不能为空')
})
})
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.
- yesterday First seen · 515 lines · 0 tokens per session scan A d62ac22e7a13
testing is a cursor rule published in the GitHub repository mywand/cusrsor-do-it (2 stars, last pushed 7mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,518 tokens. A static security scan graded it A with 1 finding (makes network calls). 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
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.