All skills
thedivergentai avatar

/godot-debugging-profiling

@9d6e91e

Expert debugging and profiling for leaks, GPU/Visual Profiler, headless CI QA, orphan nodes, thread-safe logs, and custom Debugger monitors — not print/breakpoint tutorials. Trigger on OBJECT_ORPHAN_NODE_COUNT, ObjectDB growth, Visual Profiler GPU spikes, flaky headless exits, or remote device consoles. Keywords: orphan nodes, Performance.get_monitor, Visual Profiler, Time.get_ticks_usec, EditorDebuggerPlugin, headless QA, push_error, backtrace.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-debugging-profiling

This session only. Nothing lands on disk.

referencesdebug-workflows.md

≈647 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Debug & Profiler Workflows (load on demand)

Official docs cover print/breakpoint basics. Load this when you need workflow depth beyond the symptom → script table in SKILL.md.

Print debugging contract

print("Player health:", health)  # labeled context
push_warning("Deprecated API path")
push_error("Recoverable fault")
assert(health > 0, "Health cannot be negative!")  # debug only

Wrap dev prints: if OS.is_debug_build():

Breakpoints

Editor gutter or breakpoint keyword in suspicious functions. Conditional: if player.health <= 0: breakpoint

Remote debug

Run game (F5) → Debug → Remote Debug → inspect live SceneTree.

Common patterns

Null-safe nodes

var node := get_node_or_null("MaybeExists")
if node:
	node.do_thing()

Track property changes

var _health: int = 100
var health: int:
	get: return _health
	set(value):
		print("Health changed: %d → %d" % [_health, value])
		print_stack()
		_health = value

Profiler usage

  • Time profiler: target < 16.67 ms/frame at 60 FPS
  • Monitor tab: FPS, memory, draw calls, OBJECT_ORPHAN_NODE_COUNT (debug only)
  • Profile release exports with V-Sync off

Expert workflows (scripts)

Workflow Script
Headless CI exit codes automated_qa_suite.gd
Microbenchmarks high_precision_benchmarker.gd
GPU draw-call overlay RenderingServer RENDERING_INFO_* — see baseline expert § Visual Profiler Extensions
Thread safety enforcement Thread.set_thread_safety_checks_enabled(true) + thread_safety_assert.gd
Orphan growth orphan_node_detector.gd
ObjectDB snapshots Godot ObjectDB profiler docs + memory_usage_threshold_alert.gd

File I/O error handling template

func load_save() -> Dictionary:
	if not FileAccess.file_exists(SAVE_PATH):
		push_warning("No save file found")
		return {}
	var file := FileAccess.open(SAVE_PATH, FileAccess.READ)
	if file == null:
		push_error("Failed to open save: %s" % FileAccess.get_open_error())
		return {}
	var json := JSON.new()
	if json.parse(file.get_as_text()) != OK:
		push_error("JSON parse error: %s" % json.get_error_message())
		return {}
	return json.data

Debug flags pattern

const DEBUG := true
func debug_log(message: String) -> void:
	if DEBUG:
		print("[DEBUG] ", message)

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a collection of Godot engine debugging and profiling scripts. It follows best practices for engine-level diagnostics and does not exhibit malicious behavior such as data exfiltration, obfuscation, or persistence. Minor findings relate to standard Godot dynamic loading mechanisms and data ingestion surfaces typical of debugging and profiling tools.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    3/3 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-debugging-profiling