← ClaudeAtlas

elegant-architecturelisted

Guides clean architecture design with strict 200-line file limits. Use when starting new features, refactoring large files, or planning module structure. Enforces modular design and real testing.
majiayu000/claude-arsenal · ★ 72 · AI & Automation · score 84
Install: claude install-skill majiayu000/claude-arsenal
# Elegant Architecture ## Core Principles - **200-line limit** — No file exceeds 200 lines of code - **Split when exceeded** — Convert to folder or multiple files - **Plan first, code later** — Design architecture before implementation - **Single responsibility** — Each module does one thing well - **Real tests only** — No mocks, test actual behavior ## Execution Flow ### 1. Analyze Requirements ```markdown Before writing any code: - List all features/functionalities needed - Estimate code volume for each module - Identify shared components - Map dependencies between modules ``` ### 2. Design File Structure ```markdown When estimated lines > 200: - Convert file to folder with index - Split by sub-functionality - Extract shared utilities Example transformation: ``` ``` # Before (user.ts - 400+ lines) user.ts # After (user/ folder) user/ ├── index.ts # Public exports ├── types.ts # Interfaces, types ├── validation.ts # Input validation ├── repository.ts # Data access └── service.ts # Business logic ``` ### 3. Define Interfaces First ```typescript // Define contracts before implementation interface UserService { create(input: CreateUserInput): Promise<User>; findById(id: string): Promise<User | null>; update(id: string, input: UpdateUserInput): Promise<User>; delete(id: string): Promise<void>; } interface UserRepository { save(user: User): Promise<User>; findById(id: string): Promise<User | null>; findByEmail(email: string): Prom