Skip to main content

best-practices

Read when adding a new function, module, or component, or when a file is growing large enough that splitting it is worth considering. Covers SOLID design principles, minimal interfaces, composition over inheritance, and the size and complexity limits for functions, files, and nesting depth.

소스 정보

저장소
lightly-ai/lightly-studio
최근 소스 활동
2026년 8월 5일 08:10
감지된 SKILL.md 언어
영어
스타
896
포크
40

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
best-practices
description
Read when adding a new function, module, or component, or when a file is growing large enough that splitting it is worth considering. Covers SOLID design principles, minimal interfaces, composition over inheritance, and the size and complexity limits for functions, files, and nesting depth.
# Best Practices ## Design Principles Apply SOLID principles to create maintainable, scalable components. ### Single Responsibility A function or module should have one reason to change. If it has two, split it. Do not mix data fetching, business logic and presentation in the same component. Small files are welcome. ### Minimal Interfaces Components should only accept the data that they actually use. Avoid passing entire objects when a few fields suffice. Create an abstracted interface that only exposes what the component needs. ### Composition over Inheritance Don't create deep class hierarchies. Build complex behavior by combining small, focused units. Use dependency injection and dependency inversion. ## Managing Complexity ### Split Large Units When adding new code, always consider splitting the logic into a new function, component or a file. As a rule of thumb: - Functions should be under 20 lines - Files should be under 400 lines ### Reducing Complexity Keep logic easy to understand by reducing horizontal, vertical and cyclomatic complexity. As a rule of thumb: - **Nesting depth** should be under 3 levels - use early returns to flatten - **Conditional branches** per function should be limited - extract complex logic into separate functions - **Extract helper variables** instead of writing complex inline expressions
GitHub에서 보기