Skills

Source File Layout

Decides where a file lives, how it is named and where its tests go.

Install

npx skills add lobehub/lobehub --skill source-layout -g -a claude-code -y
Repository
lobehub/lobehub83.7k
Category
Engineering
Updated
3d ago
License
See repository
Context cost
Mediumabout 2,119 tokens
Runs scripts
No, instructions only

What it does

Use for where a file lives, how it is named, where its tests go, and how to split a source or test file over 1200 lines (拆分大文件, 目录结构, 文件命名).

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

WhatFormExample
React component file / component directoryPascalCasePlanCard.tsx, ChatInput/ControlBar/
HookuseXxx.ts(x)ChatInputNotice/useChatInputNotice.ts
Other modulecamelCase or one wordoriginLink.ts, recentDirs.ts
Server class modulethe class nameservices/agentRuntime/StaleOperationReaper.ts
Service, router, store, and other non-component dirscamelCaseservices/aiAgent/, store/chat/slices/
Package directorykebab-casepackages/agent-runtime/
Files inside a packagecamelCasepackages/database/src/models/
Read the whole SKILL.md on GitHub

More in Engineering