Definition-driven spawn model
Status: Superseded
Superseded by template-schema.md. Templates replace definitions.
[harness]becomes[worker].[shared]and[platform.*]become[workstation].[env]is replaced by[compute]. Credentials are inferred from capabilities, not declared.
Definition-driven spawn model
Section titled “Definition-driven spawn model”Decision
Section titled “Decision”arpi spawn <definition> is THE command for provisioning agent workstations. A TOML definition declares everything — no flags needed for normal use. Flags are overrides with warnings.
Definition format
Section titled “Definition format”[harness]name = "debug-prod"description = "Debugging production issues"instructions = "debug-prod.agents.md"model = "opus"
[shared] # cross-platform (Claude, Codex, Cursor)skills = ["sentry-workflow", "sentry-cli"]mcps = ["sentry", "braintrust"]
[claude-code] # platform-specificsettings = ["base", "backend-go"]hooks = ["block-main-edits", "nuke-guard"]agents = ["researchers/codebase-analyzer"]
[env]workspace = "bare" # bare | worktree | sandboxruntimes = { go = "1.22", node = "22" }tools = ["aws-cli@2", "temporal-cli"]required_vars = ["SENTRY_DSN", "BRAINTRUST_API_KEY"]For sandbox definitions:
[env]workspace = "sandbox"image = "arpi/agent-base:latest"host = "eks-prod"egress = ["bifrost.internal:443"]timeout = "4h"
[env.secrets]keys = ["SENTRY_DSN", "PD_ROUTING_KEY"]Design rules
Section titled “Design rules”- No
[iam]section. IAM is runtime state (fromarpi logintoken), not a definition property. required_varsfor bare/worktree. arpi checks they exist in the shell and warns if missing. No fetching.[env.secrets]only for sandbox. arpi fetches from IAM provider and injects via credential proxy.workspacein the definition, not a flag. The definition knows whether it needs isolation.- Flags are overrides with warnings.
--bareon a sandbox definition warns and prompts for confirmation. - AGENTS.md is the instruction standard. The
instructionsfield points to an AGENTS.md-style markdown file paired with the definition. .agents/for cross-platform config. Platform-agnostic agent configuration alongside.claude/.
Spawn flow
Section titled “Spawn flow”Bare:
- Load definition. 2. Assemble .claude/ (settings, hooks, agents, skills, MCPs). 3. Check
required_varsin shell. 4. Checktoolsexist. 5. Track inarpi status.
Worktree:
- Load definition. 2.
git worktree add .arpi-worktrees/<branch>. 3. Assemble .claude/ in worktree. 4. Check required_vars, tools.
Sandbox (local):
- Load definition. 2. Verify
arpi logintoken. 3. Create sandbox via OpenSandbox API. 4. Mount project directory. 5. Inject secrets via credential proxy. 6. Assemble .claude/ inside sandbox. 7. Configure egress filtering (gateway only). 8. Launch agent. 9. Track inarpi status.
Sandbox (remote):
Same as local sandbox but container runs on remote host (--host). arpi logs streams output.
CLI commands
Section titled “CLI commands”arpi spawn <definition> # do what the definition saysarpi spawn <definition> --dry # show what would happenarpi spawn <def> --bare # override workspace (warns)arpi spawn <def> --worktree # override to worktreearpi spawn <def> --sandbox # override to sandboxarpi spawn <def> --host <name> # run sandbox on remote hostarpi spawn <def> --as <role> # escalate IAM rolearpi spawn <def> --platform <name> # override agent platform (default: claude-code)
arpi list # available definitionsarpi show <def> # inspect a definitionarpi status # running agents (local + remote)arpi stop <id> # stop a running agentarpi logs <id> # stream logs
arpi login # authenticate to IAM providerarpi whoami # show identity + role
arpi new <template> <name> # scaffold a new project (separate concern)arpi doctor # health checkWhat was removed
Section titled “What was removed”| Removed | Replaced by |
|---|---|
arpi use | arpi spawn |
arpi create | arpi new (scaffolding is a separate concern) |
arpi current | arpi status |
--env flag | Definition declares needs. Bare = check vars. Sandbox = inject. |
| YAML context format | TOML definitions |
| profiles.yaml | IAM provider roles |
Verification
Section titled “Verification”arpi spawn debug-prodloads TOML and assembles .claude/ in cwdarpi spawn debug-prod --dryshows what would be assembledarpi spawn debug-prod --worktreecreates git worktree and assembles therearpi listshows all definitions with descriptionsarpi show debug-proddisplays definition contents- Overriding workspace mode shows warning and prompts
required_varscheck warns on missing without failing