计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
nextjs-server-actions【效率与协作】Implement secure Next.js Server Actions for mutations, forms, and optimistic UI. Use when building actions, form flows, auth checks, or revalidation after writes.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
[!WARNING] If project uses
pages/directory instead of App Router, ignore this skill entirely.
Build action files as secure server entrypoints, not as thin wrappers around unsafe form data.
actions.ts with 'use server'.z.object({ ... }).safeParse(...) or formData.get('title') -> validated shape.useFormStatus, useActionState, useTransition, or useOptimistic as needed. Typical form wiring is <form action={createPost}> or <form action={action}>, with useFormStatus() and disabled={pending} inside the submit child.FormData or arguments before processing.actions.ts to avoid closure bugs.redirect() in try/catch: redirect() throws; catching it suppresses redirect.When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant: