[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79NRHQ18AX32PWKG252P032":3,"skill-same:01M79NRHQ18AX32PWKG252P032":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},"01M79NRHQ18AX32PWKG252P032","tower-defense",null,"Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives. Use for a tower-defense\u002Fwave-defense game, or balancing waves and economy.","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\u002Ftower-defense\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tower-defense\ndescription: >\n  Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire,\n  an economy, and lives. Use for a tower-defense\u002Fwave-defense game, or balancing waves and economy.\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# Tower Defense\n\nA playbook for tower defense — enemy pathing, wave spawning, tower targeting, and the\neconomy that ties them together. This is a **compositional** skill: it orchestrates pathing,\nAI, and UI into a TD loop. It does not re-teach pathfinding; it defines the systems and the\nbalance levers (DPS vs. HP vs. income) that decide whether a TD is tense or trivial.\n\n## When to use\n\n- Use when building a game where the player **places towers** that automatically attack\n  **waves of enemies** following a path, spends earned currency to expand\u002Fupgrade, and loses\n  if too many enemies leak through.\n- Use when designing wave composition\u002Fpacing, tower targeting priorities, or the gold economy.\n\n**When _not_ to use:** the player directly controls a shooter → `fps-shooter`. Free-form base\nbuilding with needs → `survival-crafting`. For the pathfinding algorithm itself, use `game-ai`.\n\n## Core loop\n\n**Prepare (place\u002Fupgrade towers with current gold) → start the wave → enemies path toward the\ngoal while towers auto-fire → earn gold from kills → survive the wave → repeat against a\nharder one.** The tension is a planning puzzle: is my current DPS enough for what's coming,\nand can I afford the answer?\n\n## Must-have systems\n\n1. **Enemy path** — waypoint lanes, or grid + pathfinding for maze TD (refs).\n2. **Wave spawner** — timed, scripted sequences of enemy types with per-wave scaling.\n3. **Towers** — range, fire rate, damage, projectile\u002Fhitscan, splash; placement validity.\n4. **Targeting** — per-tower priority (first\u002Flast\u002Fclosest\u002Fstrongest\u002Fweakest) (refs).\n5. **Economy** — gold from kills + wave bonuses; tower\u002Fupgrade costs; sell refund.\n6. **Lives \u002F leak** — enemies reaching the goal cost lives; 0 = game over.\n7. **Wave\u002Fprep UI** — lives, gold, next-wave preview, start-next-wave control.\n\n## Design knobs\n\n| Knob                      | Effect                  | Notes                                    |\n| ------------------------- | ----------------------- | ---------------------------------------- |\n| Enemy HP growth\u002Fwave      | upgrade pressure        | Geometric ~1.1–1.2× (refs).              |\n| Income vs. HP curves      | difficulty              | Player should _almost_ afford each wave. |\n| Tower DPS \u002F range \u002F cost  | tower identity          | Cheap+wide vs. expensive+tall.           |\n| Targeting priority        | optimal placement       | Changes play more than raw stats.        |\n| Enemy variety             | counters one-build wins | Fast \u002F armored \u002F flying \u002F swarm \u002F boss.  |\n| Leak penalty              | stakes                  | Cost lives _and_ lost bounty.            |\n| Upgrade vs. build economy | strategy depth          | Diminishing upgrade returns.             |\n| Wave pacing               | tension curve           | Spike → breather → spike, not monotonic. |\n\n## Patterns\n\n### 1. Wave spawner (timed, data-driven)\n\n```python\n# Pseudocode. A wave is data: a list of (enemy_type, count, spacing). Spawn over time.\nwave = [ (\"grunt\", 10, 0.5), (\"runner\", 5, 0.3), (\"tank\", 2, 1.0) ]\n\ndef run_wave(wave):\n    for enemy_type, count, spacing in wave:\n        for _ in range(count):\n            spawn_enemy(enemy_type, at=path[0])   # enter at the path start\n            wait(spacing)                          # seconds between spawns (use a timer\u002Fcoroutine)\n    # wave clears when all spawned enemies are dead or have leaked\n```\n\n### 2. Tower targeting (filter to range, then pick by priority)\n\n```python\n# Pseudocode. \"First\" (furthest along path) is the standard default for stopping leaks.\ndef acquire_target(tower, enemies, mode=\"first\"):\n    in_range = [e for e in enemies if distance(tower.pos, e.pos) \u003C= tower.range]\n    if not in_range: return None\n    if mode == \"first\":    return max(in_range, key=lambda e: e.progress)   # furthest along path (stop leaks)\n    if mode == \"last\":     return min(in_range, key=lambda e: e.progress)   # least progress (guard the entrance)\n    if mode == \"closest\":  return min(in_range, key=lambda e: distance(tower.pos, e.pos))\n    if mode == \"strongest\":return max(in_range, key=lambda e: e.hp)         # burn down tanks first\n    if mode == \"weakest\":  return min(in_range, key=lambda e: e.hp)         # secure kills \u002F last-hit bounty\n    return in_range[0]\n```\n\n### 3. \"Can this lane hold?\" sanity check (DPS vs. HP)\n\n```python\n# Pseudocode. One tower's damage to one enemy crossing its range.\ntower_dps     = tower.damage * tower.fire_rate\ntime_in_range = tower.range_coverage_length \u002F enemy.speed\ndamage_dealt  = tower_dps * time_in_range\n# Lane holds if summed damage_dealt from covering towers >= enemy.hp (per enemy). See refs.\n```\n\n## Pitfalls \u002F failure modes\n\n- **Enemy HP scales slower than player income\u002FDPS** → game trivializes after a few waves.\n  Tune the HP curve against the income curve (refs).\n- **One dominant tower\u002Fstrategy** → no decisions. Add enemy types that hard-counter builds\n  (armored vs. rapid-fire, flying vs. ground-only) and diminishing upgrade returns.\n- **Maze TD that can fully block the goal** → enemies get stuck\u002Fsoftlock. Forbid placements\n  that sever the path; recompute paths when towers change (refs).\n- **No next-wave telegraph** → specials feel random and unfair. Preview upcoming composition.\n- **Per-frame movement unscaled by `dt`** → speed varies with frame rate. Scale steering by `dt`.\n- **Leaks only cost lives, not gold** → leaking is sometimes optimal. Make leaks lose bounty too.\n- **Monotonic difficulty ramp** → exhausting. Pace spikes and breathers.\n\n## Composition (build it from these skills)\n\n- **Pathing:** `game-ai` for A\\*\u002Fflow-field\u002Fsteering; for fixed lanes, simple waypoint following.\n- **Enemy movement:** `godot-2d-movement` (or engine equivalent) to move along the path; `unity-navmesh` for nav-based pathing.\n- **Map:** `godot-tilemap` \u002F `unity-tilemap-2d` for the grid\u002Flanes; `level-design` for map layouts.\n- **Data:** `godot-resources` \u002F `unity-scriptableobjects` to define towers, enemies, and waves as assets.\n- **UI:** `game-ui-ux` for HUD layout, scaling, and the build menu; `godot-ui-control` for the concrete widgets (lives, gold, wave preview).\n- **Polish:** `audio-design` for fire\u002Fhit\u002Fleak sound cues.\n\n## References\n\n- For path representations (waypoints \u002F A\\* \u002F flow fields), targeting modes, DPS and economy\n  math, enemy scaling, and wave pacing, read `references\u002Fbalancing.md`.\n","# Tower Defense\n\nA playbook for tower defense — enemy pathing, wave spawning, tower targeting, and the\neconomy that ties them together. This is a **compositional** skill: it orchestrates pathing,\nAI, and UI into a TD loop. It does not re-teach pathfinding; it defines the systems and the\nbalance levers (DPS vs. HP vs. income) that decide whether a TD is tense or trivial.\n\n## When to use\n\n- Use when building a game where the player **places towers** that automatically attack\n  **waves of enemies** following a path, spends earned currency to expand\u002Fupgrade, and loses\n  if too many enemies leak through.\n- Use when designing wave composition\u002Fpacing, tower targeting priorities, or the gold economy.\n\n**When _not_ to use:** the player directly controls a shooter → `fps-shooter`. Free-form base\nbuilding with needs → `survival-crafting`. For the pathfinding algorithm itself, use `game-ai`.\n\n## Core loop\n\n**Prepare (place\u002Fupgrade towers with current gold) → start the wave → enemies path toward the\ngoal while towers auto-fire → earn gold from kills → survive the wave → repeat against a\nharder one.** The tension is a planning puzzle: is my current DPS enough for what's coming,\nand can I afford the answer?\n\n## Must-have systems\n\n1. **Enemy path** — waypoint lanes, or grid + pathfinding for maze TD (refs).\n2. **Wave spawner** — timed, scripted sequences of enemy types with per-wave scaling.\n3. **Towers** — range, fire rate, damage, projectile\u002Fhitscan, splash; placement validity.\n4. **Targeting** — per-tower priority (first\u002Flast\u002Fclosest\u002Fstrongest\u002Fweakest) (refs).\n5. **Economy** — gold from kills + wave bonuses; tower\u002Fupgrade costs; sell refund.\n6. **Lives \u002F leak** — enemies reaching the goal cost lives; 0 = game over.\n7. **Wave\u002Fprep UI** — lives, gold, next-wave preview, start-next-wave control.\n\n## Design knobs\n\n| Knob                      | Effect                  | Notes                                    |\n| ------------------------- | ----------------------- | ---------------------------------------- |\n| Enemy HP growth\u002Fwave      | upgrade pressure        | Geometric ~1.1–1.2× (refs).              |\n| Income vs. HP curves      | difficulty              | Player should _almost_ afford each wave. |\n| Tower DPS \u002F range \u002F cost  | tower identity          | Cheap+wide vs. expensive+tall.           |\n| Targeting priority        | optimal placement       | Changes play more than raw stats.        |\n| Enemy variety             | counters one-build wins | Fast \u002F armored \u002F flying \u002F swarm \u002F boss.  |\n| Leak penalty              | stakes                  | Cost lives _and_ lost bounty.            |\n| Upgrade vs. build economy | strategy depth          | Diminishing upgrade returns.             |\n| Wave pacing               | tension curve           | Spike → breather → spike, not monotonic. |\n\n## Patterns\n\n### 1. Wave spawner (timed, data-driven)\n\n```python\n# Pseudocode. A wave is data: a list of (enemy_type, count, spacing). Spawn over time.\nwave = [ (\"grunt\", 10, 0.5), (\"runner\", 5, 0.3), (\"tank\", 2, 1.0) ]\n\ndef run_wave(wave):\n    for enemy_type, count, spacing in wave:\n        for _ in range(count):\n            spawn_enemy(enemy_type, at=path[0])   # enter at the path start\n            wait(spacing)                          # seconds between spawns (use a timer\u002Fcoroutine)\n    # wave clears when all spawned enemies are dead or have leaked\n```\n\n### 2. Tower targeting (filter to range, then pick by priority)\n\n```python\n# Pseudocode. \"First\" (furthest along path) is the standard default for stopping leaks.\ndef acquire_target(tower, enemies, mode=\"first\"):\n    in_range = [e for e in enemies if distance(tower.pos, e.pos) \u003C= tower.range]\n    if not in_range: return None\n    if mode == \"first\":    return max(in_range, key=lambda e: e.progress)   # furthest along path (stop leaks)\n    if mode == \"last\":     return min(in_range, key=lambda e: e.progress)   # least progress (guard the entrance)\n    if mode == \"closest\":  return min(in_range, key=lambda e: distance(tower.pos, e.pos))\n    if mode == \"strongest\":return max(in_range, key=lambda e: e.hp)         # burn down tanks first\n    if mode == \"weakest\":  return min(in_range, key=lambda e: e.hp)         # secure kills \u002F last-hit bounty\n    return in_range[0]\n```\n\n### 3. \"Can this lane hold?\" sanity check (DPS vs. HP)\n\n```python\n# Pseudocode. One tower's damage to one enemy crossing its range.\ntower_dps     = tower.damage * tower.fire_rate\ntime_in_range = tower.range_coverage_length \u002F enemy.speed\ndamage_dealt  = tower_dps * time_in_range\n# Lane holds if summed damage_dealt from covering towers >= enemy.hp (per enemy). See refs.\n```\n\n## Pitfalls \u002F failure modes\n\n- **Enemy HP scales slower than player income\u002FDPS** → game trivializes after a few waves.\n  Tune the HP curve against the income curve (refs).\n- **One dominant tower\u002Fstrategy** → no decisions. Add enemy types that hard-counter builds\n  (armored vs. rapid-fire, flying vs. ground-only) and diminishing upgrade returns.\n- **Maze TD that can fully block the goal** → enemies get stuck\u002Fsoftlock. Forbid placements\n  that sever the path; recompute paths when towers change (refs).\n- **No next-wave telegraph** → specials feel random and unfair. Preview upcoming composition.\n- **Per-frame movement unscaled by `dt`** → speed varies with frame rate. Scale steering by `dt`.\n- **Leaks only cost lives, not gold** → leaking is sometimes optimal. Make leaks lose bounty too.\n- **Monotonic difficulty ramp** → exhausting. Pace spikes and breathers.\n\n## Composition (build it from these skills)\n\n- **Pathing:** `game-ai` for A\\*\u002Fflow-field\u002Fsteering; for fixed lanes, simple waypoint following.\n- **Enemy movement:** `godot-2d-movement` (or engine equivalent) to move along the path; `unity-navmesh` for nav-based pathing.\n- **Map:** `godot-tilemap` \u002F `unity-tilemap-2d` for the grid\u002Flanes; `level-design` for map layouts.\n- **Data:** `godot-resources` \u002F `unity-scriptableobjects` to define towers, enemies, and waves as assets.\n- **UI:** `game-ui-ux` for HUD layout, scaling, and the build menu; `godot-ui-control` for the concrete widgets (lives, gold, wave preview).\n- **Polish:** `audio-design` for fire\u002Fhit\u002Fleak sound cues.\n\n## References\n\n- For path representations (waypoints \u002F A\\* \u002F flow fields), targeting modes, DPS and economy\n  math, enemy scaling, and wave pacing, read `references\u002Fbalancing.md`.\n",{"name":5,"license":15,"metadata":24,"description":28,"compatibility":29},{"engine":25,"category":26,"difficulty":27},"none","genres","intermediate","Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives. Use for a tower-defense\u002Fwave-defense game, or balancing waves and economy.\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 tower-defense",{"tool":42,"command":43},"bunx","bunx skills add mistervaibhav\u002Fskills --skill tower-defense",{"tool":45,"command":46},"pnpm","pnpm dlx skills add mistervaibhav\u002Fskills --skill tower-defense","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Ftower-defense\u002FSKILL.md",true,[50],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fbalancing.md","REFERENCE","参考文档",4970,"https:\u002F\u002Fgithub.com\u002Fmistervaibhav\u002Fskills\u002Fblob\u002Fmain\u002Ftower-defense\u002Freferences\u002Fbalancing.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",[],[]]