All skills
wshobson avatar

/nodejs-backend-patterns

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

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.

Use this Skill: https://skilld.dev/gh/wshobson/agents/nodejs-backend-patterns

This session only. Nothing lands on disk.

SKILL.md

≈77 tokens always: the name and description. ≈415 when used: this file. ≈6.1k more on demand in 2 files.

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.

Source: SKILL.md on GitHub

No alerts2d5 checks · Risk SAFE
  • Gen Agent Trust Hub2d

    This skill provides secure and production-ready architectural patterns for Node.js backend development, following industry best practices for security and scalability.

  • Socket2d

    No alerts

  • Snyk2d

    Risk: LOW · No issues

  • Runlayer6mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    1 finding · Score: 82/100

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • TypeScript
  • nodejs
  • express
  • fastify
  • rest-api
  • graphql
  • microservices
  • authentication
  • middleware
  • error-handling

README badge

README badge for wshobson/agents/nodejs-backend-patterns

Provides patterns and best practices for building production Node.js backends with Express or Fastify, covering middleware, error handling, authentication, database integration, and API design. Use when creating REST APIs, GraphQL servers, microservices, or real-time applications with WebSockets.

Generated from the current SKILL.md.

Does this skill cover both Express and Fastify?
Yes. The skill provides patterns for building Node.js backends with Express or Fastify, including middleware, error handling, and API design for both frameworks.
What databases does this skill support?
Both SQL and NoSQL databases. The skill covers database integration patterns without being tied to a specific database or ORM.
Does this include authentication and authorization patterns?
Yes. Implementing authentication and authorization is listed as a core pattern covered by the skill.
Should I use TypeScript with this skill?
The skill recommends TypeScript as a best practice for type safety, but it is not a hard requirement—patterns can be applied in JavaScript.
Does this cover testing patterns?
The skill references a separate `javascript-testing-patterns` skill for comprehensive testing guidance and defers to that for unit, integration, and E2E test patterns.

Generated from the current SKILL.md. These answers refresh after source changes.