Sponsor Suno AI Music arrow_forward
Slash Command

Build Api Gateway

Build production-ready API gateway with intelligent routing, authentication,

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026
Version
2.0.0

What Build Api Gateway is

Build Api Gateway is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Build Api Gateway gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Build Api Gateway

Claude Code

  1. Download build-api-gateway.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/api-development/api-gateway-builder/commands/build-api-gateway.md, shared under the repository's MIT license. Read the full file on GitHub.

Creates enterprise-grade API gateway infrastructure that serves as the single entry point for all microservices. Implements intelligent request routing, authentication, rate limiting, load balancing, and response transformation. Supports Kong, Express Gateway, AWS API Gateway, and custom implementations.

When to Use

Use this command when:

  • Managing multiple microservices behind a unified API
  • Implementing cross-cutting concerns (auth, logging, rate limiting)
  • Needing request/response transformation between clients and services
  • Requiring API composition from multiple backend services
  • Implementing API versioning and backward compatibility
  • Building for multi-tenant SaaS applications
  • Enforcing consistent security policies across services

Do NOT use this command for:

  • Simple monolithic applications with single API
  • Internal service-to-service communication (use service mesh instead)
  • Applications with only one or two endpoints
  • Purely static content serving

Prerequisites

Before running this command, ensure:

  • Microservice architecture is defined
  • Service discovery mechanism is available
  • Authentication strategy is determined
  • Rate limiting requirements are specified
  • Monitoring infrastructure is ready

Process

Step 1: Analyze Architecture Requirements

The command examines your system architecture:

  • Maps all backend services and their endpoints
  • Identifies authentication and authorization needs
  • Determines rate limiting and throttling requirements
  • Analyzes request/response transformation needs
  • Plans for high availability and failover

Step 2: Generate Gateway Configuration

Creates comprehensive gateway setup:

  • Route definitions with path matching
  • Authentication middleware integration
  • Rate limiting rules per client/endpoint
  • Request/response transformation pipelines
  • Circuit breaker configurations

Step 3: Implement Middleware Stack

Builds layered middleware architecture:

  • CORS handling and preflight requests
  • JWT validation and OAuth2 integration
  • Request logging and metrics collection
  • Response caching strategies
  • Error handling and formatting

Step 4: Configure Load Balancing

Sets up intelligent traffic distribution:

  • Round-robin, least connections, or weighted routing
  • Health checking and automatic failover
  • Sticky sessions when required
  • Geographic routing for multi-region
  • A/B testing and canary deployments

Step 5: Deploy Monitoring & Analytics

Integrates comprehensive observability:

  • Request/response logging
  • Performance metrics and tracing
  • Error rate monitoring
  • API usage analytics
  • Real-time dashboards

Output Format

The command generates complete gateway infrastructure:

api-gateway/
├── src/
│   ├── gateway/
│   │   ├── server.js
│   │   ├── routes/
│   │   │   ├── router.js
│   │   │   └── service-registry.js
│   │   ├── middleware/
│   │   │   ├── authentication.js
│   │   │   ├── rate-limiter.js
│   │   │   ├── transformer.js
│   │   │   └── circuit-breaker.js
│   │   └── plugins/
│   │       ├── logging.js
│   │       └── monitoring.js
│   ├── config/
│   │   ├── gateway.config.js
│   │   ├── services.json
…

Examples

Example 1: Express Gateway with JWT Authentication

Scenario: Microservices gateway with JWT auth and rate limiting

Generated Express Gateway Implementation:

// gateway/server.js
import express from 'express';
import httpProxy from 'http-proxy-middleware';
import jwt from 'jsonwebtoken';
import rateLimit from 'express-rate-limit';
import CircuitBreaker from 'opossum';

class APIGateway {
  constructor(config) {
    this.app = express();
    this.services = config.services;
    this.setupMiddleware();
    this.setupRoutes();
    this.setupErrorHandling();
  }

  setupMiddleware() {
    // CORS configuration
…

Example 2: Kong Gateway Configuration

Scenario: Enterprise Kong gateway with plugins

Generated Kong Configuration:

# kong.yml
_format_version: "2.1"

services:
  - name: user-service
    url: http://user-service:3001
    routes:
      - name: user-routes
        paths:
          - /api/users
        strip_path: false
        methods:
          - GET
          - POST
          - PUT
          - DELETE
    plugins:
      - name: jwt
…

Example 3: API Composition and Response Aggregation

Scenario: Gateway that combines multiple service responses

Generated API Composition:

// gateway/api-composer.js
class APIComposer {
  async composeUserProfile(userId, req) {
    // Parallel requests to multiple services
    const [user, orders, preferences, recommendations] = await Promise.allSettled([
      this.fetchUser(userId, req.headers),
      this.fetchUserOrders(userId, req.headers),
      this.fetchUserPreferences(userId, req.headers),
      this.fetchRecommendations(userId, req.headers)
    ]);

    // Compose response with error handling
    const profile = {
      user: user.status === 'fulfilled' ? user.value : null,
      orders: orders.status === 'fulfilled' ? orders.value : [],
      preferences: preferences.status === 'fulfilled' ? preferences.value : {},
      recommendations: recommendations.status === 'fulfilled' ? recommendations.value : []
    };
…

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Build Api Gateway?

Build Api Gateway is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Build production-ready API gateway with intelligent routing, authentication,

How do I install Build Api Gateway in Claude Code?

Download build-api-gateway.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Build Api Gateway in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Build Api Gateway safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.