upgrade-express

upgrade-express is a skill for Claude Code, Codex from Phaedra-Solutions/cursor-rules. It costs 113 tokens per session (1,532 once invoked), scanned A, original, MIT.

A migration guide for Express 4 applications to Express 5, where Express is a Node.js framework for handling web requests and APIs. It applies official code changes and then addresses differences that require manual fixes.

In plain words
What is it for?
Use it to update route syntax and middleware behaviour, run the official codemods, fix remaining code, and verify important API endpoints.
Why use it?
It helps uncover route, request-body, query-string and asynchronous error-handling changes that can break an upgrade. A baseline of tests and key routes makes regressions easier to spot.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to update route syntax and middleware behaviour, run the official codemods, fix remaining code, and verify important API endpoints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phaedra-solutions/cursor-rules/upgrade-express
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.

Any agent
npx skills add Phaedra-Solutions/cursor-rules --skill upgrade-express
Clone the repo
git clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rules

Made for: Claude Code, Codex.

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 upgrade-express

README.md
[![agentmods](https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-express/github.svg)](https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-express)
Your own site
<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.

agentmods 80×15 button for upgrade-express

Your own site · 80×15
<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>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,532 The whole file, excluding the scripts and references it only reads on demand.
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.00113 $0.01532
Opus 5.5 $0.00045 $0.00613
Sonnet 5.5 $0.00023 $0.00306
Haiku 4.5 $0.00011 $0.00153

Measured 3d ago against content hash 8f9698062c6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

skills/upgrade-express/SKILL.md · 81 lines

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-4 applies 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-chain cooldown applies);
    • which routes are business-critical, for the smoke test.
  • Note: @expressjs/codemod on npm is deprecated; the official codemods now run through the codemod CLI from the codemod.com registry.

Steps

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

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

  3. Inventory route patterns that change meaning in path-to-regexp 8:

    grep -rnE "\.(get|post|put|patch|delete|all|use|route)\(\s*['\"\`][^'\"\`]*[*?()+]" src
    
  4. Run the codemods (review the diff after each run):

    npx codemod@latest @expressjs/v5-migration-recipe
    

    The recipe covers app.del → app.delete, req.param() → explicit req.params/req.body/req.query, res.send(status, body) and res.json(obj, status) → res.status().…, pluralized req.accepts*, res.sendfile → res.sendFile, res.redirect('back') and argument order, express.static.mime and dotfiles options. Individual codemods (@expressjs/route-del-to-delete, …) can be run one at a time the same way.

  5. Upgrade the package: npm install express@^5 (and @types/express@^5 for TypeScript). Update middleware that pins Express 4 peers.

  6. 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 a RegExp;
    • app.use('*', …) / router.all('*', …) → '/*splat' or no path.
  7. Behavior changes to check:

    • req.query uses the simple parser and is read-only. Code reading req.query.a.b or writing req.query.x = … must change; set app.set('query parser', 'extended') only if clients send nested queries, and validate the result.
    • req.body is undefined when no parser ran; add checks or schema validation instead of assuming {}.
    • Rejected promises now reach the error handler: remove express-async-handler/express-async-errors wrappers, and make sure the error handler handles those errors.
    • express.static ignores dotfiles by default; serve /.well-known explicitly if needed.
    • res.status() accepts only integers 100–999; res.clearCookie ignores maxAge/expires; req.host keeps the port.
  8. Verify (next section). Show the diff summary and results; commit only when the user asks (git-commit skill). Then switch to backend/express.

Read the full file on GitHub · 81 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. 3d ago First seen · 81 lines · 113 tokens per session scan A 8f9698062c6d

Subscribe to this mod's changes

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.