Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives.

Apache-2.0Auto-check passedGame Development

Install Tower Defense

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill tower-defense -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills tower-defense --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/genres/tower-defense .claude/skills/tower-defense && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tower-defense
GitHub stars
1.4k
Token cost
~1.7k tokens
SKILL.md length
578 words
Files
2 (incl. references)
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives.

  • Works in 3 steps: Wave spawner (timed, data-driven) → Tower targeting (filter to range, then… → "Can this lane hold?" sanity check (DPS…
  • A tower-defense/wave-defense game
  • SKILL.md covers When to use, Core loop, Must-have systems and Design knobs, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tower Defense is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. 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.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/balancing.md`).

It sits in Game Development. The repository describes itself as: 74 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic… The licence is Apache-2.0.

When your agent uses it

  • A tower-defense/wave-defense game
  • Balancing waves and economy

Example prompts

  • “/tower-defense”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Wave spawner (timed, data-driven)
  2. Tower targeting (filter to range, then pick by priority)
  3. "Can this lane hold?" sanity check (DPS vs. HP)

What it can do on your machine

Read from SKILL.md and the folder at commit 0a70cfc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tower Defense loads about 1.7k tokens when it runs, and up to ~2.9k if it reads all its reference files. Until then it costs about 53 tokens; SKILL.md has 578 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gamedev-skills/awesome-gamedev-agent-skills at commit 0a70cfc, republished under its Apache-2.0 licence (© gamedev-skills). 578 words, ~1,654 tokens.

Download SKILL.mdSave it as .claude/skills/tower-defense/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tower-defense
description
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.

Tower Defense

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.

When to use

  • Use when building a game where the player places towers that automatically attack waves of enemies following a path, spends earned currency to expand/upgrade, and loses if too many enemies leak through.
  • Use when designing wave composition/pacing, tower targeting priorities, or the gold economy.

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.

Core loop

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?

Must-have systems

  1. Enemy path — waypoint lanes, or grid + pathfinding for maze TD (refs).
  2. Wave spawner — timed, scripted sequences of enemy types with per-wave scaling.
  3. Towers — range, fire rate, damage, projectile/hitscan, splash; placement validity.
  4. Targeting — per-tower priority (first/last/closest/strongest/weakest) (refs).
  5. Economy — gold from kills + wave bonuses; tower/upgrade costs; sell refund.
  6. Lives / leak — enemies reaching the goal cost lives; 0 = game over.
  7. Wave/prep UI — lives, gold, next-wave preview, start-next-wave control.

Design knobs

KnobEffectNotes
Enemy HP growth/waveupgrade pressureGeometric ~1.1–1.2× (refs).
Income vs. HP curvesdifficultyPlayer should almost afford each wave.
Tower DPS / range / costtower identityCheap+wide vs. expensive+tall.
Targeting priorityoptimal placementChanges play more than raw stats.
Enemy varietycounters one-build winsFast / armored / flying / swarm / boss.
Leak penaltystakesCost lives and lost bounty.
Upgrade vs. build economystrategy depthDiminishing upgrade returns.
Wave pacingtension curveSpike → breather → spike, not monotonic.

Patterns

1. Wave spawner (timed, data-driven)
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
Show full SKILL.md (235 more words)Show less
2. Tower targeting (filter to range, then pick by priority)
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]
3. "Can this lane hold?" sanity check (DPS vs. HP)
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.

Pitfalls / failure modes

  • Enemy HP scales slower than player income/DPS → game trivializes after a few waves. Tune the HP curve against the income curve (refs).
  • One dominant tower/strategy → no decisions. Add enemy types that hard-counter builds (armored vs. rapid-fire, flying vs. ground-only) and diminishing upgrade returns.
  • Maze TD that can fully block the goal → enemies get stuck/softlock. Forbid placements that sever the path; recompute paths when towers change (refs).
  • No next-wave telegraph → specials feel random and unfair. Preview upcoming composition.
  • Per-frame movement unscaled by dt → speed varies with frame rate. Scale steering by dt.
  • Leaks only cost lives, not gold → leaking is sometimes optimal. Make leaks lose bounty too.
  • Monotonic difficulty ramp → exhausting. Pace spikes and breathers.

Composition (build it from these skills)

  • Pathing: game-ai for A*/flow-field/steering; for fixed lanes, simple waypoint following.
  • Enemy movement: godot-2d-movement (or engine equivalent) to move along the path; unity-navmesh for nav-based pathing.
  • Map: godot-tilemap / unity-tilemap-2d for the grid/lanes; level-design for map layouts.
  • Data: godot-resources / unity-scriptableobjects to define towers, enemies, and waves as assets.
  • UI: game-ui-ux for HUD layout, scaling, and the build menu; godot-ui-control for the concrete widgets (lives, gold, wave preview).
  • Polish: audio-design for fire/hit/leak sound cues.

References

  • For path representations (waypoints / A* / flow fields), targeting modes, DPS and economy math, enemy scaling, and wave pacing, read references/balancing.md.

© gamedev-skills, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/genres/tower-defense of gamedev-skills/awesome-gamedev-agent-skills.

  • SKILL.md
  • references/balancing.md

Open the folder on GitHubat commit 0a70cfc

Compare with similar skills

Tower Defense next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tower Defense compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tower Defense this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~1.7kAutomated safety check: PassApache-2.0
Image to Three.js Modelimg2threejs/img2threejs18k1 repos~8.2kAutomated safety check: PassApache-2.0
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
Threejs Game Directormajidmanzarpour/threejs-game-skills2.5k—~2.2kAutomated safety check: PassMIT
Game Asset Generatorhtdt/godogen7.1k—~2.8kAutomated safety check: PassMIT
Threejs Gameplay Systemsvalkor-ai/loom1.2k1 repos~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Image to Three.js Model

    img2threejs/img2threejs

    Rebuilds the object in a reference image as a procedural, animation-ready Three.js model written entirely in code, using staged sculpting with quality checks.

    18k GitHub starsUsed in 1 repo~8.2k tokens
    Game DevelopmentAuto-check passed
  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 1 repo~2.7k tokens
    Game DevelopmentAuto-check passed
  • Threejs Game Director

    majidmanzarpour/threejs-game-skills

    Entrypoint for building, upgrading, and finishing Three.js browser games.

    2.5k GitHub stars~2.2k tokensUpdated 13 days ago
    Game DevelopmentAuto-check passed
  • Generates game art from text prompts: PNG images, GLB 3D models, rigged characters, animations and sprites, with background removal.

    7.1k GitHub stars~2.8k tokensUpdated 9 days ago
    Game DevelopmentAuto-check passed
  • Build and iterate playable Three.js game systems: starter scaffold, architecture, design briefs, core loops, level and encounter design, entities, input, camera, collision and physics, scoring…

    1.2k GitHub starsUsed in 1 repo~1.4k tokens
    Game DevelopmentAuto-check passed
  • Uloop Execute Dynamic Code

    CyberAgentGameEntertainment/NovaShader

    Execute C with Unity APIs when existing uloop tools cannot inspect or edit enough.

    1.6k GitHub starsUsed in 1 repo~1.9k tokens
    Game DevelopmentAuto-check passed

More from gamedev-skills/awesome-gamedev-agent-skills

All 53 skills in this repo
  • Create Game Assets

    gamedev-skills/awesome-gamedev-agent-skills

    Plan, generate, source, normalize, and validate cohesive visual game assets.

    1.4k GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Roblox UI

    gamedev-skills/awesome-gamedev-agent-skills

    Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion…

    1.4k GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • AI Behavior Trees Utility AI

    gamedev-skills/awesome-gamedev-agent-skills

    Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…

    1.4k GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Card Game

    gamedev-skills/awesome-gamedev-agent-skills

    Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.

    1.4k GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Fps Shooter

    gamedev-skills/awesome-gamedev-agent-skills

    Build a first-person shooter: move+mouse-look controller, hitscan or projectile shooting, weapons, health, and enemy AI.

    1.4k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed

Questions about Tower Defense

What does Tower Defense do?

Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives. Tower Defense is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives.

When should I use Tower Defense?

Tower Defense fits situations like: A tower-defense/wave-defense game; balancing waves and economy.

How do I install Tower Defense in Claude Code?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill tower-defense -a claude-code`. Or copy the skill folder (skills/genres/tower-defense in gamedev-skills/awesome-gamedev-agent-skills) into .claude/skills/tower-defense in your project. Claude Code loads it when a task matches its description.

How do I install Tower Defense in Codex?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill tower-defense -a codex`. Or copy the skill folder (skills/genres/tower-defense in gamedev-skills/awesome-gamedev-agent-skills) into .agents/skills/tower-defense in your project. Codex loads it when a task matches its description.

Can I use Tower Defense in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill tower-defense -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tower-defense, .gemini/skills/tower-defense, .github/skills/tower-defense and .opencode/skills/tower-defense in your project.

What does Tower Defense need to run?

SKILL.md names no scripts, command-line tools or credentials: Tower Defense is instructions for the agent only. Our summary lists: Python 3.

Does Tower Defense access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tower Defense safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tower Defense use?

Tower Defense is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tower Defense use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Tower Defense?

Skills that share tags, products or a category with Tower Defense: Image to Three.js Model (img2threejs/img2threejs, 18k stars), Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), Threejs Game Director (majidmanzarpour/threejs-game-skills, 2.5k stars) and Game Asset Generator (htdt/godogen, 7.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tower Defense?

gamedev-skills (a GitHub organization) maintains it in gamedev-skills/awesome-gamedev-agent-skills, which has 1,389 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on October 9, 2026.

Source: gamedev-skills/awesome-gamedev-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.