在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用code-quality
星标0
分支0
更新时间2026年1月23日 02:42
코드 품질 가이드, 클린 코드 원칙, 리팩토링 패턴
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
코드 품질 가이드, 클린 코드 원칙, 리팩토링 패턴
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
디버깅 전략, 로깅 베스트 프랙티스, 에러 추적
REST API 설계 원칙, GraphQL 패턴, API 버저닝
기술 문서 작성 가이드, 문서 유형별 템플릿
Git 작업 흐름, 커밋 메시지, 브랜치 전략 가이드
성능 최적화 패턴, 캐싱 전략, 데이터베이스 최적화
보안 취약점 분석, OWASP Top 10, 인증/인가 패턴
| name | code-quality |
| description | 코드 품질 가이드, 클린 코드 원칙, 리팩토링 패턴 |
# Bad
d = get_current_date()
arr = filter(u -> u.a > 18, users)
# Good
currentDate = get_current_date()
adultUsers = filter(user -> user.age > 18, users)
# Bad: function doing multiple things
function processUser(user):
# validation
if not user.email:
throw Error("Email required")
# data transformation
user.email = lowercase(user.email)
# DB save
db.users.insert(user)
# send email
sendWelcomeEmail(user)
# Good: single responsibility
function createUser(userData):
validatedData = validateUserData(userData)
normalizedData = normalizeUserData(validatedData)
user = saveUser(normalizedData)
sendWelcomeEmail(user)
return user
# Bad: explaining with comment
# check if adult
if user.age >= 18:
...
# Good: explain with function name
if isAdult(user):
...
function isAdult(user):
ADULT_AGE = 18
return user.age >= ADULT_AGE
# Bad: ignoring error
try:
doSomething()
catch error:
pass # do nothing
# Good: proper error handling
try:
doSomething()
catch error:
logger.error("Operation failed", error, context)
throw ApplicationError("Failed to complete operation", error)
# Bad: multiple responsibilities
class UserService:
createUser()
sendEmail()
generateReport()
# Good: single responsibility
class UserService:
createUser()
class EmailService:
sendEmail()
class ReportService:
generateReport()
# Bad: open for modification
function calculateArea(shape):
if shape.type == "circle":
return PI * shape.radius ^ 2
else if shape.type == "rectangle":
return shape.width * shape.height
# need to modify function for new shapes
# Good: open for extension
interface Shape:
calculateArea()
class Circle implements Shape:
calculateArea():
return PI * self.radius ^ 2
class Rectangle implements Shape:
calculateArea():
return self.width * self.height
# Before
function printReport(user):
print("=" * 40)
print("Name: " + user.name)
print("Email: " + user.email)
print("=" * 40)
# After
function printReport(user):
printSeparator()
printUserDetails(user)
printSeparator()
function printSeparator():
print("=" * 40)
function printUserDetails(user):
print("Name: " + user.name)
print("Email: " + user.email)
# Before
function getSpeed(vehicle):
switch vehicle.type:
case "car": return vehicle.baseSpeed * 1.2
case "bike": return vehicle.baseSpeed * 0.8
default: return vehicle.baseSpeed
# After
class Vehicle:
getSpeed(): return self.baseSpeed
class Car extends Vehicle:
getSpeed(): return self.baseSpeed * 1.2
class Bike extends Vehicle:
getSpeed(): return self.baseSpeed * 0.8
# Before: nested conditionals
function processOrder(order):
if order:
if length(order.items) > 0:
if order.status == "pending":
# process logic
# After: Guard Clause
function processOrder(order):
if not order: return
if length(order.items) == 0: return
if order.status != "pending": return
# process logic
| 스멜 | 증상 | 해결책 |
|---|---|---|
| Long Method | 50줄 이상의 함수 | Extract Method |
| Large Class | 너무 많은 책임 | Extract Class |
| Long Parameter List | 3개 이상 파라미터 | Parameter Object |
| Duplicate Code | 중복된 코드 블록 | Extract Method/Class |
| Feature Envy | 다른 클래스 데이터에 과도한 접근 | Move Method |
| Magic Numbers | 의미 불명의 숫자 | Named Constant |
# Magic Numbers (Bad)
if user.age >= 18 and length(items) <= 10:
...
# Named Constants (Good)
ADULT_AGE = 18
MAX_CART_ITEMS = 10
if user.age >= ADULT_AGE and length(items) <= MAX_CART_ITEMS:
...
testing: 테스트 작성 전략debugging: 에러 추적 및 디버깅