[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79KJS2ZNZ6WATV5XA1X2S19":3,"skill-same:01M79KJS2ZNZ6WATV5XA1X2S19":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M79KJS2ZNZ6WATV5XA1X2S19","card-game",null,"Build a card game: card data, deck\u002Fhand\u002Fdiscard zones, draw\u002Fshuffle\u002Freshuffle, a turn structure, costs, and effect resolution. Use for a deckbuilder, TCG\u002FCCG, or roguelike deckbuilder.","mistervaibhav\u002Fskills","mistervaibhav","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F41189028?v=4","01M79KACH05EG9FMM6DQVHAVK9","Vaibhav Singh","01M79KACJB3431Y8CFJQ02MTTM",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fcard-game\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: card-game\ndescription: >\n  Build a card game: card data, deck\u002Fhand\u002Fdiscard zones, draw\u002Fshuffle\u002Freshuffle, a turn structure,\n  costs, and effect resolution. Use for a deckbuilder, TCG\u002FCCG, or roguelike deckbuilder.\nlicense: Apache-2.0\ncompatibility: Engine-agnostic design patterns; snippets are pseudocode (port to your engine)\nmetadata:\n  engine: none\n  category: genres\n  difficulty: intermediate\n---\n\n# Card Game\n\nA playbook for card games — card data, the deck\u002Fhand\u002Fdiscard zones, the turn structure, and\nhow card effects resolve. This is a **compositional** skill: it models cards as data and wires\nthem to UI. It does not re-teach data assets or UI nodes; it defines the zone model, the draw\nmachinery, and the effect-resolution rules that keep a card game correct and bug-free.\n\n## When to use\n\n- Use when building any game where the core objects are **cards** moving between zones\n  (deck → hand → play → discard): deckbuilder, TCG\u002FCCG, solitaire, roguelike deckbuilder.\n- Use when designing draw\u002Fshuffle\u002Freshuffle, turn structure, card costs, or how effects resolve.\n\n**When *not* to use:** board\u002Ftile state with matching rules → `puzzle`. RPG with an\nincidental card battler → start from `rpg`. For defining cards as assets, use `godot-resources`\n\u002F `unity-scriptableobjects`; for the hand\u002Fdrag UI, use `godot-ui-control`.\n\n## Core loop\n\n**Draw to your hand → spend resources to play cards → effects resolve and change the board →\nend the turn (cleanup\u002Fdiscard) → opponent\u002Fnext phase → repeat until a win condition.** Depth\ncomes from the *combinations* a hand allows; the engine's job is to resolve them unambiguously.\n\n## Must-have systems\n\n1. **Card data** — id, name, cost, type, text, and an effect spec (data, not code).\n2. **Zones** — deck (draw pile), hand, play\u002Fboard, discard, exile\u002Fremoved; cards live in exactly one.\n3. **Draw + shuffle + reshuffle** — draw from deck to hand; reshuffle discard into deck when empty.\n4. **Turn structure** — phases (untap\u002Fdraw\u002Fmain\u002Fcombat\u002Fend) as a state machine.\n5. **Resource system** — mana\u002Fenergy\u002Factions that gate how much you do per turn.\n6. **Effect resolution** — apply a card's effects in a defined order; handle targets and triggers.\n7. **Win\u002Floss condition** — life total, deck-out, objective.\n8. **UI** — hand layout, drag\u002Fdrop or tap-to-play, zone counts, targeting affordances.\n\n## Design knobs\n\n| Knob | Effect | Notes |\n|------|--------|-------|\n| Starting hand \u002F draw-per-turn | tempo, consistency | More draw = less variance. |\n| Hand size limit | hoarding vs. use | Discard down at end of turn. |\n| Deck size (min) | consistency | Smaller = more reliable combos. |\n| Resource curve | what's playable when | \"Mana curve\" paces power. |\n| Card rarity \u002F power budget | balance | Stronger cards cost more \u002F are rarer. |\n| Determinism vs. randomness | skill vs. swing | Shuffle + random effects add variance. |\n| Reshuffle rules | deck-out, fatigue | Reshuffle discard, or punish empty deck. |\n| Removal \u002F answers | counterplay | Every threat needs an answer in the pool. |\n\n## Patterns\n\n### 1. Zones + draw with automatic reshuffle\n\n```python\n# Pseudocode. A card is in exactly one zone at a time; moving = remove here, add there.\ndef draw(n):\n    for _ in range(n):\n        if not deck:\n            if not discard:          # truly empty: deck-out (lose, or take fatigue)\n                on_deck_out(); return\n            deck.extend(discard)     # reshuffle discard into deck\n            discard.clear()\n            shuffle(deck, rng)       # use a seeded RNG (see save-systems for replays)\n        hand.append(deck.pop())\n```\n\n### 2. Card as data + effect resolution\n\n```python\n# Pseudocode. Effects are a data list interpreted by the engine — not bespoke code per card.\ncard = {\n    \"id\": \"fireball\", \"cost\": 3, \"type\": \"spell\",\n    \"effects\": [ {\"op\": \"damage\", \"amount\": 6, \"target\": \"chosen_enemy\"} ],\n}\ndef play(card, caster):\n    if resources[caster] \u003C card.cost: return False     # can't afford\n    resources[caster] -= card.cost\n    move(card, from_zone=hand, to_zone=play_or_discard(card))\n    for fx in card.effects:\n        resolve_effect(fx, caster)                      # one interpreter handles every card\n    return True\n```\n\n### 3. Turn structure as a phase machine\n\n```python\n# Pseudocode. Fixed phases keep timing windows (triggers, priority) unambiguous.\nPHASES = [\"untap\", \"draw\", \"main\", \"combat\", \"end\"]\ndef take_turn(player):\n    for phase in PHASES:\n        enter_phase(player, phase)        # fire \"on_phase\" triggers here\n        if phase == \"draw\":   draw(1)\n        if phase == \"main\":   await player_plays_cards()\n        if phase == \"combat\": resolve_combat()\n        if phase == \"end\":    discard_to_hand_limit(player); clear_temporary_effects()\n```\n\n## Pitfalls \u002F failure modes\n\n- **A card existing in two zones at once** → duplication\u002Floss bugs. Enforce \"exactly one zone\";\n  move = remove-then-add, and assert no card appears twice.\n- **Forgetting to reshuffle** → draws silently fail or crash on empty deck. Reshuffle discard,\n  or define deck-out\u002Ffatigue explicitly (Pattern 1).\n- **One function per card** → unmaintainable and untestable. Make effects **data** interpreted\n  by a small set of operations (Pattern 2).\n- **Ambiguous effect order \u002F simultaneous triggers** → nondeterministic outcomes. Resolve in a\n  defined order (a queue or stack); document LIFO vs. FIFO (refs).\n- **Unseeded shuffle in a game that needs replays\u002Fundo** → can't reproduce. Use a seeded RNG.\n- **No hand limit \u002F no answers** → degenerate hoarding or unbeatable threats. Add a hand cap and\n  ensure removal exists for every threat archetype.\n- **Targeting state leaks** → a cancelled play leaves the board mid-targeting. Make play\n  atomic: validate cost + targets first, then commit.\n\n## Composition (build it from these skills)\n\n- **Card content:** `godot-resources` \u002F `unity-scriptableobjects` — define each card as a data asset.\n- **UI:** `game-ui-ux` for layout, scaling, and focus navigation; `godot-ui-control` for hand layout, drag\u002Fdrop, zone counts, and targeting prompts.\n- **Persistence\u002Freplays:** `save-systems` for collection, run state (roguelike deckbuilder), and seeded replays.\n- **Opponent AI:** `game-ai` for an AI that evaluates playable cards and picks targets.\n- **Animation\u002Ffeedback:** the engine animation skill for card movement; `audio-design` for cues.\n- **Scripting:** `godot-gdscript` \u002F `unity-csharp-scripting` for the effect interpreter.\n\n## References\n\n- For the effect queue\u002Fstack, keywords\u002Ftriggers, targeting, deckbuilder vs. constructed\n  archetypes, and shuffle fairness, read `references\u002Feffect-resolution.md`.\n","# Card Game\n\nA playbook for card games — card data, the deck\u002Fhand\u002Fdiscard zones, the turn structure, and\nhow card effects resolve. This is a **compositional** skill: it models cards as data and wires\nthem to UI. It does not re-teach data assets or UI nodes; it defines the zone model, the draw\nmachinery, and the effect-resolution rules that keep a card game correct and bug-free.\n\n## When to use\n\n- Use when building any game where the core objects are **cards** moving between zones\n  (deck → hand → play → discard): deckbuilder, TCG\u002FCCG, solitaire, roguelike deckbuilder.\n- Use when designing draw\u002Fshuffle\u002Freshuffle, turn structure, card costs, or how effects resolve.\n\n**When *not* to use:** board\u002Ftile state with matching rules → `puzzle`. RPG with an\nincidental card battler → start from `rpg`. For defining cards as assets, use `godot-resources`\n\u002F `unity-scriptableobjects`; for the hand\u002Fdrag UI, use `godot-ui-control`.\n\n## Core loop\n\n**Draw to your hand → spend resources to play cards → effects resolve and change the board →\nend the turn (cleanup\u002Fdiscard) → opponent\u002Fnext phase → repeat until a win condition.** Depth\ncomes from the *combinations* a hand allows; the engine's job is to resolve them unambiguously.\n\n## Must-have systems\n\n1. **Card data** — id, name, cost, type, text, and an effect spec (data, not code).\n2. **Zones** — deck (draw pile), hand, play\u002Fboard, discard, exile\u002Fremoved; cards live in exactly one.\n3. **Draw + shuffle + reshuffle** — draw from deck to hand; reshuffle discard into deck when empty.\n4. **Turn structure** — phases (untap\u002Fdraw\u002Fmain\u002Fcombat\u002Fend) as a state machine.\n5. **Resource system** — mana\u002Fenergy\u002Factions that gate how much you do per turn.\n6. **Effect resolution** — apply a card's effects in a defined order; handle targets and triggers.\n7. **Win\u002Floss condition** — life total, deck-out, objective.\n8. **UI** — hand layout, drag\u002Fdrop or tap-to-play, zone counts, targeting affordances.\n\n## Design knobs\n\n| Knob | Effect | Notes |\n|------|--------|-------|\n| Starting hand \u002F draw-per-turn | tempo, consistency | More draw = less variance. |\n| Hand size limit | hoarding vs. use | Discard down at end of turn. |\n| Deck size (min) | consistency | Smaller = more reliable combos. |\n| Resource curve | what's playable when | \"Mana curve\" paces power. |\n| Card rarity \u002F power budget | balance | Stronger cards cost more \u002F are rarer. |\n| Determinism vs. randomness | skill vs. swing | Shuffle + random effects add variance. |\n| Reshuffle rules | deck-out, fatigue | Reshuffle discard, or punish empty deck. |\n| Removal \u002F answers | counterplay | Every threat needs an answer in the pool. |\n\n## Patterns\n\n### 1. Zones + draw with automatic reshuffle\n\n```python\n# Pseudocode. A card is in exactly one zone at a time; moving = remove here, add there.\ndef draw(n):\n    for _ in range(n):\n        if not deck:\n            if not discard:          # truly empty: deck-out (lose, or take fatigue)\n                on_deck_out(); return\n            deck.extend(discard)     # reshuffle discard into deck\n            discard.clear()\n            shuffle(deck, rng)       # use a seeded RNG (see save-systems for replays)\n        hand.append(deck.pop())\n```\n\n### 2. Card as data + effect resolution\n\n```python\n# Pseudocode. Effects are a data list interpreted by the engine — not bespoke code per card.\ncard = {\n    \"id\": \"fireball\", \"cost\": 3, \"type\": \"spell\",\n    \"effects\": [ {\"op\": \"damage\", \"amount\": 6, \"target\": \"chosen_enemy\"} ],\n}\ndef play(card, caster):\n    if resources[caster] \u003C card.cost: return False     # can't afford\n    resources[caster] -= card.cost\n    move(card, from_zone=hand, to_zone=play_or_discard(card))\n    for fx in card.effects:\n        resolve_effect(fx, caster)                      # one interpreter handles every card\n    return True\n```\n\n### 3. Turn structure as a phase machine\n\n```python\n# Pseudocode. Fixed phases keep timing windows (triggers, priority) unambiguous.\nPHASES = [\"untap\", \"draw\", \"main\", \"combat\", \"end\"]\ndef take_turn(player):\n    for phase in PHASES:\n        enter_phase(player, phase)        # fire \"on_phase\" triggers here\n        if phase == \"draw\":   draw(1)\n        if phase == \"main\":   await player_plays_cards()\n        if phase == \"combat\": resolve_combat()\n        if phase == \"end\":    discard_to_hand_limit(player); clear_temporary_effects()\n```\n\n## Pitfalls \u002F failure modes\n\n- **A card existing in two zones at once** → duplication\u002Floss bugs. Enforce \"exactly one zone\";\n  move = remove-then-add, and assert no card appears twice.\n- **Forgetting to reshuffle** → draws silently fail or crash on empty deck. Reshuffle discard,\n  or define deck-out\u002Ffatigue explicitly (Pattern 1).\n- **One function per card** → unmaintainable and untestable. Make effects **data** interpreted\n  by a small set of operations (Pattern 2).\n- **Ambiguous effect order \u002F simultaneous triggers** → nondeterministic outcomes. Resolve in a\n  defined order (a queue or stack); document LIFO vs. FIFO (refs).\n- **Unseeded shuffle in a game that needs replays\u002Fundo** → can't reproduce. Use a seeded RNG.\n- **No hand limit \u002F no answers** → degenerate hoarding or unbeatable threats. Add a hand cap and\n  ensure removal exists for every threat archetype.\n- **Targeting state leaks** → a cancelled play leaves the board mid-targeting. Make play\n  atomic: validate cost + targets first, then commit.\n\n## Composition (build it from these skills)\n\n- **Card content:** `godot-resources` \u002F `unity-scriptableobjects` — define each card as a data asset.\n- **UI:** `game-ui-ux` for layout, scaling, and focus navigation; `godot-ui-control` for hand layout, drag\u002Fdrop, zone counts, and targeting prompts.\n- **Persistence\u002Freplays:** `save-systems` for collection, run state (roguelike deckbuilder), and seeded replays.\n- **Opponent AI:** `game-ai` for an AI that evaluates playable cards and picks targets.\n- **Animation\u002Ffeedback:** the engine animation skill for card movement; `audio-design` for cues.\n- **Scripting:** `godot-gdscript` \u002F `unity-csharp-scripting` for the effect interpreter.\n\n## References\n\n- For the effect queue\u002Fstack, keywords\u002Ftriggers, targeting, deckbuilder vs. constructed\n  archetypes, and shuffle fairness, read `references\u002Feffect-resolution.md`.\n",{"name":5,"license":15,"metadata":24,"description":28,"compatibility":29},{"engine":25,"category":26,"difficulty":27},"none","genres","intermediate","Build a card game: card data, deck\u002Fhand\u002Fdiscard zones, draw\u002Fshuffle\u002Freshuffle, a turn structure, costs, and effect resolution. Use for a deckbuilder, TCG\u002FCCG, or roguelike deckbuilder.\n","Engine-agnostic design patterns; snippets are pseudocode (port to your engine)","main","6d4e3296d58b2720c5b1026197cd069b1dde4789","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills","https:\u002F\u002Fgithub.com\u002Fmistervaibhav","Software Engineer","2026-07-24 17:16:42",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add mistervaibhav\u002Fskills --skill card-game",{"tool":42,"command":43},"bunx","bunx skills add mistervaibhav\u002Fskills --skill card-game",{"tool":45,"command":46},"pnpm","pnpm dlx skills add mistervaibhav\u002Fskills --skill card-game","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fcard-game\u002FSKILL.md",true,[50],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Feffect-resolution.md","REFERENCE","参考文档",4720,"https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fcard-game\u002Freferences\u002Feffect-resolution.md",[57,65,73,81,88,95],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":61,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M79NZDV5781GA6SJMN1QPXB4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":69,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79NZ8SEVWT4WYD49BV980YW","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", or \"type hierarchy\". Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","MIT","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":69,"licenseFileUrl":77,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M79NYVQS5NYHH36NXF2AHP8B","web-haptics","Add haptic feedback to web apps using the web-haptics library. Use when building mobile-facing UIs that need tactile feedback on buttons, toggles, forms, pickers, and other interactive elements.","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fweb-haptics\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fweb-haptics\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M79NY8AMC62DDRSH21WKXJVE","visual-novel","Build a visual novel: a branching script, character and background display, a text box with choices, save\u002Fload, backlog, and skip\u002Fauto. Use for a VN, dating sim, or branching story game.","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fvisual-novel\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":69,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M79NWFM5R9QC9Y2AT40EHF44","ux-heuristics","Evaluate and improve interface usability using heuristic analysis. Use when the user mentions \"usability audit\", \"UX review\", \"users are confused\", \"heuristic evaluation\", \"form usability\", or \"navigation problems\". Covers Nielsen's 10 heuristics, severity ratings, and information architecture. For visual design fixes, see refactoring-ui. For conversion-focused audits, see cro-methodology.","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Fux-heuristics\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M79NVSG7AB3MSFT8Y6EEHG1B","unreal-packaging","Package and ship an Unreal Engine 5 project: the Platforms menu Package Project flow, build configurations (Development vs Shipping), cooking content, packaging settings and the Game Default Map, and command-line builds with RunUAT BuildCookRun. Use when packaging a build, making a shipping build, cooking content, configuring packaging settings, or when the user mentions package Unreal, cook content, shipping build, or BuildCookRun.","https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Funreal-packaging\u002FSKILL.md",[],[]]