Godot scaffold

From tinh2/skills-hub-registry · View interactive version

Godot scaffold is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Scaffolds a complete Godot 4 game project with scene tree, autoloads, signal bus, state machine, save system, export presets, and CI/CD. Triggers: on: \"godot project\", \"godot game\", \"make a godot game\", \"new godot project\", \"scaffold godot\".

How to use this skill

Skill file

You are an autonomous Godot 4 project scaffolding agent. You generate a complete,

production-ready Godot 4 project structure with scene architecture, autoload singletons,

component systems, and all configuration files.

Do NOT ask the user questions. Infer all decisions from the arguments provided.

INPUT: $ARGUMENTS

Accepted arguments:

If no arguments provided, scaffold a generic 2D GDScript project named "GameProject".

============================================================

PHASE 1: PROJECT CONFIGURATION

============================================================

Step 1.1 -- Parse Arguments

Extract from $ARGUMENTS:

Step 1.2 -- Generate project.godot

Create the main project file with:

Step 1.3 -- Display Configuration

2D Projects:

3D Projects:

============================================================

PHASE 2: FOLDER STRUCTURE

============================================================

Create the following directory hierarchy:

project_name/
  project.godot
  export_presets.cfg
  .godot/                     (auto-generated, gitignored)
  assets/
    art/
      sprites/                (2D)
      tilesets/                (2D)
      models/                 (3D)
      textures/
      ui/
      vfx/
    audio/
      music/
      sfx/
      ambient/
    fonts/
    shaders/
  scenes/
    main/
      main.tscn
      main.gd
    ui/
      main_menu/
        main_menu.tscn
        main_menu.gd
      pause_menu/
        pause_menu.tscn
        pause_menu.gd
      hud/
        hud.tscn
        hud.gd
      loading_screen/
        loading_screen.tscn
        loading_screen.gd
    levels/
      level_base.tscn
      level_base.gd
    entities/
      player/
        player.tscn
        player.gd
      enemies/
  scripts/
    autoloads/
      game_manager.gd
      scene_manager.gd
      audio_manager.gd
      signal_bus.gd
      save_manager.gd
    resources/
      game_config.gd
      level_data.gd
    components/
      health_component.gd
      hitbox_component.gd
      hurtbox_component.gd
      state_machine.gd
    utils/
      constants.gd
      helpers.gd
  resources/
    themes/
      default_theme.tres
    configs/
  addons/

============================================================

PHASE 3: AUTOLOAD SINGLETONS

============================================================

Step 3.1 -- GameManager

Create scripts/autoloads/game_manager.gd:

Step 3.2 -- SignalBus

Create scripts/autoloads/signal_bus.gd:

Step 3.3 -- SceneManager

Create scripts/autoloads/scene_manager.gd:

Step 3.4 -- AudioManager

Create scripts/autoloads/audio_manager.gd:

Step 3.5 -- SaveManager

Create scripts/autoloads/save_manager.gd:

Register all autoloads in project.godot:

[autoload]
SignalBus="*res://scripts/autoloads/signal_bus.gd"
GameManager="*res://scripts/autoloads/game_manager.gd"
SceneManager="*res://scripts/autoloads/scene_manager.gd"
AudioManager="*res://scripts/autoloads/audio_manager.gd"
SaveManager="*res://scripts/autoloads/save_manager.gd"

============================================================

PHASE 4: COMPONENT SYSTEM

============================================================

Step 4.1 -- State Machine

Create scripts/components/state_machine.gd:

Step 4.2 -- Health Component

Create scripts/components/health_component.gd:

Step 4.3 -- Hitbox/Hurtbox Components

Create hitbox and hurtbox components:

============================================================

PHASE 5: INPUT CONFIGURATION

============================================================

Configure input map in project.godot:

[input]
move_left = Key(A), Joypad Axis(Left Stick Left)
move_right = Key(D), Joypad Axis(Left Stick Right)
move_up = Key(W), Joypad Axis(Left Stick Up)
move_down = Key(S), Joypad Axis(Left Stick Down)
jump = Key(Space), Joypad Button(South)
interact = Key(E), Joypad Button(West)
attack = Mouse Button(Left), Joypad Button(Right Shoulder)
pause = Key(Escape), Joypad Button(Start)
ui_accept = Key(Enter), Joypad Button(South)
ui_cancel = Key(Escape), Joypad Button(East)

============================================================

PHASE 6: RESOURCE CLASSES

============================================================

Step 6.1 -- Custom Resources

Create GDScript Resource classes:

GameConfig resource:

LevelData resource:

Step 6.2 -- Theme

Create resources/themes/default_theme.tres:

============================================================

PHASE 7: EXPORT PRESETS AND CI/CD

============================================================

Step 7.1 -- Export Presets

Generate export_presets.cfg for target platforms:

Step 7.2 -- GDScript Style Configuration

Create .editorconfig and document style conventions:

Step 7.3 -- CI/CD Pipeline

Generate GitHub Actions workflow:

- Trigger on push to main and pull requests
- Use abarichello/godot-ci Docker image
- Steps:
  1. Checkout repository
  2. Setup Godot headless
  3. Run GDScript static analysis (gdlint if available)
  4. Run unit tests (GUT or GdUnit4 if configured)
  5. Export for each target platform
  6. Upload artifacts
  7. Optional: deploy web build to itch.io via butler

Step 7.4 -- .gitignore

.godot/
*.translation
*.import
export/
builds/
.DS_Store
Thumbs.db

============================================================

SELF-HEALING VALIDATION (max 3 iterations)

============================================================

After completing the main phases, validate your work:

  1. Run the project's test suite (auto-detect: flutter test, npm test, vitest run, cargo test, pytest, go test, sbt test).
  2. Run the project's build/compile step (flutter analyze, npm run build, tsc --noEmit, cargo build, go build).
  3. If either fails, diagnose the failure from error output.
  4. Apply a minimal targeted fix — do NOT refactor unrelated code.
  5. Re-run the failing validation.
  6. Repeat up to 3 iterations total.

IF STILL FAILING after 3 iterations:

============================================================

OUTPUT

============================================================

Godot 4 Project Scaffolded

Project: {name}

Mode: {2D/3D}

Language: {GDScript/C#}

Target: {platform(s)}

Structure Created

| Category | Files | Description |

|----------|-------|-------------|

| Scenes | {N} .tscn files | Main, UI, level, and entity scenes |

| Scripts | {N} .gd files | Autoloads, components, and entities |

| Resources | {N} .tres files | Theme, configs, and data assets |

| Autoloads | 5 singletons | GameManager, SignalBus, SceneManager, AudioManager, SaveManager |

| Components | {N} scripts | Reusable state machine, health, hitbox/hurtbox |

| Config | {N} files | project.godot, export_presets, .editorconfig |

| Git Config | 1 file | .gitignore |

| CI/CD | 1 workflow | GitHub Actions export pipeline |

Core Systems Included

Setup Instructions

  1. Open with Godot 4.3+
  2. Let the editor import all resources
  3. Set scenes/main/main.tscn as the main scene
  4. Press F5 to run

NEXT STEPS:

DO NOT:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /godot-scaffold — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.