Agent skill
vkc-api-route-pattern
Standardize Next.js App Router API route implementations under src/app/api/** (auth/session, input validation, Drizzle queries, rate limiting, response shape). Use when creating or refactoring API routes in this repo.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/vkc-api-route-pattern
Metadata
Additional technical details for this skill
- short description
- API Route skeleton + rules
SKILL.md
VKC API Route Pattern
When to use
- Creating new endpoints under
src/app/api/** - Refactoring existing endpoints to match house style
House style (this repo)
- Auth:
getSession(user) orgetAdminSession(admin) - DB:
dbfrom@/lib/db, tables from@/lib/db/schema - Rate limit (if needed):
checkRateLimit+rateLimitResponse - Responses:
- Public APIs: prefer
@/lib/api/responsehelpers - Admin APIs: typically
NextResponse.json(...)directly (keep consistent within/api/admin/**)
- Public APIs: prefer
- Validation: repo currently uses explicit runtime checks (no Zod dependency yet). If Zod is added later, migrate route-by-route.
Canonical references
- Public route w/ validation + rate-limit:
src/app/api/reports/route.ts - Public route w/ typed allowlists:
src/app/api/events/route.ts - Admin CRUD + schedule fields:
src/app/api/admin/news/route.ts
Template
- Full skeleton (copy + customize):
.codex/skills/vkc-api-route-pattern/references/api-route-template.ts
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?