card-game
What it does
This skill guides building card games where cards move between a deck, a hand, a play area, and a discard pile. It is for developers making deckbuilders, collectible card games, or roguelike card games.
When to use it
- βWhen you are building a deckbuilder or collectible card game.
- βWhen you need draw, shuffle, and reshuffle rules that work correctly.
- βWhen you want card effects to resolve in a clear and predictable order.
Skill link
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/card-game/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI am making a deckbuilder. Can you set up the deck, hand and discard piles, and make the turn structure work?β
5 new skills a week. 1 minute to read.
How it works
The agent models cards as data with costs and effects, sets up zones for the deck, hand, play area, and discard, and writes the turn order. It resolves each card effect in a fixed sequence so results are predictable.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Card Game
A playbook for card games β card data, the deck/hand/discard zones, the turn structure, and how card effects resolve. This is a compositional skill: it models cards as data and wires them to UI. It does not re-teach data assets or UI nodes; it defines the zone model, the draw machinery, and the effect-resolution rules that keep a card game correct and bug-free.
When to use
- Use when building any game where the core objects are cards moving between zones (deck β hand β play β discard): deckbuilder, TCG/CCG, solitaire, roguelike deckbuilder.
- Use when designing draw/shuffle/reshuffle, turn structure, card costs, or how effects resolve.
When not to use: board/tile state with matching rules β puzzle. RPG with an
incidental card battler β start from rpg. For defining cards as assets, use godot-resources
/ unity-scriptableobjects; for the hand/drag UI, use godot-ui-control.
Core loop
Draw to your hand β spend resources to play cards β effects resolve and change the board β end the turn (cleanup/discard) β opponent/next phase β repeat until a win condition. Depth comes from the combinations a hand allows; the engine's job is to resolve them unambiguously.
Must-have systems
- Card data β id, name, cost, type, text, and an effect spec (data, not code).
- Zones β deck (draw pile), hand, play/board, discard, exile/removed; cards live in exactly one.
- Draw + shuffle + reshuffle β draw from deck to hand; reshuffle discard into deck when empty.
- Turn structure β phases (untap/draw/main/combat/end) as a state machine.
- Resource system β mana/energy/actions that gate how much you do per turn.
- Effect resolution β apply a card's effects in a defined order; handle targets and triggers.
- Win/loss condition β life total, deck-out, objective.
- UI β hand layout, drag/drop or tap-to-play, zone counts, targeting affordances.
Design knobs
| Knob | Effect | Notes |
|---|---|---|
| Starting hand / draw-per-turn | tempo, consistency | More draw = less variance. |
| Hand size limit | hoarding vs. use | Discard down at end of turn. |
| Deck size (min) | consistency | Smaller = more reliable combos. |
| Resource curve | what's playable when | "Mana curve" paces power. |
| Card rarity / power budget | balance | Stronger cards cost more / are rarer. |
| Determinism vs. randomness | skill vs. swing | Shuffle + random effects add variance. |
| Reshuffle rules | deck-out, fatigue | Reshuffle discard, or punish empty deck. |
| Removal / answers | counterplay | Every threat needs an answer in the pool. |
Patterns
1. Zones + draw with automatic reshuffle
# Pseudocode. A card is in exactly one zone at a time; moving = remove here, add there.
def draw(n):
for _ in range(n):
if not deck:
if not discard: # truly empty: deck-out (lose, or take fatigue)
on_deck_out(); return
deck.extend(discard) # reshuffle discard into deck
discard.clear()
shuffle(deck, rng) # use a seeded RNG (see save-systems for replays)
hand.append(deck.pop())
2. Card as data + effect resolution
# Pseudocode. Effects are a data list interpreted by the engine β not bespoke code per card.
card = {
"id": "fireball", "cost": 3, "type": "spell",
"effects": [ {"op": "damage", "amount": 6, "target": "chosen_enemy"} ],
}
def play(card, caster, chosen_targets):
# Validate everything first; a failed check must leave zones and resources untouched.
if resources[caster] < card.cost: return False # can't afford
if not targets_legal(card, chosen_targets): return False
resources[caster] -= card.cost # commit: pay, then move, then resolve
move(card, from_zone=hand, to_zone=play_or_discard(card))
for fx in card.effects:
resolve_effect(fx, caster, chosen_targets) # one interpreter handles every card
return True
3. Turn structure as a phase machine
# Pseudocode. Fixed phases keep timing windows (triggers, priority) unambiguous.
PHASES = ["untap", "draw", "main", "combat", "end"]
def take_turn(player):
for phase in PHASES:
enter_phase(player, phase) # fire "on_phase" triggers here
if phase == "draw": draw(1)
if phase == "main": await player_plays_cards()
if phase == "combat": resolve_combat()
if pha
FAQ
Should card effects be code or data?
The skill says to define effects as data, which keeps cards easier to balance and change.
Does it cover the drag-and-drop card UI?
The hand and drag UI is covered by the engine UI skill, which this one points to.
What kinds of card games does it fit?
It fits deckbuilders, TCG and CCG style games, solitaire, and roguelike deckbuilders.
Details
Original description by the author
Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution. Use for a deckbuilder, TCG/CCG, or roguelike deckbuilder.
Popularity
- GitHub stars
- 6.6k
- Ranking position
- #13807
- License
- Apache-2.0
- Updated
- 10/28/2026
Comments
- β¦
More skills from this repository
router
6.6kHelps your agent pick the right game development skill for a request by detecting your engine and the kind of task you need.
ai-behavior-trees-utility-ai
6.6kHelps your agent build a behavior tree and utility AI system for game enemies and characters that choose actions by priority and score.
audio-design
6.6kTeaches your agent game audio mixing: buses, decibel volume, ducking under dialogue, adaptive music and sound effect variation.
camera-systems
6.6kHelps your agent build game cameras that follow smoothly, stay inside the level, and orbit or look around in 3D.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.