draft-a-godot-frontend-scene
Skill0 starsChanged 7 months agoMITView on GitHub
Interactively create a self-contained Godot 4.x frontend leaf scene. The user describes a visual UI/HUD/feature widget, the skill asks clarifying questions, then generates a folder under frontend/scenes/<feature>/ containing a .tscn, .gd script, and optional resources. Generated scenes are pure leaves — they never reference other frontend scenes. All configuration is exposed through @export values with validated setters. Use when the user wants to create a new visual frontend component, HUD element, UI widget, or tweakable scene.
In this repository28 other files it gives its agents.
- bootstrapSkill
- build-alignmentSkill
- decompose-issueSkill
- deploySkill
- design-an-interfaceSkill
- edit-articleSkill
- explore-realitySkill
- git-guardrails-claude-codeSkill
- grill-meSkill
- implement-issueSkill
- improve-codebase-architectureSkill
- insightSkill
- integrate-godot-frontend-sceneSkill
- learn-itSkill
- migrate-to-shoehornSkill
- new-plasmoidSkill
- obsidian-vaultSkill
- prd-to-godot-frontendSkill
- prd-to-issuesSkill
- prd-to-planSkill
- request-refactor-planSkill
- scaffold-exercisesSkill
- setup-pre-commitSkill
- tddSkill
- triage-issueSkill
- ubiquitous-languageSkill
- write-a-prdSkill
- write-a-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Do not overwrite. Warn the user and show what exists.
- Distinctive: line 49
Ask: "What visual elements do you see?
- Very specific: line 52
Every visual property the user might want to adjust → @export.
- Distinctive: line 53
Ask per element: "What about this should be adjustable?
- Distinctive: line 54
If the user says "it should be red", ask: "Hardcoded red or @export color so you can tweak it?"
- Very specific: line 60
Document the limit formula in the ## docstring.
- Distinctive: line 65
Ask: "What should happen when X changes?
- Very specific: line 71
Ask: "Do you have an existing texture/font/shader for this, or should we use a placeholder?"
- Very specific: line 75
Every generated .gd file MUST follow these rules:
- Very specific: line 141
If frontend/scenes/<feature_name>/ already exists:
- Distinctive: line 144
Read the existing README.md (Interface Manifest).
- Distinctive: line 209
User: Create a health bar.
- Distinctive: line 215
Skill: Should the color be hardcoded red or an @export so you can tweak it?
- Distinctive: line 223
Skill: Should the bar width be a fixed pixel size or a ratio of screen width?
- Distinctive: line 227
Skill: Should it emit a signal when health drops below 25%?
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Godot Frontend Scene
Interactively create a self-contained, tweakable Godot 4.x frontend leaf scene.
Invocation Flow
- User describes a visual feature. Example: "I want a health bar with a red fill and a text label"
- Skill asks clarifying questions. Walk the user through the design tree until the scene is fully specified. See Clarifying Questions.
- Skill proposes a design summary.
List all
@exportvariables, node tree, signals, and resources. User confirms. - Skill generates files.
Creates
frontend/scenes/<feature_name>/with:<feature_name>.tscn<feature_name>.gd- Optional:
.gdshader,.tres, texture imports
- If folder already exists, STOP. Do not overwrite. Warn the user and show what exists. Require explicit confirmation or a new name.
Output Structure
res://frontend/scenes/<feature_name>/
├── <feature_name>.tscn # Scene file
├── <feature_name>.gd # Script (leaf, no frontend refs)
├── <feature_name>.gdshader # (optional) If shader needed
└── README.md # Auto-generated interface manifestThe README.md is an Interface Manifest listing every @export, its type, limits, default, and signals. This protects the user when they manually xref this scene into parent compositions.
Clarifying Questions
For every feature, resolve these branches:
1. What nodes make up this scene?
- Godot built-ins only (
Control,TextureRect,Label,ProgressBar,ColorRect,CanvasLayer, etc.) - Forbidden:
AnimationPlayer,Tweennodes, or sub-instances of otherfrontend/scenes/*scenes. - Ask: "What visual elements do you see? (e.g., background bar, fill, text, icon)"
2. What values should be tweakable at design time?
- Every visual property the user might want to adjust →
@export. - Ask per element: "What about this should be adjustable? Color? Size? Text? Visibility?"
- If the user says "it should be red", ask: "Hardcoded red or @export color so you can tweak it?"
3. Are there dynamic limits?
- Viewport-relative? (e.g., max width = 40% of screen)
- Parent-relative? (e.g., fill = ratio of parent width)
- State-derived? (e.g., current_health clamped to max_health)
- Document the limit formula in the
##docstring.
4. What state changes should emit signals?
- Any value change a parent (or Renderer) might want to react to.
- Minimum: if there are
@exportvars, there must be signals. - Ask: "What should happen when X changes? Should the scene tell its parent?"
5. Are external resources needed?
- Textures, fonts, shaders from
res://assets/→ reference them. - Allowed: Shared project assets.
- Forbidden: References to other
frontend/scenes/*scripts or scenes. - Ask: "Do you have an existing texture/font/shader for this, or should we use a placeholder?"
Code Rules (Strict)
Every generated .gd file MUST follow these rules:
1. Leaf Guarantee
# FORBIDDEN anywhere in the file:
preload("res://frontend/scenes/") # No references to sibling frontend scenes
get_node("../../OtherScene") # No tree traversal to other frontend scenes
ext_resource path="res://frontend/scenes/" # In .tscn, no frontend scene instancesThe only references allowed are:
- Godot built-in nodes
- Resources in
res://assets/(textures, fonts, shaders, themes)
2. @tool and class_name
@tool
class_name HealthBar
extends Control3. Every @export has a setter + docstring
## Current health value.
## Limits: [0, max_health]
## Recalculates on: setter call, max_health change.
@export var current_health: float = 100.0:
set(value):
current_health = clampf(value, 0.0, max_health)
_update_fill()
if not Engine.is_editor_hint():
health_changed.emit(current_health, value)4. No animation logic
# FORBIDDEN:
create_tween()
AnimationPlayer
await get_tree().create_timer()
.tween_property()Animations are the responsibility of the parent / Renderer. The scene exposes properties; something else tweens them.
5. Signals for all state changes
signal health_changed(new_value: float, old_value: float)
signal critical_state_entered()
signal layout_invalidated()6. Safe node references
@onready var _fill: ColorRect = %Fill
func _update_fill() -> void:
if not _fill:
if Engine.is_editor_hint():
push_warning("HealthBar: Fill node missing")
return
_fill.size.x = (current_health / max_health) * self.size.xRegeneration Policy
If frontend/scenes/<feature_name>/ already exists:
- STOP generation.
- Read the existing
README.md(Interface Manifest). - Show the user:
⚠️ frontend/scenes/health_bar/ already exists. Existing exports: - current_health: float [0, max_health] - max_health: float [1, 10000] Options: [1] Pick a new name (e.g., health_bar_v2) [2] Overwrite (DANGER: breaks parent scenes that embed this) [3] Cancel - Never auto-overwrite.
Interface Manifest (README.md)
Auto-generate this in the folder:
# HealthBar Interface Manifest
## @exports (Stable API — renaming these breaks parent scenes)
| Name | Type | Default | Limits | Description |
|------|------|---------|--------|-------------|
| current_health | float | 100.0 | [0, max_health] | Current health value |
| max_health | float | 100.0 | [1, 10000] | Maximum health |
| fill_color | Color | Color.RED | alpha [0,1] | Color of the health fill |
## Signals
| Name | Payload | When |
|------|---------|------|
| health_changed | (new, old) | When current_health changes |
| critical_state_entered | () | When current_health < 25% of max |
## Node Tree
- HealthBar (Control)
- Background (ColorRect)
- Fill (ColorRect)
- Label (Label)
## Resources
- None (or list textures/fonts used from res://assets/)
## Parent Scenes
- None tracked. If you embed this in a .tscn, document it here manually.Quick Reference
| Rule | Enforcement |
| Leaf guarantee | No frontend/scenes/* references in .gd or .tscn |
@tool | Mandatory first line |
class_name | Mandatory, PascalCase, matches folder name |
@export setter | Must clamp/validate; must have ## docstring |
@export default | Must be sane and within limits |
| Animation | Forbidden — pure state only |
| Signals | Required if @export vars exist |
| Node refs | Safe (@onready + null check) |
| Regeneration | Stop and warn if folder exists |
Example Session
User: Create a health bar.
Skill: What visual elements should it have?
User: A background, a red fill, and a text label showing the number.
Skill: Should the color be hardcoded red or an @export so you can tweak it?
User: Export it.
Skill: What about the text — should it show "100/100" or just "100"?
User: Just the current value.
Skill: Should the bar width be a fixed pixel size or a ratio of screen width?
User: Ratio of screen width, max 40%.
Skill: Should it emit a signal when health drops below 25%?
User: Yes.
Skill: Proposed design:
- Exports:
current_health,max_health,screen_width_ratio,fill_color,text_color - Limits: screen_width_ratio clamped to [0.0, 0.4] via viewport
- Signals:
health_changed(new, old),critical_state_entered() - Nodes: Control → Background (ColorRect), Fill (ColorRect), Label (Label)
Confirm? [Y/n]
User: Yes.
Skill: → Generates frontend/scenes/health_bar/health_bar.tscn, health_bar.gd, README.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

