Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-command-pattern

unity-command-pattern

Verified

Encapsulate actions as objects for queuing, undo/redo, and async execution.

FileKindSize
SKILL.mdskill md584 B
assets/code/Command.cs.txtmarkdown1.3 KB
references/guide.mdmarkdown1.4 KB

assets/code/Command.cs.txt

View on GitHub
using System.Threading.Tasks;
using UnityEngine;

namespace Standard.Patterns {
    /// <summary>
    /// Command interface with async support for sequential execution.
    /// </summary>
    public interface ICommand {
        Task Execute();
    }

    /// <summary>
    /// ScriptableObject-based command for data-driven actions.
    /// Use this for simple, inspector-configurable commands.
    /// </summary>
    public abstract class CommandSO : ScriptableObject {
        public abstract void Execute();
    }

    /// <summary>
    /// Command invoker for queuing and executing commands sequentially.
    /// </summary>
    public class CommandQueue : MonoBehaviour {
        private System.Collections.Generic.Queue<ICommand> _commands = new();
        private bool _isExecuting;

        public void Enqueue(ICommand command) {
            _commands.Enqueue(command);
            if (!_isExecuting) {
                ExecuteNext();
            }
        }

        private async void ExecuteNext() {
            if (_commands.Count == 0) {
                _isExecuting = false;
                return;
            }

            _isExecuting = true;
            ICommand command = _commands.Dequeue();
            await command.Execute();
            ExecuteNext();
        }
    }
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall