Skills nodejs-backend-patterns
🟢

nodejs-backend-patterns

Safe 🌐 Network access⚡ Contains scripts⚙️ External commands📁 Filesystem access🔑 Env variables

Build production Node.js backends

Creating Node.js backend services requires understanding middleware patterns, authentication flows, and database integration. This skill provides ready-to-use code patterns and architectural guidance for Express and Fastify frameworks.

Supports: Claude Codex Code(CC)
⚠️ 68 Poor
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "nodejs-backend-patterns". Create an Express server with authentication and rate limiting

Expected outcome:

  • Server setup with helmet security, cors configuration, and compression middleware
  • Rate limiting using express-rate-limit with Redis store for distributed environments
  • JWT authentication middleware that validates tokens and handles unauthorized errors
  • Request logging middleware using pino for structured logging

Using "nodejs-backend-patterns". Show me how to structure a Node.js backend with layered architecture

Expected outcome:

  • Controllers handle HTTP requests and responses
  • Services contain business logic and validation
  • Repositories manage data access and database operations
  • Middleware provides cross-cutting concerns like auth and logging

Using "nodejs-backend-patterns". How do I connect to PostgreSQL in Node.js with TypeScript?

Expected outcome:

  • Use pg library with connection pool for efficient database connections
  • Implement repository pattern to abstract database operations
  • Use parameterized queries to prevent SQL injection
  • Handle transactions for atomic operations across multiple queries

Security Audit

Safe
v4 • 1/17/2026

Pure documentation skill containing code examples and architectural patterns for Node.js backend development. No executable code, no file system access, no network calls, no system command execution. All content is static documentation meant for user reference. Static findings are false positives triggered by example code patterns.

2
Files scanned
1,198
Lines analyzed
5
findings
4
Total audits

Risk Factors

🌐 Network access (6)
⚡ Contains scripts (1)
⚙️ External commands (47)
📁 Filesystem access (11)
🔑 Env variables (50)
Audited by: claude View Audit History →

Quality Score

38
Architecture
100
Maintainability
87
Content
22
Community
100
Security
78
Spec Compliance

What You Can Build

Build REST APIs

Create scalable REST APIs with proper middleware, validation, and error handling using Express or Fastify

Design backend architecture

Implement layered architecture with controllers, services, repositories, and dependency injection patterns

Set up authentication

Configure JWT authentication, role-based authorization, and secure password handling with bcrypt

Try These Prompts

Server Setup
Show me how to set up an Express.js server with helmet, cors, compression, and request logging middleware
Auth Middleware
Create JWT authentication middleware for Express that validates Bearer tokens and attaches user to request
Database Pattern
Show the repository pattern for PostgreSQL with connection pooling, transaction support, and CRUD operations
Error Handling
Create a global error handler for Express with custom error classes and proper HTTP status codes

Best Practices

  • Use TypeScript for type safety and to prevent runtime errors in production backends
  • Implement proper error handling with custom error classes and global error handlers
  • Validate all input using Zod or Joi schemas before processing in business logic

Avoid

  • Hardcoding secrets or credentials directly in source code instead of using environment variables
  • Using synchronous methods or blocking operations that degrade server performance
  • Returning detailed error messages in production that expose internal implementation details

Frequently Asked Questions

What Node.js frameworks are supported?
This skill covers Express.js and Fastify with TypeScript. Both frameworks have extensive examples for routes, middleware, and plugins.
What are the recommended database patterns?
PostgreSQL with pg connection pool and MongoDB with Mongoose ODM are covered with repository patterns and transaction support.
How does this skill integrate with other tools?
Patterns are framework-agnostic in structure. JWT, bcrypt, and Redis patterns work with any Node.js backend framework.
Is my data safe when using this skill?
Yes. This skill is pure documentation. No code is executed, no files are accessed, and no data leaves your environment.
Why are my API routes not working?
Check that middleware order is correct, validation schemas match request structure, and error handlers are registered last.
How is this different from other backend skills?
This skill focuses on production patterns including layered architecture, dependency injection, and enterprise error handling patterns.

Developer Details

File structure

📄 SKILL.md