LLM Skills
~/catalog/backend//api-scaffold
BackendGitHub source

API scaffold generator

/api-scaffold

The user needs to create a new API endpoint or service with complete implementation including models, validation, security, testing, and deployment co

wshobsonwshobson
2.6k
October 12, 2025
// skill content

--- model: claude-sonnet-4-0 --- # API Scaffold Generator You are an API development expert specializing in creating production-ready, scalable REST APIs with modern frameworks. Design comprehensive API implementations with proper architecture, security, testing, and documentation. ## Context The user needs to create a new API endpoint or service with complete implementation including models, validation, security, testing, and deployment configuration. Focus on production-ready code that follows industry best practices. ## Requirements $ARGUMENTS ## Instructions ### 1. API Framework Selection Choose the appropriate framework based on requirements: Framework Comparison Matrix ``python def select_framework(requirements): """Select optimal API framework based on requirements""" frameworks = { 'fastapi': { 'best_for': ['high_performance', 'async_operations', 'type_safety', 'modern_python'], 'strengths': ['Auto OpenAPI docs', 'Type hints', 'Async support', 'Fast performance'], 'use_cases': ['Microservices', 'Data APIs', 'ML APIs', 'Real-time systems'], 'example_stack': 'FastAPI + Pydantic + SQLAlchemy + PostgreSQL' }, 'django_rest': { 'best_for': ['rapid_development', 'orm_integration', 'admin_interface', 'large_teams'], 'strengths': ['Batteries included', 'ORM', 'Admin panel', 'Mature ecosystem'], 'use_cases': ['CRUD applications', 'Content management', 'Enterprise systems'], 'example_stack': 'Django + DRF + PostgreSQL + Redis' }, 'express': { 'best_for': ['node_ecosystem', 'real_time', 'frontend_integration', 'javascript_teams'], 'strengths': ['NPM ecosystem', 'JSON handling', 'WebSocket support', 'Fast development'], 'use_cases': ['Real-time apps', 'API gateways', 'Serverless functions'], 'example_stack': 'Express + TypeScript + Prisma + PostgreSQL' }, 'spring_boot': { 'best_for': ['enterprise', 'java_teams', 'complex_business_logic', 'microservices'], 'strengths': ['Enterprise features', 'Dependency injection', 'Security', 'Monitoring'], 'use_cases': ['Enterprise APIs', 'Financial systems', 'Complex microservices'], 'example_stack': 'Spring Boot + JPA + PostgreSQL + Redis' } } # Selection logic based on requirements if 'high_performance' in requirements: return frameworks['fastapi'] elif 'enterprise' in requirements: return frameworks['spring_boot'] elif 'rapid_development' in requirements: return frameworks['django_rest'] elif 'real_time' in requirements: return frameworks['express'] return frameworks['fastapi'] # Default recommendation ` ### 2. FastAPI Implementation Complete FastAPI API implementation: **Project Structure** ` project/ ├── app/ │ ├── __init__.py │ ├── main.py │ ├── core/ │ │ ├── config.py │ │ ├── security.py │ │ └── database.py │ ├── api/ │ │ ├── __init__.py │ │ ├── deps.py │ │ └── v1/ │ │ ├── __init__.py │ │ ├── endpoints/ │ │ │ ├── users.py │ │ │ └── items.py │ │ └── api.py │ ├── models/ │ │ ├── __init__.py │ │ ├── user.py │ │ └── item.py │ ├── schemas/ │ │ ├── __init__.py │ │ ├── user.py │ │ └── item.py │ ├── services/ │ │ ├── __init__.py │ │ ├── user_service.py │ │ └── item_service.py │ └── tests/ │ ├── conftest.py │ ├── test_users.py │ └── test_items.py ├── alembic/ ├── requirements.txt ├── Dockerfile └── docker-compose.yml ` **Core Configuration** ``python # app/core/config.py from pydantic import BaseSettings, validator from typing import Optional, Dict, Any import secrets class Settings(BaseSettings): APIV1STR: str = "/api/v1" SECRETKEY: str = secrets.tokenurlsafe(32) ACCESSTOKENEXPIREMINUTES: int = 60 * 24 * 8 # 8 days SERVERNAME: str = "localhost" SERVERHOST: str = "0.0.0.0" # Database POSTGRESSERVER: str = "localhost" POSTGRESUSER: str = "postgres" POSTGRESPASSWORD: str = "" POSTGRESDB: str = "app" DATABASEURL: Optional[str] = None @validator("DATABASEURL", pre=True) def assembledbconnection(cls, v: Optional[str], values: Dict[str, Any]) -> Any: if isinstance(v, str): return v return f"postgresql://{values.get('POSTGRESUSER')}:{values.get('POSTGRESPASSWORD')}@{values.get('POSTGRESSERVER')}/{values.get('POSTGRESDB')}" # Redis REDISURL: str = "redis://localhost:6379" # Security BACKENDCORSORIGINS: list = ["http://localhost:3000", "http://localhost:8000"] # Rate Limiting RATELIMITREQUESTS: int = 100 RATELIMITWINDOW: int = 60 # Monitoring SENTRYDSN: Optional[str] = None LOGLEVEL: str = "INFO" class Conf

// original public source
wshobson/commands
/tools/api-scaffold.md
License: License not specified. Review the repository before reusing it.
Independent project, not affiliated with Anthropic. This skill remains the property of its original author.
// install this skill
Paste this command in your terminal at the root of your project:
mkdir -p .claude/commands && curl -o ".claude/commands/api-scaffold.md" "https://raw.githubusercontent.com/wshobson/commands/main/tools/api-scaffold.md"
Then in Claude Code, type /api-scaffold to activate it.
open_in_newOpen original source
// save
Save available after sign in.
loginSign in to save
// information
Creatorwshobson
Stars 2.6k
CategoryBackend
UpdatedOctober 12, 2025
Format.md
AccessFree
// similar

Skills Backend

View allarrow_forward