Recipe: scaffold a new agent project
Produce a fresh, ready-to-build Harbor agent project with harbor scaffold. The generated project passes harbor validate and ships a worked agent plus a harbortest-driven test with zero further edits.
Steps
Build the CLI (once per clone):
shmake buildScaffold the project:
sh./bin/harbor scaffold --name my-agentFlags:
--name(required) — the project name. Lowercase alphanumeric, dash, or underscore.--template(optional) — defaults tominimal-react.--output(optional) — target directory; defaults to./<name>.--json(optional) — machine-readable output.
Inspect the output. The
minimal-reacttemplate produces:textmy-agent/ ├── README.md next-steps guide ├── go.mod ├── harbor.yaml production-shaped, pre-validated config ├── agent.go the EchoAgent placeholder └── agent_test.go a harbortest.RunOnce-driven testPoint
go.modat your Harbor checkout. Until Harbor publishes a tagged module release, uncomment thereplacedirective at the bottom of the generatedgo.modand adjust the relative path to your local Harbor clone.Validate and run:
shharbor validate ./my-agent/harbor.yaml harbor dev --config ./my-agent/harbor.yaml
Next steps
- Replace
EchoAgent.Runinagent.gowith your agent's real logic — see Define an in-process tool and Select and configure a planner. - The worked equivalent of the scaffolded agent lives at
examples/agents/echo/.