PluginBench
Skill
Pass
Audit score 90

nodejs-backend-patterns

wshobson/agents

Build production-ready Node.js backends with Express/Fastify, middleware patterns, auth, and database integration.

What is nodejs-backend-patterns?

Comprehensive guidance for building scalable, maintainable Node.js backend applications. Covers REST APIs, GraphQL servers, microservices, authentication, error handling, database integration, and modern architectural patterns. Use when creating Node.js servers, APIs, or microservices architectures.

  • Implement middleware patterns and error handling strategies
  • Set up authentication and authorization flows
  • Design REST APIs and GraphQL backends
  • Integrate SQL and NoSQL databases with connection pooling
  • Build microservices architectures
  • Implement real-time features with WebSockets

How to install nodejs-backend-patterns

npx skills add https://github.com/wshobson/agents --skill nodejs-backend-patterns
Claude Code
Cursor
Windsurf
Cline

How to use nodejs-backend-patterns

  1. 1.Review the best practices section for foundational patterns
  2. 2.Consult references/details.md for in-depth pattern documentation
  3. 3.Choose your framework (Express or Fastify) based on performance needs
  4. 4.Implement TypeScript for type safety in your codebase
  5. 5.Set up environment variables for configuration management
  6. 6.Configure structured logging using Pino or Winston
  7. 7.Implement input validation with Zod or Joi
  8. 8.Add authentication and authorization middleware

Use cases

Good for
  • Building REST APIs with Express or Fastify frameworks
  • Creating GraphQL servers with proper schema design
  • Implementing microservices with inter-service communication
  • Setting up authentication systems with JWT or session-based approaches
  • Designing scalable database architectures with proper pooling
Who it's for
  • Backend developers building Node.js services
  • Full-stack developers creating server-side logic
  • DevOps engineers designing microservices architectures
  • Teams building production-grade APIs
  • Developers transitioning to Node.js from other platforms

nodejs-backend-patterns FAQ

Should I use Express or Fastify?

Both are production-ready. Express has larger ecosystem and community; Fastify offers better performance and modern defaults. Choose based on your performance requirements and team familiarity.

How do I handle errors properly?

Use custom error classes, implement centralized error handling middleware, log errors with context, and return appropriate HTTP status codes. Never expose internal error details to clients.

What's the recommended authentication approach?

Use JWT for stateless APIs and microservices, or session-based auth for traditional web apps. Always use HTTPS in production and never hardcode secrets.

How should I structure my database connections?

Use connection pooling to manage database connections efficiently. Configure pool size based on expected concurrent requests and database limits.

Where can I find detailed pattern examples?

Detailed pattern documentation and worked examples are in the references/details.md file included with this skill.

Full instructions (SKILL.md)

Source of truth, from wshobson/agents.


name: nodejs-backend-patterns description: Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.

Node.js Backend Patterns

Comprehensive guidance for building scalable, maintainable, and production-ready Node.js backend applications with modern frameworks, architectural patterns, and best practices.

When to Use This Skill

  • Building REST APIs or GraphQL servers
  • Creating microservices with Node.js
  • Implementing authentication and authorization
  • Designing scalable backend architectures
  • Setting up middleware and error handling
  • Integrating databases (SQL and NoSQL)
  • Building real-time applications with WebSockets
  • Implementing background job processing

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Use TypeScript: Type safety prevents runtime errors
  2. Implement proper error handling: Use custom error classes
  3. Validate input: Use libraries like Zod or Joi
  4. Use environment variables: Never hardcode secrets
  5. Implement logging: Use structured logging (Pino, Winston)
  6. Add rate limiting: Prevent abuse
  7. Use HTTPS: Always in production
  8. Implement CORS properly: Don't use * in production
  9. Use dependency injection: Easier testing and maintenance
  10. Write tests: Unit, integration, and E2E tests
  11. Handle graceful shutdown: Clean up resources
  12. Use connection pooling: For databases
  13. Implement health checks: For monitoring
  14. Use compression: Reduce response size
  15. Monitor performance: Use APM tools

Testing Patterns

See javascript-testing-patterns skill for comprehensive testing guidance.