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 skills add Phaedra-Solutions/cursor-rules --skill upgrade-expressgit clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rulesWrote 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/skills/phaedra-solutions/cursor-rules/upgrade-express)<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-express"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-express/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/skills/phaedra-solutions/cursor-rules/upgrade-express"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-express.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.00113 | $0.01532 |
| Opus 5.5 | $0.00045 | $0.00613 |
| Sonnet 5.5 | $0.00023 | $0.00306 |
| Haiku 4.5 | $0.00011 | $0.00153 |
Grade A, and why
upgrade-express 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 3d 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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Upgrade Express 4 → 5
When to use
- The user asks to upgrade Express, or to move off Express 4 (in maintenance since 1 Apr 2025; EOL no sooner than 1 Oct 2026).
legacy/express-4applies and the user agrees to upgrade.
For a patch within 4.x, follow Safe maintenance in legacy/express-4 instead.
Before you start
- Read
express, its middleware (body-parser,cors,helmet,express-session,multer,passport, routers, error wrappers) and Node from the lockfile and config. Express 5 needs Node ≥ 18; move to a supported LTS first if needed (upgrade-node). - The working tree must be clean; work on a branch (
chore/express-5). - Ask the user:
- whether codemods may edit files (they rewrite code; run them on a clean tree so the diff is reviewable);
- whether network installs are approved (
core/supply-chaincooldown applies); - which routes are business-critical, for the smoke test.
- Note:
@expressjs/codemodon npm is deprecated; the official codemods now run through thecodemodCLI from the codemod.com registry.
Steps
-
Baseline. Install from the lockfile and record lint, typecheck, tests and a manual hit on key routes. If the baseline fails, report it and ask before continuing.
-
Patch 4.x first (
npm install express@^4.22.3) and make sure tests pass, so the major upgrade starts from the latest 4.x. -
Inventory route patterns that change meaning in path-to-regexp 8:
grep -rnE "\.(get|post|put|patch|delete|all|use|route)\(\s*['\"\`][^'\"\`]*[*?()+]" src -
Run the codemods (review the diff after each run):
npx codemod@latest @expressjs/v5-migration-recipeThe recipe covers
app.del→app.delete,req.param()→ explicitreq.params/req.body/req.query,res.send(status, body)andres.json(obj, status)→res.status().…, pluralizedreq.accepts*,res.sendfile→res.sendFile,res.redirect('back')and argument order,express.static.mimeanddotfilesoptions. Individual codemods (@expressjs/route-del-to-delete, …) can be run one at a time the same way. -
Upgrade the package:
npm install express@^5(and@types/express@^5for TypeScript). Update middleware that pins Express 4 peers. -
Fix route syntax by hand (codemods don't rewrite patterns):
/*→/*splat(or/{*splat}to also match the root); the matched value is an array;/:file.:ext?→/:file{.:ext};- regex characters in strings (
(,),+,?,[,]) → arrays of paths or aRegExp; app.use('*', …)/router.all('*', …)→'/*splat'or no path.
-
Behavior changes to check:
req.queryuses thesimpleparser and is read-only. Code readingreq.query.a.bor writingreq.query.x = …must change; setapp.set('query parser', 'extended')only if clients send nested queries, and validate the result.req.bodyisundefinedwhen no parser ran; add checks or schema validation instead of assuming{}.- Rejected promises now reach the error handler: remove
express-async-handler/express-async-errorswrappers, and make sure the error handler handles those errors. express.staticignores dotfiles by default; serve/.well-knownexplicitly if needed.res.status()accepts only integers 100–999;res.clearCookieignoresmaxAge/expires;req.hostkeeps the port.
-
Verify (next section). Show the diff summary and results; commit only when the user asks (
git-commitskill). Then switch tobackend/express.
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.
- 3d ago First seen · 81 lines · 113 tokens per session scan A 8f9698062c6d
upgrade-express is a skill published in the GitHub repository Phaedra-Solutions/cursor-rules (4 stars, last pushed 2d ago), licensed MIT. It adds 113 tokens to every session and 1,532 once invoked, about $0.0005 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-11-01.
Other skills, from other repositories
nestjs
Use when building or structuring a NestJS backend — feature modules, providers and DI wiring, provider scopes and request-lifecycle order, where to bind guards/pipes/interceptors/filters, and testing with Test.createTestingModule. NOT a bare Express/Fastify service with no DI (that is nodejs), NOT framework-agnostic…
express-typescript
Guidelines for building robust APIs with Express.js and TypeScript, covering middleware patterns, routing, and security best practices.
koa-typescript
Guidelines for building modern APIs with Koa.js and TypeScript, featuring the onion middleware model and async/await patterns.
fastify-typescript
Guidelines for building high-performance APIs with Fastify and TypeScript, covering validation, Prisma integration, and testing best practices.
hono-typescript
Guidelines for building edge-first, high-performance APIs with Hono and TypeScript for Cloudflare Workers, Deno, Bun, and Node.js.
nodejs-development
Node.js development guidelines covering Payload CMS, Vue.js with TypeScript, and general TypeScript best practices.