用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill budget-management命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | budget-management |
| description | Track and manage travel budget across accommodations, meals, and activities |
Manage and allocate a fixed travel budget across accommodations, meals, attractions, and other expenses.
from typing import Dict, List
class BudgetTracker:
def __init__(self, total_budget: float):
self.total_budget = total_budget
self.expenses: Dict[str, List[float]] = {
'accommodation': [],
'breakfast': [],
'lunch': [],
'dinner': [],
'attractions': [],
'transportation': []
}
def add_expense(self, category: str, amount: float) -> None:
"""Add expense to tracker"""
if category in self.expenses:
self.expenses[category].append(amount)
def get_total_by_category(self, category: str) -> float:
"""Get total spent in a category"""
return sum(self.expenses.get(category, []))
def get_remaining_budget(self) -> float:
"""Calculate remaining budget"""
total_spent = sum(
sum(expenses) for expenses in self.expenses.values()
)
return self.total_budget - total_spent
def get_budget_summary(self) -> Dict[str, float]:
"""Get spending summary by category"""
summary = {}
for category, expenses in self.expenses.items():
total = sum(expenses)
summary[category] = {
'total': total,
'count': len(expenses),
'average': total / len(expenses) if expenses else 0
}
return summary
def is_within_budget(self) -> bool:
"""Check if spending is within budget"""
return self.get_remaining_budget() >= 0
def estimate_accommodation_cost(
num_nights: int,
price_per_night: float
) -> float:
"""Estimate total accommodation cost"""
return num_nights * price_per_night
def estimate_meal_cost(
num_days: int,
num_people: int,
cost_per_meal_per_person: float
) -> float:
"""Estimate total meal cost (3 meals per day)"""
return num_days * num_people * 3 * cost_per_meal_per_person
def find_affordable_options(
data: List[Dict],
budget_per_item: float,
price_field: str
) -> List[Dict]:
"""Filter options within budget"""
affordable = []
for item in data:
try:
price = float(item.get(price_field, 0))
if price <= budget_per_item:
affordable.append(item)
except (ValueError, TypeError):
continue
return affordable
tracker = BudgetTracker(5100)
# Add expenses as itinerary is built
tracker.add_expense('accommodation', 250) # Per night
tracker.add_expense('breakfast', 25) # For 2 people
tracker.add_expense('lunch', 40)
tracker.add_expense('dinner', 60)
# Check status
print(f"Remaining: ${tracker.get_remaining_budget()}")
print(f"Within budget: {tracker.is_within_budget()}")