一键导入
nextjs-params
Ensures Next.js 15 dynamic route parameters are properly awaited. Checks for missing await on params destructuring and provides automatic fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Ensures Next.js 15 dynamic route parameters are properly awaited. Checks for missing await on params destructuring and provides automatic fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Setup and patterns for a Vite + React frontend with Capacitor and Ionic React, plus a separate Next.js backend in a monorepo. Use when creating or modifying a Capacitor mobile app with a Vite frontend and Next.js API, or when adding Capacitor to an existing Vite app with a Next.js backend.
Modify Cursor/VSCode user settings in settings.json. Use when the user wants to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Essential workflow guidelines for AI agents working on development tasks. Use at the start of every task to ensure proper workflow, skill discovery, port detection, testing methodology, and verification. Consolidates critical prompt updates for consistent agent behavior across all tasks.
Integrate external assets (PixelLab, ElevenLabs) into projects with proper error handling, fallback mechanisms, and testing patterns. Use when generating assets, downloading files, or integrating assets into game code. Standardizes workflow and reduces integration time by 25-35%.
Handle asynchronous operations from MCP servers (PixelLab, ElevenLabs, etc.) with intelligent polling, timeout management, and parallel work opportunities. Use when waiting for async jobs, polling status, or managing long-running operations. Provides exponential backoff, ETA-aware waiting, and prevents premature downloads.
| name | nextjs-params |
| description | Ensures Next.js 15 dynamic route parameters are properly awaited. Checks for missing await on params destructuring and provides automatic fixes. |
This skill detects and fixes Next.js 15 dynamic route parameter issues where params is used without await. In Next.js 15, dynamic route parameters became asynchronous and must be awaited.
This skill should trigger automatically when:
params should be awaited before using its propertiesThe skill looks for these patterns in Next.js route handlers:
// Missing await on params destructuring
export async function GET(request: NextRequest, { params }: { params: { id: string } }) {
const { id } = params; // ERROR: params not awaited
}
// Missing Promise type annotation
export async function GET(request: NextRequest, { params }: { params: { id: string } }) {
const { id } = await params; // ERROR: type should be Promise<{ id: string }>
}
// Proper async params usage
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params; // ✅ Correct
}
When the skill detects an issue, it provides these quick fixes:
// Before:
const { id } = params;
// After:
const { id } = await params;
// Before:
{ params }: { params: { id: string } }
// After:
{ params }: { params: Promise<{ id: string }> }
// Before:
export async function GET(request: NextRequest, { params }: { params: { id: string } }) {
const { id } = params;
}
// After:
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
}
The skill analyzes route handler functions by:
Route Handler Identification: Looks for functions exported as HTTP methods (GET, POST, PUT, DELETE) in files with dynamic routes ([param] in path)
Params Usage Analysis:
params is destructured from function parametersawait is used when destructuring paramsPromise<>Context Awareness: Only applies to Next.js 15+ projects (detected by package.json or Next.js version)
src/app/**/[**]/route.ts (App Router dynamic routes)src/pages/**/[**].tsx (Pages Router dynamic routes - though less common in Next.js 15)This skill helps prevent the common Next.js 15 migration error:
Error: Route "/api/example/[id]" used `params.id`. `params` should be awaited before using its properties.
export async function GET(
request: NextRequest,
{ params }: { params: { userId: string } }
) {
try {
const { userId } = params; // ❌ Error: params not awaited
// ... rest of handler
}
}
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ userId: string }> }
) {
try {
const { userId } = await params; // ✅ Fixed automatically
// ... rest of handler
}
}
The skill is enabled by default for:
next in package.json)[param]Disable the skill for specific files by adding a comment:
// @cursor-skill-disable nextjs-params