Agent skill

Express

by blencorp in blencorp/claude-code-kit

Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs.

MITAuto-check passed

Install Express

skills CLI
$ npx skills add blencorp/claude-code-kit --skill express -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install blencorp/claude-code-kit express --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/blencorp/claude-code-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli/kits/express/skills/express .claude/skills/express && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
express
GitHub stars
106
Token cost
~2.7k tokens
SKILL.md length
238 words
Files
2
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs.

  • Works in 3 steps: Business Logic in Routes → Wrong Middleware Order → No Error Handling
  • Working with Express routes
  • SKILL.md covers Purpose, When to Use This Skill, Clean Route Pattern and BaseController Pattern, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Express is an agent skill from blencorp/claude-code-kit. Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs. Use when working with Express routes, middleware, or Express applications.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `skill-rules-fragment.json`).

It works with Express. The repository describes itself as: Claude Code infrastructure with auto-activating skills and framework-specific kits. Install complete Claude Code infrastructure in 30 seconds with automatic framework detection… The licence is MIT.

When your agent uses it

  • Working with Express routes
  • Express applications

Example prompts

  • “/express”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Business Logic in Routes
  2. Wrong Middleware Order
  3. No Error Handling

What it can do on your machine

Read from SKILL.md and the folder at commit d1b17ed. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Express loads about 2.7k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 238 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from blencorp/claude-code-kit at commit d1b17ed, republished under its MIT licence (© blencorp). 238 words, ~2,657 tokens.

Download SKILL.mdSave it as .claude/skills/express/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
express
description
Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs. Use when working with Express routes, middleware, or Express applications.

Express.js Framework Patterns

Purpose

Essential Express.js patterns for building scalable backend APIs, emphasizing clean routing, middleware composition, and proper request/response handling.

When to Use This Skill

  • Creating or modifying Express routes
  • Building middleware (auth, validation, error handling)
  • Working with Express Request/Response objects
  • Implementing BaseController pattern
  • Error handling in Express

Clean Route Pattern

Routes Only Route

Routes should ONLY:

  • ✅ Define route paths
  • ✅ Register middleware
  • ✅ Delegate to controllers

Routes should NEVER:

  • ❌ Contain business logic
  • ❌ Access database directly
  • ❌ Implement validation logic
  • ❌ Format complex responses
typescript
import { Router } from 'express';
import { UserController } from '../controllers/UserController';
import { SSOMiddlewareClient } from '../middleware/SSOMiddleware';

const router = Router();
const controller = new UserController();

// Clean delegation - no business logic
router.get('/:id',
    SSOMiddlewareClient.verifyLoginStatus,
    async (req, res) => controller.getUser(req, res)
);

router.post('/',
    SSOMiddlewareClient.verifyLoginStatus,
    async (req, res) => controller.createUser(req, res)
);

export default router;

BaseController Pattern

Implementation
typescript
import * as Sentry from '@sentry/node';
import { Response } from 'express';

export abstract class BaseController {
    protected handleError(
        error: unknown,
        res: Response,
        context: string,
        statusCode = 500
    ): void {
        Sentry.withScope((scope) => {
            scope.setTag('controller', this.constructor.name);
            scope.setTag('operation', context);
            Sentry.captureException(error);
        });

        res.status(statusCode).json({
            success: false,
            error: {
                message: error instanceof Error ? error.message : 'An error occurred',
                code: statusCode,
            },
        });
    }

    protected handleSuccess<T>(
        res: Response,
        data: T,
        message?: string,
        statusCode = 200
    ): void {
        res.status(statusCode).json({
            success: true,
            message,
            data,
        });
    }

    protected async withTransaction<T>(
        name: string,
        operation: string,
        callback: () => Promise<T>
    ): Promise<T> {
        return await Sentry.startSpan({ name, op: operation }, callback);
    }

