undo-module

Manage undo and redo with a pluggable command history.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/punkfuncgames/tetris-clone --skill undo-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: undo-module
Source: https://github.com/punkfuncgames/tetris-clone/tree/main/.claude/skills/undo-module
Command: npx skills add https://github.com/punkfuncgames/tetris-clone --skill undo-module

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Undo/redo systems are essential for complex interactions, but implementing reliable, mergeable undo stacks across diverse actions is error-prone and time-consuming.

Core Features & Use Cases

  • Implements an UndoRedoService that exposes deterministic undo/redo stacks, reactive state (e.g., CanUndo, CanRedo), and event-driven notifications.
  • Supports mergeable commands via IMergeableCommand to condense consecutive actions and optimize history.
  • Includes built-in commands (CompositeCommand, MoveTransformCommand, SetSettingCommand<T>, SetVolumeCommand) and a ready-to-use installer to wire the service in projects.
  • Event types include CommandExecutedEvent, UndoPerformedEvent, RedoPerformedEvent, and UndoStackClearedEvent for UI and analytics.

Quick Start

Install and wire up the UndoRedoService, implement a custom IUndoableCommand, and attach it to your action triggers via ExecuteAsync to enable undo/redo.

Frequently Asked Questions about undo-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement an undo redo system for user actions in Unity?

Implement an undo redo system in Unity by wiring up an UndoRedoService that manages deterministic stack-based history. Create custom IUndoableCommand instances and attach them to action triggers via ExecuteAsync to enable reversible operations.

How do mergeable commands optimize undo history for continuous actions?

Mergeable commands use IMergeableCommand to condense consecutive actions into a single history entry. This optimizes the undo stack by preventing repetitive operations, like continuous slider adjustments, from flooding the fixed max size history.

Does this undo command pattern support reactive state for UI workflows?

Yes, the command pattern exposes reactive state such as CanUndo and CanRedo alongside event-driven notifications. These include CommandExecutedEvent and UndoPerformedEvent to properly update UI workflows and analytics.

How do I add reversible actions across multiple game editor modules?

Add reversible actions across modules by utilizing built-in commands like CompositeCommand and MoveTransformCommand. These pluggable components manage cross-module operations within a unified, stack-based command history.

What is the best way to track undo and redo events for game tools analytics?

Track undo and redo events by subscribing to built-in event types like UndoPerformedEvent, RedoPerformedEvent, and UndoStackClearedEvent. These event-driven notifications expose action history for game tools UI and analytics integration.

How do I configure a fixed max size for an undo stack?

Configure a fixed max size for the undo stack using the ready-to-use service installer. This manages the deterministic history limits, automatically discarding the oldest commands when the stack capacity is exceeded.