Agent skill · lobehub
source-layout
Use for where a file lives, how it is named, where its tests go, and how to split a source or test file over 800 lines (拆分大文件, 目录结构, 文件命名).
What it needs
About 4k tokens when loaded.
What this skill does
Source Layout Top-level ownership (src/features, src/routes, apps/server/src, packages, …) is in AGENTS.md and project-overview. This skill owns placement and naming inside those roots, test placement, and how a large file becomes a directory. The rules record the conventions the codebase already follows; where it was split between two forms, the rule names the one to use for new files. Do not rename existing files only to match. 1. Names What Form Example ---------------------------------------------------- --------------------- ---------------------------------------------- React component file / component directory PascalCase PlanCard.tsx, ChatInput/ControlBar/ Hook useXxx.ts(x) ChatInputNotice/useChatInputNotice.ts Other module camelCase or one word originLink.ts, recentDirs.ts Server class module the class name services/agentRuntime/CompletionLifecycle.ts Service, router, store, and other non-component dirs camelCase services/aiAgent/, store/chat/slices/ Package directory kebab-case packages/agent-runtime/ Files inside a package camelCase packages/database/src/models/ A package whose files are already kebab-case (alint, openapi, builtin-skills) keeps kebab-case internally. Shared per-directory modules are constants.ts, types.ts, style.ts, and utils.ts, not const.ts, type.ts, styles.ts, or helpers.ts. Create one only when two or more modules in that directory use it; a constant or type used by one module stays in that module. New files use named exports (export const PlanCard = …), even when the neighboring files default-export; do not copy the older default-export habit. The exceptions are modules a framework, tool, or loader imports by their default export: route segments under src/routes (see spa-routes), Next.js special files (page.tsx, layout.tsx, not-found.tsx), .config.ts files, desktop controllers and services (Ctr.ts, Srv.ts, globbed by apps/desktop/src/main/core/App.ts), and locale resource files. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills lobehub/source-layout