add-router — community add-router, x4-mono, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Full Stack Agents needing automated CRUD procedure generation for Next.js, React Native, Electron, and Hono.js applications. A mono repo for Next.js, React Native, Electron, and Hono.js with lots of bells and whistles.

corbanb corbanb
[0]
[0]
Updated: 2/23/2026

Agent Capability Analysis

The add-router skill by corbanb is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Full Stack Agents needing automated CRUD procedure generation for Next.js, React Native, Electron, and Hono.js applications.

Core Value

Empowers agents to create new tRPC routers with OpenAPI meta and test files, streamlining API development with features like ownership checks and customizable auth levels, utilizing languages like TypeScript.

Capabilities Granted for add-router

Generating tRPC routers for resource management
Automating CRUD procedure creation with OpenAPI documentation
Implementing ownership checks and auth levels for secure API endpoints

! Prerequisites & Limits

  • Requires mono repository setup with Next.js, React Native, Electron, or Hono.js
  • Limited to TypeScript and tRPC framework
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

add-router

Install add-router, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Add Router Skill

Create a new tRPC router with CRUD procedures, OpenAPI meta, and test file for x4-mono.

Arguments

The user describes the resource. If unclear, ask for:

  • Resource name (singular, camelCase for router, e.g., comment)
  • Which procedures: list, get, create, update, delete (default: all)
  • Auth level: public, protected, or admin
  • Whether it needs ownership checks

File Locations

  • Router: apps/api/src/routers/{name}.ts
  • Registration: apps/api/src/routers/index.ts
  • Tests: apps/api/src/__tests__/{name}.test.ts
  • Schemas: packages/shared/utils/validators.ts (if not already there)

Router Template

Reference: apps/api/src/routers/projects.ts

typescript
1import { eq, sql } from 'drizzle-orm'; 2import { router, publicProcedure, protectedProcedure } from '../trpc'; 3import { Errors } from '../lib/errors'; 4import { tableName } from '@x4/database'; 5import { 6 CreateEntitySchema, 7 UpdateEntitySchema, 8 EntityResponseSchema, 9 EntityListResponseSchema, 10 IdParamSchema, 11 PaginationSchema, 12} from '@x4/shared/utils'; 13 14export const entityRouter = router({ 15 list: publicProcedure 16 .meta({ openapi: { method: 'GET', path: '/entities', tags: ['Entity'] } }) 17 .input(PaginationSchema) 18 .output(EntityListResponseSchema) 19 .query(async ({ ctx, input }) => { 20 const items = await ctx.db.select().from(tableName).limit(input.limit).offset(input.offset); 21 return { items, total: items.length, limit: input.limit, offset: input.offset }; 22 }), 23 24 get: publicProcedure 25 .meta({ openapi: { method: 'GET', path: '/entities/{id}', tags: ['Entity'] } }) 26 .input(IdParamSchema) 27 .output(EntityResponseSchema) 28 .query(async ({ ctx, input }) => { 29 const [record] = await ctx.db.select().from(tableName).where(eq(tableName.id, input.id)); 30 if (!record) throw Errors.notFound('Entity').toTRPCError(); 31 return record; 32 }), 33 34 create: protectedProcedure 35 .meta({ openapi: { method: 'POST', path: '/entities', tags: ['Entity'], protect: true } }) 36 .input(CreateEntitySchema) 37 .output(EntityResponseSchema) 38 .mutation(async ({ ctx, input }) => { 39 const [record] = await ctx.db 40 .insert(tableName) 41 .values({ ...input, ownerId: ctx.user.userId }) 42 .returning(); 43 return record; 44 }), 45 46 update: protectedProcedure 47 .meta({ openapi: { method: 'PATCH', path: '/entities/{id}', tags: ['Entity'], protect: true } }) 48 .input(UpdateEntitySchema) 49 .output(EntityResponseSchema) 50 .mutation(async ({ ctx, input }) => { 51 const { id, ...data } = input; 52 const [existing] = await ctx.db.select().from(tableName).where(eq(tableName.id, id)); 53 if (!existing) throw Errors.notFound('Entity').toTRPCError(); 54 if (existing.ownerId !== ctx.user.userId && ctx.user.role !== 'admin') { 55 throw Errors.forbidden('Not the owner').toTRPCError(); 56 } 57 const [updated] = await ctx.db 58 .update(tableName) 59 .set(data) 60 .where(eq(tableName.id, id)) 61 .returning(); 62 return updated; 63 }), 64 65 delete: protectedProcedure 66 .meta({ 67 openapi: { method: 'DELETE', path: '/entities/{id}', tags: ['Entity'], protect: true }, 68 }) 69 .input(IdParamSchema) 70 .output(z.object({ success: z.boolean() })) 71 .mutation(async ({ ctx, input }) => { 72 const [existing] = await ctx.db.select().from(tableName).where(eq(tableName.id, input.id)); 73 if (!existing) throw Errors.notFound('Entity').toTRPCError(); 74 if (existing.ownerId !== ctx.user.userId && ctx.user.role !== 'admin') { 75 throw Errors.forbidden('Not the owner').toTRPCError(); 76 } 77 await ctx.db.delete(tableName).where(eq(tableName.id, input.id)); 78 return { success: true }; 79 }), 80});

Registration

Add to apps/api/src/routers/index.ts:

typescript
1import { entityRouter } from './entity'; 2 3export const appRouter = router({ 4 // ... existing routers 5 entity: entityRouter, 6});

Workflow

  1. Ensure Zod schemas exist (use /add-schema first if needed)
  2. Ensure database table exists (use /add-table first if needed)
  3. Create router file at apps/api/src/routers/{name}.ts
  4. Register in apps/api/src/routers/index.ts
  5. Run bun turbo type-check to verify AppRouter updates
  6. Create test file at apps/api/src/__tests__/{name}.test.ts (use /add-test or bun-test-gen)
  7. Run bun test --cwd apps/api to verify

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is add-router?

Perfect for Full Stack Agents needing automated CRUD procedure generation for Next.js, React Native, Electron, and Hono.js applications. A mono repo for Next.js, React Native, Electron, and Hono.js with lots of bells and whistles.

How do I install add-router?

Run the command: npx killer-skills add corbanb/x4-mono/add-router. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for add-router?

Key use cases include: Generating tRPC routers for resource management, Automating CRUD procedure creation with OpenAPI documentation, Implementing ownership checks and auth levels for secure API endpoints.

Which IDEs are compatible with add-router?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for add-router?

Requires mono repository setup with Next.js, React Native, Electron, or Hono.js. Limited to TypeScript and tRPC framework.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add corbanb/x4-mono/add-router. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use add-router immediately in the current project.

Related Skills

Looking for an alternative to add-router or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI