Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/brendadeeznuts1111/betting-brain-v3npx agentmods add rules/brendadeeznuts1111/betting-brain-v3/process-managementWrote 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/brendadeeznuts1111/betting-brain-v3/process-management)<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/process-management"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/process-management/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/brendadeeznuts1111/betting-brain-v3/process-management"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/process-management.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.00942 |
| Opus 5 | $0.00000 | $0.00471 |
| Sonnet 5 | $0.00000 | $0.00188 |
| Haiku 4.5 | $0.00000 | $0.00094 |
Grade A, and why
process-management 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 9d 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 — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Process Management Rules
Zombie Process Prevention
ALWAYS use the process cleanup utility for spawning child processes:
// ❌ BAD - Can create zombie processes
const proc = Bun.spawn(['command', 'args']);
await Promise.race([proc.exited, timeout]); // Process not killed on timeout
// ✅ GOOD - Automatic cleanup
import processManager from './tests/utils/process-cleanup';
const proc = processManager.spawn(['command', 'args']);
try {
await Promise.race([proc.exited, timeout]);
} catch (error) {
await processManager.kill(proc, 15, 2000);
} finally {
await processManager.killAll(3000);
}
Process Spawning Patterns
Script Files
For automation scripts that spawn processes:
import processManager from '../tests/utils/process-cleanup';
async function runCommand(command: string[], timeout: number) {
const proc = processManager.spawn(command, {
cwd: process.cwd(),
stdio: ['ignore', 'pipe', 'pipe']
});
try {
const exitCode = await Promise.race([
proc.exited,
new Promise<never>((_, reject) =>
setTimeout(() => reject(new Error('Timeout')), timeout)
)
]);
return exitCode === 0;
} catch (error) {
await processManager.kill(proc, 15, 2000);
throw error;
}
}
Test Files
Always use process manager in tests:
import { describe, test, beforeEach, afterEach } from 'bun:test';
import processManager from '../utils/process-cleanup';
describe('My Test Suite', () => {
afterEach(async () => {
// Cleanup all spawned processes after each test
await processManager.killAll(3000);
});
test('should spawn process', async () => {
const proc = processManager.spawn(['echo', 'hello']);
await proc.exited;
});
});
Signal Handling
Always ensure scripts handle cleanup on exit:
// Automatic via processManager (recommended)
import processManager from './tests/utils/process-cleanup';
// Signal handlers are automatically set up
// Or manual (if needed)
process.on('SIGINT', async () => {
console.log('Cleaning up...');
await processManager.killAll(3000);
process.exit(0);
});
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.
- 9d ago First seen · 163 lines · 0 tokens per session scan A 1a040d7e07fe
process-management is a cursor rule published in the GitHub repository brendadeeznuts1111/betting-brain-v3 (8 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 942 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
workers-patterns
Skim this on every task that touches workers, env, routes, or bindings.
git-workflow
Cloud Agents MUST run git add, git commit, and git push before ending their response when they have made code changes. Do not end your turn without pushing. ALWAYS use Pull Requests instead of pushing directly to main.
typescript-imports
Golden rule: import each symbol from the module that defines it. A package index.ts may barrel only its own ./ modules — never another package.
new-env-var-checklist
Checklist when adding any new env secret/variable — Turbo globalEnv, GitHub sync, workflow maps, Alchemy bindings. Prevents "secret synced but worker never gets it".
project-init
When the user has not yet personalized a copy of this monorepo, help them before building features.
realtime-websockets
Socka-first Durable Object WebSockets, SSR-safe client URLs, no fake localhost. Use for durable-objects/, apps/web, WebSocket forwarding, or @firtoz/socka.