Skip to main content
command

design-rest-api — Claude Code command: what it does, how to install

Designs RESTful API architectures, endpoints, authentication flows, and OpenAPI documentation directly from project code.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command setup/design-rest-api
Open on GitHub

What design-rest-api does

The command inspects project dependencies in package.json or requirements.txt to recognize frameworks like Express, FastAPI, or Spring Boot. Using Bash grep checks across src/, it counts existing routes, session or JWT handlers, and inspects files like swagger.yaml or openapi.json.

It then outlines resource endpoints, HTTP methods, data validation, status codes, and security mechanisms such as RBAC, OAuth, or rate limiting. You can pass target parameters directly, choosing between --v1, --v2, --graphql-hybrid, or --openapi.

Without a src/ directory, automated endpoint detection returns zero matches, requiring manual path adjustments. The resulting output delivers API specifications, error-handling conventions, and documentation.

What it helps with

  • outline REST endpoints and URL resource hierarchies
  • define request validation and response models
  • configure authentication schemes using JWT, OAuth, or RBAC
  • generate OpenAPI and Swagger documentation specifications

Example prompts for the agent

  • /design-rest-api --openapi
  • /design-rest-api --v1
  • /design-rest-api --graphql-hybrid

How to install design-rest-api

1claude-code-templates

npx claude-code-templates@latest --command setup/design-rest-api

2Manually: put the files in place

.claude/commands/design-rest-api.md

Call it with /design-rest-api. For all projects use ~/.claude/commands/

Questions about design-rest-api

How to install design-rest-api in Claude Code?

Run npx claude-code-templates@latest --command setup/design-rest-api in your terminal or place the file directly at .claude/commands/design-rest-api.md.

What does design-rest-api do?

It evaluates existing project code to architect RESTful endpoints, data validation schemas, auth controls, and API documentation.

What arguments can you pass to design-rest-api?

You can supply an explicit version or use flags like --v1, --v2, --graphql-hybrid, and --openapi.

Source text

design-rest-api.md · MIT
---
allowed-tools: Read, Write, Edit, Bash
argument-hint: "[api-version] | --v1 | --v2 | --graphql-hybrid | --openapi"
description: Design RESTful API architecture with comprehensive endpoints, authentication, and documentation
---

# Design REST API

Design comprehensive RESTful API architecture: **$ARGUMENTS**

## Current Application State

- Framework detection: @package.json or @requirements.txt (Express, FastAPI, Spring Boot, etc.)
- Existing API: !`grep -r "route\|endpoint\|@app\\.route" src/ 2>/dev/null | wc -l` routes found
- Authentication: !`grep -r "auth\|jwt\|session" src/ 2>/dev/null | wc -l` auth components
- Documentation: @swagger.yaml or @openapi.json (if exists)

## Task

Design complete RESTful API with industry best practices and comprehensive functionality:

**API Version**: Use $ARGUMENTS to specify API version, GraphQL hybrid approach, or OpenAPI specification

**API Architecture**:
1. **Resource Design** - RESTful endpoints, HTTP methods, URL structure, resource relationships
2. **Request/Response Models** - Data validation, serialization, error handling, status codes
3. **Authentication & Authorization** - JWT, OAuth, RBAC, API keys, rate limiting
4. **API Documentation** - OpenAPI/Swagger specs, interactive documentation, code examples
5. **Versioning Strategy** - URL, header, or content-type based versioning
6. **Performance & Security** - Caching, pagination, CORS, input validation, SQL injection prevention

**Advanced Features**: Real-time capabilities, file uploads, batch operations, webhooks, and monitoring integration.

**Standards Compliance**: Follow REST principles, HTTP specifications, and API design best practices.

**Output**: Complete API specification with endpoints, authentication, validation, documentation, and client SDKs.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Backend and APIs →

From the same set238

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor