Agent skill

AI Behavior Trees Utility AI

by gamedev-skills in 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…

Apache-2.0Auto-check passedGame Development

Install AI Behavior Trees Utility AI

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill ai-behavior-trees-utility-ai -a claude-code

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

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills ai-behavior-trees-utility-ai --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/disciplines/ai-behavior-trees-utility-ai .claude/skills/ai-behavior-trees-utility-ai && 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
ai-behavior-trees-utility-ai
GitHub stars
1.4k
Token cost
~2k tokens
SKILL.md length
695 words
Files
5 (incl. references)
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 6 steps: Pick the model. Structured, prioritized,… → Design the Blackboard first. One typed… → Write leaves. Conditions return… → …
  • Implementing a reusable behavior-tree
  • SKILL.md covers When to use, Core workflow, Architecture at a glance and Utility scoring in one snippet, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

AI Behavior Trees Utility AI is an agent skill from 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, sigmoid, quadratic — considerations, and action evaluators), plus hybrid BT-drives-Utility agents. Use when implementing a reusable behavior-tree or utility-based decision system, or tuning enemy/NPC decisions beyond a simple FSM, or when the user mentions behavior tree, blackboard, decorator, selector, sequence, tick…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/behavior-tree-core.md`, `references/best-practices-and-pitfalls.md` and `references/practical-examples.md`).

It sits in Game Development, covering 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

  • Implementing a reusable behavior-tree
  • Utility-based decision system
  • Tuning enemy/NPC decisions beyond a simple FSM
  • The user mentions behavior tree

Example prompts

  • “/ai-behavior-trees-utility-ai”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Pick the model. Structured, prioritized, interruptible behavior → BT. Continuous
  2. Design the Blackboard first. One typed key/value store per agent is the shared memory that
  3. Write leaves. Conditions return Success/Failure immediately; actions return
  4. Compose. Selector = OR/fallback (first non-failure wins); Sequence = AND (stop at first
  5. For Utility: enumerate considerations, map each raw fact through a normalized 0..1 curve,
  6. Tick deliberately. Tick the tree/evaluator once per decision step (often slower than

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 csharp and mermaid).

    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

AI Behavior Trees Utility AI loads about 2k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 187 tokens; SKILL.md has 695 words of instructions outside code blocks.

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

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). 695 words, ~2,050 tokens.

Download SKILL.mdSave it as .claude/skills/ai-behavior-trees-utility-ai/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
ai-behavior-trees-utility-ai
description
Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential, sigmoid, quadratic — considerations, and action evaluators), plus hybrid BT-drives-Utility agents. Use when implementing a reusable behavior-tree or utility-based decision system, or tuning enemy/NPC decisions beyond a simple FSM, or when the user mentions behavior tree, blackboard, decorator, selector, sequence, tick status, utility AI, response/scoring curve, or consideration. For choosing between FSM/BT/steering or for pathfinding, use game-ai; for Unreal's BehaviorTree/Blackboard assets, use unreal-behavior-trees.

Behavior Trees & Utility AI

Two complementary ways to structure NPC decision-making, plus how to combine them. A behavior tree (BT) expresses structured, prioritized, reactive logic as a tree that is "ticked" each step. Utility AI answers "how much do I want each option right now?" by scoring actions with normalized curves and picking the best. Ship believable agents by using a BT for structure and Utility AI where graded trade-offs matter.

This skill is the implementation companion to game-ai (which helps you choose between FSM / BT / steering / pathfinding). Read game-ai to pick a model; read this to build the runtime.

When to use

  • Use to build a reusable BT runtime: a Blackboard, Node base, action/condition leaves, Sequence/Selector/Parallel composites, and decorators (Inverter, Cooldown, Repeat).
  • Use to build a Utility AI decider: response curves, considerations, and an evaluator that scores and selects actions (max, softmax, or weighted-random for variety).
  • Use to build hybrid AI — a BT whose leaf delegates the "which attack / which target" choice to a utility evaluator.

When not to use: to choose between FSM, BT, steering, or pathfinding, and for A*/navmesh routing, use game-ai. For Unreal's asset-based BehaviorTree/Blackboard, BTTask/BTService and AIController, use unreal-behavior-trees. For the navmesh agent that moves the NPC, use unity-navmesh or the engine's navigation node.

Core workflow

  1. Pick the model. Structured, prioritized, interruptible behavior → BT. Continuous "score every option" decisions (targeting, needs, item choice) → Utility. Both → hybrid.
  2. Design the Blackboard first. One typed key/value store per agent is the shared memory that decouples nodes; leaves read/write it and never hold references to each other.
  3. Write leaves. Conditions return Success/Failure immediately; actions return Running across frames until they finish. Keep leaves small and side-effect-explicit.
  4. Compose. Selector = OR/fallback (first non-failure wins); Sequence = AND (stop at first non-success); Parallel for concurrent branches. Wrap with decorators for policy (invert, cooldown, repeat, force-success).
  5. For Utility: enumerate considerations, map each raw fact through a normalized 0..1 curve, combine (weighted product with compensation, or weighted sum), then select the max — add hysteresis so agents don't flip-flop on ties.
  6. Tick deliberately. Tick the tree/evaluator once per decision step (often slower than render). Preserve Running state between ticks; verify by drawing the active path and the per-action scores on screen while tuning.

Architecture at a glance

A behavior tree evaluates top-down, left-to-right; each node returns a status up to its parent:

mermaid
flowchart TD
    Root["Selector (root)"] --> Combat["Sequence: Combat"]
    Root --> Patrol["Action: Patrol"]
    Combat --> See["Condition: CanSeePlayer?"]
    Combat --> InRange{"Selector: Reach"}
    Combat --> Attack["Action: Attack (Running)"]
    InRange --> Close["Condition: InAttackRange?"]
    InRange --> MoveTo["Action: MoveToPlayer (Running)"]

Utility AI is a scoring pipeline — every candidate action is scored, then one is selected:

text
facts (distance, health, ammo…)
      │  each fact → a normalized 0..1 response curve (consideration)
      ▼
score(action) = weight · combine(consideration_1 … consideration_n)   # product+compensation or sum
      ▼
select: argmax  ·  or softmax / weighted-random for variety  ·  + hysteresis to avoid jitter

Status is a three-value enum shared by every node — this is the contract that makes the tree composable:

csharp
public enum Status { Success, Failure, Running }

public abstract class Node
{
    public abstract Status Tick(Blackboard bb, float dt);
    public virtual void Reset() { }   // called when a parent abandons this subtree
}
csharp
// Selector = fallback/OR: return the first child that is not Failure.
public sealed class Selector : Composite
{
    public override Status Tick(Blackboard bb, float dt)
    {
        for (; _current < Children.Count; _current++)
        {
            var s = Children[_current].Tick(bb, dt);
            if (s != Status.Failure) return s;   // Success or Running stops the scan
        }
        _current = 0;
        return Status.Failure;                    // every child failed
    }
}

The reciprocal Sequence (AND — stop at first non-Success), Parallel, the Blackboard, the leaf base classes, and every decorator are in references/behavior-tree-core.md.

Show full SKILL.md (249 more words)Show less

Utility scoring in one snippet

csharp
// A consideration maps one raw fact to 0..1 through a response curve.
float Score(Blackboard bb)
{
    float distance01 = Curves.InverseLerp01(bb.Get<float>("distToPlayer"), 20f, 2f); // near = 1
    float health01   = Curves.Sigmoid(bb.Get<float>("health01"), k: 8f, mid: 0.4f);  // hurt = low
    // Product + compensation keeps a single 0 from vetoing while low values still dampen.
    return Curves.CompensatedProduct(new[] { distance01, health01 });
}

The full curve library (linear, quadratic, exponential, logistic/sigmoid, smoothstep), the Consideration/UtilityAction types, and the UtilityEvaluator selection strategies are in references/utility-ai-system.md.

Pitfalls

  • Re-ticking a Running action from the root every frame restarts it. Return Running and resume where you left off; only Reset() a subtree when a parent actually abandons it.
  • Deep trees re-evaluated wholesale each tick waste time and cause thrash. Prefer shallow trees and conditional aborts (a higher-priority condition can interrupt a lower branch).
  • Un-normalized considerations. If one curve outputs 0..100 and another 0..1, the big one dominates. Every consideration must return 0..1.
  • Utility jitter on near-ties. Add hysteresis: give the currently-running action a small bonus so the agent commits instead of oscillating.
  • Allocating nodes, closures, or arrays every tick creates GC spikes. Build the tree once at spawn; keep per-tick work allocation-free.

References

  • references/behavior-tree-core.md — Blackboard, Node/leaf base classes, action & condition leaves, Sequence/Selector/Parallel, and the decorator library (full C#).
  • references/utility-ai-system.md — response-curve library, Consideration, UtilityAction, and the UtilityEvaluator (argmax, softmax, weighted-random, hysteresis).
  • references/practical-examples.md — a guard Patrol→Combat BT, a villager needs-based Utility AI, and a hybrid agent, as drop-in templates.
  • references/best-practices-and-pitfalls.md — memory management, profiling, avoiding deep trees, event-driven aborts, and combining Utility AI with BTs (hybrid architecture).
  • game-ai — choose between FSM / BT / steering; A* and navmesh pathfinding.
  • unreal-behavior-trees — Unreal's asset-based BT/Blackboard, tasks, decorators, services.
  • unity-navmesh — the NavMeshAgent that carries out "move to" intents.
  • physics-tuning — agent radius, movement, and collision response for the motion layer.
  • tower-defense, fps-shooter, rpg — genres that compose this decision layer.

© 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 4 other files (references) in skills/disciplines/ai-behavior-trees-utility-ai of gamedev-skills/awesome-gamedev-agent-skills.

  • SKILL.md
  • references/behavior-tree-core.md
  • references/best-practices-and-pitfalls.md
  • references/practical-examples.md
  • references/utility-ai-system.md

Open the folder on GitHubat commit 0a70cfc

Compare with similar skills

AI Behavior Trees Utility AI 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.

AI Behavior Trees Utility AI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AI Behavior Trees Utility AI this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~2kAutomated safety check: PassApache-2.0
Godot Gdscript Patterns925236118/AlphaAgent10310 repos~5kAutomated safety check: PassMIT
Sprite Genaldegad/sprite-gen2.7k—~4.9kAutomated safety check: PassApache-2.0
2D Map and Scene Generator0x0funky/agent-sprite-forge4.4k—~2.9kAutomated safety check: PassMIT
Fantasy Framework Development Guideqq362946/Fantasy1.4k—~5.8kAutomated safety check: PassCustom licence
Dev StoryDonchitos/Claude-Code-Game-Studios26k—~2.4kAutomated safety check: NotesMIT

Similar skills

  • Godot Gdscript Patterns

    925236118/AlphaAgent

    Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization.

    103 GitHub starsUsed in 10 repos~5k tokens
    Game DevelopmentAuto-check passed
  • Sprite Gen

    aldegad/sprite-gen

    Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation.

    2.7k GitHub stars~4.9k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • 2D Map and Scene Generator

    0x0funky/agent-sprite-forge

    Plans and builds 2D game maps and scenes, from tilemaps and parallax backgrounds to HD-2D plates, with collision checks, a playable HTML preview and Tiled, Godot or LDtk export.

    4.4k GitHub stars~2.9k tokensUpdated 4 days ago
    Game DevelopmentAuto-check passed
  • Development and review guide for the Fantasy C# distributed game server framework: ECS, FTask, routing, service discovery, config and databases.

    1.4k GitHub stars~5.8k tokensUpdated 2 days ago
    Game DevelopmentAuto-check passed
  • Dev Story

    Donchitos/Claude-Code-Game-Studios

    Implement a story: ADR guidelines, right programmer agent, code plus test.

    26k GitHub stars~2.4k tokensUpdated 3 days ago
    Game DevelopmentAuto-check: notes
  • Asset Pipeline

    rehan-remade/universal-modder

    Turn generated or hand-made art into exactly what a game engine loads.

    6.5k GitHub stars~2k tokensUpdated today
    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
  • 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
  • Godot 2D Movement

    gamedev-skills/awesome-gamedev-agent-skills

    Implement 2D kinematic character movement in Godot 4.7 with CharacterBody2D and moveandslide(): platformer run/jump with gravity, top-down 8-direction motion, slope handling, and reading collisions.

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

Questions about AI Behavior Trees Utility AI

What does AI Behavior Trees Utility AI do?

Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…. AI Behavior Trees Utility AI is an agent skill from 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, sigmoid, quadratic — considerations, and action evaluators), plus hybrid BT-drives-Utility agents.

When should I use AI Behavior Trees Utility AI?

AI Behavior Trees Utility AI fits situations like: implementing a reusable behavior-tree; utility-based decision system; tuning enemy/NPC decisions beyond a simple FSM; the user mentions behavior tree.

How do I install AI Behavior Trees Utility AI in Claude Code?

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

How do I install AI Behavior Trees Utility AI in Codex?

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

Can I use AI Behavior Trees Utility AI 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 ai-behavior-trees-utility-ai -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ai-behavior-trees-utility-ai, .gemini/skills/ai-behavior-trees-utility-ai, .github/skills/ai-behavior-trees-utility-ai and .opencode/skills/ai-behavior-trees-utility-ai in your project.

What does AI Behavior Trees Utility AI need to run?

SKILL.md names no scripts, command-line tools or credentials: AI Behavior Trees Utility AI is instructions for the agent only.

Does AI Behavior Trees Utility AI 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 AI Behavior Trees Utility AI 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 AI Behavior Trees Utility AI use?

AI Behavior Trees Utility AI 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 AI Behavior Trees Utility AI use?

About 2k tokens (SKILL.md is roughly 8.2k 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 8.9k tokens, read only when the agent opens those files.

What are the alternatives to AI Behavior Trees Utility AI?

Skills that share tags, products or a category with AI Behavior Trees Utility AI: Godot Gdscript Patterns (925236118/AlphaAgent, 103 stars), Sprite Gen (aldegad/sprite-gen, 2.7k stars), 2D Map and Scene Generator (0x0funky/agent-sprite-forge, 4.4k stars) and Fantasy Framework Development Guide (qq362946/Fantasy, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AI Behavior Trees Utility AI?

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.