engineering-conventions

engineering-conventions is a cursor rule for Cursor from webhook-co/webhook. It costs 787 tokens per session, scanned A, original, Apache-2.0.

A set of engineering rules for TypeScript and Cloudflare Workers projects. It covers types, input validation, shared code, error handling, testing, and the boundary between Node.js and Workers code.

In plain words
What is it for?
Use it to guide TypeScript code, validate webhook and API inputs, share types, configure package boundaries, handle errors, and define testing expectations.
Why use it?
It prevents inconsistent patterns, unsafe handling of external data, and type conflicts between different JavaScript runtime environments. It also keeps the same operation aligned across command-line, API, web, and MCP surfaces.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to guide TypeScript code, validate webhook and API inputs, share types, configure package boundaries, handle errors, and define testing expectations.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/webhook-co/webhook/engineering-conventions
Install

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.

Clone the repo
git clone --depth 1 https://github.com/webhook-co/webhook

Made for: Cursor.

Wrote 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.

agentmods badge for engineering-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/webhook-co/webhook/engineering-conventions/github.svg)](https://agentmods.dev/rules/webhook-co/webhook/engineering-conventions)
Your own site
<a href="https://agentmods.dev/rules/webhook-co/webhook/engineering-conventions"><img src="https://agentmods.dev/badge/rules/webhook-co/webhook/engineering-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.

agentmods 80×15 button for engineering-conventions

Your own site · 80×15
<a href="https://agentmods.dev/rules/webhook-co/webhook/engineering-conventions"><img src="https://agentmods.dev/badge/rules/webhook-co/webhook/engineering-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 787 This file is loaded in full into every session.
When invoked 787 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00787 $0.00787
Opus 5.5 $0.00315 $0.00315
Sonnet 5.5 $0.00157 $0.00157
Haiku 4.5 $0.00079 $0.00079

Measured 1mo ago against content hash 4b097f0ba44e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 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.

.cursor/rules/engineering-conventions.mdc · 56 lines

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, strict on. No any unless justified with a comment; prefer unknown + 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's Uint8Array<ArrayBufferLike> vs the DOM BufferSource for WebCrypto). So an internal dependency edge that crosses that boundary resolves to the dep's built dist/*.d.ts via tsconfig paths, not its source; same-world edges stay on source. Use the @webhook-co/* → dist wildcard when every internal dep crosses (db); use an exact @webhook-co/<pkg> redirect when only some do (api/mcp → db). The tsconfig-boundary guard (scripts/tsconfig-boundary.mjs, wired into lint and 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.

Read the full file on GitHub · 56 lines

Changes

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.

  1. 1mo ago First seen · 56 lines · 787 tokens per session scan A 4b097f0ba44e

Subscribe to this mod's changes

engineering-conventions is a cursor rule published in the GitHub repository webhook-co/webhook (0 stars, last pushed 5d ago), licensed Apache-2.0. It adds 787 tokens to every session, about $0.0031 per session on Opus 5.5. 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.