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.
git clone --depth 1 https://github.com/0xranx/golembotWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/0xranx/golembot/testing-conventions)<a href="https://agentmods.dev/rules/0xranx/golembot/testing-conventions"><img src="https://agentmods.dev/badge/rules/0xranx/golembot/testing-conventions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/0xranx/golembot/testing-conventions"><img src="https://agentmods.dev/badge/rules/0xranx/golembot/testing-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00000 | $0.01388 |
| Opus 5.5 | $0.00000 | $0.00555 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (323 stars, last pushed today), 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
react-chakra-ui---typescript-usage
Guidance for using TypeScript with Chakra UI components in React. It covers typed component props, custom themes, editor support, and avoiding the unsafe any type.
angular-typescript-cursorrules-prompt-file
Cursor rules for Angular development with TypeScript integration.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.
naming-conventions-rule
A small set of naming rules for TypeScript, Node.js, and Next.js projects. It defines how directories and React components should be named and exported.
syntax-and-formatting-rule
A set of syntax and formatting rules for TypeScript, Node.js, and Next.js code. It covers functions, conditions, and JSX, the XML-like syntax used to describe React interfaces.
typescript-coding-style
TypeScript coding rules define formatting and design limits using ESLint, Prettier, and EditorConfig settings. They also set limits for line length, function size, parameter count, and loop style.