agentleFS
smileynetsmileynet/game-spice/skills/architecture-audit/SKILL.md

architecture-audit

Skill0 starsChanged 9 months agoMITView on GitHub

Game-specific code architecture auditing. Use when auditing game code architecture, reviewing game loop patterns, evaluating game state management, assessing frame budget, checking entity architecture, input handling, or running architecture-audit on a game project. Covers game loop timing, state machines, ECS patterns, performance smells, technical debt timing.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prototype, review and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GoogleSkill

    prototype

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 3 projects that use this

The file

Files
SKILL.md

Game Architecture Audit

Audit game code architecture for correctness, performance, and maintainability. Catches game-specific patterns that generic code audits miss.

Quick Reference

Game Architecture Health Scorecard

CategoryHealthyWarningCritical
Game LoopFixed update + variable renderVariable delta timePhysics in render loop
State ManagementFSM or state patternBoolean flags (≤3)Boolean combinatorial explosion
Input HandlingAction mapping layerDirect key checks with remappingHardcoded key checks in gameplay
Entity ArchitectureComponents/ECS appropriate to scaleMild inheritance (≤3 deep)Deep inheritance or god objects
Resource ManagementObject pooling for hot pathsOccasional allocation in loopsnew/malloc every frame
Frame BudgetMeasured, within targetUnmeasured but seems fineVisible frame drops, no profiling
Scene OrganizationSubsystem separation, clear ownershipSome coupling between subsystemsMonolithic scene, spaghetti refs
Build/DeployAutomated, reproducibleManual but documented"Works on my machine"

Game Loop Patterns

The correct answer for most games: Fixed Update with Variable Rendering (see implementation → Game Loop Setup for the accumulator pattern and code).

Audit Smells

SmellWhat's WrongFix
Physics in render loopPhysics in _process/Update/render callbackMove to _physics_process/FixedUpdate
No delta timeHardcoded position += 5Multiply by delta: position += speed * delta
God update functionSingle update() >100 linesExtract subsystems with single responsibilities
Missing state guardsGame logic runs during pause/menuCheck game state before processing
Spiral of DeathUncapped accumulator, physics falls behindCap max accumulated time (e.g., 0.25s)

Architecture Health Checklist

  • Game loop uses fixed update for physics, variable for rendering
  • No physics or movement code in render/draw callbacks
  • State management uses FSM or state pattern (no boolean flag explosion)
  • Input goes through a mapping/action layer (not raw key checks)
  • No allocations in per-frame hot paths
  • Entity architecture matches project scale (not over- or under-engineered)
  • Scene/node organization has clear subsystem boundaries
  • Technical debt is intentional and scheduled for payoff
  • Frame budget is measured, not assumed

Deep Dives

  • (see architecture-audit/detailed-audits.md for State Management, Entity Architecture, Input Handling, Performance Smells, Game-Specific Technical Debt)

Engine-Specific Patterns

Engine-agnostic principles above apply everywhere. For engine-specific guidance:

  • (see architecture-audit/godot.md for Godot/GDScript scene tree, signals, and process patterns)
  • (see architecture-audit/rust.md for Rust/Bevy ECS, plugin architecture, and system ordering)
  • (see architecture-audit/unity.md for Unity/C# MonoBehaviour lifecycle, ScriptableObjects, and component architecture)
  • (see architecture-audit/unreal.md for Unreal/C++ Actor model, Gameplay Framework, and Blueprint vs C++ patterns)
  • (see architecture-audit/python.md for Python/Pygame game loop management, sprite groups, and performance constraints)
  • (see architecture-audit/typescript.md for TypeScript/Phaser browser game patterns, asset loading, and typed event systems)

See Also

  • plan-audit — Plan-level audit (companion to code architecture audit) (see plan-audit)
  • scoping — MLP scope determines acceptable technical debt levels (see scoping)
  • antipatterns — Design anti-patterns that manifest as architecture problems (see antipatterns)
  • design-frameworks — Systems thinking for architecture decisions (see design-frameworks)
  • playtesting — Playtest methodology for validating architecture decisions (see playtesting)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.