next-project-structure — for Claude Code next-project-structure, toy-project, community, for Claude Code, ide skills, **판단 결과에 따라 분기:** - 모노레포 +, 존재 →, 사용 - 단일 앱 →, 에 BaseServices 직접 정의 - App Router →, 참조 - Pages Router →

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need next-project-structure. 本地化技能摘要: # next-project-structure Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

next-project-structure
Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬.
이 스킬 자체가 패턴의 기준 이다 — CLAUDE.md에 의존하지 말고 이 스킬의 패턴을 따른다.
단, CLAUDE.md에 더 구체적인 프로젝트 패턴이 있다면 그것을 우선 참조한다.
Step 1: 프로젝트 환경 파악

# 核心主题

yesroad yesroad
[0]
[0]
更新于: 3/19/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 10/11

This page remains useful for teams, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
10/11
Quality Score
61
Canonical Locale
ko
Detected Body Locale
ko

适用场景: Ideal for AI agents that need next-project-structure. 本地化技能摘要: # next-project-structure Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

推荐说明: next-project-structure helps agents next-project-structure. next-project-structure Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

适用 Agent 类型

适用场景: Ideal for AI agents that need next-project-structure.

赋予的主要能力 · next-project-structure

适用任务: Applying next-project-structure
适用任务: Applying Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬
适用任务: Applying 이 스킬 자체가 패턴의 기준 이다 — CLAUDE.md에 의존하지 말고 이 스킬의 패턴을 따른다

! 使用限制与门槛

  • 限制说明: Requires repository-specific context from the skill documentation
  • 限制说明: Works best when the underlying tools and dependencies are already configured

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

next-project-structure 是什么?

适用场景: Ideal for AI agents that need next-project-structure. 本地化技能摘要: # next-project-structure Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 next-project-structure?

运行命令:npx killer-skills add yesroad/toy-project/next-project-structure。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

next-project-structure 适用于哪些场景?

典型场景包括:适用任务: Applying next-project-structure、适用任务: Applying Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬、适用任务: Applying 이 스킬 자체가 패턴의 기준 이다 — CLAUDE.md에 의존하지 말고 이 스킬의 패턴을 따른다。

next-project-structure 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

next-project-structure 有哪些限制?

限制说明: Requires repository-specific context from the skill documentation;限制说明: Works best when the underlying tools and dependencies are already configured。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add yesroad/toy-project/next-project-structure。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    next-project-structure 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

next-project-structure

# next-project-structure Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

next-project-structure

Next.js 프로젝트에 일관된 폴더 구조와 코드 패턴을 적용하는 스킬. 이 스킬 자체가 패턴의 기준이다 — CLAUDE.md에 의존하지 말고 이 스킬의 패턴을 따른다. 단, CLAUDE.md에 더 구체적인 프로젝트 패턴이 있다면 그것을 우선 참조한다.


워크플로우

Step 1: 프로젝트 환경 파악

bash
1# 모노레포 여부 확인 2ls packages/ 2>/dev/null && echo "Monorepo" || echo "Single app" 3 4# App Router 여부 확인 5ls src/app 2>/dev/null || ls app 2>/dev/null && echo "App Router" || echo "Pages Router" 6 7# 기존 services/queries 패턴 확인 (있으면 그 패턴을 따름) 8ls src/services/api/ 2>/dev/null 9ls src/queries/ 2>/dev/null

판단 결과에 따라 분기:

  • 모노레포 + packages/services 존재 → import Services from '@workspace/services' 사용
  • 단일 앱 → src/services/core/base.ts에 BaseServices 직접 정의
  • App Router → references/app-router.md 참조
  • Pages Router → references/pages-router.md 참조

Step 2: 기존 패턴 탐색 (신규 기능 전 필수)

새 도메인/파일을 만들기 전에 유사한 기존 코드를 먼저 찾는다. 기존 패턴이 있으면 그대로 따른다.

bash
1# 기존 서비스 패턴 참조 2ls src/services/api/ 3# 기존 쿼리 패턴 참조 4ls src/queries/ 5# 기존 뷰 패턴 참조 6ls src/views/

