Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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/wave-defense game, or balancing waves and economy.
.claude/skills/gamedev-skills-tower-defense/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 68% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 78% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 63% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 6% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 46% | 0% |
A playbook for tower defense — enemy pathing, wave spawning, tower targeting, and the economy that ties them together. This is a compositional skill: it orchestrates pathing, AI, and UI into a TD loop. It does not re-teach pathfinding; it defines the systems and the balance levers (DPS vs. HP vs. income) that decide whether a TD is tense or trivial.
waves of enemies following a path, spends earned currency to expand/upgrade, and loses if too many enemies leak through.
When _not_ to use: the player directly controls a shooter → fps-shooter. Free-form base building with needs → survival-crafting. For the pathfinding algorithm itself, use game-ai.
Prepare (place/upgrade towers with current gold) → start the wave → enemies path toward the goal while towers auto-fire → earn gold from kills → survive the wave → repeat against a harder one. The tension is a planning puzzle: is my current DPS enough for what's coming, and can I afford the answer?
| Knob | Effect | Notes | | ------------------------- | ----------------------- | ---------------------------------------- | | Enemy HP growth/wave | upgrade pressure | Geometric ~1.1–1.2× (refs). | | Income vs. HP curves | difficulty | Player should _almost_ afford each wave. | | Tower DPS / range / cost | tower identity | Cheap+wide vs. expensive+tall. | | Targeting priority | optimal placement | Changes play more than raw stats. | | Enemy variety | counters one-build wins | Fast / armored / flying / swarm / boss. | | Leak penalty | stakes | Cost lives _and_ lost bounty. | | Upgrade vs. build economy | strategy depth | Diminishing upgrade returns. | | Wave pacing | tension curve | Spike → breather → spike, not monotonic. |
python# Pseudocode. A wave is data: a list of (enemy_type, count, spacing). Spawn over time. wave = [ ("grunt", 10, 0.5), ("runner", 5, 0.3), ("tank", 2, 1.0) ] def run_wave(wave): for enemy_type, count, spacing in wave: for _ in range(count): spawn_enemy(enemy_type, at=path[0]) # enter at the path start wait(spacing) # seconds between spawns (use a timer/coroutine) # wave clears when all spawned enemies are dead or have leaked
python# Pseudocode. "First" (furthest along path) is the standard default for stopping leaks. def acquire_target(tower, enemies, mode="first"): in_range = [e for e in enemies if distance(tower.pos, e.pos) <= tower.range] if not in_range: return None if mode == "first": return max(in_range, key=lambda e: e.progress) # furthest along path (stop leaks) if mode == "last": return min(in_range, key=lambda e: e.progress) # least progress (guard the entrance) if mode == "closest": return min(in_range, key=lambda e: distance(tower.pos, e.pos)) if mode == "strongest":return max(in_range, key=lambda e: e.hp) # burn down tanks first if mode == "weakest": return min(in_range, key=lambda e: e.hp) # secure kills / last-hit bounty return in_range[0]
python# Pseudocode. One tower's damage to one enemy crossing its range. tower_dps = tower.damage * tower.fire_rate time_in_range = tower.range_coverage_length / enemy.speed damage_dealt = tower_dps * time_in_range # Lane holds if summed damage_dealt from covering towers >= enemy.hp (per enemy). See refs.
Tune the HP curve against the income curve (refs).
(armored vs. rapid-fire, flying vs. ground-only) and diminishing upgrade returns.
that sever the path; recompute paths when towers change (refs).
dt → speed varies with frame rate. Scale steering by dt.game-ai for A\/flow-field/steering; for fixed lanes, simple waypoint following.godot-2d-movement (or engine equivalent) to move along the path; unity-navmesh for nav-based pathing.godot-tilemap / unity-tilemap-2d for the grid/lanes; level-design for map layouts.godot-resources / unity-scriptableobjects to define towers, enemies, and waves as assets.game-ui-ux for HUD layout, scaling, and the build menu; godot-ui-control for the concrete widgets (lives, gold, wave preview).audio-design for fire/hit/leak sound cues.math, enemy scaling, and wave pacing, read references/balancing.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 9,703 | 8,747 | -10% | 1 | 1 | 0% | 1,938 | 3,456 | +78% | 0 | 0 | — |
case-02 | pass→pass | 11,558 | 8,350 | -28% | 1 | 1 | 0% | 2,088 | 3,405 | +63% | 0 | 0 | — |
case-03 | pass→pass | 16,135 | 11,134 | -31% | 1 | 1 | 0% | 3,372 | 3,561 | +6% | 0 | 0 | — |
case-04 | fail→pass | 14,897 | 14,019 | -6% | 1 | 1 | 0% | 2,417 | 4,058 | +68% | 0 | 0 | — |
case-05 | pass→pass | 14,626 | 11,282 | -23% | 1 | 1 | 0% | 2,326 | 3,405 | +46% | 0 | 0 | — |
case-06 | fail→fail | 11,374 | 6,797 | -40% | 1 | 1 | 0% | 2,146 | 2,827 | +32% | 0 | 0 | — |
case-07 | pass→pass | 17,117 | 12,457 | -27% | 1 | 1 | 0% | 2,638 | 3,738 | +42% | 0 | 0 | — |
case-08 | pass→pass | 21,037 | 17,645 | -16% | 1 | 1 | 0% | 3,579 | 4,657 | +30% | 0 | 0 | — |
case-22 | pass→pass | 12,001 | 11,366 | -5% | 1 | 1 | 0% | 1,901 | 3,267 | +72% | 0 | 0 | — |
case-09 | pass→pass | 14,746 | 16,128 | +9% | 1 | 1 | 0% | 2,257 | 3,966 | +76% | 0 | 0 | — |
case-10 | fail→fail | 16,160 | 12,256 | -24% | 1 | 1 | 0% | 2,448 | 3,482 | +42% | 0 | 0 | — |
case-11 | pass→pass | 9,346 | 11,856 | +27% | 1 | 1 | 0% | 1,773 | 4,055 | +129% | 0 | 0 | — |
case-12 | pass→pass | 14,933 | 10,660 | -29% | 1 | 1 | 0% | 2,813 | 3,725 | +32% | 0 | 0 | — |
case-13 | pass→pass | 17,653 | 14,072 | -20% | 1 | 1 | 0% | 2,744 | 3,794 | +38% | 0 | 0 | — |
case-14 | pass→pass | 15,837 | 10,751 | -32% | 1 | 1 | 0% | 2,489 | 3,454 | +39% | 0 | 0 | — |
case-15 | pass→pass | 18,816 | 12,900 | -31% | 1 | 1 | 0% | 3,105 | 3,598 | +16% | 0 | 0 | — |
case-16 | pass→pass | 16,714 | 14,025 | -16% | 1 | 1 | 0% | 2,936 | 3,984 | +36% | 0 | 0 | — |
case-17 | pass→pass | 8,464 | 6,357 | -25% | 1 | 1 | 0% | 1,610 | 2,822 | +75% | 0 | 0 | — |
case-18 | pass→pass | 17,486 | 16,949 | -3% | 1 | 1 | 0% | 2,785 | 4,348 | +56% | 0 | 0 | — |
case-19 | pass→pass | 28,204 | 22,566 | -20% | 1 | 1 | 0% | 4,790 | 6,169 | +29% | 0 | 0 | — |
case-20 | fail→fail | 23,655 | 20,454 | -14% | 1 | 1 | 0% | 4,577 | 5,698 | +24% | 0 | 0 | — |
case-21 | pass→pass | 16,934 | 17,241 | +2% | 1 | 1 | 0% | 3,779 | 5,704 | +51% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.