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/webhook-co/webhook/engineering-conventionsgit clone --depth 1 https://github.com/webhook-co/webhookWhat 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.00787 |
| Opus 5 | $0.00000 | $0.00394 |
| Sonnet 5 | $0.00000 | $0.00157 |
| Haiku 4.5 | $0.00000 | $0.00079 |
Grade A, and why
engineering-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 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.
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 — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Engineering conventions (TypeScript / Workers)
Language & types
- TypeScript everywhere,
stricton. Noanyunless justified with a comment; preferunknown+ narrowing. Validate all external input (webhook bodies, API params) at the boundary with a schema. - Keep
shared/the home for cross-surface types. The same operation across CLI / API / web / MCP should share types — don't redefine payloads per surface. - Node↔Workers tsconfig boundary. Packages export source for live cross-package types, but a
Node-typed package (
types: ["node"]) and a Workers-typed one (types: ["@cloudflare/workers-types"]) must never recompile each other's source — the lib worlds disagree (e.g.@types/node'sUint8Array<ArrayBufferLike>vs the DOMBufferSourcefor WebCrypto). So an internal dependency edge that crosses that boundary resolves to the dep's builtdist/*.d.tsvia tsconfigpaths, not its source; same-world edges stay on source. Use the@webhook-co/*→distwildcard when every internal dep crosses (db); use an exact@webhook-co/<pkg>redirect when only some do (api/mcp → db). Thetsconfig-boundaryguard (scripts/tsconfig-boundary.mjs, wired intolintand CI) fails the build if a cross-boundary edge isn't redirected.
Workers / Durable Objects
- Workers handlers stay thin: validate → delegate → respond. ACK ingestion fast; do delivery work off the request hot path (via the DO + alarms), not inline.
- One Durable Object per endpoint is the ordering/isolation primitive — preserve FIFO semantics and never share a DO across endpoints.
- Schedule retries/backoff with DO Alarms, not hot-path queues. Make delivery idempotent and dedup by event id.
- Never block on long outbound work in a Worker; route heavy/blocking delivery through the container-delivery seam (don't bypass the interface).
- Use bindings (KV, R2, Hyperdrive, DO) — never hardcode endpoints or credentials.
Error handling
- Fail loud internally, fail safe externally. Return Standard-Webhooks-correct status codes; don't leak internal errors, stack traces, secrets, or tenant data to responses or logs.
- Errors are typed and actionable; wrap with context rather than swallowing. Retryable vs terminal failures must be distinguishable so the retry scheduler does the right thing.
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 · 56 lines · 787 tokens per session scan A 4b097f0ba44e
engineering-conventions is a cursor rule published in the GitHub repository webhook-co/webhook (0 stars, last pushed 6d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 787 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
docs
All documentation files use MDX format with a specific structure.
type-inference
Derive TypeScript types from Zod schemas - no hand-written interfaces for wire shapes.
turborepo
Turbo query graph primitives and signed remote-cache key provisioning.
workers-cache
Workers Cache - Cache-Control, gateway exports cache off, RPC vs fetch.
boundaries
Package dependency boundaries - tag map and enforced invariants.
react
React 19 SPA invariants - client-only, no fetch in useEffect, Compiler memo policy.