templates/skills/frameworks/nextjs/SKILL.md
Language: TypeScript, JavaScript
npx skillsauth add hivellm/rulebook Next.jsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Language: TypeScript, JavaScript
Version: Next.js 14+ (App Router)
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
reactStrictMode: true,
images: {
domains: ['your-domain.com'],
},
env: {
CUSTOM_KEY: process.env.CUSTOM_KEY,
},
}
export default nextConfig
# Type check
npm run type-check # or: tsc --noEmit
# Lint
npm run lint # Next.js ESLint
# Format
npx prettier --check "**/*.{ts,tsx}"
# Tests
npm test # Vitest or Jest
# Build
npm run build # Must succeed
# Check bundle size
npm run build && npx @next/bundle-analyzer
✅ DO:
❌ DON'T:
app/
├── layout.tsx # Root layout
├── page.tsx # Home page
├── (routes)/
│ ├── dashboard/
│ │ ├── layout.tsx
│ │ └── page.tsx
│ └── api/
│ └── users/
│ └── route.ts
├── components/
├── lib/
└── types/
// Server Component (default)
async function ServerComponent() {
const data = await fetch('https://api.example.com/data')
return <div>{data}</div>
}
// Client Component
'use client'
import { useState } from 'react'
function ClientComponent() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(count + 1)}>{count}</button>
}
// app/api/users/route.ts
import { NextRequest, NextResponse } from 'next/server'
export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams
const id = searchParams.get('id')
return NextResponse.json({ id })
}
export async function POST(request: NextRequest) {
const body = await request.json()
// Handle POST
return NextResponse.json({ success: true })
}
<!-- NEXTJS:END -->research
Create structured analyses with numbered findings, execution plans, and task materialization
research
Author a rulebook task spec interactively — research, draft, ask the user clarifying questions, confirm, then create the tasks in rulebook ready for /rulebook-driver. Use when the user wants to plan/spec a feature before implementing.
development
Behavioral guidelines to reduce common LLM coding mistakes — overcomplication, sloppy refactors, hidden assumptions, weak goals. Use when writing, reviewing, or refactoring code. Auto-applies; invoke explicitly via /karpathy-guidelines or 'follow karpathy discipline'.
data-ai
Autonomous AI agent loop for iterative task implementation (@hivehub/rulebook ralph)