Add Agent
Scope decision
- •If the user wants a one-off agent in an existing account, use the Agents UI or
api.agents.create. No code changes needed; setsoulContentor rely ongenerateDefaultSoulinpackages/backend/convex/lib/agent_soul.ts. - •If the user wants the agent in the default seeded roster, follow the update map below.
Non-negotiables: agent instructions and heartbeat
- •The SOUL, AGENTS, and HEARTBEAT instructions are the operating system for a new agent. If they are vague, the agent fails.
- •For every new role, fully specify mission, personality constraints, domain strengths, default operating procedure (including heartbeat behavior), quality checks, and the never-do list. Base on
docs/runtime/SOUL_TEMPLATE.md. - •Review
docs/runtime/AGENTS.mdanddocs/runtime/HEARTBEAT.mdand update them if the new agent introduces new tools, output formats, or heartbeat steps. - •Ensure
heartbeatIntervaland the SOUL "Default operating procedure" match the heartbeat checklist (what to read, how to prioritize, when to postHEARTBEAT_OK).
Skill quality requirements
- •Skills are the second operating system. Sloppy skill definitions lead to unreliable agents.
- •For new skills, write precise scope, triggers, required inputs, step-by-step behavior, output expectations, and do-not-do rules.
- •Keep skill content in sync across
.cursor/skills/<slug>/SKILL.mdandpackages/backend/convex/seed-skills/<slug>.md, then regenerateseed_skills_content.generated.ts.
Required inputs
- •Name, slug (safe: letters/numbers/hyphen/underscore), role, description
- •SOUL inputs: mission, personality constraints, domain strengths, default operating procedure, quality checks, never-do list
- •Heartbeat interval (minutes), behavior flags, and whether this agent should be the orchestrator
- •Skill slugs and definitions (new or existing)
Update map (seeded agents)
- •
packages/backend/convex/seed.ts- •Add the agent in
seedAgentswithname,slug,role,description,skillSlugs,heartbeatInterval,canCreateTasks. - •If this is a new role, extend
AgentRoleand add abuildSoulContentcase usingdocs/runtime/SOUL_TEMPLATE.md. - •If the agent needs new skills, add them to
seedSkills(name/slug/description) and include the slug inCURSOR_SKILL_SLUGSif every seed agent should receive it. - •If this agent should be the default orchestrator, update the
orchestratorAgentIdpatch to point at the new slug.
- •Add the agent in
- •Skills content (only when you add new skill slugs)
- •Local skills: create
.cursor/skills/<slug>/SKILL.md, then frompackages/backendrun:- •
npx tsx scripts/seed-skills-copy-cursor.ts - •
npm run seed-skills:generate
- •
- •External skills: update
packages/backend/convex/seed-skills-mapping.json, then run:- •
npm run seed-skills:download - •
npm run seed-skills:generate
- •
- •Do not edit
packages/backend/convex/seed_skills_content.generated.tsby hand.
- •Local skills: create
- •Documentation alignment
- •Review/update
docs/runtime/AGENTS.mdanddocs/runtime/HEARTBEAT.mdif the new agent changes tools, output formats, or heartbeat behavior. - •Ensure the new SOUL content matches the heartbeat checklist and task-status rules.
- •Review/update
- •Search for hard-coded slugs/roles
- •Run
rg "squad-lead|engineer|qa"(or your new slug) and update any role-specific behavior or docs. - •Most UI/runtime paths are data-driven; update only if you find hard-coded assumptions.
- •Run
Runtime + UI behavior
- •Runtime picks up new agents via
service/agents.listForRuntimeand writesSOUL.md/TOOLS.mdinapps/runtime/src/openclaw-profiles.ts. No code changes required. - •The Agents UI is data-driven; new agents appear automatically. Set an orchestrator via the Agent detail page or
accounts.update.
Verification
- •Re-run seed (
packages/backend):npm run seed(requiresCLERK_USER_IDenv set). - •Confirm in Convex: agent exists,
sessionKeyisagent:{slug}:{accountId},soulContentis present,openclawConfig.skillIdsmatch. - •Confirm in UI: roster shows new agent and status.
Output expectation
- •Provide a short checklist of edits made and exact files touched.