소스 정보
- 저장소
- ffsshhttiikk/opencode-agents-skills
- 최근 소스 활동
- 2026년 2월 28일 22:54
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill clean-code명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | Clean Code |
| description | Principles and practices for writing readable, maintainable, and expressive code |
| category | software-development |
I help developers write code that is easy to understand, maintain, and extend. Clean code is about respecting both machines and humans—code that works correctly today and can be understood and modified by other developers (or your future self) tomorrow. I encompass naming conventions, function design, formatting, error handling, and overall code organization that prioritizes clarity over cleverness.
Apply clean code principles to all production code that will be maintained over time. Clean code matters most in collaborative environments where multiple developers read and modify the same codebase. Use these practices when writing new features, during code reviews, when debugging, or when refactoring legacy code. Avoid over-engineering one-off scripts or exploratory code where maintainability is not a concern.
from datetime import datetime, timedelta
# Bad
def get_things(a, b):
lst = []
for i in range(a):
for x in lst:
if x.status == 1:
x.status = 2
return lst
# Good
class Task:
def __init__(self, task_id: int, title: str):
self.task_id = task_id
self.title = title
self.status: TaskStatus = TaskStatus.PENDING
class TaskStatus:
PENDING = 1
IN_PROGRESS = 2
COMPLETED = 3
def activate_pending_tasks(
tasks: list[Task],
days_ago: int = 30
) -> list[Task]:
cutoff_date = datetime.now() - timedelta(days=days_ago)
activated_tasks: list[Task] = []
for task in tasks:
if task.status == TaskStatus.PENDING:
task.status = TaskStatus.IN_PROGRESS
activated_tasks.append(task)
return activated_tasks
from decimal import Decimal
from typing import Optional
# Bad - One function doing too much
def process_order(order_data: dict) -> dict:
validate_order(order_data)
calculate_totals(order_data)
apply_discounts(order_data)
save_order(order_data)
send_confirmation(order_data)
update_inventory(order_data)
return order_data
# Good - Each function does one thing
def validate_order(order_data: dict) -> None:
required_fields = ["customer_id", "items", "shipping_address"]
for field in required_fields:
if field not in order_data:
raise ValueError(f"Missing required field: {field}")
def calculate_order_totals(order: dict) -> None:
subtotal = sum(item["price"] * item["quantity"] for item in order["items"])
tax = subtotal * Decimal("0.08")
order["subtotal"] = subtotal
order["tax"] = tax
order["total"] = subtotal + tax
def apply_discounts(order: , discount_code: [] = ) -> :
discount_code == :
order[] *= Decimal()
order[] =
() -> :
validate_order(order_data)
calculate_order_totals(order_data)
apply_discounts(order_data, discount_code)
saved_order = save_order(order_data)
send_confirmation(saved_order)
update_inventory(saved_order)
saved_order
from contextlib import contextmanager
from typing import Generator
class InsufficientFundsError(Exception):
def __init__(self, balance: float, withdrawal: float):
self.balance = balance
self.withdrawal = withdrawal
super().__init__(f"Insufficient funds: {balance} < {withdrawal}")
class AccountClosedError(Exception):
pass
class BankAccount:
def __init__(self, account_id: str, initial_balance: float = 0):
self.account_id = account_id
self._balance = Decimal(str(initial_balance))
self._is_active = True
@property
def balance(self) -> float:
return float(self._balance)
def deposit(self, amount: float) -> None:
if amount <= :
ValueError()
._is_active:
AccountClosedError(.account_id)
._balance += Decimal((amount))
() -> :
amount <= :
ValueError()
._is_active:
AccountClosedError(.account_id)
amount > ._balance:
InsufficientFundsError((._balance), amount)
._balance -= Decimal((amount))
() -> Generator[BankAccount, , ]:
:
account
Exception e:
()
from datetime import datetime
from typing import NamedTuple
class UserCredentials(NamedTuple):
username: str
password_hash: str
salt: str
class AuthenticationResult(NamedTuple):
success: bool
user_id: int | None = None
error_message: str | None = None
class PasswordHasher:
@staticmethod
def hash(password: str, salt: str) -> str:
import hashlib
return hashlib.sha256(f"{password}{salt}".encode()).hexdigest()
@staticmethod
def verify(
password: str,
salt: str,
expected_hash: str
) -> bool:
return PasswordHasher.hash(password, salt) == expected_hash
def authenticate_user(
credentials: UserCredentials,
stored_credentials: dict[str, UserCredentials]
) -> AuthenticationResult:
credentials.username stored_credentials:
AuthenticationResult(success=)
stored = stored_credentials[credentials.username]
PasswordHasher.verify(
credentials.password,
stored.salt,
stored.password_hash
):
AuthenticationResult(success=)
AuthenticationResult(success=, user_id=(credentials.username))
from dataclasses import dataclass
from enum import Enum
from typing import Protocol, runtime_checkable
class OrderStatus(Enum):
PENDING = "pending"
CONFIRMED = "confirmed"
SHIPPED = "shipped"
DELIVERED = "delivered"
CANCELLED = "cancelled"
@dataclass(frozen=True)
class OrderItem:
product_id: str
quantity: int
unit_price: float
@property
def total_price(self) -> float:
return self.quantity * self.unit_price
@dataclass
class ShippingAddress:
street: str
city: str
state: str
zip_code: str
country: str
@dataclass
class Order:
order_id: str
customer_id: str
items: list[OrderItem]
shipping_address: ShippingAddress
status: OrderStatus = OrderStatus.PENDING
created_at: datetime = None
@property
def total_amount() -> :
(item.total_price item .items)
():
() -> :
() -> Order | :