Grouping agents by function (engineering team, content team, support team), setting team-level budget envelopes, configuring team heartbeat cadences, and the dashboard team view.
Design a complete agent team with clear roles, set up coordination and communication, and implement a content production team as a worked example.
Content Team (company budget: $50/month)
├── Editor-in-Chief ($15) — decides topics, coordinates team
├── Researcher ($15) — gathers facts and sources
├── Writer ($12) — drafts content from research
├── Editor ($5) — reviews and improves drafts
└── SEO Analyst ($3) — adds keywords and meta descriptions
DO $$
DECLARE
cid uuid;
eic uuid;
res uuid;
wri uuid;
edi uuid;
seo uuid;
BEGIN
SELECT id INTO cid FROM companies WHERE slug = 'content-co';
-- Editor-in-Chief (coordinator)
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status)
VALUES (cid, 'EiC', 'Editor-in-Chief',
'You are the Editor-in-Chief. You plan the content calendar and coordinate the writing team. Output subtask plans as JSON.',
'claude-code', 15.00, 'active')
RETURNING id INTO eic;
-- Researcher
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status, reports_to)
VALUES (cid, 'Researcher', 'Research Analyst',
'You are a Research Analyst. Given a topic, produce a structured research note with 5 key facts, 3 expert quotes (sourced), and a list of 10 related keywords.',
'claude-code', 15.00, 'active', eic)
RETURNING id INTO res;
-- Writer
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status, reports_to)
VALUES (cid, 'Writer', 'Content Writer',
'You are a Content Writer. Given a research note, write a 800-word blog post with an engaging introduction, 3 body sections, and a conclusion with CTA.',
'claude-code', 12.00, 'active', eic)
RETURNING id INTO wri;
-- Editor
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status, reports_to)
VALUES (cid, 'Editor', 'Copy Editor',
'You are a Copy Editor. Review the draft for clarity, grammar, and factual accuracy. Return the improved draft with inline comments.',
'claude-code', 5.00, 'active', eic)
RETURNING id INTO edi;
-- SEO Analyst
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status, reports_to)
VALUES (cid, 'SEO', 'SEO Analyst',
'You are an SEO Analyst. Given a finished article, produce: a meta title (60 chars max), meta description (155 chars max), and 5 keyword tags.',
'claude-code', 3.00, 'active', eic)
RETURNING id INTO seo;
END $$;
Agents communicate through issue content. The writer receives the researcher's output as the issue description:
-- After researcher resolves, create a writer issue with researcher output
INSERT INTO issues (company_id, title, description, assigned_agent_id, parent_issue_id)
SELECT
i.company_id,
'Write: ' || REPLACE(i.title, 'Research: ', ''),
'Research notes:\n\n' || i.result,
(SELECT id FROM agents WHERE role = 'Content Writer' AND company_id = i.company_id LIMIT 1),
i.parent_issue_id
FROM issues i
WHERE i.id = 'researcher-issue-id'
AND i.status = 'resolved';
reports_to hierarchy