clean-code
Solid클린 코드 원칙 및 적용 가이드를 실행합니다.
Code & Development 13 stars
2 forks Updated 5 days ago MIT
Install
Quality Score: 81/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Clean Code Skill
클린 코드 원칙 및 적용 가이드를 실행합니다.
## 네이밍
### 의도를 드러내는 이름
```javascript
// ❌ Bad
const d = 86400;
const list = users.filter(u => u.a > 18);
// ✅ Good
const SECONDS_PER_DAY = 86400;
const adultUsers = users.filter(user => user.age > 18);
```
### 검색 가능한 이름
```javascript
// ❌ Bad
setTimeout(fn, 86400000);
// ✅ Good
const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
setTimeout(fn, MILLISECONDS_PER_DAY);
```
### 발음 가능한 이름
```javascript
// ❌ Bad
const yyyymmdstr = moment().format('YYYY/MM/DD');
// ✅ Good
const currentDate = moment().format('YYYY/MM/DD');
```
## 함수
### 작게 만들기
```javascript
// ❌ Bad: 너무 긴 함수
function processOrder(order) {
// 100줄의 코드...
}
// ✅ Good: 작은 함수들로 분리
function processOrder(order) {
validateOrder(order);
calculateTotal(order);
applyDiscounts(order);
saveOrder(order);
sendConfirmation(order);
}
```
### 하나의 일만 하기
```javascript
// ❌ Bad: 여러 일을 함
function emailClients(clients) {
clients.forEach(client => {
const record = database.lookup(client);
if (record.isActive()) {
email(client);
}
});
}
// ✅ Good: 하나의 일만
function emailActiveClients(clients) {
clients
.filter(isActiveClient)
.forEach(email);
}
function isActiveClient(client) {
const record = database.lookup(client);
return record.isActive();
}
```
### 인수 최소화
```javascript
// ❌ Bad: 인수가 많음
function createUser(name, email, age, address, phone, role) {}
// ✅ Good: 객체로 전달
function createUser({ name, email, age, address, phone, role }) {}
/...
Details
- Author
- excatt
- Repository
- excatt/superclaude-plusplus
- Created
- 3 months ago
- Last Updated
- 5 days ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Featured
debug-helper
Help debug code by analyzing error messages, identifying root causes, and providing fix suggestions.
528 Updated today
JackyST0 DevOps & Infrastructure Solid
node.js-
检查 RCE、SSRF、SQL 注入、路径穿越等安全问题,支持 Express/Koa/NestJS
833 Updated 3 days ago
TencentBlueKing Code & Development Listed
coding-standards
Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.
10 Updated 1 months ago
GiorgioBertolotti Code & Development Featured
code-review
Perform thorough code reviews with security, performance, and maintainability analysis. Use when user asks to review code, check for bugs, or audit a codebase.
62,572 Updated today
shareAI-lab