perf-profile
它能做什么
这个技能查找游戏中运行缓慢的部分,并根据项目设定的性能预算,对加速方法进行排序。适合负责帧率、加载时间或内存的开发者。
适用场景
- ✓当游戏运行缓慢或掉帧,团队需要找出原因的时候。
- ✓当开发者希望根据项目预算来衡量性能的时候。
- ✓当团队在发布前需要一份优化建议排序清单的时候。
技能链接
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/perf-profile/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的游戏在城市场景中会掉帧。请找出瓶颈,并对修复方案排序。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会读取性能分析器的输出和性能设置,把结果与预算进行对比,并生成一份排序后的建议清单。如果没有性能分析数据,它会报告无法运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys performance.enforce,automation,workflow
Resolved above — use as-is. No block → defaults in
.claude/docs/config-resolution.md.
Performance Profile
Every AskUserQuestion call follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
Insufficient input — check this before producing any report
If the inputs this skill needs do not exist, the answer is "could not run" — not a filled-in report. Check first, and stop if the check fails.
- List the inputs this skill reads (data files, prior reports, profiler output, test results, registries, source code).
- For each, record
FOUNDorABSENT— not "assumed present". - If any input required for a section is ABSENT, that section is
NOT ASSESSED — NO DATA. Do not estimate it, do not infer it from an adjacent artifact, and do not leave a mandated cell to be filled by whoever reads the template next. - If every required input is ABSENT, stop and report
NOT ASSESSED — NO DATAas the whole verdict, naming what was missing and which skill produces it.
A verdict of NOT ASSESSED is a success. It is the correct, useful answer to
"what does the data say?" when there is no data. The failure mode this prevents is
specific: a report whose verdict enum has no "could not run" state produces
false clean passes — an asset audit returning COMPLIANT on a project with no
assets and no standards, or a performance profile reporting ">99% headroom against
a 16.67ms budget" with zero profiler data and no budget ever set.
Absence of evidence is never evidence of absence. A scan that finds no matches because there are no files to scan has not verified anything. Say which of the two happened — a reader cannot tell from a green result.
Phase 0: Resolve Budget Enforcement
performance.enforce decides what a budget violation means in this run. It
does not change which budgets are measured — performance.target_framerate,
frame_budget_ms, draw_call_limit and memory_ceiling_mb are profiled the
same way at every level:
| Value | Effect on this profile's findings |
|---|---|
warn (default) |
Violations are reported as findings. They do not block; CI logs them without failing. |
block |
Violations are blockers. Say so explicitly in the report — a block project treats an over-budget system as release-stopping, and /gate-check will FAIL the Polish gate on it. |
off |
Budgets are informational only. Still report measured values, but do not raise violations as findings or recommendations to fix. |
Only warn, block and off are recognized. Surface any other value to the
user and fall back to warn rather than guessing.
The value is locally overridable (
/settings --local performance.enforce=block), so use the resolved block above rather than readingproject.yaml— a teammate's stricter local setting is meant to bite on their machine only.
Phase 1: Determine Scope
Read the argument:
- System name → focus profiling on that specific system
full→ run a comprehensive profile across all systems
Phase 2: Load Performance Budgets
Read the committed budgets from config first — they are the project's record of what it agreed to, and design docs are the fallback, not the source:
bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" get_effective_yaml_key performance.target_framerate
bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" get_effective_yaml_key performance.frame_budget_ms
bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" get_effective_yaml_key performance.draw_call_limit
bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" get_effective_yaml_key performance.memory_ceiling_mb
Run each line as its own plain command, one key per call: the helper moves to
the project root itself, so it works when the session was started in a
subfolder, and this skill pre-approves that form only (a source or cd ... &&
wrapper asks the user every time). Empty output means that budget is not set.
Resolve these budgets from
project.yaml, not from prose. Phase 0 above states these four budgets "are profiled the same way at every level". A user who setperformance.target_framerate: 60inproject.yamlhas it ignored if
常见问题
我需要先有性能分析数据吗?
需要。这个技能需要性能分析器的输出才能与预算比较,没有它就无法运行。
什么是性能预算?
它们是项目事先设定的目标上限,例如帧时间或内存。
它会自己修复问题吗?
它的输出是一份排序后的建议清单,供团队执行。
详情
作者的原始描述
Performance profiling — find bottlenecks, measure against budgets, produce ranked optimization recommendations.
热度
- GitHub 星标
- 33k
- 排名
- #8466
- 许可证
- MIT
- 更新时间
- 2026/10/18
评论
- …