一键导入
architecture
Project file organization, naming conventions, and import patterns. Use when creating new files, organizing code, or deciding where to place modules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Project file organization, naming conventions, and import patterns. Use when creating new files, organizing code, or deciding where to place modules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design-token and theming conventions for the Starter — semantic CSS variables in theme.css, Tailwind v4 @theme registration in globals.css, dark mode, and the Figma token-sync flow. Use when extracting repeated design values, adding/editing tokens, theming, or syncing tokens from Figma.
API service layer with ky/apiClient and Next.js API routes with Zod validation. Use when creating services, API endpoints, or HTTP calls.
Conventions when no auth provider is bundled. Use when adding authentication or guarding routes.
React component patterns — server vs client components, styling with cn(), props interfaces. Use when creating UI or shared components.
Use before writing or referencing any stack library — fetches version-accurate docs via the context7 MCP server so call signatures, hooks, and APIs match what is installed. Invoke on first usage of any non-none slot library, on any non-trivial Next.js API, or when uncertain whether an API is current.
TanStack Query patterns for data fetching — useQuery, useMutation, query keys, cache invalidation. Use when fetching server data or creating data hooks.
| name | architecture |
| description | Project file organization, naming conventions, and import patterns. Use when creating new files, organizing code, or deciding where to place modules. |
| paths | src/** |
src/
├── app/ # Next.js App Router pages and API routes
│ ├── (auth)/ # Auth route group (login, register)
│ ├── (dashboard)/ # Dashboard route group
│ ├── (marketing)/ # Public marketing pages
│ └── api/ # API routes
├── config/ # App configuration (site, routes, api, storage, queries)
├── components/
│ ├── ui/ # Atomic UI components (Button, Input, Modal)
│ ├── shared/ # Composed shared components (Navbar, Footer)
│ └── providers/ # React context providers
├── lib/
│ ├── api/ # HTTP client and error handling
│ ├── auth/ # Auth adapter pattern and providers
│ ├── hooks/ # Custom React hooks (one per file)
│ ├── store/ # Client state stores
│ ├── utils/ # Utility functions (cn, format)
│ └── validations/ # Validation schemas (modular files)
├── services/ # API service layer
└── types/ # TypeScript interfaces and types
| Type | Pattern | Example |
|---|---|---|
| UI component | PascalCase .tsx | Button.tsx |
| Shared component | PascalCase .tsx | PageHeader.tsx |
| Hook | use + camelCase .ts | useUserData.ts |
| Service | camelCase .service.ts | user.service.ts |
| Store | camelCase .store.ts | ui.store.ts |
| Schema | camelCase .ts | auth.ts (in validations/) |
| Type file | camelCase .ts | user.ts (in types/) |
| Route folder | kebab-case | user-profile/ |
| API route | route.ts in folder | api/users/route.ts |
Always use @/ alias. Group imports in this order:
// 1. React / Next.js
import { useState } from 'react'
import { useRouter } from 'next/navigation'
import type { Metadata } from 'next'
// 2. External libraries (data-fetching lib, validation lib, forms lib, state lib, etc.)
// 3. Internal @/ imports
import { Button } from '@/components/ui'
import { useAuth } from '@/lib/hooks'
import { cn } from '@/lib/utils'
import type { User } from '@/types'
any, proper interfaces and genericspage.tsx and layout.tsxconst always, let only when reassignment is needed, never varindex.ts filessrc/config/ — never hardcode URLs or app settings