소스 정보
- 저장소
- 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 refactoring명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | Refactoring |
| description | Systematic improvement of existing code without changing external behavior |
| category | software-development |
I provide techniques for improving the structure of existing code while preserving its functionality. Refactoring is the art of transforming code into a better version of itself—cleaner, simpler, more maintainable—without altering what the code does. I help identify code smells, apply transformation patterns, and ensure that improvements don't introduce regressions.
Refactor when adding new features, fixing bugs, or during code reviews when you notice opportunities for improvement. Apply the "Rule of Three" — code can be copied once, but the third time needs refactoring. Refactor when code is hard to understand, when tests are difficult to write, or when you see duplication. Never refactor without tests that verify behavior. Avoid refactoring production code without proper safeguards.
# Before: Long method doing multiple things
def process_order(order_data: dict) -> dict:
# Validate order
if "customer_id" not in order_data:
raise ValueError("Missing customer_id")
if "items" not in order_data or not order_data["items"]:
raise ValueError("Order must have items")
# Calculate prices
subtotal = 0
for item in order_data["items"]:
subtotal += item["price"] * item["quantity"]
tax = subtotal * 0.08
total = subtotal + tax
# Apply discounts
if "discount_code" in order_data:
discount = 0.1 if order_data["discount_code"] == "SAVE10" else 0
total *= (1 - discount)
# Save order
order_data["order_id"] = generate_order_id()
order_data["subtotal"] = subtotal
order_data["tax"] = tax
order_data["total"] = total
order_data["status"] = "processed"
send_email(order_data[], , order_data)
order_data
() -> :
validate_order(order_data)
calculate_order_prices(order_data)
apply_discounts(order_data)
finalize_order(order_data)
send_order_notification(order_data)
order_data
() -> :
order_data:
ValueError()
order_data order_data[]:
ValueError()
() -> :
subtotal = (item[] * item[] item order_data[])
order_data[] = subtotal
order_data[] = subtotal *
order_data[] = subtotal *
() -> :
order_data order_data[] == :
order_data[] *=
order_data[] =
() -> :
order_data[] = generate_order_id()
order_data[] =
() -> :
send_email(order_data[], , order_data)
() -> :
uuid
(uuid.uuid4())[:]
from abc import ABC, abstractmethod
from datetime import datetime
# Before: Long switch statement
class Employee:
def __init__(self, name: str, employee_type: str, salary: float = 0):
self.name = name
self.employee_type = employee_type
self.base_salary = salary
def calculate_pay(self, hours_worked: float) -> float:
if self.employee_type == "hourly":
return hours_worked * self.base_salary
elif self.employee_type == "salaried":
return self.base_salary / 12
elif self.employee_type == "commission":
return self.base_salary * 0.1
# After: Polymorphic approach
class Employee(ABC):
def __init__(self, name: str):
self.name = name
() -> :
():
():
().__init__(name)
.hourly_rate = hourly_rate
() -> :
hours_worked * .hourly_rate
():
():
().__init__(name)
.annual_salary = annual_salary
() -> :
.annual_salary /
():
():
().__init__(name)
.base_salary = base_salary
() -> :
.base_salary *
from dataclasses import dataclass
from typing import NamedTuple
# Before: Long parameter lists
def create_report(
title: str,
author: str,
date_created: str,
start_date: str,
end_date: str,
include_charts: bool,
include_summary: bool,
format: str,
template: str,
output_path: str
) -> None:
print(f"Creating report: {title}")
# Implementation...
# After: Grouped parameters
class ReportConfig(NamedTuple):
title: str
author: str
date_created: str
class DateRange(NamedTuple):
start_date: str
end_date: str
class ReportOptions(NamedTuple):
include_charts: bool = True
include_summary: bool = True
format: str = "pdf"
template: str = "default"
class ():
output_path:
() -> :
()
# Before: Magic numbers everywhere
class Order:
def __init__(self, items: list):
self.items = items
def calculate_discount(self, order_value: float, customer_age: int) -> float:
if order_value > 100:
discount = 0.1
elif order_value > 50:
discount = 0.05
else:
discount = 0
if customer_age > 65:
discount += 0.05
return order_value * discount
def is_expired(self, order_date: str) -> bool:
from datetime import datetime, timedelta
date = datetime.strptime(order_date, "%Y-%m-%d")
return datetime.now() - date > timedelta(30)
# After: Named constants
class Order:
FREE_SHIPPING_THRESHOLD = 100.0
STANDARD_DISCOUNT_RATE = 0.05
PREMIUM_DISCOUNT_RATE = 0.1
SENIOR_DISCOUNT_RATE = 0.05
ORDER_EXPIRY_DAYS = 30
def __init__(self, items: ):
.items = items
() -> :
order_value >= .FREE_SHIPPING_THRESHOLD:
discount_rate = .PREMIUM_DISCOUNT_RATE
order_value >= .FREE_SHIPPING_THRESHOLD / :
discount_rate = .STANDARD_DISCOUNT_RATE
:
discount_rate =
customer_age >= :
discount_rate += .SENIOR_DISCOUNT_RATE
order_value * discount_rate
() -> :
datetime datetime, timedelta
date = datetime.strptime(order_date, )
datetime.now() - date > timedelta(.ORDER_EXPIRY_DAYS)
# Before: Poorly named methods
class Account:
def __init__(self, balance: float):
self.balance = balance
def x(self) -> bool:
return self.balance > 100
def do_stuff(self, amount: float) -> None:
if self.x():
self.balance -= amount
# After: Clear names, inline when appropriate
class Account:
MINIMUM_BALANCE = 100.0
def __init__(self, balance: float):
self.balance = balance
def has_minimum_balance(self) -> bool:
return self.balance >= self.MINIMUM_BALANCE
def withdraw(self, amount: float) -> None:
if self.has_minimum_balance():
self.balance -= amount