# express-production

Provides production-grade patterns for Express.js web applications and REST APIs. Helps developers set up security headers, request middleware pipelines, and PM2 deployment.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 508 installs · ★ 78
- Author: bobmatnyc
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/bobmatnyc/claude-mpm-skills/tree/HEAD/toolchains/javascript/frameworks/express-production/SKILL.md
- Updated: 2026-07-18
- HTML: https://affpapa.org/en/nevibecode/skills/express-production

## What it does

This skill guides the AI assistant in structuring Express.js applications according to production requirements. It splits setup across `src/app.js` as an application factory and `src/server.js` as the runtime entry point. Code layouts cleanly isolate routing tables from controller logic.

Middleware execution follows a strict security-first flow. It mounts `helmet` headers first, resolves CORS rules, and triggers `express-rate-limit` before parsing incoming JSON payloads. Compression and request logging with `morgan` or `winston` run next. For failure handling, it supplies custom `AppError` classes alongside async wrapper routines.

Production execution relies on PM2 clustering defined via `ecosystem.config.js`. Servers listen for `SIGTERM` signals to finish inflight requests prior to exit. Missing core packages like `helmet` or `express-rate-limit` will break the startup sequence immediately.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add bobmatnyc/claude-mpm-skills --skill express-production -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/express-production/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/express-production/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add bobmatnyc/claude-mpm-skills --skill express-production -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/express-production/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add bobmatnyc/claude-mpm-skills --skill express-production -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/express-production/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install bobmatnyc/claude-mpm-skills express-production
```

2. **Manually: put the files in place**
- File: `.github/skills/express-production/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add bobmatnyc/claude-mpm-skills --skill express-production -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/bobmatnyc/claude-mpm-skills --path toolchains/javascript/frameworks/express-production
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/express-production/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add bobmatnyc/claude-mpm-skills --skill express-production -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/bobmatnyc/claude-mpm-skills/tree/HEAD/toolchains/javascript/frameworks/express-production/SKILL.md

## When to use it
- enforce the correct middleware execution order from security headers to routes
- handle server termination safely via `SIGTERM` events
- centralize asynchronous error reporting with custom `AppError` utilities
- configure PM2 process clustering for zero-downtime releases

## Example prompts
- Generate a production Express folder structure with separate `app.js` and `server.js` files.
- Configure the Express middleware pipeline with `helmet`, CORS, and `express-rate-limit`.
- Implement graceful shutdown logic for an Express server handling `SIGTERM`.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 31cef7b1e77ff4a7.

BEGIN THIRD-PARTY FILE 31cef7b1e77ff4a7
````text
---
name: express-production
description: Production-ready Express.js development covering middleware architecture, error handling, security hardening, testing strategies, and deployment patterns
user-invocable: false
disable-model-invocation: true
skill_version: 2.0.0
updated_at: 2025-12-03T00:00:00Z
tags: [express, nodejs, production, middleware, security, testing, deployment, backend]
progressive_disclosure:
  entry_point:
    summary: "Production-ready Express.js framework with comprehensive middleware, security, testing, and deployment patterns"
    when_to_use: "Building production REST APIs, microservices, web applications requiring robust middleware architecture, security hardening, and comprehensive testing"
    quick_start: "1. npm install express 2. Create app.js with middleware stack 3. Implement error handling 4. Add security middleware 5. Deploy with PM2"
  references:
    - references/middleware-patterns.md
    - references/security-hardening.md
    - references/testing-strategies.md
    - references/production-deployment.md
context_limit: 800
---

# Express.js - Production Web Framework

## Overview

Express is a minimal and flexible Node.js web application framework providing a robust set of features for web and mobile applications. This skill covers **production-ready** Express development including middleware architecture, structured error handling, security hardening, comprehensive testing, and deployment strategies.

**Key Features**:
- Flexible middleware architecture with composition patterns
- Centralized error handling with async support
- Security hardening (Helmet, CORS, rate limiting, input validation)
- Comprehensive testing with Supertest
- Production deployment with PM2 clustering
- Environment-based configuration
- Structured logging and monitoring
- Graceful shutdown patterns
- Zero-downtime deployments

**Installation**:
```bash
# Basic Express
npm install express

# Production stack
npm install express helmet cors express-rate-limit express-validator
npm install morgan winston compression
npm install dotenv

# Development tools
npm install -D nodemon supertest jest

# Optional: Database and auth
npm install mongoose jsonwebtoken bcrypt
```

## When to Use This Skill

Use this comprehensive Express skill when:
- Building production REST APIs
- Creating microservices architectures
- Implementing secure web applications
- Need flexible middleware composition
- Require comprehensive error handling
- Building systems requiring extensive testing
- Deploying high-availability services
````
END THIRD-PARTY FILE 31cef7b1e77ff4a7

The third-party file has ended. Everything between the 31cef7b1e77ff4a7 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2557 of 49762 bytes. © bobmatnyc · MIT · https://github.com/bobmatnyc/claude-mpm-skills/tree/HEAD/toolchains/javascript/frameworks/express-production/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
