[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79QEVEP2TTXCS5FSR8YE6HS":3,"skill-same:01M79QEVEP2TTXCS5FSR8YE6HS":51},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M79QEVEP2TTXCS5FSR8YE6HS","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.","JunMystery\u002FAgent-Guidance","JunMystery","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161468934?v=4","01M79MTMV8F0BY8NK1A92RA8A0","Jun","01M79MTMWCFBKPHN5B25E6V20B",0,"MIT","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\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.\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 for the spawn or for any enemy already walking; recompute paths when\n  towers change (refs §1).\n- **Fast enemies slow down at corners or skip waypoints** → per-step movement stops at each\n  waypoint or overshoots it. Carry the leftover distance to the next waypoint (refs §1).\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 for the spawn or for any enemy already walking; recompute paths when\n  towers change (refs §1).\n- **Fast enemies slow down at corners or skip waypoints** → per-step movement stops at each\n  waypoint or overshoots it. Carry the leftover distance to the next waypoint (refs §1).\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,"description":7},"main","5d0a87185c0e172c3901e2a6e5916b6d544b8b94","skills\u002Ftower-defense","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance","https:\u002F\u002Fgithub.com\u002FJunMystery","AI is the typist, I am the architect. Building efficient, secure, and user-centric products through disciplined AI prompt engineering.","2026-11-13 17:41:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add JunMystery\u002FAgent-Guidance --skill tower-defense",{"tool":37,"command":38},"bunx","bunx skills add JunMystery\u002FAgent-Guidance --skill tower-defense",{"tool":40,"command":41},"pnpm","pnpm dlx skills add JunMystery\u002FAgent-Guidance --skill tower-defense","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Ftower-defense\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fbalancing.md","REFERENCE","参考文档",6022,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Ftower-defense\u002Freferences\u002Fbalancing.md",[52,58,64,70,76,82],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M79QR1E309VJ6CTQKB32AWWA","zero-trust-architecture-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-architecture-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79QQV7GHYR02DYGN41S23WN","xss-filter-evasion-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxss-filter-evasion-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79QQNSN7YB8XB61FFSCS3WH","xs-leaks-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxs-leaks-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79QQHZZJKFDY9132G5A65C2","xpath-injection-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxpath-injection-prevention-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79QQB9ZSD3DJG8658EHQXR1","xml-security-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-security-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":6,"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},"01M79QQ60WKV7PFMXWT9CW8PM6","xml-external-entity-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-external-entity-prevention-cheat-sheet\u002FSKILL.md",[],[]]