Unity Claude Code
Use this skill for Unity repositories where coding speed matters but asset integrity matters more.
Workflow
- Confirm the repo is actually a Unity project.
- Run
scripts/unity-preflight.sh <repo-root>before proposing edits. - Read only the needed reference file:
references/project-discovery.mdfor repo scan and change targetingreferences/safe-editing-rules.mdfor Unity-specific guardrailsreferences/claude-code-handoff.mdwhen preparing a Claude Code / ACP task
- Keep edits scoped to the requested feature or bug.
- Validate with concrete checks, not assumptions.
Non-negotiables
- Preserve
.metafiles. Never mass-delete, regenerate, or rename them casually. - Treat
*.unity,*.prefab,*.asset,*.mat, andProjectSettings/*as high-risk files. - Prefer C# code changes over broad YAML edits when both can solve the task.
- Call out any scene/prefab edits explicitly in the report.
- If a task touches Addressables, asmdef boundaries, packages, or build settings, mention the impact area before implementation.
Default execution pattern
1. Preflight
Run:
bash scripts/unity-preflight.sh /path/to/repo
2. Identify the narrowest safe target
Prioritize these folders in order:
Assets/**for gameplay/runtime/editor codePackages/manifest.jsonfor package dependenciesProjectSettings/**only when project configuration changes are required
3. Match the task type
- Bugfix → inspect stack path, assembly boundary, scene references, regression risk
- Feature → identify runtime entry points, serialized fields, authoring flow, validation path
- Refactor → map public APIs, scene bindings, serialized names, asmdef consumers
- Review / Handoff → create a Claude Code-ready task brief using
references/claude-code-handoff.md
4. Verify concretely
Use whichever checks fit the repo:
bash -nfor helper scriptsnode --check/node --testfor JS tooling around the Unity repo- repo-specific build/test commands if available
- file diff inspection for
.metachurn and scene/prefab YAML churn
Reporting format
- Changed: exact files
- Risk: scene/prefab/meta/asmdef/package impact
- Verify: commands run and outcomes
- Next: one recommended follow-up
Resources
references/project-discovery.mdreferences/safe-editing-rules.mdreferences/claude-code-handoff.mdscripts/unity-preflight.sh
微信扫一扫