AGENT SKILL

fitness-nutrition

健身动作库与营养查询。通过 wger API 搜索 690+ 动作(按肌群/器械/名称), 通过 USDA FoodData Central 查询 38万+ 食物营养数据。 离线计算器:BMI、TDEE、1RM、宏量分配、体脂率。纯 Python,无 pip 依赖。

License 许可
MIT
最近更新
2026-11-11
Stars
★ 447
Forks
138

01 前言 Front Matter

name
fitness-nutrition
authors
[ "haileymarshall (original)" ]
license
MIT
version
1.0.0
platforms
[ "linux", "macos", "windows" ]
description
健身动作库与营养查询。通过 wger API 搜索 690+ 动作(按肌群/器械/名称), 通过 USDA FoodData Central 查询 38万+ 食物营养数据。 离线计算器:BMI、TDEE、1RM、宏量分配、体脂率。纯 Python,无 pip 依赖。

02 资源文件 3

03 SKILL.md 正文

Fitness & Nutrition

健身动作库 + 营养查询 + 身体计算器,训练计划所需数据全部在这里。

When to Use

触发此 skill 当用户:

  • 制定训练计划(需要查动作)
  • 问动作怎么做(需要动作详情)
  • 问饮食/营养(需要食物数据或宏量计算)
  • 需要计算 BMI / TDEE / 1RM / 体脂率 / 宏量分配

Procedure

动作查询(wger API)

wger 公开端点无需认证。始终加 language=2&status=2 获取已审核英文动作。

按名称搜索:

QUERY="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$QUERY")
curl -s "https://wger.de/api/v2/exercise/search/?term=${ENCODED}&language=english&format=json" \
  | python3 -c "
import json,sys
data=json.load(sys.stdin)
for s in data.get('suggestions',[])[:10]:
    d=s.get('data',{})
    print(f'  ID {d.get(\"id\",\"?\"):>4} | {d.get(\"name\",\"N/A\"):<35} | Category: {d.get(\"category\",\"N/A\")}')
"

获取动作详情:

EXERCISE_ID="$1"
curl -s "https://wger.de/api/v2/exerciseinfo/${EXERCISE_ID}/?format=json" \
  | python3 -c "
import json,sys,html,re
data=json.load(sys.stdin)
trans=[t for t in data.get('translations',[]) if t.get('language')==2]
t=trans[0] if trans else data.get('translations',[{}])[0]
desc=re.sub('<[^>]+>','',html.unescape(t.get('description','N/A')))
print(f'Exercise  : {t.get(\"name\",\"N/A\")}')
print(f'Category  : {data.get(\"category\",{}).get(\"name\",\"N/A\")}')
print(f'Primary   : {\", \".join(m.get(\"name_en\",\"\") for m in data.get(\"muscles\",[])) or \"N/A\"}')
print(f'Secondary : {\", \".join(m.get(\"name_en\",\"\") for m in data.get(\"muscles_secondary\",[])) or \"none\"}')
print(f'Equipment : {\", \".join(e.get(\"name\",\"\") for e in data.get(\"equipment\",[])) or \"bodyweight\"}')
print(f'How to    : {desc[:500]}')
imgs=data.get('images',[])
if imgs: print(f'Image     : {imgs[0].get(\"image\",\"\")}')
"

按肌群/器械筛选:

FILTER="$1"  # e.g. "muscles=4" or "category=11" or "equipment=3"
curl -s "https://wger.de/api/v2/exercise/?${FILTER}&language=2&status=2&limit=20&format=json" \
  | python3 -c "
import json,sys
data=json.load(sys.stdin)
print(f'Found {data.get(\"count\",0)} exercises.')
for ex in data.get('results',[]):
    print(f'  ID {ex[\"id\"]:>4} | muscles: {ex.get(\"muscles\",[])} | equipment: {ex.get(\"equipment\",[])}')
"

营养查询(USDA FoodData Central)

