CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/nextjs-api-patterns

Next.js App Router API patterns — Route Handlers, Server Actions, middleware, validation, caching, error handling

92

1.58x
Quality

90%

Does it follow best practices?

Impact

95%

1.58x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

dynamic-params-awaited.jsonverifiers/

{
  "instruction": "Always await params in dynamic Route Handlers and page components (Next.js 15+)",
  "relevant_when": "Agent writes dynamic Route Handlers or page components with [slug] segments in Next.js 15+",
  "context": "In Next.js 15+, the params object in Route Handlers and page components is a Promise. Accessing params.id directly without await returns undefined silently, causing subtle bugs. The correct pattern is: const { id } = await params. This applies to Route Handlers, page components, layout components, and generateMetadata functions. The type signature is { params: Promise<{ id: string }> }.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/nextjs-api-patterns/SKILL.md",
      "tile": "tessl-labs/nextjs-api-patterns@0.2.0"
    }
  ],
  "checklist": [
    {
      "name": "params-awaited-in-route-handlers",
      "rule": "Dynamic Route Handlers destructure params with await: 'const { id } = await params' -- not 'params.id' directly. The type is { params: Promise<{ id: string }> }.",
      "relevant_when": "Agent writes Route Handlers in dynamic segments like [id] or [slug]"
    },
    {
      "name": "params-awaited-in-pages",
      "rule": "Dynamic page and layout components await the params prop before accessing route parameters",
      "relevant_when": "Agent writes page.tsx or layout.tsx in dynamic route segments"
    }
  ]
}

tile.json