一键导入
code-reviewer
Analyze GDScript code for quality, anti-patterns, and refactoring opportunities, then execute fixes. Combines review and refactoring in one skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze GDScript code for quality, anti-patterns, and refactoring opportunities, then execute fixes. Combines review and refactoring in one skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate and maintain a playable HTML/JS prototype from feature specs. Builds a persistent browser-based game sandbox that grows across sprints, letting you test mechanics and UI flows before committing to Godot implementation.
Orchestrate the full game development workflow — Phase 0 design pipeline, sprint cycles, lifecycle gates. Reads workflow state to ensure correct sequencing across sessions. Run this before starting any game development work.
End-to-end UI generation pipeline — generate art with Ludo MCP, build HTML mockup, push to Figma, pull interactive Make prototype back, and implement in Godot.
Generate a comprehensive Full Game Vision document capturing every mechanic, system, content layer, and feature across all lifecycle phases. Creates the master scope map that GDDs pull from.
Generate sprint-based implementation roadmaps with "Player can X" playable increments and per-agent breakdowns. Scales from prototype to production.
Generate detailed feature specifications with an optional idea refinement phase. Handles the full pipeline from vague idea to structured spec, using the project's feature spec template, GDD, and roadmap for context.
| name | code-reviewer |
| description | Analyze GDScript code for quality, anti-patterns, and refactoring opportunities, then execute fixes. Combines review and refactoring in one skill. |
| domain | code-quality |
| type | reviewer |
| version | 1.0.0 |
| allowed-tools | ["Read","Write","Edit","Glob","Grep"] |
This skill analyzes GDScript files for code quality issues and executes refactorings. It operates in two modes: Review mode (analyze and report) and Fix mode (apply recommended changes).
| Field | Value |
|---|---|
| Assigned Agent | qa-docs |
| Sprint Phase | Phase C (QA) |
| Directory Scope | Reviews all scripts/ directories |
| Output Directory | docs/code-reviews/ |
| Workflow Reference | See docs/agent-team-workflow.md |
Invoke this skill when the user:
Analyze code and produce a report. Triggered by:
Execute refactorings from a review report. Triggered by:
When neither mode is specified explicitly:
Node References:
get_node("NodeName") or $NodeName in _ready() or repeatedly@onready var node_ref = $NodeNameSignals vs. Polling:
_process() every frame (e.g., if health <= 0:)health_depleted.emit())Process Functions:
_process(delta)_physics_process(delta) for physics_process() or _physics_process() functions (remove them)Resource Loading:
load("res://...")const RESOURCE = preload("res://...")Node Access:
get_node("../../UI/HUD/Label")Type Safety:
var speed = 100) and returns (func get_damage():)var speed: float = 100.0) and returns (func get_damage() -> int:)Expensive Operations in Loops:
# Bad -- query inside loop
for enemy in enemies:
var player = get_tree().get_first_node_in_group("player")
# Good -- query once outside loop
var player = get_tree().get_first_node_in_group("player")
for enemy in enemies:
String Operations:
str += "text")"%s: %d" % [name, value])Unnecessary Repeated Calls:
get_tree() calls@onready var tree = get_tree()Array/Dictionary Operations:
append() in hot paths without pre-sizingarray.resize(expected_size)Node Creation:
Magic Numbers:
# Bad
velocity.x = 200
health -= 15
# Good
const MAX_SPEED: float = 200.0
const BULLET_DAMAGE: int = 15
Long Functions: Functions over 30-40 lines should be broken up.
Duplicate Code: Similar code blocks across files should be extracted to shared functions or base classes.
Poor Naming: Single-letter variables (except loops), unclear function names (do_thing()), generic names (temp, data).
Missing Documentation: No docstrings for public functions, no comments explaining complex logic, no @export hints for designer-facing variables.
Signal Leaks:
_exit_tree() or use CONNECT_ONE_SHOTQueue Free:
free() directly (can cause crashes)queue_free() for safe deferred deletionCircular References: Nodes holding references to each other without cleanup.
Resource Cleanup: Not freeing manually allocated resources or holding references to destroyed nodes.
Null Checks:
# Bad -- crashes if null
var target = get_target()
target.take_damage(10)
# Good
var target = get_target()
if target:
target.take_damage(10)
Array Access:
array[5]) without bounds checkif array.size() > 5:)Type Assumptions: Always verify with is_instance_valid() before accessing destroyed nodes.
Look for repeated logic in:
Suggest: Base classes, composition (health_component.gd, movement_component.gd), utility functions.
Deprecated Syntax:
onready var should be @onready varexport var should be @export varyield() should be await.emit()New Features Not Used:
var items: Array[Item]@export_range, @export_enum@warning_ignoreDelta Scaling: Using delta when should use DeltaScale.get_scaled_delta(delta).
Manager Access: Direct scene tree queries instead of using managers (PassiveManager, VFXManager, etc.).
Weapon Pattern: Weapons not following established pattern (target selection, cooldown, firing). Missing required methods: fire(), select_target(), reset().
Enemy Pattern: Enemies not inheriting from enemy_base.gd. Not using shared health/damage/death systems.
docs/code-reviews/# GDScript Refactor Report: [script_name].gd
## Summary
- Lines of code: X
- Issues found: X
- Severity breakdown: Critical / Warning / Suggestion
---
## Critical Issues (Fix Immediately)
### 1. [Issue Name] - Line X
**Problem:**
[code snippet]
**Impact:** [Why this is critical]
**Fix:**
[improved code snippet]
## Performance Warnings (Should Fix)
[Same format]
## Code Quality Suggestions (Nice to Have)
[Same format]
## Code Duplication Analysis
[If multiple files checked, show similar code blocks]
---
## Refactoring Recommendations
1. **[Suggestion]**
- Extract [X] to [Y]
- Benefits: [description]
- Effort: Low/Medium/High
## Overall Assessment
[1-2 paragraph summary with priority recommendations]
Every review must be saved to a file in addition to being shown in chat.
File Location: docs/code-reviews/[script-name]_review_[YYYY-MM-DD].md
Examples:
docs/code-reviews/player_review_2025-01-15.mddocs/code-reviews/weapon-scripts_review_2025-01-15.mddocs/code-reviews/enemy-ai_review_2025-01-15.mdFile Naming Convention:
.gd extension), converted to kebab-case_review_[date] where date is YYYY-MM-DD formatReport Header (file only, not in chat):
---
review_date: YYYY-MM-DD
reviewed_files:
- path/to/script1.gd
- path/to/script2.gd
reviewer: Claude Code (code-reviewer skill)
---
List available reports from docs/code-reviews/ and ask user to confirm which report to execute. If invoked immediately after a review, use that review's findings directly.
Extract actionable items grouped by priority:
For each item, identify: target file, line numbers, issue type, and suggested fix.
Before making ANY changes, show the user a plan:
## Execution Plan
### Priority 1: Critical Issues (N fixes)
1. player.gd:45 - Add type annotation to `speed` variable
2. player.gd:67 - Convert `get_node()` to `@onready`
3. player.gd:89 - Add null check before accessing `target`
### Priority 2: Performance Warnings (N fixes)
1. player.gd:102 - Cache `get_tree()` call outside loop
2. player.gd:134 - Use `@onready` for node reference
### Priority 3: Code Quality (N fixes)
[... etc ...]
**Total changes:** X edits across Y files
Proceed with execution?
Wait for user confirmation before proceeding.
For each fix, in priority order:
Handle edge cases:
Save to docs/refactoring/[report-name]_execution_[YYYY-MM-DD].md:
# Refactoring Execution Report
**Executed:** [YYYY-MM-DD]
**Source Report:** docs/code-reviews/[report-name].md
**Executor:** Claude Code (code-reviewer skill)
---
## Summary
- Fixes applied: X
- Fixes skipped: Y
- Fixes failed: Z
- Files modified: N
## Applied Fixes
### 1. file.gd:line - Description
**Issue:** [description]
**Fix:** [what was changed]
**Status:** Applied successfully
## Skipped Fixes
### 1. file.gd:line - Description
**Reason:** [why it was skipped]
## Failed Fixes
### 1. file.gd:line - Description
**Reason:** [why it failed]
## Modified Files
1. scripts/systems/player.gd (N changes)
## Recommendations
1. Test the game to ensure functionality is preserved
2. Manual review needed for any failed fixes
3. Consider committing refactorings separately for easy rollback
Type Annotations:
var speed = 200 becomes var speed: float = 200.0
Deprecated Syntax:
onready var player = $Player becomes @onready var player = $Player
Node Reference Optimization:
get_node("Player") in _process() becomes @onready var player = $Player
Magic Numbers to Constants:
Inline numbers become named const declarations at the top of the script.
Null Safety Checks:
Direct access becomes guarded with if target: checks.
Performance Optimizations: Move expensive operations out of loops, cache repeated lookups.
Signal Connection Cleanup:
Add _exit_tree() disconnection for signals connected in _ready().
Process Function Corrections:
Move physics operations from _process() to _physics_process().
Line numbers do not match: Search for surrounding code context. If found, apply fix. If not found, skip.
File modified since report: Check if issue still exists. If yes, apply. If no, skip as already resolved.
Fix is ambiguous: Skip, add to "Manual Review Needed" section.
Syntax error after edit: Attempt to revert the edit, mark as failed, continue with remaining fixes.
Review mode:
Fix mode:
Combined flow:
Review mode:
docs/code-reviews/[name]_review_[date].mdFix mode:
docs/refactoring/