    protected addBreadcrumb(
        message: string,
        category: string,
        data?: Record<string, any>
    ): void {
        Sentry.addBreadcrumb({ message, category, level: 'info', data });
    }
}
Using BaseController
typescript
import { Request, Response } from 'express';
import { BaseController } from './BaseController';
import { UserService } from '../services/userService';
import { createUserSchema } from '../validators/userSchemas';

export class UserController extends BaseController {
    private userService: UserService;

    constructor() {
        super();
        this.userService = new UserService();
    }

    async getUser(req: Request, res: Response): Promise<void> {
        try {
            this.addBreadcrumb('Fetching user', 'user_controller', {
                userId: req.params.id
            });

            const user = await this.userService.findById(req.params.id);

            if (!user) {
                return this.handleError(
                    new Error('User not found'),
                    res,
                    'getUser',
                    404
                );
            }

            this.handleSuccess(res, user);
        } catch (error) {
            this.handleError(error, res, 'getUser');
        }
    }

    async createUser(req: Request, res: Response): Promise<void> {
        try {
            const validated = createUserSchema.parse(req.body);

            const user = await this.withTransaction(
                'user.create',
                'db.query',
                () => this.userService.create(validated)
            );

            this.handleSuccess(res, user, 'User created successfully', 201);
        } catch (error) {
            this.handleError(error, res, 'createUser');
        }
    }
}

Middleware Patterns

Authentication
typescript
import { Request, Response, NextFunction } from 'express';
import jwt from 'jsonwebtoken';
import { config } from '../config/unifiedConfig';

export class SSOMiddlewareClient {
    static verifyLoginStatus(req: Request, res: Response, next: NextFunction): void {
        const token = req.cookies.refresh_token;

        if (!token) {
            return res.status(401).json({ error: 'Not authenticated' });
        }

        try {
            const decoded = jwt.verify(token, config.tokens.jwt);
            res.locals.claims = decoded;
            res.locals.effectiveUserId = decoded.sub;
            next();
        } catch (error) {
            res.status(401).json({ error: 'Invalid token' });
        }
    }
}
Audit with AsyncLocalStorage
typescript
import { Request, Response, NextFunction } from 'express';
import { AsyncLocalStorage } from 'async_hooks';
import { v4 as uuidv4 } from 'uuid';

export interface AuditContext {
    userId: string;
    userName?: string;
    requestId: string;
    timestamp: Date;
}

export const auditContextStorage = new AsyncLocalStorage<AuditContext>();

export function auditMiddleware(req: Request, res: Response, next: NextFunction): void {
    const context: AuditContext = {
        userId: res.locals.effectiveUserId || 'anonymous',
        userName: res.locals.claims?.preferred_username,
        timestamp: new Date(),
        requestId: req.id || uuidv4(),
    };

    auditContextStorage.run(context, () => next());
}

export function getAuditContext(): AuditContext | null {
    return auditContextStorage.getStore() || null;
}
Error Boundary
typescript
import { Request, Response, NextFunction } from 'express';
import * as Sentry from '@sentry/node';

export function errorBoundary(
    error: Error,
    req: Request,
    res: Response,
    next: NextFunction
): void {
    const statusCode = error.statusCode || 500;

    Sentry.captureException(error);

    res.status(statusCode).json({
        success: false,
        error: {
            message: error.message,
            code: error.name,
        },
    });
}

// Async wrapper
export function asyncErrorWrapper(
    handler: (req: Request, res: Response, next: NextFunction) => Promise<any>
) {
    return async (req: Request, res: Response, next: NextFunction) => {
        try {
            await handler(req, res, next);
        } catch (error) {
            next(error);
        }
    };
}

Middleware Ordering

Critical Order
typescript
import express from 'express';
import * as Sentry from '@sentry/node';

const app = express();

// 1. Sentry request handler (FIRST)
app.use(Sentry.Handlers.requestHandler());

// 2. Body/cookie parsing
app.use(express.json());
app.use(cookieParser());

// 3. Routes
app.use('/api/users', userRoutes);