Step 3: 요청 종류에 따라 생성 대상 결정

요청 키워드생성 대상비고
서비스, API, serviceservices/api/{domain}.ts
쿼리, useQuery, TanStack, queryKeysqueries/{domain}/
view, 뷰, view+hook 분리views/{page}/
전체 도메인, 도메인 추가services + queries + view + types 모두
컴포넌트, 훅 단독 생성component-creator 스킬 사용

Step 4: 파일 생성 + 배럴 index.ts 즉시 업데이트

파일을 만든 즉시 해당 폴더의 index.ts 배럴 export를 업데이트한다. 배럴 미업데이트는 import 에러의 주요 원인이다.


폴더 구조 원칙

src/
├── components/          # 앱 공통 UI 컴포넌트
│   └── {Name}/
│       ├── index.tsx           # UI만 (로직 없음)
│       └── use{Name}.ts        # 로직이 있으면 반드시 분리
├── hooks/               # 앱 공통 커스텀 훅
├── services/            # API 서비스
│   └── api/
│       ├── {domain}.ts         # BaseServices 상속
│       └── index.ts            # 배럴 export
├── queries/             # TanStack Query 훅
│   ├── {domain}/
│   │   ├── index.ts            # use{Domain}Query / use{Domain}Mutation
│   │   └── queryKeys.ts        # 쿼리 키 팩토리 (훅과 반드시 분리)
│   └── index.ts
├── types/
│   └── api/             # API 요청/응답 타입
├── lib/                 # 순수 함수 유틸리티
├── utils/               # 앱 유틸리티
└── provider/            # QueryProvider 등 전역 컨텍스트

모노레포 추가 구조:

packages/
├── services/            # BaseServices (axios wrapper) — 앱에서 상속
└── ui/                  # shadcn/ui 공통 컴포넌트
apps/
└── {app-name}/src/      # 위 src/ 구조와 동일

핵심 패턴

Services (BaseServices 상속)

모노레포 — @workspace/services 있을 때:

typescript
1// src/services/api/{domain}.ts 2import Services from '@workspace/services'; 3import type { {ResponseType} } from '@/types/api/{domain}'; 4 5class {Domain}Services extends Services { 6 constructor() { 7 super({ baseURL: '/api/{domain}' }); 8 } 9 10 get{Resource}(params: {ParamsType}): Promise<{ResponseType}> { 11 return this.get<{ResponseType}>('', params); 12 } 13} 14 15export default new {Domain}Services(); // 싱글턴

단일 앱 — BaseServices 없을 때:

typescript
1// src/services/api/{domain}.ts 2import axios from 'axios'; 3import type { {ResponseType} } from '@/types/api/{domain}'; 4 5// 또는 기존 http 클라이언트 패턴 확인 후 따름 6const {domain}Api = axios.create({ baseURL: '/api/{domain}' }); 7 8export const {domain}Services = { 9 get{Resource}: (params: {ParamsType}) => 10 {domain}Api.get<{ResponseType}>('', { params }).then(r => r.data), 11};

QueryKeys (반드시 별도 파일)

typescript
1// src/queries/{domain}/queryKeys.ts 2export const {domain}Keys = { 3 all: ['{domain}'] as const, 4 lists: () => [...{domain}Keys.all, 'list'] as const, 5 list: (param: string) => [...{domain}Keys.lists(), param] as const, 6 detail: (id: string) => [...{domain}Keys.all, 'detail', id] as const, 7};

queryKeys를 별도 파일로 분리하는 이유: 훅 파일이 커지면 쿼리 키만 교체하거나 다른 도메인에서 참조하기 쉽다. 또한 invalidateQueries에서 일관성을 보장한다.

Query Hook

