Skip to content

Repository files navigation

Spawnfile

Write your agent team once. Compile it for different runtimes.

npm downloads node MIT website

Spawnfile compiles one agent source into multiple runtimes

Describe your agents, give them identities and tools, and keep the whole team in one source project. Spawnfile compiles that project into the configuration and workspaces their runtimes need, then builds and deploys it with Docker.

Spawnfile + workspace ─→ compile ─→ runtime files

Try it

Start with one agent. Requires Node.js 22.19+; compilation needs no Docker or model credentials.

npm install -g spawnfile
spawnfile init my-agent
cd my-agent
spawnfile validate
spawnfile compile

init creates an OpenClaw project with IDENTITY.md, SOUL.md, and AGENTS.md. compile writes runtime configuration, the generated workspace, and container files into .spawn/. Read spawnfile-report.json there to see how your source was compiled. The agent is configured, but has not started.

Edit the Markdown files to define who the agent is and what it should do, then compile again. Keep the source in Git; .spawn/ is generated and ignored.

From one agent to a team

A team has its own Spawnfile, which references the member agent projects. Create its directory with spawnfile init my-team --team. Once you have two projects with distinct agent names under my-team/agents/, put their references in my-team/Spawnfile:

spawnfile_version: "0.1"
kind: team
name: research-team
mode: swarm
members:
  - id: researcher
    ref: ./agents/researcher
  - id: writer
    ref: ./agents/writer

Each member has its own Spawnfile, identity, and runtime. Teams can share instructions and resources, contain nested teams, and declare Moltnet rooms. The team guide covers the full setup; examples show complete projects.

What travels with your team

  • Agents: Identity documents, instructions, skills, workspace resources, and each agent’s wake schedule.
  • Tools and models: MCP connections, model selection, and declared secret requirements.
  • Team structure: Members, nested teams, and shared resources.
  • Communication: Declared Moltnet networks and rooms for agents to exchange messages across runtimes.
  • Deployment: Runtime configuration, container files, and a capability report built from the same source.

A team declaration alone does not create a conversation or a useful division of work. Give the agents a task, configure their communication, and choose how they wake. Start with the team guide and example projects.

Run and share it

Once the prompts and configuration are ready:

  1. Provide credentials. Import an existing subscription login or configure provider credentials with auth profiles. Keep secret values out of Git.
  2. Build and start. With Docker available, spawnfile up . --detach --auth-profile <profile> compiles, builds, and starts the project. A Docker context can target another machine.
  3. Check the deployment. spawnfile status . --live probes the running deployment; spawnfile status . reads only local declared and compiled state.
  4. Share an image. spawnfile publish packages the project for an OCI registry so another operator can run it without the source, using their own credentials.

See container deployment, status, and image distribution for complete commands and requirements.

Runtime support

Runtime Use it for
Daimon Agents using subscription CLI engines such as Codex and Claude Code, with Moltnet and memory integration.
OpenClaw OpenClaw agents and their native messaging surfaces. The default agent scaffold.
PicoClaw PicoClaw agents and their native messaging surfaces.

Daimon requires a pinned runtime image matching the compiler contract. The older pi adapter remains available for existing projects.

Portability is capability-specific: the compiler reports each feature as supported, degraded, or unsupported. Read that report before switching runtimes. Exact versions live in runtimes.yaml; the runtime specification describes the adapter model.

Go further

I want to… Read
Understand the source format Spawnfile specification
Explore complete projects Examples
Add an adapter or contribute Contributing
Integrate with deployment tooling Target and lifecycle contracts
Find a detailed contract Specification index

Spawnfile is part of Noopolis. Moltnet supplies messaging; Daimon runs individual agents; Simfile builds simulation worlds around organizations. You can use Spawnfile on its own.

License

MIT


spawnfile.com · Examples · Contributing

About

A spec and compiler for autonomous agent runtimes and agentic organizations. Write your agent once, compile for any runtime

Topics

Resources

Contributing

Stars

9 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages