Communitygithub.com

ComeOnOliver/skillshub

Next.js App Router 및 Server Actions를 위한 핵심 보안 표준입니다. App Router 경로, Server Actions 또는 API 엔드포인트를 보호할 때 사용합니다.

skillshub란 무엇인가요?

이 기술은 Next.js 애플리케이션에서 보안 강화를 위한 포괄적인 가이드라인을 제공합니다. App Router, Server Actions, API 엔드포인트에서 인증, 입력 검증, 데이터 유출 방지를 위한 구체적인 구현 방법을 설명합니다. middleware.ts를 통한 엣지 수준 인증, Zod를 사용한 Server Actions 입력 검증, 실험적 taint API를 통한 민감 데이터 보호, rate limiting과 CSRF 방어 등이 포함됩니다. 또한 HttpOnly/Secure 쿠키 사용, 서버 전용 패키지를 통한 로직 격리, dangerouslySetInnerHTML 사용 시 DOMPurify 적용 등 일반적인 보안 안티패턴을 피하는 방법을 제시합니다. 이 기술은 개발자들이 Next.js 애플리케이션을 안전하게 구축하고 유지할 수 있도록 돕습니다.

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

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

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

문서

Next.js 보안

우선순위: P0 (중요)

구조

app/
├── lib/
│   └── validation.ts   # 공유 Zod 스키마
└── middleware.ts       # 인증 및 헤더

구현 가이드라인

  • Next.js 미들웨어: **middleware.ts**를 사용하여 엣지 수준 인증, 역할 기반 접근 제어(RBAC) 및 보안 헤더(예: Content-Security-Policy (CSP), X-XSS-Protection)를 적용합니다.
  • 서버 액션: FormData 또는 JSON의 모든 입력을 Zod를 사용하여 항상 검증합니다. 모든 액션 내에서 호출자를 확인하기 위해 인증 검사(await auth())를 수행합니다.
  • 데이터 오염 방지: experimental_taint API(taintObjectReference)를 사용하여 민감한 서버 객체(예: passwordHash가 포함된 사용자)가 클라이언트 컴포넌트로 절대 유출되지 않도록 합니다.
  • 라우트 핸들러 (route.ts): 무차별 대입 공격이나 DoS 공격을 방지하기 위해 속도 제한을 구현합니다. CSRF(교차 사이트 요청 위조)를 완화하기 위해 Origin/Referer 헤더를 확인합니다.
  • 인증 토큰: 세션 관리에는 HttpOnly, Secure 쿠키를 **SameSite: 'Lax'**와 함께 엄격히 사용합니다. localStorage에 토큰을 절대 저장하지 마십시오.
  • 로직 격리: server-only 패키지를 사용하여 백엔드 특정 로직이 클라이언트 번들에 포함되지 않도록 방지합니다.
  • 컴포넌트 순수성: 컴포넌트에서 렌더링되는 모든 사용자 제공 콘텐츠를 이스케이프합니다. **DOMPurify**와 같은 살균기 없이 **dangerouslySetInnerHTML**을 절대 사용하지 마십시오.

안티패턴

  • 클라이언트로 DB 필드 유출 금지: DTO를 사용하십시오. 원시 모델 객체를 절대 전달하지 마십시오.
  • 클라이언트 번들에 process.env 사용 금지: 노출해도 안전한 경우에만 NEXT_PUBLIC_으로 표시하십시오.
  • 검증되지 않은 서버 액션 입력 금지: 항상 Zod 스키마로 검증하십시오.
  • 공유 레이아웃에서 인증 검사 금지: 레이아웃에서의 인증은 안전하지 않습니다. 미들웨어를 사용하십시오.

참고 자료

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

관련 스킬