All skills
jeffallan avatar

/game-developer

@efebc44
by jeffallanjeffallan/claude-skills12k stars
1,124

Use when building game systems, implementing Unity/Unreal Engine features, or optimizing game performance. Invoke to implement ECS architecture, configure physics systems and colliders, set up multiplayer networking with lag compensation, optimize frame rates to 60+ FPS targets, develop shaders, or apply game design patterns such as object pooling and state machines. Trigger keywords: Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI.

Use this Skill: https://skilld.dev/gh/jeffallan/claude-skills/game-developer

This session only. Nothing lands on disk.

referencesunity-patterns.md

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

Unity Development Patterns

MonoBehaviour Best Practices

using UnityEngine;
using System.Collections.Generic;

public class EnemyController : MonoBehaviour
{
    // Serialize private fields for Inspector
    [SerializeField] private float moveSpeed = 5f;
    [SerializeField] private Transform target;

    // Cache component references
    private Rigidbody rb;
    private Animator animator;

    private void Awake()
    {
        // Cache components in Awake
        rb = GetComponent<Rigidbody>();
        animator = GetComponent<Animator>();
    }

    private void Start()
    {
        // Initialize after all Awake calls complete
        if (target == null)
            target = GameObject.FindGameObjectWithTag("Player").transform;
    }

    private void FixedUpdate()
    {
        // Physics calculations in FixedUpdate
        Vector3 direction = (target.position - transform.position).normalized;
        rb.MovePosition(transform.position + direction * moveSpeed * Time.fixedDeltaTime);
    }

    private void OnDisable()
    {
        // Clean up when disabled
        StopAllCoroutines();
    }
}

ScriptableObjects for Data

[CreateAssetMenu(fileName = "WeaponData", menuName = "Game/Weapon")]
public class WeaponData : ScriptableObject
{
    public string weaponName;
    public int damage;
    public float fireRate;
    public GameObject projectilePrefab;
    public AudioClip fireSound;

    // Methods can contain logic
    public float GetDamageMultiplier(float distance)
    {
        return Mathf.Max(0.5f, 1f - (distance / 100f));
    }
}

// Usage in MonoBehaviour
public class Weapon : MonoBehaviour
{
    [SerializeField] private WeaponData weaponData;
    private float nextFireTime;

    public void Fire()
    {
        if (Time.time < nextFireTime) return;

        // Use data from ScriptableObject
        Instantiate(weaponData.projectilePrefab, transform.position, transform.rotation);
        nextFireTime = Time.time + 1f / weaponData.fireRate;
    }
}

Object Pooling Pattern

public class ObjectPool : MonoBehaviour
{
    [SerializeField] private GameObject prefab;
    [SerializeField] private int poolSize = 20;

    private Queue<GameObject> pool = new Queue<GameObject>();

    private void Start()
    {
        // Pre-instantiate objects
        for (int i = 0; i < poolSize; i++)
        {
            GameObject obj = Instantiate(prefab);
            obj.SetActive(false);
            pool.Enqueue(obj);
        }
    }

    public GameObject Get()
    {
        if (pool.Count > 0)
        {
            GameObject obj = pool.Dequeue();
            obj.SetActive(true);
            return obj;
        }

        // Expand pool if needed
        return Instantiate(prefab);
    }

    public void Return(GameObject obj)
    {
        obj.SetActive(false);
        pool.Enqueue(obj);
    }
}

// Pooled object example
public class Bullet : MonoBehaviour
{
    private ObjectPool pool;

    public void Initialize(ObjectPool pool)
    {
        this.pool = pool;
    }

    private void OnCollisionEnter(Collision collision)
    {
        // Return to pool instead of destroying
        pool.Return(gameObject);
    }
}

Event System Pattern

using System;
using UnityEngine.Events;

// Event definition
[Serializable]
public class HealthChangedEvent : UnityEvent<int, int> { } // current, max

public class Health : MonoBehaviour
{
    [SerializeField] private int maxHealth = 100;
    private int currentHealth;

    // UnityEvent visible in Inspector
    public HealthChangedEvent onHealthChanged;
    public UnityEvent onDeath;

    private void Start()
    {
        currentHealth = maxHealth;
        onHealthChanged?.Invoke(currentHealth, maxHealth);
    }

