tune-enemy-ai — Claude Code skill: combat enemy AI
A skill for building, debugging and balancing combat enemy AI: aggro, target selection, navigation, attack telegraphs and boss behavior.
npx skills add MengTo/Skills --skill tune-enemy-ai -a claude-codeWhat tune-enemy-ai does
The skill pushes you to model enemy decisions explicitly. Instead of logic smeared across the codebase, you get a small state machine or utility layer with named states: idle, investigate, pursue, reposition, windup, attack, recover, stagger, retreat, defeated. Every transition spells out its prerequisites, exit conditions, minimum dwell time and cooldown effects.
Perception, intent and motion stay separate. First you gather observable inputs — distance, line of sight, target state, occupancy, threat, health, timers. Then the enemy picks one intention from constrained legal actions. Only after that does it move and animate, and the decision is not rewritten mid-action. Movement success comes from authoritative collision and navigation results, not from rendered pose or an assumed completed path.
Fair combat gets its own section: telegraph attacks before the active window, and block instant turn-and-hit, perpetual chase, attacks clipped through blockers and recovery spam. For verification the skill recommends deterministic fixtures covering target acquisition, target loss, obstruction, path failure, close-range pressure, multiple enemies, retaliation, interrupt, stagger, boss phase and reset. Assert transitions and outcomes, not just final positions. Then run a real browser encounter after the automated tests.
What it helps with
- name enemy states and the transitions between them
- split perception, intent selection and motion
- stop instant turn-and-hit and perpetual chase
- set up attack telegraphs before the active window
- write deterministic tests for target acquisition and loss
Example prompts for the agent
- Lay out a state machine for a swordsman enemy: idle, pursue, windup, attack, recover, retreat
- Why does the enemy hit through a wall? Walk through movement and collisions
- Write deterministic tests for target loss and attack interrupt
How to install tune-enemy-ai
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tune-enemy-ai -a claude-code2Manually: put the files in place
~/.claude/skills/tune-enemy-ai/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tune-enemy-ai/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tune-enemy-ai -a codex2Manually: put the files in place
.agents/skills/tune-enemy-ai/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tune-enemy-ai -a cursor2Manually: put the files in place
.cursor/skills/tune-enemy-ai/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills tune-enemy-ai2Manually: put the files in place
.github/skills/tune-enemy-ai/SKILL.md1Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tune-enemy-ai -a gemini-cli2Platform CLI
gemini skills install https://github.com/MengTo/Skills --path agent-skills/game-development/tune-enemy-aiManually: put the files in place
.devin/skills/tune-enemy-ai/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add MengTo/Skills --skill tune-enemy-ai -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tune-enemy-ai
How do I install tune-enemy-ai in Claude?
Run npx skills add MengTo/Skills --skill tune-enemy-ai -a claude-code. The skill file lands at ~/.claude/skills/tune-enemy-ai/SKILL.md.
What does tune-enemy-ai do?
It helps you build and debug combat enemy AI: aggro, target selection, navigation, spacing, attack choices, telegraphs, retreats and boss behavior. It also covers deterministic regression tests for AI decisions.
Which platforms does the skill support?
Besides Claude there are install commands for Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Each platform has its own command and its own SKILL.md path.
Source text
SKILL.md · MIT
--- name: tune-enemy-ai description: Build, debug, balance, or test combat enemy AI for playable action games. Use for aggro, target selection, navigation, spacing, attack choices, telegraphs, retreats, boss behavior, behavior-state machines, and deterministic AI regression tests. --- # Tune Enemy AI Make enemy choices legible, bounded, and reproducible. ## Model decisions explicitly Use a small state machine or utility layer with named states such as idle, investigate, pursue, reposition, windup, attack, recover, stagger, retreat, and defeated. State transitions must state their prerequisites, exit conditions, minimum dwell time, and cooldown effects. ## Separate perception, intent, and motion 1. Gather observable inputs: distance, line of sight, target state, occupancy, threat, health, and timers. 2. Select one intention from constrained legal actions. 3. Move and animate toward that intent without rewriting the decision mid-action. Use authoritative collision and navigation results for movement success. Do not derive them from rendered pose or assumed path completion. ## Preserve fair combat Telegraph attacks before their active window. Prevent instant turn-and-hit behavior, perpetual chase, clipped attacks through blockers, and repeated recovery spam. Add spacing and commitment so the player can read and answer each enemy archetype. ## Test the decision surface Create deterministic fixtures for target acquisition, target loss, obstruction, path failure, close-range pressure, multiple enemies, retaliation, interrupt, stagger, boss phase, and reset. Assert transitions and outcomes, not only final positions. Run a real browser encounter after automated tests.
© MengTo · MIT · MengTo/Skills