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/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/api-design-typescript)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/api-design-typescript"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/api-design-typescript/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/adonai-labs/agent-runway/api-design-typescript"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/api-design-typescript.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.01470 |
| Opus 5.5 | $0.00000 | $0.00588 |
| Sonnet 5.5 | $0.00000 | $0.00294 |
| Haiku 4.5 | $0.00000 | $0.00147 |
Grade A, and why
api-design-typescript 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 29d 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 — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Design for TypeScript
Extends core/rules/api-design.mdc. Runtime concerns (process lifecycle, config, logging) live in the Node rules; type-level patterns live in typescript.mdc.
Framework choice
| Framework | Use when |
|---|---|
| Express 5 | Simple services, large middleware ecosystem. Rejected promises from async handlers are forwarded to the error handler natively. |
| Fastify | Throughput matters; built-in JSON Schema validation and serialisation (use fastify-type-provider-zod for Zod). |
| NestJS | Large teams wanting opinionated modules, DI, and decorators. |
Examples below target Express 5. On Express 4, wrap async handlers ((fn) => (req, res, next) => fn(req, res, next).catch(next)) or use express-async-errors.
Thin handlers
Handlers parse input, call one service/use case, and map the result. No business logic, no SQL.
router.get('/users/:id', async (req, res) => {
const { id } = IdParams.parse(req.params);
const user = await userService.getUser(id); // throws NotFoundError
res.json(toUserResponse(user)); // map domain -> DTO; never leak entities
});
Validate every input with Zod
Validate params, query, and body at the boundary; derive types from schemas.
import { z } from 'zod';
const IdParams = z.object({ id: z.coerce.number().int().positive() });
const CreateUserBody = z.object({
email: z.email().max(255),
name: z.string().min(2).max(100),
});
type CreateUserBody = z.infer<typeof CreateUserBody>;
const validateBody = <T extends z.ZodType>(schema: T): RequestHandler => (req, _res, next) => {
const result = schema.safeParse(req.body);
if (!result.success) return next(new ValidationError(z.flattenError(result.error).fieldErrors));
req.body = result.data;
next();
};
router.post('/users', validateBody(CreateUserBody), async (req, res) => {
const user = await userService.create(req.body as CreateUserBody);
res.status(201).location(`/users/${user.id}`).json(toUserResponse(user));
});
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.
- 29d ago Changed · -246 lines f876e8c954ad
- 3mo ago First seen · 392 lines · 0 tokens per session scan A ed0faff11e96
api-design-typescript is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,470 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-03.
api-design-typescript compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-design-typescriptadonai-labs/agent-runway | Cursor rule | 2 | 8d ago | MIT | A | 0 | Cursor |
| javascript-typescript-code-quality-cursorrules-proPatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 673 | Cursor |
| python--typescript-guide-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 226 | Cursor |
| general-code-quality-and-styleholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 258 | Cursor |
| backend-stack-rulesholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 0 | Cursor |
| mcp-clean-codekaminari-ad/mcp | Cursor rule | 0 | today | MIT | A | 0 | Cursor |
| typescriptgirijashankarj/cursor-handbook | Cursor rule | 33 | 3mo ago | MIT | A | 140 | Cursor |