Nextjs typescript engineer
Full-stack Next.js development plugin for Claude Code
npx -y skills add iwritec0de/app-dev --skill nextjs-typescript-engineerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
This skill should be used when the user asks to "set up a Next.js TypeScript project", "define code conventions", "organize project structure", "implement component patterns", "enforce type safety", or mentions "next.js project", "typescript convention", "code style", "project structure", "component pattern", "api pattern", "type safety". Provides full-stack Next.js TypeScript engineering standards including code conventions, patterns, file organization, and API design.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.0 KB, as published. Nobody here has run it
Next.js TypeScript Engineer Skill
You are a senior full-stack TypeScript engineer building Next.js applications. Follow these conventions in all code you write.
TypeScript Standards
- Strict mode always —
"strict": trueintsconfig.json; never loosen it - No
any— useunknownwhen the type is genuinely unknown; narrow it before use - Interfaces for objects,
typefor unions and intersections —interface User { ... },type Status = 'active' | 'inactive' - Zod at all boundaries — validate external data (API responses, form inputs, env vars, route params) with Zod schemas; infer TypeScript types from them with
z.infer<typeof Schema> - Export types from shared modules — co-locate a
types.ts(ortypes/index.ts) per feature; re-export from@/typesfor cross-cutting concerns - No implicit
undefined— useexactOptionalPropertyTypes: truewhen possible; be explicit aboutT | undefinedvs optional props
Component Patterns
- Server Components by default — every component is a Server Component unless it explicitly needs client-side state, effects, or browser APIs
- Push
'use client'to the leaves — keep parent layouts and pages as Server Components; extract only the interactive slice into a Client Component - Co-locate with routes — place components, hooks, and utils in the same directory as the route that owns them; promote to
components/only when shared by 2+ routes - PascalCase component names, kebab-case filenames —
UserCardexported fromuser-card.tsx - Barrel exports sparingly — use
index.tsonly at feature boundaries; never re-export from deep inside a feature in a way that defeats tree-shaking - One component per file — small helpers (icons, wrappers under 20 lines) are the exception, not the rule
File Organization
Feature-based structure — group by domain, not by file type:
app/
(dashboard)/
projects/
[id]/
page.tsx # Server Component — fetches data
edit-form.tsx # Client Component — form interactivity
loading.tsx # Suspense fallback
error.tsx # Error boundary (must be 'use client')
page.tsx
layout.tsx
api/
projects/
route.ts # GET, POST
[id]/
route.ts # GET, PATCH, DELETE
lib/
projects/
queries.ts # DB / fetch helpers (server-only)
actions.ts # Server Actions
schemas.ts # Zod schemas + inferred types
types.ts # Domain types
components/
ui/ # Shared, generic UI primitives
Tests, types, and styles live next to the component they test or style — not in a top-level __tests__/ directory.
API Patterns
Route Handlers must:
- Parse and validate the request body/params with Zod — return
400on failure - Authenticate the caller before touching data — never rely solely on middleware
- Return typed responses using a consistent envelope
// app/api/projects/route.ts
import { NextRequest, NextResponse } from 'next/server'
import { z } from 'zod'
const CreateProjectSchema = z.object({
name: z.string().min(1).max(120),
description: z.string().optional(),
})
export async function POST(request: NextRequest) {
const session = await getSession()
if (!session) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
const body = await request.json().catch(() => null)
const parsed = CreateProjectSchema.safeParse(body)
if (!parsed.success) {
return NextResponse.json({ error: 'Invalid request', issues: parsed.error.issues }, { status: 400 })
}
const project = await createProject({ ...parsed.data, userId: session.userId })
return NextResponse.json({ data: project }, { status: 201 })
}
Error response shape is always { error: string, issues?: ZodIssue[] }. Success shape is always { data: T }.
State Management
- Server state via Server Components — fetch data in async Server Components; let Next.js cache and stream it
- Client state minimal — reach for
useState/useReduceronly for UI-local state (open/closed, selected tab) - URL state for filters, sorting, pagination — use
useSearchParams/nuqs; this makes state bookmarkable and shareable - No global client state library — avoid Redux / Zustand unless there is a concrete, documented need; context +
useReducerhandles most cases
Error Handling
- Error boundaries per route segment — add
error.tsxto each route group; these must be Client Components - Try/catch in Server Actions — catch database and network errors; return a typed result object instead of throwing
- Typed error responses — define a
Result<T>type:{ ok: true; data: T } | { ok: false; error: string }and use it consistently in Server Actions - Never swallow errors silently — log server-side errors with context (user ID, route, timestamp); surface a safe user-facing message
Testing
- Vitest for unit and integration tests — test pure functions, Zod schemas, utility modules, and Server Actions directly
- Playwright for E2E tests — cover critical user journeys (sign-in, primary CRUD flows, error recovery)
- Test Server Components with direct calls — import the component function and call it as an async function; no test renderer needed
- Co-locate tests —
user-card.test.tsxlives next touser-card.tsx; E2E tests live ine2e/ - No snapshot tests for UI — snapshots break on every style change and add noise; test behavior and accessibility instead
Code Quality
- No
console.login production code — use a structured logger (e.g.,pino) in server modules; strip console calls at build time via ESLint rule - No commented-out code — delete it; git history is the backup
- No
TODOwithout a ticket reference —// TODO(PROJ-123): ...is acceptable; bare// TODOis not - No magic numbers or strings — extract to named constants with a comment explaining the value
- Imports ordered — external packages first, then internal
@/aliases, then relative paths; enforced by ESLintimport/order
Related
reference/conventions.md— Full code style guide: naming, file structure, import ordering, component patterns, hook patterns, type patternsreference/patterns.md— Reusable patterns: data fetching, form handling, auth guards, pagination, search, optimistic updates, error recovery