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/BetterTyped/hype-stackWrote 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/bettertyped/hype-stack/background-work)<a href="https://agentmods.dev/rules/bettertyped/hype-stack/background-work"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/background-work/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/bettertyped/hype-stack/background-work"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/background-work.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.00924 |
| Opus 5.5 | $0.00000 | $0.00370 |
| Sonnet 5.5 | $0.00000 | $0.00185 |
| Haiku 4.5 | $0.00000 | $0.00092 |
Grade A, and why
background-work 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 26d 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 — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Background Work
Two tools, two questions. The scheduler (src/libs/scheduler) answers when. The task queue (src/libs/queue) answers how much at once.
| Job | Task | |
|---|---|---|
| What | a cron entry | one queued unit of work |
| Registered in | src/jobs/index.ts |
src/queues/index.ts |
| Runs | once per fire across all instances | on any instance, up to the queue's concurrency each |
| Good for | sweeps, digests, cleanup, "every night at 3" | parsing an upload, calling a model, sending a batch |
| Must be | fast: it holds a database transaction while it runs | safe to run twice |
If a job finds slow work, it enqueues tasks and returns. It never does the slow work itself.
Defining a queue
// src/features/reports/queues/render-report.queue.ts
export const renderReportQueue = defineQueue({
name: "render-report",
schema: z.object({ reportId: z.string() }),
concurrency: 2,
exclusive: true,
run: async ({ data, signal }) => {
await renderReport(data.reportId, signal);
},
onExhausted: async ({ data }) => {
await markReportFailed(data.reportId);
},
});
Then add it to the array in src/queues/index.ts. enqueue throws for a queue that is not registered there.
Enqueue in the same transaction as the row
await postgres.qb.transaction().execute(async (trx) => {
await trx.insertInto("report").values(report).execute();
await enqueue(renderReportQueue, { reportId: report.id }, { trx, key: report.id });
});
The task commits or rolls back with the row. A row can never sit in queued with nothing behind it. Never enqueue before the transaction, and never after it in a separate step.
Rules
- Payloads are ids, not data. Put
{ reportId }in the task and read the row in the handler. The row is the truth, the payload is a pointer. - Status lives in your table. Keep a status column the UI can read. The queue is plumbing, not a place the frontend looks.
- Handlers run twice sometimes. A crash or a deploy mid-run means a retry. Checkpoint progress in your own tables and resume from it.
- Errors a retry cannot fix are not thrown. Bad file, unsupported format: write the failure to your row and return. Throw only when trying again could help.
onExhaustedmarks the row failed. It fires once, after the last retry. Sentry gets the error either way.- Pass
signalto slow calls. It aborts on expiry and on shutdown. - No
try/catchto swallow errors in a handler. Same rule as routes: let it throw, the queue logs, retries, and reports. - Use
exclusivewith akeywhen the task is "process row X", so a double click cannot process it twice.
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.
- 26d ago Changed · -8 lines b0d54d3a36db
- 27d ago First seen · 78 lines · 0 tokens per session scan A f392effb8dd2
background-work is a cursor rule published in the GitHub repository BetterTyped/hype-stack (12 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 924 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-09-19.
Other cursor rules, from other repositories
supabase-db-create-functions
Guidelines for writing Supabase database functions.
sql-queries-not-asts
Name built-and-lowered SQL units "queries", not "asts".
supabase
Do not use the Supabase Client, instead use the Jawn Client and put all new endpoints in controllers. Don't use RLS policies, instead enable RLS for new tables and revoke privledges. Example.
java-springboot-jpa-cursorrules-prompt-file
Cursor rules for Java development with Springboot and JPA integration.
backend-architecture
The backend is built on Supabase, providing PostgreSQL database, authentication, and Edge Functions for serverless API endpoints.
windsurfrules
Node.js ESM + EloquentJS ORM + PostgreSQL/MongoDB + Express/Fastify.