// 4. Error handler (AFTER routes)
app.use(errorBoundary);

// 5. Sentry error handler (LAST)
app.use(Sentry.Handlers.errorHandler());

Rules:

  • Sentry request handler FIRST
  • Body/cookie parsers before routes
  • Error handlers AFTER all routes
  • Sentry error handler LAST

Request/Response Handling

Typed Requests
typescript
interface CreateUserRequest {
    email: string;
    name: string;
    password: string;
}

async function createUser(
    req: Request<{}, {}, CreateUserRequest>,
    res: Response
): Promise<void> {
    const { email, name, password } = req.body; // Typed
}
Response Patterns
typescript
// Success (200)
res.json({ success: true, data: user });

// Created (201)
res.status(201).json({ success: true, data: user });

// Error (400/500)
res.status(400).json({ success: false, error: { message: 'Invalid input' } });
HTTP Status Codes
CodeUse Case
200Success (GET, PUT)
201Created (POST)
204No Content (DELETE)
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Server Error

Common Mistakes

1. Business Logic in Routes
typescript
// ❌ Never do this
router.post('/submit', async (req, res) => {
    // 100+ lines of logic
    const user = await db.user.create(req.body);
    const workflow = await processWorkflow(user);
    res.json(workflow);
});

// ✅ Do this
router.post('/submit', (req, res) => controller.submit(req, res));
2. Wrong Middleware Order
typescript
// ❌ Error handler before routes
app.use(errorBoundary);
app.use('/api', routes); // Won't catch errors

// ✅ Error handler after routes
app.use('/api', routes);
app.use(errorBoundary);
3. No Error Handling
typescript
// ❌ Unhandled errors crash server
router.get('/user/:id', async (req, res) => {
    const user = await userService.get(req.params.id); // May throw
    res.json(user);
});

// ✅ Proper error handling
async getUser(req: Request, res: Response): Promise<void> {
    try {
        const user = await this.userService.get(req.params.id);
        this.handleSuccess(res, user);
    } catch (error) {
        this.handleError(error, res, 'getUser');
    }
}

Common Imports

typescript
// Express core
import express, { Request, Response, NextFunction, Router } from 'express';

// Middleware
import cookieParser from 'cookie-parser';
import cors from 'cors';

// Sentry
import * as Sentry from '@sentry/node';

// Utilities
import { AsyncLocalStorage } from 'async_hooks';

Best Practices

  1. Keep Routes Clean - Routes only route, delegate to controllers
  2. Use BaseController - Consistent error handling and response formatting
  3. Proper Middleware Order - Sentry → Parsers → Routes → Error handlers
  4. Type Everything - Use TypeScript for Request/Response types
  5. Handle All Errors - Use try-catch in controllers, error boundaries globally

Related Skills:

  • nodejs - Core Node.js patterns and async handling
  • backend-dev-guidelines - Complete backend architecture guide
  • prisma - Database patterns with Prisma ORM

© blencorp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in cli/kits/express/skills/express of blencorp/claude-code-kit.

  • SKILL.md
  • skill-rules-fragment.json

Open the folder on GitHubat commit d1b17ed

Compare with similar skills

Express next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Express compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Express this skillblencorp/claude-code-kit106—~2.7kAutomated safety check: PassMIT
Validator Dependency Upgradeexpress-validator/express-validator6.2k—~1.2kAutomated safety check: PassMIT
API Generatinghuangjia2019/claude-code-engineering1.1k1 repos~426Automated safety check: PassNone
Close The Looppietheinstrengholt/rssmonster564—~2kAutomated safety check: PassMIT
Nodejs Express Serverever-works/ever-works158—~965Automated safety check: PassAGPL-3.0
Rssmonster Browserpietheinstrengholt/rssmonster564—~3.4kAutomated safety check: PassMIT

