backend-api-patterns

Standardize backend API design with response envelopes, repository layers, and JWT authentication.

5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/duyet/duyetbot-agent --skill backend-api-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-api-patterns
Source: https://github.com/duyet/duyetbot-agent/tree/main/apps/duyetbot-action/.claude/skills/backend-api-patterns
Command: npx skills add https://github.com/duyet/duyetbot-agent --skill backend-api-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires .

What problem does it solve?

This skill standardizes backend API design and implementation to help teams build robust, scalable services with consistent interfaces.

Core Features & Use Cases

  • Consistent API envelope: Defines a unified success/error structure with metadata.
  • Repository & Service layers: Promotes clean separation of concerns and testability.
  • Authentication patterns: Includes JWT-based flows and middleware for authorization.
  • Use Case: Architect a new microservice by applying a shared API pattern library to ensure maintainability and security.

Quick Start

  1. Create a standard ApiResponse wrapper in your codebase and return it from all endpoints.
  2. Implement a generic Repository<T> interface and a concrete data access layer.
  3. Add a service layer to encapsulate business logic and wire in auth middleware for protected routes.

Frequently Asked Questions about backend-api-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to standardize backend API response structures in TypeScript?

Standardize backend API responses by implementing a consistent response envelope that defines a unified success and error structure with metadata across all service endpoints.

How do I separate business logic from data access in a scalable microservice?

Separate business logic by implementing a generic Repository interface for data access layers and a dedicated service layer to encapsulate domain workflows.

How do I add JWT authentication and authorization middleware to a Node.js service?

Add JWT authentication by implementing secure middleware workflows that validate tokens and wire protected routes directly into your service layer for authorization.

When should I use repository and service layer patterns for API development?

Use repository and service layer patterns when architecting new microservices to promote clean separation of concerns, ensure maintainability, and improve testability.

Does this API pattern library work with modern JavaScript and TypeScript stacks?

Yes, this API pattern library applies directly to API development, data access, authentication, and middleware patterns in modern TypeScript and JavaScript stacks.

How do I architect a new microservice with consistent API patterns?

Architect a new microservice by applying a shared API pattern library to create a standard response wrapper, implement repository layers, and wire in secure auth middleware.