assembly-definitions
Assembly definition management — when to create asmdefs, reference rules, Editor/Runtime/Test separation, platform filters, compilation speed optimization.
Mobile puzzle game architecture — grid/board logic, undo system, hint system, level packs, star ratings, touch drag-and-drop, tutorial overlays.
$ npx -y skills add XeldarAlz/everything-claude-unity --skill puzzle --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/puzzleContext preview
The summary Claude sees to decide when to auto-load this skill.
Mobile puzzle game architecture — grid/board logic, undo system, hint system, level packs, star ratings, touch drag-and-drop, tutorial overlays.
name: puzzle description: "Mobile puzzle game architecture — grid/board logic, undo system, hint system, level packs, star ratings, touch drag-and-drop, tutorial overlays." globs: ["**/Puzzle*.cs", "**/Board*.cs", "**/Grid*.cs", "**/Hint*.cs", "**/Undo*.cs"]
public interface IGameCommand
{
void Execute();
void Undo();
}
public sealed class UndoManager
{
private readonly Stack<IGameCommand> _undoStack = new();
private readonly int _maxUndoSteps;
public UndoManager(int maxSteps = 50)
{
_maxUndoSteps = maxSteps;
}
public int UndoCount => _undoStack.Count;
public void Execute(IGameCommand command)
{
command.Execute();
_undoStack.Push(command);
if (_undoStack.Count > _maxUndoSteps)
{
// Trim oldest — would need a different data structure for efficiency
}
}
public bool Undo()
{
if (_undoStack.Count == 0) return false;
IGameCommand command = _undoStack.Pop();
command.Undo();
return true;
}
public void Clear()
{
_undoStack.Clear();
}
}
// Example: move a piece
public sealed class MovePieceCommand : IGameCommand
{
private readonly Piece _piece;
private readonly Vector2Int _fromPos;
private readonly Vector2Int _toPos;
public MovePieceCommand(Piece piece, Vector2Int from, Vector2Int to)
{
_piece = piece;
_fromPos = from;
_toPos = to;
}
public void Execute() { _piece.MoveTo(_toPos); }
public void Undo() { _piece.MoveTo(_fromPos); }
}[CreateAssetMenu(menuName = "Puzzle/Level Pack")]
public sealed class LevelPack : ScriptableObject
{
[SerializeField] private string _packId;
[SerializeField] private string _displayName;
[SerializeField] private Sprite _icon;
[SerializeField] private PuzzleLevel[] _levels;
[SerializeField] private bool _isLocked;
[SerializeField] private int _starsToUnlock;
public string PackId => _packId;
public string DisplayName => _displayName;
public IReadOnlyList<PuzzleLevel> Levels => _levels;
public bool IsLocked => _isLocked;
public int StarsToUnlock => _starsToUnlock;
}
[CreateAssetMenu(menuName = "Puzzle/Level")]
public sealed class PuzzleLevel : ScriptableObject
{
[SerializeField] private string _levelId;
[SerializeField] private int _parMoves; // 3 stars if completed in this many moves
[SerializeField] private int _maxMoves; // fail if exceeded (0 = unlimited)
[SerializeField] private float _parTime; // 3 stars if completed in this time
[SerializeField] private TextAsset _levelData; // JSON or custom format
public string LevelId => _levelId;
public int ParMoves => _parMoves;
public int MaxMoves => _maxMoves;
}public sealed class StarCalculator
{
public static int Calculate(PuzzleLevel level, int movesTaken, float timeTaken)
{
int stars = 1; // completing = 1 star minimum
if (level.ParMoves > 0 && movesTaken <= level.ParMoves)
{
stars = 3;
}
else if (level.ParMoves > 0 && movesTaken <= level.ParMoves * 1.5f)
{
stars = 2;
}
return stars;
}
public static int GetTotalStars(string packId)
{
// Sum all stars earned across levels in pack
int total = 0;
// Read from save data...
return total;
}
}public sealed class HintSystem : MonoBehaviour
{
[SerializeField] private float _autoHintDelay = 15f; // show hint after N seconds idle
[SerializeField] private int _freeHints = 3;
private int _hintsRemaining;
private float _idleTimer;
private bool _hintShowing;
public event System.Action<HintData> OnShowHint;
public event System.Action OnHideHint;
private void Update()
{
if (_hintShowing) return;
_idleTimer += Time.deltaTime;
if (_idleTimer >= _autoHintDelay)
{
ShowAutoHint();
}
}
public void OnPlayerAction()
{
_idleTimer = 0f;
if (_hintShowing)
{
_hintShowing = false;
OnHideHint?.Invoke();
}
}
public bool UseHint()
{
if (_hintsRemaining <= 0) return false;
_hintsRemaining--;
ShowExplicitHint();
return true;
}
private void ShowAutoHint()
{
// Subtle hint — highlight possible move
_hintShowing = true;
}
private void ShowExplicitHint()
{
// Obvious hint — animate the solution move
_hintShowing = true;
}
}public sealed class DragHandler : MonoBehaviour
{
[SerializeField] private Camera _camera;
[SerializeField] private LayerMask _draggableLayer;
[SerializeField] private float _dragOffset = 0.5f; // lift piece while dragging
private Piece _draggedPiece;
private Vector3 _dragStartWorldPos;
private Vector2Int _dragStartGridPos;
private void Update()
{
if (UnityEngine.InputSystem.Touchscreen.current == null) return;
UnityEngine.InputSystem.Controls.TouchControl touch =
UnityEngine.InputSystem.Touchscreen.current.primaryTouch;
if (touch.press.wasPressedThisFrame)
{
TryStartDrag(touch.position.ReadValue());
}
else if (touch.press.isPressed && _draggedPiece != null)
{
UpdateDrag(touch.position.ReadValue());
}
else if (touch.press.wasReleasedThisFrame && _draggedPiece != null)
{
EndDrag(touch.position.ReadValue());
}
}
private void TryStartDrag(Vector2 screenPos)
{
Ray ray = _camera.ScreenPointToRay(screenPos);
if (Physics2D.Raycast(ray.origin, ray.direction, 100f, _draggabThe ultimate Claude Code toolkit for Unity game development. A production-ready, plug-and-play system that gives Claude Code deep Unity expertise — from writing performant C# to building scenes, profiling performance, and triggering iOS/Android builds — all
Assembly definition management — when to create asmdefs, reference rules, Editor/Runtime/Test separation, platform filters, compilation speed optimization.
Structured commit trailers — adds Constraint, Rejected, Scope-risk, and Not-tested metadata to commit messages. Captures architectural decisions and known gaps…
Ambiguity gating — detects vague feature requests and forces structured requirements gathering with scoring across scope, platform, performance, integration,…
Event system patterns — C# events, UnityEvent, SO event channels, static EventBus. When to use each, zero-allocation patterns, memory leak prevention.
Configures Claude Code's statusline to display Unity workflow state — current phase, active agent, files modified, and session duration.
Post-debugging knowledge extraction — captures non-obvious, codebase-specific learnings that pass quality gates. Invoke after resolving tricky bugs or…