使用 USDA_API_KEY 环境变量,未设置则回退到 DEMO_KEY。 DEMO_KEY = 30次/小时,免费注册 = 1000次/小时。

# 搜索单种食物
python3 scripts/nutrition_search.py "chicken breast"

# 搜索多种食物
python3 scripts/nutrition_search.py "rice" "eggs" "broccoli"

身体计算(离线)

python3 scripts/body_calc.py bmi <体重kg> <身高cm>
python3 scripts/body_calc.py tdee <体重kg> <身高cm> <年龄> <M|F> <活动量1-5>
python3 scripts/body_calc.py 1rm <重量> <次数>
python3 scripts/body_calc.py macros <TDEE> <cut|maintain|bulk>
python3 scripts/body_calc.py bodyfat <M|F> <颈围cm> <腰围cm> [臀围cm] <身高cm>

公式出处见 references/FORMULAS.md。

中文适配规则

wger 和 USDA 返回的数据都是英文,必须:

  1. 动作名:保留英文原名 + 附带中文常用名(如 Bench Press/卧推)
  2. 动作描述:翻译为中文后输出,不直接给用户看英文原文
  3. 食物名:翻译为中文(如 chicken breast → 鸡胸肉)
  4. 肌群名:用中文(如 Pectoralis major → 胸大肌)

Pitfalls

  • wger 默认返回所有语言 → 必须加 language=2 筛英文
  • wger 包含未审核用户提交 → 必须加 status=2 只取已审核
  • USDA DEMO_KEY 30次/小时 → 批量查询加 sleep 2 或注册免费 Key
  • USDA 数据是每 100g → 提醒用户按实际份量换算
  • BMI 不区分肌肉和脂肪 → 肌肉型用户高 BMI 不是问题
  • 体脂率公式误差 ±3-5% → 建议DEXA扫描获取精确值
  • 1RM 公式在 >10 次时准确度下降 → 用 3-5 次的数据估算最准
  • wger 的搜索端点用 term 不是 query

04 同仓库更多 Skills

infometa
infometa/workbuddyskills

yingmi-skill

当用户需要查询基金、策略、公告、财经资讯,做资产配置、组合诊断、风险回测、现金流分析,或生成图表、PDF 时,优先使用本 Skill 获取真实数据与可执行能力。

★ 447
infometa
infometa/workbuddyskills

web-access

所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、网络交互等。

★ 447
infometa
infometa/workbuddyskills

tencentmap-map-assistant

腾讯位置服务·地图助手 Skill,一句自然语言调用腾讯地图全套能力,无需开发者账号、开箱即用。提供 AI 旅游攻略、地点搜索(含评分/人均/营业时间)、关键词提示、路线规划(驾车/步行/公交/骑行)、地址解析与逆解析、行政区划、IP 定位、距离计算、天气查询,并可将行程或多 POI 渲染成网页地图。涉及找地点、规划路线、旅游行程、查天气、坐标转换等出行场景时使用。

★ 447
infometa
infometa/workbuddyskills

skill-scanner

Scan any agent skill for security risks before you install or use it. Powered by Tencent Zhuque Lab A.I.G (AI-Infra-Guard). 100% local static analysis — no file contents or credentials leave your device. Compatible with CodeBuddy, Cursor, Windsurf, Claude Code, OpenClaw and more. Triggers on: 这个 skill 安全吗, skill 安全扫描, 检查 skill 安全, audit skill, scan skill, check skill safety, analyze skill, inspect skill, verify skill, skill security, skill supply chain. Do NOT trigger for general agent usage, full system health checks, project debugging, or normal development.

★ 447
infometa
infometa/workbuddyskills

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends agent capabilities with specialized knowledge, workflows, or tool integrations.

★ 447
infometa
infometa/workbuddyskills

shader-dev

Comprehensive GLSL shader techniques for creating stunning visual effects — ray marching, SDF modeling, fluid simulation, particle systems, procedural generation, lighting, post-processing, and more.

★ 447