
Tabletopkit
Implement observer hooks, custom TabletopKit actions, dice physics, card layouts, and multiplayer coordination when shipping an iOS tabletop game with Swift.
Overview
TabletopKit is an agent skill for the Build phase that documents advanced Apple TabletopKit patterns for observers, custom actions, layouts, multiplayer coordination, and full iOS tabletop game architecture.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill tabletopkitWhat is this skill?
- TabletopGame.Observer lifecycle: validate, pending, confirmed, rollback, and cancel hooks for rule enforcement
- Custom TabletopAction patterns plus MoveEquipmentAction-style validation on the arbiter host
- Dice simulation, card and tile layout recipes, and interaction-delegate wiring
- Full game architecture examples with network/multiplayer coordination
- State bookmarks, undo, score tracking, and TabletopKit-oriented debugging techniques
Adoption & trust: 1.1k installs on skills.sh; 713 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are coding a TabletopKit game but lack concrete patterns for observers, custom actions, dice and cards, multiplayer sync, undo, and debugging.
Who is it for?
Indie iOS developers and agent-assisted coders implementing or extending a TabletopKit board, card, or dice game with multiplayer or rich interactions.
Skip if: Builders still ideating game mechanics without Swift/TabletopKit, Android or cross-platform engines, or teams wanting only App Store marketing copy.
When should I use this skill?
You are implementing or refactoring an iOS TabletopKit game and need observer, action, layout, multiplayer, or debugging patterns.
What do I get? / Deliverables
Your agent can scaffold validated actions, observer-driven state updates, layouts, and multiplayer-safe flows that match TabletopKit’s snapshot and arbiter model.
- Observer and custom-action implementations aligned with game rules
- Layout and interaction-delegate code for dice, cards, and equipment
- Multiplayer coordination and debugging patterns integrated into the game target
Recommended Skills
Journey fit
TabletopKit game code—observers, actions, layouts, and network sync—lands in the Build phase when you are implementing the playable product on device. Patterns center on SwiftUI/RealityKit-style game UI, interaction delegates, and on-table equipment—canonical shelf is mobile game frontend against Apple's TabletopKit APIs.
How it compares
Framework pattern reference for Apple TabletopKit—not a generic Unity Godot guide or a CI/deploy skill.
Common Questions / FAQ
Who is tabletopkit for?
Solo and small-team iOS builders shipping tabletop-style games with Swift and TabletopKit who want agent-ready implementation patterns instead of guessing observer and action APIs.
When should I use tabletopkit?
During Build (frontend/game implementation) when wiring TabletopGame observers, custom actions, dice and card layouts, multiplayer coordination, score tracking, or undo—after you have committed to TabletopKit on iOS.
Is tabletopkit safe to install?
Treat it as documentation-only procedural knowledge; review the Security Audits panel on this Prism page before enabling the skill in an agent that can write to your repo.
SKILL.md
READMESKILL.md - Tabletopkit
# TabletopKit Extended Patterns Overflow reference for the `tabletopkit` skill. Contains advanced patterns for observer implementation, custom actions, dice physics, card layouts, network coordination, and full game architecture examples. ## Contents - [Observer Patterns](#observer-patterns) - [Custom Action Patterns](#custom-action-patterns) - [Dice Simulation](#dice-simulation) - [Card and Tile Layouts](#card-and-tile-layouts) - [Interaction Delegate Patterns](#interaction-delegate-patterns) - [Full Game Architecture](#full-game-architecture) - [Network and Multiplayer Coordination](#network-and-multiplayer-coordination) - [State Bookmarks and Undo](#state-bookmarks-and-undo) - [Score Tracking](#score-tracking) - [Debugging Techniques](#debugging-techniques) ## Observer Patterns ### Implementing TabletopGame.Observer The observer receives callbacks when actions are validated, pending, confirmed, rolled back, or cancelled. Use `actionWasConfirmed` as the primary hook for updating game-specific state. ```swift import TabletopKit class GameObserver: TabletopGame.Observer { weak var game: Game? func validateAction(_ action: some TabletopAction, snapshot: TableSnapshot) -> Bool { // Return false to reject the action before it applies. // Called on the arbiter (host) device in multiplayer. if let moveAction = action as? MoveEquipmentAction { // Validate move is legal in current game rules return isLegalMove(moveAction, in: snapshot) } return true } func actionIsPending(_ action: some TabletopAction, oldSnapshot: TableSnapshot, newSnapshot: TableSnapshot) { // Action applied locally but not yet confirmed by arbiter. // Use for optimistic UI updates. } func actionWasConfirmed(_ action: some TabletopAction, oldSnapshot: TableSnapshot, newSnapshot: TableSnapshot) { guard let game else { return } // Handle built-in actions if let setTurn = action as? SetTurnAction { game.currentTurnSeats = setTurn.seatIDsInTurn return } if let counterAction = action as? UpdateCounterAction { game.scores[counterAction.counterID] = counterAction.newValue return } // Handle custom actions if let collect = CollectCoin(from: action) { handleCoinCollected(collect, snapshot: newSnapshot) return } } func actionWasRolledBack(_ action: some TabletopAction, snapshot: TableSnapshot) { // Arbiter rejected the action. Revert optimistic UI. } func actionWasCancelled(_ action: some TabletopAction, reason: TabletopGame.ActionCancellationReason) { switch reason { case .actionInvalidated: // Action was invalidated by a conflicting action break case .interactionCancelled: // The interaction that queued this action was cancelled break @unknown default: break } } func playerChangedSeats(_ player: Player, oldSeat: (any TableSeat)?, newSeat: (any TableSeat)?, snapshot: TableSnapshot) { game?.updatePlayerList(snapshot: snapshot) } func stateDidResetToBookmark(_ bookmarkID: StateBookmarkIdentifier) { game?.handleStateReset() } private func isLegalMove(_ action: MoveEquipmentAction, in snapshot: TableSnapshot) -> Bool { // Game-specific validation true } private func handleCoinCollected(_ action: CollectCoin, snapshot: TableSnapshot) { // Update game-specific state } } ``` ### Registering