typescript
1// src/queries/{domain}/index.ts 2'use client'; // 반드시 최상단 — Client Component에서만 훅 실행 가능 3 4import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; 5import {domain}Services from '@/services/api/{domain}'; 6import { {domain}Keys } from './queryKeys'; 7 8export function use{Domain}ListQuery(param: string) { 9 return useQuery({ 10 queryKey: {domain}Keys.list(param), 11 queryFn: () => {domain}Services.get{Resource}(param), 12 staleTime: 5 * 60 * 1000, 13 enabled: !!param, // param 없으면 실행 안 함 14 }); 15} 16 17export function useCreate{Domain}Mutation() { 18 const queryClient = useQueryClient(); 19 return useMutation({ 20 mutationFn: (body: {CreateType}) => {domain}Services.create{Resource}(body), 21 onSuccess: () => { 22 queryClient.invalidateQueries({ queryKey: {domain}Keys.lists() }); 23 }, 24 }); 25}

View (UI와 로직 분리)

뷰를 UI와 로직으로 분리하는 이유: 로직만 단독으로 테스트할 수 있고, UI 변경 시 로직을 건드리지 않아도 된다. 또한 여러 UI가 같은 로직을 공유할 수 있다.

typescript
1// src/views/{page}/use{Page}View.ts 2'use client'; 3 4import { useState, useCallback } from 'react'; 5import { use{Domain}ListQuery } from '@/queries/{domain}'; 6 7export function use{Page}View() { 8 const [searchParam, setSearchParam] = useState(''); 9 const { data, isLoading, isError } = use{Domain}ListQuery(searchParam); 10 11 const handleSearch = useCallback((value: string) => { 12 setSearchParam(value); 13 }, []); 14 15 return { data, isLoading, isError, searchParam, handleSearch }; 16}
typescript
1// src/views/{page}/index.tsx 2'use client'; 3 4import { use{Page}View } from './use{Page}View'; 5 6export default function {Page}View() { 7 const { data, isLoading, isError, handleSearch } = use{Page}View(); 8 9 if (isLoading) return <div>로딩 중...</div>; 10 if (isError) return <div>오류가 발생했습니다.</div>; 11 12 return ( 13 <main> 14 {/* UI만 — 비즈니스 로직 없음 */} 15 </main> 16 ); 17}

Component (로직 있으면 훅 분리)

typescript
1// src/components/{Name}/use{Name}.ts 2import { useState, useCallback } from 'react'; 3 4export function use{Name}() { 5 const [state, setState] = useState(false); 6 const handleAction = useCallback(() => setState(prev => !prev), []); 7 return { state, handleAction }; 8} 9 10// src/components/{Name}/index.tsx 11import { use{Name} } from './use{Name}'; 12 13interface {Name}Props { /* props */ } 14 15export default function {Name}(props: {Name}Props) { 16 const { state, handleAction } = use{Name}(); 17 return <div>{/* UI */}</div>; 18}

주요 금지 패턴

금지이유대안
useState(() => localStorage.getItem(...))SSR에서 ReferenceErroruseEffect에서 로드
any 타입런타임 에러 미감지명시적 interface/type
배럴 index.ts 미업데이트import 경로 불일치파일 생성 즉시 추가
뷰에 비즈니스 로직 직접 작성UI/로직 책임 혼재use{Page}View 훅으로 분리
훅 파일 상단에 'use client' 누락TanStack Query 서버 실행 오류모든 훅 파일 최상단에 추가
queryKeys를 훅 파일에 인라인 작성invalidate/prefetch 재사용 불가별도 queryKeys.ts 파일

새 도메인 추가 체크리스트

  • types/api/{domain}.ts — 요청/응답 타입 정의
  • services/api/{domain}.ts — API 서비스 (BaseServices 상속 또는 기존 패턴)
  • services/api/index.ts — 배럴 업데이트
  • queries/{domain}/queryKeys.ts — 쿼리 키 팩토리
  • queries/{domain}/index.ts — 훅 ('use client' 필수)
  • queries/index.ts — 배럴 업데이트
  • views/{page}/use{Page}View.ts — 로직 훅
  • views/{page}/index.tsx — UI 컴포넌트
  • App Router: app/{route}/page.tsx 에서 뷰 위임

상세 참조

파일내용
references/app-router.mdApp Router 전용 패턴 (Server Component, Suspense 등)
references/pages-router.mdPages Router 전용 패턴
references/boilerplate-templates.md복사 즉시 사용 가능한 전체 보일러플레이트

相关技能

寻找 next-project-structure 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具