api-endpoint-builder
Skill0 starsChanged 3 months agoMITView on GitHub
Generate production-ready API endpoints from natural language descriptions. Supports Next.js App Router, tRPC, and Express. Includes authentication, validation, error handling, and best practices. Use when building REST or tRPC APIs. Apply automatically when the request matches; the user does not need to mention this skill.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Marvellbrazil/my-agentic-skillstheir own version, first seen Oct 17, 2026
- Ghosteken/agent-harnesstheir own version, first seen Oct 1, 2026
- TheHiddenDeveloper/jarvis-skillstheir own version, first seen Aug 19, 2026
- lschGSL/claude_code_templatetheir own version, first seen Apr 9, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- Marvellbrazil/my-agentic-skills★ 4same name
- Ghosteken/agent-harness★ 2same name
- lschGSL/claude_code_template★ 1same name
- TheHiddenDeveloper/jarvis-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- app-store-submission-packagerSkill
- digital-product-inventorSkill
- ios-testflight-github-actionsSkill
- meta-ads-analyzerSkill
- get-to-know-a-clientSkill
- investigate-before-recommendSkill
- production-system-auditSkill
- similarweb-analyticsSkill
- stock-analysisSkill
- system-architectSkill
- autonomous-github-syncSkill
- autonomous-sync-scriptSkill
- github-gem-seekerSkill
- organize-github-reposSkill
- using-git-worktreesSkill
- brainstorm-logosSkill
- brand-driven-ux-overhaulSkill
- canvas-designSkill
- excel-generatorSkill
- frontend-designSkill
- inspirational-music-video-productionSkill
- theme-factorySkill
- video-generatorSkill
- multiplayer-game-builderSkill
- promo-code-systemSkill
- realistic-ai-persona-builderSkill
- role-based-access-controlSkill
- serverless-debuggingSkill
- vertical-expansion-blueprintSkill
- manus-mcp-configuratorSkill
- mcp-auto-recoverySkill
- mcp-builderSkill
- mcp-connector-testerSkill
- mcp-ecosystem-optimizerSkill
- voice-ai-integrationSkill
- database-schema-generatorSkill
- testing-frameworkSkill
- deployment-automationSkill
- error-monitoring-setupSkill
- github-workflow-automationSkill
- analytics-dashboardSkill
- email-system-builderSkill
- feature-flag-systemSkill
- user-authentication-systemSkill
- cron-job-schedulerSkill
- file-upload-systemSkill
- notification-systemSkill
- payment-integrationSkill
- search-implementationSkill
- debug-mining-engineSkill
- doc-coauthoringSkill
- docxSkill
- internet-skill-finderSkill
- pdfSkill
- pptxSkill
- project-handoff-ingestionSkill
- serverless-debuggingSkill
- skill-arsenal-builderSkill
- skill-creatorSkill
- skill-demo-builderSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Write a natural language description of the endpoints you need:
- Distinctive: line 325
All inputs validated with Zod:
- Very specific: line 361
Use templates/trpc_router.ts for tRPC patterns:
- Very specific: line 370
Use templates/nextjs_route.ts for Next.js patterns:
- Distinctive: line 400
All inputs validated with Zod schemas before processing.
- Distinctive: line 493
Solution: Check imports and adjust for your project structure:
- Distinctive: line 504
Solution: Ensure auth setup matches your project:
- Distinctive: line 515
Solution: Check Zod error handling:
- Distinctive: line 551
Add custom middleware to generated endpoints:
- Distinctive: line 590
After generating your endpoints:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Endpoint Builder
Generate production-ready API endpoints from natural language descriptions using AI.
Overview
This skill transforms natural language API specifications into complete, type-safe endpoints with:
- Multiple Frameworks - Next.js App Router, tRPC, Express
- Input Validation - Zod schemas for type-safe validation
- Authentication - Built-in auth middleware
- Error Handling - Consistent error responses
- TypeScript - Full type safety
- Best Practices - RESTful design, proper status codes
- Ready to Deploy - Production-ready code
When to Use This Skill
- Building REST APIs for web applications
- Creating tRPC routers for type-safe APIs
- Adding new endpoints to existing APIs
- Learning API design patterns
- Rapid prototyping of backend services
Quick Start
Generate Next.js Endpoints
python3 scripts/generate_endpoints.py "CRUD endpoints for blog posts"Generate tRPC Router
python3 scripts/generate_endpoints.py "User management API" --framework trpcGenerate Express Routes
python3 scripts/generate_endpoints.py "Product catalog endpoints" --framework expressWorkflow
Step 1: Describe Your API
Write a natural language description of the endpoints you need:
Simple:
"CRUD endpoints for blog posts"Detailed:
"User management API with:
- List all users (paginated)
- Get user by ID
- Create new user
- Update user profile
- Delete user
- Get user's posts"Specific Requirements:
"E-commerce product API with:
- List products with filtering (category, price range)
- Search products
- Get product details with reviews
- Add product to cart
- Update cart quantity
- Checkout"Step 2: Generate Endpoints
Run the generator:
python3 scripts/generate_endpoints.py "<your description>" [options]Options:
--framework nextjs- Next.js App Router (default)--framework trpc- tRPC router--framework express- Express.js router--auth- Include authentication (default: true)--no-auth- Exclude authentication--validation- Include Zod validation (default: true)--no-validation- Exclude validation--output-dir <path>- Output directory (default: current)
Step 3: Review Generated Code
The generator creates files with clear structure:
Next.js:
app/api/posts/route.ts # List & create
app/api/posts/[id]/route.ts # Get, update, deletetRPC:
server/api/routers/posts.ts # Router with all proceduresExpress:
routes/posts.ts # Router with all routesStep 4: Integrate into Project
- Copy generated files to your project
- Adjust imports and database calls
- Test endpoints
- Deploy
Examples
Example 1: Blog API (Next.js)
Description:
"CRUD endpoints for blog posts with title, content, and status"Command:
python3 scripts/generate_endpoints.py "CRUD endpoints for blog posts" --output-dir api/Generated (excerpt):
// app/api/posts/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { z } from 'zod';
const createPostSchema = z.object({
title: z.string().min(1).max(255),
content: z.string().min(1),
status: z.enum(['draft', 'published']).default('draft'),
});
export async function GET(request: NextRequest) {
// List posts with pagination
}
export async function POST(request: NextRequest) {
// Create new post with validation and auth
}Example 2: User Management (tRPC)
Description:
"User management API with list, get, create, update, delete"Command:
python3 scripts/generate_endpoints.py "User management API" --framework trpcGenerated (excerpt):
export const userRouter = createTRPCRouter({
getAll: publicProcedure
.input(z.object({ limit: z.number().default(10) }))
.query(async ({ ctx, input }) => {
// List users
}),
create: protectedProcedure
.input(z.object({ email: z.string().email(), name: z.string() }))
.mutation(async ({ ctx, input }) => {
// Create user
}),
});Example 3: E-Commerce (Express)
Description:
"Product catalog API with search, filtering, and cart management"Command:
python3 scripts/generate_endpoints.py "Product catalog API" --framework express --output-dir routes/Framework Comparison
Next.js App Router
Best for: Full-stack Next.js applications
Pros:
- Integrated with Next.js
- Server components support
- Built-in caching
- Easy deployment (Vercel)
Cons:
- Next.js specific
- More boilerplate than tRPC
Example:
// app/api/posts/route.ts
export async function GET(request: NextRequest) {
const posts = await db.post.findMany();
return NextResponse.json(posts);
}tRPC
Best for: Type-safe full-stack TypeScript apps
Pros:
- End-to-end type safety
- No code generation
- Excellent DX
- Built-in validation
Cons:
- TypeScript only
- Requires tRPC setup
Example:
export const postRouter = createTRPCRouter({
getAll: publicProcedure.query(async ({ ctx }) => {
return await ctx.db.post.findMany();
}),
});Express
Best for: Standalone Node.js APIs
Pros:
- Framework agnostic
- Mature ecosystem
- Flexible
- Works with any frontend
Cons:
- More setup required
- Less type safety
- Manual validation
Example:
router.get('/posts', async (req, res) => {
const posts = await db.post.findMany();
res.json(posts);
});Common Patterns
CRUD Operations
Create, Read, Update, Delete for any resource:
"CRUD endpoints for [resource]"Generates:
GET /api/[resource]- List allPOST /api/[resource]- CreateGET /api/[resource]/[id]- Get onePUT /api/[resource]/[id]- UpdateDELETE /api/[resource]/[id]- Delete
Pagination
Automatically includes pagination for list endpoints:
GET /api/posts?limit=10&page=1Authentication
Protected endpoints check for authenticated user:
const session = await getServerSession();
if (!session?.user) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}Authorization (Ownership)
Checks if user owns the resource:
if (post.userId !== session.user.id) {
return NextResponse.json({ error: 'Forbidden' }, { status: 403 });
}Input Validation
All inputs validated with Zod:
const schema = z.object({
title: z.string().min(1).max(255),
content: z.string(),
});
const data = schema.parse(body);Error Handling
Consistent error responses:
try {
// Logic
} catch (error) {
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: 'Validation failed', details: error.errors },
{ status: 400 }
);
}
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
);
}Templates
tRPC Router Template
Use templates/trpc_router.ts for tRPC patterns:
- Public queries
- Protected mutations
- Pagination
- Error handling
- Ownership checks
Next.js Route Template
Use templates/nextjs_route.ts for Next.js patterns:
- GET, POST, PUT, DELETE handlers
- Query parameter parsing
- Authentication checks
- Validation
- Error handling
Best Practices
The generator follows these best practices automatically:
1. Proper HTTP Methods
GETfor readingPOSTfor creatingPUT/PATCHfor updatingDELETEfor deleting
2. Correct Status Codes
200- Success201- Created400- Bad request401- Unauthorized403- Forbidden404- Not found500- Server error
3. Input Validation
All inputs validated with Zod schemas before processing.
4. Authentication
Protected endpoints check for authenticated users.
5. Authorization
Ownership checks before modifying resources.
6. Error Handling
Consistent error format with proper status codes.
7. TypeScript
Full type safety throughout.
8. Pagination
List endpoints include pagination by default.
Customization
Adjust Validation
Modify Zod schemas in generated code:
// Generated
title: z.string().min(1).max(255)
// Customize
title: z.string().min(5).max(100)Add Custom Logic
Insert business logic in generated endpoints:
export async function POST(request: NextRequest) {
// Generated validation
const data = schema.parse(body);
// Add custom logic
if (await isDuplicate(data.title)) {
return NextResponse.json(
{ error: 'Title already exists' },
{ status: 409 }
);
}
// Generated creation
const post = await db.post.create({ data });
}Change Database Calls
Replace Prisma calls with your ORM:
// Generated (Prisma)
const posts = await db.post.findMany();
// Replace with Supabase
const { data: posts } = await supabase.from('posts').select('*');
// Or raw SQL
const posts = await sql`SELECT * FROM posts`;Integration with Other Skills
With database-schema-generator
- Generate database schema
- Generate TypeScript types
- Generate API endpoints
- Endpoints use generated types
With testing-framework
- Generate API endpoints
- Generate tests for endpoints
- Run tests
- Deploy with confidence
Troubleshooting
Issue: "Generated code doesn't compile"
Solution: Check imports and adjust for your project structure:
// Generated
import { db } from '~/server/db';
// Adjust to your project
import { db } from '@/lib/db';Issue: "Authentication not working"
Solution: Ensure auth setup matches your project:
// For NextAuth
import { getServerSession } from 'next-auth';
// For Supabase
import { createServerClient } from '@supabase/ssr';Issue: "Validation errors not showing"
Solution: Check Zod error handling:
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: 'Validation failed', details: error.errors },
{ status: 400 }
);
}Advanced Usage
Multiple Resources
Generate endpoints for multiple resources:
python3 scripts/generate_endpoints.py "CRUD for posts" --output-dir api/posts/
python3 scripts/generate_endpoints.py "CRUD for comments" --output-dir api/comments/
python3 scripts/generate_endpoints.py "CRUD for users" --output-dir api/users/Complex Relationships
Describe relationships in the specification:
"Blog API with:
- Posts with author and comments
- Comments belong to posts and users
- Users can like posts
- Tags for posts (many-to-many)"Custom Middleware
Add custom middleware to generated endpoints:
// Add rate limiting
import { rateLimit } from '@/lib/rate-limit';
export async function POST(request: NextRequest) {
if (!rateLimit(request.ip)) {
return NextResponse.json({ error: 'Too many requests' }, { status: 429 });
}
// Generated code
}Reference Files
references/api_patterns.md- API design patterns and best practicestemplates/trpc_router.ts- tRPC router templatetemplates/nextjs_route.ts- Next.js route template
Success Criteria
✅ Endpoints generate without errors
✅ Code compiles in your project
✅ Validation works correctly
✅ Authentication checks pass
✅ Error handling is consistent
✅ Endpoints follow REST principles
✅ TypeScript types are correct
Time Savings
- Manual endpoint creation: 45-60 minutes
- With this skill: 5-10 minutes
- Savings: ~45 minutes per API
Next Steps
After generating your endpoints:
- ✅ Review generated code
- ✅ Adjust validation schemas
- ✅ Integrate with database
- ✅ Test endpoints
- ✅ Add custom business logic
- ✅ Write tests (use testing-framework skill)
- ✅ Deploy
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

