Playbook
in package
The strategy an agent plays by: the verb catalogue plus the system prompt {@see AgentBrain} sends at the head of every decision request.
This is deliberately its own file so the "how to play well" knowledge can be iterated on without touching prompt assembly, parsing, or transport. It is distilled from the public game reference — keep it in sync when the era or rules change:
Tags
Table of Contents
Constants
- VERBS : array<string, string> = ['move' => 'dx:int,dy:int (a step) OR x:int,y:i...
- The verbs the brain may pick, each with a one-line argument hint. A curated slice of the full intent vocabulary — enough to play every phase, small enough to keep the model on task. `wait` means "pass this tick".
Methods
- systemPrompt() : string
- The system prompt: the current {@see Stance} briefing, then mission, the decision ladder, phase playbook and anti-patterns, with the verb catalogue appended. Sent once per turn.
Constants
VERBS
The verbs the brain may pick, each with a one-line argument hint. A curated slice of the full intent vocabulary — enough to play every phase, small enough to keep the model on task. `wait` means "pass this tick".
public
array<string, string>
VERBS
= ['move' => 'dx:int,dy:int (a step) OR x:int,y:int (a target) — ~3 cells/tick on foot', 'mine' => 'n:int, resource?:string — mine the nearest deposit within 8 cells (auto-walks)', 'chop' => 'n:int — harvest the nearest wood', 'gather' => 'n:int — forage the nearest plant within 8 (herb/lichen/fungus/algae → medicine)', 'plant' => 'no args — spend 1 wood to top up the most-drained tree on your cell (cap 22); rejected if all full', 'combine' => 'ingredients:{res:qty}, name?:string, n?:int — craft; matches the SET of physics tags, 1 of each per copy', 'build' => 'part:string, with?:{res:qty} — craft one vehicle part', 'finalize' => 'name?:string — assemble ALL loose parts into one vehicle', 'deploy' => 'no args — send a finalized vehicle off to mine autonomously', 'construct' => 'shape:string, size:1-20, height:1-60, color?, name? — raise a structure (build TALL + VARIED)', 'ride' => 'no args — ride a completed orbital elevator up/down for free (stand on its base cell)', 'launch' => 'no args — burn fuel to climb +10 altitude (needs thrust-to-weight ≥ gate)', 'land' => 'no args — controlled descent toward the ground', 'dock' => 'no args — latch onto an asteroid while in orbit (alt 300-599, within 2 cells)', 'attune' => 'no args — bond with a nearby ancient artifact for a lasting boon', 'collect' => 'loot:int — pick up an adjacent loot pile', 'heal' => 'item?:string, target?:int — apply a medicine to self or an ally within 6', 'sell' => 'resource:string, n:int — sell to the depot for credits (works from anywhere)', 'buy' => 'resource:string, n:int — buy from the depot', 'order' => 'side:"buy"|"sell", resource:string, qty:int, price:number — post a market order', 'contract' => 'reward:{res:qty}, want:{res:qty}, deadline_ticks?:int — post a supply job', 'fulfill' => 'contract_id:int — deliver an open contract for its reward', 'trade' => 'to:int, give:{res:qty}, want:{res:qty} — offer a peer swap', 'attack' => 'weapon:string, target:int — fire a ranged weapon (needs weapon+ammo+range+LOS)', 'ally' => 'to:int — propose an alliance (allies cannot hurt each other; can assist/heal)', 'say' => 'text:string — world chat (≤280 chars, one per tick)', 'tell' => 'to:int, text:string — private message one agent', 'wait' => 'no args — do nothing this tick']
Methods
systemPrompt()
The system prompt: the current {@see Stance} briefing, then mission, the decision ladder, phase playbook and anti-patterns, with the verb catalogue appended. Sent once per turn.
public
static systemPrompt([string $stance = 'homestead' ]) : string
The ladder here mirrors Ladder::suggestion(); both are
diagrammed in docs/PLAYBOOK.md — update it whenever either changes.
Parameters
- $stance : string = 'homestead'
-
One of Stance's values; defaults to homestead.