    public void TakeDamage(int damage)
    {
        currentHealth = Mathf.Max(0, currentHealth - damage);
        onHealthChanged?.Invoke(currentHealth, maxHealth);

        if (currentHealth <= 0)
            onDeath?.Invoke();
    }
}

// C# event alternative for performance
public static class GameEvents
{
    public static event Action<int> OnScoreChanged;
    public static event Action<string> OnGameOver;

    public static void TriggerScoreChanged(int score) => OnScoreChanged?.Invoke(score);
    public static void TriggerGameOver(string reason) => OnGameOver?.Invoke(reason);
}

Coroutines Best Practices

using System.Collections;

public class TimedAbility : MonoBehaviour
{
    // Cache WaitForSeconds to avoid GC
    private WaitForSeconds cooldownWait = new WaitForSeconds(5f);
    private Coroutine currentAbility;

    public void ActivateAbility()
    {
        // Stop previous coroutine if running
        if (currentAbility != null)
            StopCoroutine(currentAbility);

        currentAbility = StartCoroutine(AbilityCoroutine());
    }

    private IEnumerator AbilityCoroutine()
    {
        // Activate ability
        Debug.Log("Ability activated");

        // Wait for duration
        yield return cooldownWait;

        // Cooldown complete
        Debug.Log("Ability ready");
        currentAbility = null;
    }

    // Animation-based coroutine
    private IEnumerator LerpPosition(Vector3 target, float duration)
    {
        Vector3 start = transform.position;
        float elapsed = 0f;

        while (elapsed < duration)
        {
            elapsed += Time.deltaTime;
            float t = elapsed / duration;
            transform.position = Vector3.Lerp(start, target, t);
            yield return null; // Wait one frame
        }

        transform.position = target; // Ensure exact final position
    }
}

Singleton Pattern (Use Sparingly)

public class GameManager : MonoBehaviour
{
    private static GameManager instance;
    public static GameManager Instance => instance;

    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
}

Performance Tips

  • Cache GetComponent<T>() calls in Awake/Start
  • Use CompareTag() instead of tag == "TagName"
  • Use object pooling for frequently instantiated objects
  • Avoid Camera.main in Update (cache the reference)
  • Use FixedUpdate for physics, Update for input/logic
  • Disable components instead of GameObjects when possible
  • Use StringBuilder for string concatenation in loops

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk CRITICAL
  • Gen Agent Trust Hub16d

    The skill provides reference documentation and code samples for Unity and Unreal Engine game development, covering patterns like ECS, object pooling, and multiplayer networking. No malicious patterns, prompt injections, or security vulnerabilities were found.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    2/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
Other metadata
metadata
{
  "author": "https://github.com/Jeffallan",
  "version": "1.1.0",
  "domain": "specialized",
  "triggers": "Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI",
  "role": "specialist",
  "scope": "implementation",
  "output-format": "code",
  "related-skills": null
}
  • Performance
  • unity
  • unreal-engine
  • game-development
  • ecs
  • physics
  • multiplayer
  • networking
  • optimization
  • shader
  • game-ai

README badge

README badge for jeffallan/claude-skills/game-developer

Implements core game systems for Unity and Unreal Engine including ECS architecture, physics, multiplayer networking, and performance optimization targeting 60+ FPS. Provides patterns for object pooling, component caching, state machines, and shader development with validation checkpoints for profiling and cross-platform testing.

Generated from the current SKILL.md.

Does this skill support both Unity and Unreal Engine?
Yes. The skill includes reference guides for both Unity C# and Unreal C++/Blueprints, with platform-specific patterns and constraints for each engine.
What performance targets does this skill enforce?
The skill mandates 60+ FPS on all platforms with validation checkpoints using profilers (Unity Profiler or Unreal Insights) to confirm frame time stays at or below 16 ms.
Does this cover multiplayer networking?
Yes. The skill includes guidance on client-server architecture and lag compensation strategies via the multiplayer-networking reference guide.
What game architecture patterns does this skill teach?
The skill covers Entity Component System (ECS) architecture, state machines, object pooling, and component caching, with concrete code examples for each pattern.
Can I use this skill for mobile game optimization?
Yes. The skill explicitly addresses platform-specific constraints including mobile performance, memory usage, and battery considerations as part of the optimization workflow.

Generated from the current SKILL.md. These answers refresh after source changes.