Beginner sample for the Squad SDK that demonstrates how to locate or create a team directory, cast a themed team of agents from The Usual Suspects universe, onboard them with persistent identities, and verify that agent names remain consistent across multiple casts.
- Node.js >= 20
- npm
- The SDK must be built first:
cd ../../ && npm run build
- Install dependencies:
npm install - Run the sample:
npm start
- How to use
resolveSquad()to find or create a.squad/directory - How to cast a themed team from the Squad SDK universe system
- How to onboard each agent with a charter and history files
- How casting history provides deterministic, persistent agent identities
The sample walks through five steps. First, it locates or creates a .squad/ directory using resolveSquad(). Next, it uses the CastingEngine to create a team of four agents from The Usual Suspects universe, assigning them lead, developer, tester, and scribe roles based on their personalities. Then it onboards each agent by creating their individual agent directories and initializing their charter and history files. It displays the team roster in a formatted table showing each agent's name, role, and personality. Finally, it demonstrates the casting history system by casting the same team configuration twice and verifying that agent names match across both casts, proving the system is deterministic.
π¬ hello-squad β Squad SDK beginner sample
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 1 β Resolve .squad/ directory
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Created demo .squad/ at: /tmp/hello-squad-demo/.squad
resolveSquad() β /tmp/hello-squad-demo/.squad
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 2 β Cast a team from "The Usual Suspects"
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Universe: The Usual Suspects
Team size: 4
π Keyser β Lead
Personality: Quietly commanding; sees the whole board before anyone else.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 3 β Onboard agents
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Keyser β Lead
β
McManus β Developer
β
Fenster β Tester
β
Verbal β Scribe
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 4 β Team roster
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Names match across casts: β
Yes
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 5 β Casting history (persistent names)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Casting records: 2
Names match across casts: β
Yes
| File | Purpose |
|---|---|
index.ts |
Main demo script showcasing all five steps |
tests/hello-squad.test.ts |
Acceptance tests for casting and onboarding |
TEST-SCRIPT.md |
Manual test walkthrough |
- Check out the knock-knock sample to see agents interact with live LLM responses
- Read the Squad SDK documentation for more details on the casting system