بنقرة واحدة
code-style
GDScript coding standards for The Sparkling Farce. Use when writing or reviewing code for style compliance.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
GDScript coding standards for The Sparkling Farce. Use when writing or reviewing code for style compliance.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Where to place game content vs platform code. Use when creating new files or moving existing code.
Run the project test suite. Use when user mentions "diagnostics", "run level 1 diagnostics", or asks to run tests.
Core development philosophy - fix platform code, not mod content. Load when making decisions about what to fix or implement.
Correct patterns for accessing game resources via ModLoader registry. Use when loading characters, items, abilities, or any mod content.
View the newest screenshot(s) from the user's Screenshots folder. Use when user says SNS, SNS2, SNS3, or asks to see a screenshot.
Reference for preferred UNIX tools over LLM processing. Use when processing JSON, text, searching files, or doing batch operations.
| name | code-style |
| description | GDScript coding standards for The Sparkling Farce. Use when writing or reviewing code for style compliance. |
The Sparkling Farce enforces strict GDScript style. These are non-negotiable.
# CORRECT - Explicit type annotation
var health: int = 100
var name: String = "Max"
var position: Vector2 = Vector2.ZERO
var items: Array[ItemData] = []
var stats: Dictionary[String, int] = {}
# WRONG - Type inference (walrus operator)
var health := 100
var name := "Max"
var position := Vector2.ZERO
Why: Project settings enforce untyped_declaration = Error and infer_on_variant = Error.
# CORRECT
if "key" in dict:
var value = dict["key"]
if "key" not in dict:
push_error("Missing key")
# WRONG
if dict.has("key"):
var value = dict["key"]
# CORRECT - All parameters and return types annotated
func calculate_damage(attacker: Unit, defender: Unit, is_critical: bool = false) -> int:
return 0
# WRONG - Missing types
func calculate_damage(attacker, defender, is_critical = false):
return 0
# CORRECT - Typed loop variable
for item: ItemData in inventory:
process(item)
for i: int in range(10):
print(i)
for key: String in dict.keys():
print(key)
# WRONG - Untyped loop variable
for item in inventory:
process(item)
# CORRECT - Direct signal emission
battle_started.emit(battle_data)
damage_dealt.emit(attacker, defender, amount)
# WRONG - String-based emission
emit_signal("battle_started", battle_data)
| Type | Convention | Example |
|---|---|---|
| Classes | PascalCase | CharacterData, BattleManager |
| Functions | snake_case | calculate_damage(), get_active_unit() |
| Variables | snake_case | current_hp, active_units |
| Constants | UPPER_SNAKE | MAX_HP, DEFAULT_SPEED |
| Private | _prefix | _internal_state, _calculate_bonus() |
| Signals | snake_case | battle_started, unit_died |
# Preload for constants (compile-time)
const CharacterData = preload("res://core/resources/character_data.gd")
# Load for runtime resources
var scene: PackedScene = load("res://scenes/battle/battle.tscn")
## Brief description of the class.
##
## Longer description if needed, explaining purpose,
## usage patterns, and integration notes.
class_name MyClass
extends Node
## Calculates damage between two units.
##
## [param attacker]: The unit dealing damage
## [param defender]: The unit receiving damage
## [return]: The final damage amount after modifiers
func calculate_damage(attacker: Unit, defender: Unit) -> int:
pass
Full style guide: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html