6.1 KiB
Godot Game Development Plugin
This directory contains a Claude Code plugin designed to streamline Godot game development with AI assistance.
Components
Commands (commands/)
Custom slash commands for common Godot workflows:
-
/gd:setup- Validates and configures the Godot development environment- Detects Godot installation
- Verifies Godot MCP server is built
- Creates
.mcp.jsonconfiguration - Provides guidance for missing dependencies
-
/gd:init-game- Initializes a new game project with interactive planning- Launches the game-planner agent
- Creates project structure based on requirements
- Sets up scenes and folders
- Documents the project plan
-
/gd:run- Quickly run the current Godot project- Uses MCP tools to launch the game
- Displays debug output and errors
-
/gd:stop- Stop the running Godot instance
Agents (agents/)
Specialized autonomous agents:
game-planner- Interactive game design assistant- Asks about game type, genre, mechanics
- Gathers technical requirements
- Produces comprehensive game design document
- Recommends project structure and architecture
Skills (skills/)
Autonomous capabilities that activate based on context:
godot-dev- Godot Engine expertise- Activates when working with Godot-specific tasks
- Provides knowledge about nodes, scenes, GDScript
- Uses MCP tools automatically
- Recommends best practices
Hooks (hooks/)
Event-driven automation:
SessionStart- Validates environment when starting a session- Checks if
.mcp.jsonexists - Verifies MCP server and Godot paths
- Displays friendly warnings if misconfigured
- Non-blocking (exit code 0)
- Checks if
Scripts (scripts/)
Helper utilities called by commands and hooks:
validate-env.sh- Environment validation (used by SessionStart hook)setup-mcp.sh- MCP server configuration (used by /setup command)init-project.sh- Project structure initialization (used by /init-game)
Architecture
Command Flow
User types /setup
↓
setup.md executes
↓
Calls setup-mcp.sh script
↓
Script detects Godot & MCP paths
↓
Creates .mcp.json from template
↓
Reports success/failure
Agent Flow
User types /init-game
↓
init-game.md executes
↓
Launches game-planner agent via Task tool
↓
Agent asks user questions
↓
Agent produces game design doc
↓
Command uses plan to create project structure
Skill Activation
User: "How do I add a sprite to my character?"
↓
Claude matches against skill descriptions
↓
godot-dev skill activates automatically
↓
Provides Godot-specific guidance
↓
Uses MCP tools to make changes
Hook Execution
User starts Claude Code session
↓
SessionStart hook triggers
↓
validate-env.sh runs
↓
Checks .mcp.json and paths
↓
Displays warnings if needed (non-blocking)
MCP Server Configuration
The plugin expects the Godot MCP server to be configured in .mcp.json:
{
"mcpServers": {
"godot": {
"command": "node",
"args": ["/path/to/godot-mcp/build/index.js"],
"env": {
"GODOT_PATH": "/path/to/Godot"
}
}
}
}
The /setup command creates this file automatically by:
- Reading
.mcp.json.template - Detecting Godot and MCP server paths
- Replacing placeholders
- Writing
.mcp.json
Customization
Adding New Commands
- Create a new
.mdfile incommands/ - Add frontmatter with
descriptionandallowed-tools - Write the command prompt
- Restart Claude Code to load the command
Example:
---
description: Export the game for a specific platform
allowed-tools:
- mcp__godot__*
- Bash(godot:*)
---
Export the Godot project for the specified platform...
Adding New Skills
- Create a subdirectory in
skills/ - Add a
SKILL.mdfile with frontmatter - Include
nameanddescriptionfields - The skill activates automatically based on description match
Modifying Hooks
Edit hooks/hooks.json to add new hook events. Available events:
- PreToolUse, PostToolUse
- UserPromptSubmit
- SessionStart, SessionEnd
- Stop, SubagentStop
- Notification
- PreCompact
Adding Scripts
- Create new
.shfile inscripts/ - Make it executable:
chmod +x script.sh - Reference it from commands using
!bash .claude/scripts/script.sh - Use
${CLAUDE_PROJECT_DIR}for project-relative paths
Environment Variables
Available in commands and scripts:
CLAUDE_PROJECT_DIR- Absolute path to project rootCLAUDE_PLUGIN_ROOT- Path to plugin directory (for plugins only)
Best Practices
- Keep commands focused - Each command should do one thing well
- Use scripts for complex logic - Bash scripts for multi-step operations
- Make hooks non-blocking - Exit code 0 for validation hooks
- Write clear descriptions - Helps Claude know when to use skills/agents
- Restrict allowed-tools - Only grant necessary permissions
- Document everything - Future you will thank present you
Troubleshooting
Commands not appearing
- Restart Claude Code after adding/modifying commands
- Check for syntax errors in frontmatter
Skills not activating
- Verify
descriptionfield is specific and relevant - Test by directly asking Claude questions that match the description
- Check for YAML syntax errors
Hooks not running
- Verify hooks.json syntax is valid
- Check script paths are correct
- Make scripts executable
- Use
${CLAUDE_PROJECT_DIR}for relative paths - Restart Claude Code after modifying hooks
MCP tools not available
- Verify
.mcp.jsonexists and paths are correct - Restart Claude Code after changing
.mcp.json - Check MCP server is built:
ls ~/projects/godot-mcp/build/index.js - Run
/setupto reconfigure
Contributing
When adding features to this plugin:
- Update this README
- Test thoroughly in a real project
- Document expected behavior
- Add error handling to scripts
- Keep commands simple and composable
Version History
- v1.0.0 - Initial plugin with setup, init-game, run/stop commands, game-planner agent, godot-dev skill