Communitygithub.com

ComeOnOliver/skillshub

변형, 폼 처리 및 RPC 스타일 호출. Next.js에서 서버 액션, 폼 변형 또는 RPC 스타일 데이터 변형을 구현할 때 사용합니다.

skillshub란 무엇인가요?

이 스킬은 Next.js의 App Router 환경에서 서버 액션(Server Actions)을 구현하고 폼 제출을 처리하는 방법을 상세히 안내합니다. 개발자는 'use server' 지시어, 폼 액션, revalidatePath, useFormStatus 등 최신 패턴을 사용하여 API 엔드포인트 없이도 데이터 변형을 수행할 수 있습니다. 특히 React 19/Next.js 15의 useActionState를 활용한 상태 관리, optimistic updates, 보안 검증(입력값 정제, 인증 확인) 등 실무에 필요한 고급 기능을 포함합니다. Cursor, Claude Code, Codex 등 다양한 AI 에이전트 플랫폼에서 참조할 수 있도록 설계되었으며, app/**/actions.ts 또는 src/app/**/*.tsx 패턴의 파일에서 트리거됩니다. 이 스킬을 통해 개발자는 안전하고 확장성 있는 서버 액션을 신속하게 구현할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/HoangNguyen0403/agent-skills-standard/nextjs-server-actions

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

서버 액션

우선순위: P1 (높음)

[!WARNING] 프로젝트가 App Router 대신 pages/ 디렉터리를 사용하는 경우, 이 스킬을 완전히 무시하십시오.

API 엔드포인트를 생성하지 않고 폼 제출 및 변형을 처리합니다.

구현 가이드라인

  • 지시어: 파일이나 함수를 항상 'use server'로 시작하십시오. 타입이 지정된 폼 필드에 접근하려면 formData.get('title')을 사용하십시오. 변형을 위해 async 함수를 내보내십시오(export).

  • 폼 처리: <form>의 action prop을 사용하여 action={createPost}와 같이 액션을 트리거하십시오. useFormStatus()를 사용하여 pending 상태를 처리하고, 버튼에 disabled={pending}을 적용하십시오. React 19/Next.js 15에서는 useActionState를 사용하여 <form action={action}>과 함께 action={action} 폼 상태를 처리하십시오.

  • 데이터 갱신: 성공적인 변형 후 revalidatePath('/') 또는 revalidateTag('tag-name') 를 사용하여 UI를 업데이트하십시오.

  • 상호작용: 폼이 아닌 트리거의 경우 useTransition 훅을 사용하여 액션을 호출하고 로딩 UI를 처리하며 페이지가 차단되지 않도록 하십시오.

  • 낙관적 업데이트: useOptimistic 을 사용하여 서버가 변형을 확인하기 전에 예상되는 UI 상태를 즉시 표시하십시오.

  • 보안: FormData에서 가져온 모든 입력값을 정제하십시오. 모든 액션 내에서 인증 검사(await auth())를 수행하십시오. 파일 업로드는 크기와 MIME 유형으로 제한하십시오.

  • 폼: <form action={createPost}> (점진적 향상은 JS 없이도 작동합니다).

  • 이벤트 핸들러: onClick={() => createPost(data)}.

  • 대기 상태: useFormStatus 훅을 사용하십시오 (해당 훅은 폼 내부에 렌더링된 컴포넌트 안에 있어야 합니다).

P1: 운영 표준

1. 보안 및 유효성 검사

처리하기 전에 항상 z.object({ 스키마와 safeParse로 입력값의 유효성을 검사하십시오. 액션 내에서 권한을 확인하십시오. 보안 액션 예제를 참조하십시오.

2. 대기 상태

상태 관리를 위해 useActionState(React 19/Next.js 15+)를 사용하고 버튼 로딩 상태를 위해 useFormStatus를 사용하십시오.

제약 사항

  • 클로저: 숨겨진 클로저 암호화 오버헤드와 직렬화 버그를 방지하기 위해 컴포넌트 내부에 액션을 정의하지 마십시오.
  • 리디렉션: 성공적인 탐색을 위해 redirect()를 사용하십시오. 이 함수는 Next.js가 리디렉션을 처리하기 위해 잡는 예외를 던집니다.

안티 패턴

  • 유효성 검사되지 않은 서버 액션 입력 금지: 처리 전에 항상 Zod를 사용하여 유효성을 검사하십시오.
  • 인증 검사 생략 금지: 미들웨어뿐만 아니라 모든 액션 내에서 세션/사용자를 확인하십시오.
  • 컴포넌트 내부에 액션 정의 금지: 클로저 버그를 방지하기 위해 actions.ts에 정의하십시오.
  • try/catch 내에서 redirect() 사용 금지: redirect()는 예외를 던지므로, 이를 catch하면 리디렉션이 실행되지 않습니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