Similar skills

  • Validator Dependency Upgrade

    express-validator/express-validator

    Walks maintainers through bumping the pinned validator package in express-validator and syncing chain types, implementations and options with the new release.

    6.2k GitHub stars~1.2k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • API Generating

    huangjia2019/claude-code-engineering

    Generate API endpoint documentation from Express route files.

    1.1k GitHub starsUsed in 1 repo~426 tokens
    DevelopmentAuto-check passed
  • Close The Loop

    pietheinstrengholt/rssmonster

    A skill your agent uses when a feature has already gone through multiple implementation and review cycles and the work is starting to loop.

    564 GitHub stars~2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Nodejs Express Server

    ever-works/ever-works

    Build production-ready Express.js servers with middleware, authentication, routing, and database integration.

    158 GitHub stars~965 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Rssmonster Browser

    pietheinstrengholt/rssmonster

    Use Codex browser capabilities to inspect and validate the RSSMonster UI in a real browser.

    564 GitHub stars~3.4k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Final Review

    pietheinstrengholt/rssmonster

    Perform a rigorous final review of an implementation before considering it ready to merge or ship.

    564 GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check passed

More from blencorp/claude-code-kit

All 11 skills in this repo
  • Mui

    blencorp/claude-code-kit

    Material-UI v7 component library patterns including sx prop styling, theme integration, responsive design, and MUI-specific hooks.

    106 GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed
  • Nextjs

    blencorp/claude-code-kit

    Next.js 15+ App Router development patterns including Server Components, Client Components, data fetching, layouts, and server actions.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    Auto-check passed
  • Nodejs

    blencorp/claude-code-kit

    Core Node.js backend patterns for TypeScript applications including async/await error handling, middleware concepts, configuration management, testing strategies, and layered architecture principles.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    Auto-check passed
  • Prisma

    blencorp/claude-code-kit

    Prisma ORM patterns including Prisma Client usage, queries, mutations, relations, transactions, and schema management.

    106 GitHub stars~2.7k tokensUpdated 10 mo ago
    Auto-check passed
  • React

    blencorp/claude-code-kit

    Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization.

    106 GitHub stars~2.5k tokensUpdated 10 mo ago
    Auto-check passed
  • Shadcn

    blencorp/claude-code-kit

    shadcn/ui component library patterns with Radix UI primitives and Tailwind CSS.

    106 GitHub stars~3.2k tokensUpdated 10 mo ago
    Auto-check passed

Works with

Questions about Express

What does Express do?

Express.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs. Express is an agent skill from blencorp/claude-code-kit.js framework patterns including routing, middleware, request/response handling, and Express-specific APIs.

When should I use Express?

Express fits situations like: working with Express routes; express applications.

How do I install Express in Claude Code?

Run `npx skills add blencorp/claude-code-kit --skill express -a claude-code`. Or copy the skill folder (cli/kits/express/skills/express in blencorp/claude-code-kit) into .claude/skills/express in your project. Claude Code loads it when a task matches its description.

How do I install Express in Codex?

Run `npx skills add blencorp/claude-code-kit --skill express -a codex`. Or copy the skill folder (cli/kits/express/skills/express in blencorp/claude-code-kit) into .agents/skills/express in your project. Codex loads it when a task matches its description.

Can I use Express in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add blencorp/claude-code-kit --skill express -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/express, .gemini/skills/express, .github/skills/express and .opencode/skills/express in your project.

What does Express need to run?

SKILL.md names no scripts, command-line tools or credentials: Express is instructions for the agent only. Our summary lists: Node.js.

Does Express access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Express safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Express use?

Express is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Express use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Express?

Skills that share tags, products or a category with Express: Validator Dependency Upgrade (express-validator/express-validator, 6.2k stars), API Generating (huangjia2019/claude-code-engineering, 1.1k stars), Close The Loop (pietheinstrengholt/rssmonster, 564 stars) and Nodejs Express Server (ever-works/ever-works, 158 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Express?

blencorp (a GitHub organization) maintains it in blencorp/claude-code-kit, which has 106 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on November 28, 2025.

Source: blencorp/claude-code-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.