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/0xranx/golembot/testing-conventionsgit clone --depth 1 https://github.com/0xranx/golembotWhat 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.01388 |
| Opus 5 | $0.00000 | $0.00694 |
| Sonnet 5 | $0.00000 | $0.00278 |
| Haiku 4.5 | $0.00000 | $0.00139 |
Grade A, and why
testing-conventions 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing Conventions
Feature Changes Must Be Verified (Most Important Rule)
Any substantive change to source files under src/ must:
- Add dedicated tests for the new functionality — passing existing tests is not enough. Each new feature/field/parameter needs corresponding test cases; these must fail when the feature is removed.
- Evaluate whether e2e tests need updates — if the change affects interaction with the real Agent (e.g. params, output parsing, event types), add new assertions in e2e.
- Run e2e once (
pnpm run e2e) to ensure real scenarios still work — even if the change seems small.
⚠️ Anti-Pattern Warning
"Changed code + all old tests pass = done" — that is wrong. Old tests only verify old behavior. New functionality without dedicated tests is effectively unverified.
Typical mistakes:
- Added
apiKeytoInvokeOpts→ but no test verifiesapiKeyis actually passed to the engine - Added
durationMstodoneevent → but no test for with/withoutduration_msscenarios - Modified
parseStreamLine→ but e2e has no assertion for the new fields returned by the real Agent
Correct approach:
- Unit tests: mock engine captures new params; verify end-to-end propagation of new fields from source to consumer
- e2e assertions: verify new fields have values in real conversations (e.g.
durationMs > 0) - Do not consider it done until tests have been run
Unit Tests (vitest)
Location: src/__tests__/<module>.test.ts
Mock Engine Pattern
Unit tests do not call the real Agent (Cursor / Claude Code). Replace with a mock engine:
async function* mockInvoke(prompt, opts): AsyncIterable<StreamEvent> {
yield { type: 'text', content: 'mock response' };
yield { type: 'done', sessionId: 'mock-session-123' };
}
Inject via vi.mock('../engine.js', ...), returning mock engine from createEngine.
Key Test Scenarios
- session.test.ts: Multi-key routing, Phase 1 format migration, concurrency safety
- index.test.ts: sessionKey routing, KeyedMutex concurrency isolation, resetSession
- server.test.ts: All HTTP endpoints, SSE streaming, Bearer auth, CORS, input validation
- engine.test.ts: stream-json parsing (parseStreamLine + parseClaudeStreamLine), ANSI stripping, injectClaudeSkills, createEngine factory
- workspace.test.ts: golem.yaml read/write, skills scanning, AGENTS.md generation
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.
- 2d ago First seen · 108 lines · 0 tokens per session scan A 138dcc3d3b1d
testing-conventions is a cursor rule published in the GitHub repository 0xranx/golembot (319 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,388 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-30.
Other cursor rules, from other repositories
app_feature_first_architecture
Feature-first architecture is a design pattern that organizes code by business features rather than technical layers. This approach promotes better maintainability, scalability, and team collaboration by keeping related functionality together and reducing coupling between different parts of the application.
best_practices
Advanced Best Practices covering Error Handling, Environment Variables, Performance, and Accessibility rules.
qmd-search
Prefer QMD over grep/ripgrep for searching vault content.
skill-conventions
Project conventions for creating and editing Obsidian vault skills.
commits
Guidance on commit messages.
migration
Cursor rule "migration" from sunmh207/entire-dashboard, covering migration 数据库迁移脚本规范, 1. 目录结构, 2. 脚本文件命名规范, 3. 数据库与字符集规范 and 4. 表、字段书写规范.