MCPInstall

programming-architecture

Game code architecture, design patterns, scalable systems, and maintainable code structure for complex games.

Installs
106
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/pluginagentmarketplace/custom-plugin-game-developer --skill programming-architecture
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads programming-architecture automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Game Programming Architecture

Design Patterns for Games

1. State Machine

Best for: Character states, AI, game flow

// ✅ Production-Ready State Machine
public abstract class State<T> where T : class
{
    protected T Context { get; private set; }
    public void SetContext(T context) => Context = context;
    public virtual void Enter() { }
    public virtual void Update() { }
    public virtual void Exit() { }
}

public class StateMachine<T> where T : class
{
    private State<T> _current;
    private readonly T _context;

    public StateMachine(T context) => _context = context;

    public void ChangeState(State<T> newState)
    {
        _current?.Exit();
        _current = newState;
        _current.SetContext(_context);
        _current.Enter();
    }

    public void Update() => _current?.Update();
}

// Usage
public class PlayerIdleState : State<Player>
{
    public override void Enter() => Context.Animator.Play("Idle");
    public override void Update()
    {
        if (Context.Input.magnitude > 0.1f)
            Context.StateMachine.ChangeState(new PlayerMoveState());
    }
}

2. Object Pool

Best for: Bullets, particles, enemies

// ✅ Production-Ready Object Pool
public class ObjectPool<T> where T : Component
{
    private readonly Queue<T> _pool = new();
    private readonly T _prefab;
    private readonly Transform _parent;

    public ObjectPool(T prefab, int initialSize, Transform parent = null)
    {
        _prefab = prefab;
        _parent = parent;
        for (int i = 0; i < initialSize; i++)
            _pool.Enqueue(CreateInstance());
    }

    public T Get(Vector3 position)
    {
        var obj = _pool.Count > 0 ? _pool.Dequeue() : CreateInstance();
        obj.transform.position = position;
        obj.gameObject.SetActive(true);
        return obj;
    }

    public void Return(T obj)
    {
        obj.gameObject.SetActive(false);
        _pool.Enqueue(obj);
    }

    private T CreateInstance() => Object.Instantiate(_prefab, _parent);
}

3. Observer Pattern (Events)

Best for: UI updates, achievements, damage notifications

// ✅ Production-Ready Event System
public static class GameEvents
{
    public static event Action<int> OnScoreChanged;
    public static event Action<float> OnHealthChanged;
    public static event Action OnPlayerDied;

    public static void ScoreChanged(int score) => OnScoreChanged?.Invoke(score);
    public static void HealthChanged(float health) => OnHealthChanged?.Invoke(health);
    public static void PlayerDied() => OnPlayerDied?.Invoke();
}

// Subscribe
GameEvents.OnScoreChanged += UpdateScoreUI;

// Always unsubscribe in OnDestroy
private void OnDestroy() => GameEvents.OnScoreChanged -= UpdateScoreUI;

4. Command Pattern

Best for: Undo/redo, input replay, networking

public interface ICommand
{
    void Execute();
    void Undo();
}

public class MoveCommand : ICommand
{
    private readonly Transform _target;
    private readonly Vector3 _direction;
    private Vector3 _previousPosition;

    public MoveCommand(Transform target, Vector3 direction)
    {
        _target = target;
        _direction = direction;
    }

    public void Execute()
    {
        _previousPosition = _target.position;
        _target.position += _direction;
    }

    public void Undo() => _target.position = _previousPosition;
}

Architecture Layers

┌─────────────────────────────────────────────────────────────┐
│                    GAME LAYER                                │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ Managers (GameManager, UIManager, AudioManager)      │   │
│  └─────────────────────────────────────────────────────┘   │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ Systems (Combat, Movement, Inventory, Quest)         │   │
│  └─────────────────────────────────────────────────────┘   │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ Components (Health, Weapon, CharacterController)     │   │
│  └─────────────────────────────────────────────────────┘   │
├─────────────────────────────────────────────────────────────┤
│                    ENGINE LAYER                              │
│  Physics │ Rendering │ Audio │ Input │ Networking          │
└─────────────────────────────────────────────────────────────┘

🔧 Troubleshooting

┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Spaghetti code / tight coupling                     │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS:                                                   │
│ → Use dependency injection                                  │
│ → Communicate via events, not direct references             │
│ → Follow single responsibility principle                    │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│ PROBLEM: Hard to test game systems                           │
├─────────────────────────────────────────────────────────────┤
│ SOLUTIONS:                                                   │
│ → Separate logic from MonoBehaviour                         │
│ → Use interfaces for dependencies                           │
│ → Create testable pure functions                            │
└─────────────────────────────────────────────────────────────┘

Best Practices

PracticeBenefit
Loose couplingSystems can change independently
Data-driven designBalance without recompiling
Interface abstractionsEasy mocking and testing
Single responsibilityClear, focused classes

Use this skill: When architecting systems, improving code structure, or optimizing performance.

FAQ

What does the programming-architecture skill do?

Game code architecture, design patterns, scalable systems, and maintainable code structure for complex games.

How do I install programming-architecture?

Run npx skills add https://github.com/pluginagentmarketplace/custom-plugin-game-developer --skill programming-architecture in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/programming-architecture/ (personal) or .claude/skills/programming-architecture/ (project).

Which AI agents can use programming-architecture?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is programming-architecture safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains programming-architecture?

It is published by pluginagentmarketplace in pluginagentmarketplace/custom-plugin-game-developer. It has 106 recorded installs.

More from pluginagentmarketplace/custom-plugin-game-developer

View all →

game-design-theory

pluginagentmarketplace/custom-plugin-game-developer

Comprehensive game design theory covering MDA framework, player psychology, balance principles, and progression systems. Master why games are fun.

Media & Creative2.5K installs

level-design

pluginagentmarketplace/custom-plugin-game-developer

Level design fundamentals, pacing, difficulty progression, environmental storytelling, and spatial design for engaging gameplay experiences.

Media & Creative565 installs

gameplay-mechanics

pluginagentmarketplace/custom-plugin-game-developer

Core gameplay mechanics implementation, system interactions, feedback loops, and iterative balance refinement for engaging player experiences.

Media & Creative300 installs

daw-music

pluginagentmarketplace/custom-plugin-game-developer

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

Media & Creative213 installs

game-engines

pluginagentmarketplace/custom-plugin-game-developer

Open the skill to read its SKILL.md instructions.

Media & Creative201 installs

particle-systems

pluginagentmarketplace/custom-plugin-game-developer

Creating visual effects using particle systems, physics simulation, and post-processing for polished, dynamic game graphics.

Media & Creative177 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.