部署一个包含3个代理的自动化新闻稿管道。适用场景:1. 用户想搭建新闻稿或邮件自动化管道;2. 用户在...
Deploy 3 agents that curate content, write newsletters, and dispatch emails.
RoleHostnameSkillsPurposecurator<prefix>-curatorpilot-discover, pilot-stream-data, pilot-archiveAggregates trending content into curated digestswriter<prefix>-writerpilot-task-router, pilot-share, pilot-receiptTransforms content into newsletter copymailer<prefix>-mailerpilot-webhook-bridge, pilot-announce, pilot-metricsDispatches emails, tracks delivery metrics
Step 1: Ask the user which role this agent should play and what prefix to use.
Step 2: Install the skills for the chosen role:
bash
# For curator:
clawhub install pilot-discover pilot-stream-data pilot-archive
# For writer:
clawhub install pilot-task-router pilot-share pilot-receipt
# For mailer:
clawhub install pilot-webhook-bridge pilot-announce pilot-metrics
Step 3: Set the hostname:
bash
pilotctl --json set-hostname <prefix>-<role>
Step 4: Write the setup manifest:
bash
mkdir -p ~/.pilot/setups
cat > ~/.pilot/setups/newsletter-automation.json << 'MANIFEST'
{
"setup": "newsletter-automation",
"setup_name": "Newsletter Automation",
"role": "<ROLE_ID>",
"role_name": "<ROLE_NAME>",
"hostname": "<prefix>-<role>",
"description": "<ROLE_DESCRIPTION>",
"skills": { "<skill>": "<contextual description>" },
"peers": [ { "role": "...", "hostname": "...", "description": "..." } ],
"data_flows": [ { "direction": "send|receive", "peer": "...", "port": 1002, "topic": "...", "description": "..." } ],
"handshakes_needed": [ "<peer-hostname>" ]
}
MANIFEST
Step 5: Tell the user to initiate handshakes with direct communication peers.
json
{
"setup": "newsletter-automation", "setup_name": "Newsletter Automation",
"role": "curator", "role_name": "Content Curator",
"hostname": "<prefix>-curator",
"description": "Aggregates trending articles, RSS feeds, and industry news into curated content digests.",
"skills": {
"pilot-discover": "Find trending articles and industry news from configured sources.",
"pilot-stream-data": "Stream RSS feeds and content APIs into structured digests.",
"pilot-archive": "Archive curated content for historical reference and deduplication."
},
"peers": [
{ "role": "writer", "hostname": "<prefix>-writer", "description": "Receives curated content for newsletter writing" },
{ "role": "mailer", "hostname": "<prefix>-mailer", "description": "Final stage — does not communicate directly" }
],
"data_flows": [
{ "direction": "send", "peer": "<prefix>-writer", "port": 1002, "topic": "content-digest", "description": "Curated content digest with sources and summaries" }
],
"handshakes_needed": ["<prefix>-writer"]
}
json
{
"setup": "newsletter-automation", "setup_name": "Newsletter Automation",
"role": "writer", "role_name": "Newsletter Writer",
"hostname": "<prefix>-writer",
"description": "Transforms curated content into engaging newsletter copy with subject lines and sections.",
"skills": {
"pilot-task-router": "Route writing tasks across content sections and templates.",
"pilot-share": "Share draft previews with other agents for review.",
"pilot-receipt": "Confirm receipt of curated content from curator."
},
"peers": [
{ "role": "curator", "hostname": "<prefix>-curator", "description": "Sends curated content digests" },
{ "role": "mailer", "hostname": "<prefix>-mailer", "description": "Receives newsletter drafts for delivery" }
],
"data_flows": [
{ "direction": "receive", "peer": "<prefix>-curator", "port": 1002, "topic": "content-digest", "description": "Curated content digest with sources and summaries" },
{ "direction": "send", "peer": "<prefix>-mailer", "port": 1002, "topic": "newsletter-draft", "description": "Newsletter draft with subject line and HTML body" }
],
"handshakes_needed": ["<prefix>-curator", "<prefix>-mailer"]
}
json
{
"setup": "newsletter-automation", "setup_name": "Newsletter Automation",
"role": "mailer", "role_name": "Email Dispatcher",
"hostname": "<prefix>-mailer",
"description": "Formats newsletters for email delivery, manages subscriber segments, tracks open rates.",
"skills": {
"pilot-webhook-bridge": "Send formatted emails via email service provider webhooks.",
"pilot-announce": "Broadcast delivery confirmations and schedule notifications.",
"pilot-metrics": "Track open rates, click rates, and delivery success per segment."
},
"peers": [
{ "role": "curator", "hostname": "<prefix>-curator", "description": "First stage — does not communicate directly" },
{ "role": "writer", "hostname": "<prefix>-writer", "description": "Sends newsletter drafts for delivery" }
],
"data_flows": [
{ "direction": "receive", "peer": "<prefix>-writer", "port": 1002, "topic": "newsletter-draft", "description": "Newsletter draft with subject line and HTML body" },
{ "direction": "send", "peer": "external", "port": 443, "topic": "email-dispatch", "description": "Email dispatch to subscriber segments" }
],
"handshakes_needed": ["<prefix>-writer"]
}
curator -> writer : content-digest events (port 1002)writer -> mailer : newsletter-draft events (port 1002)mailer -> external : email-dispatch via webhook (port 443)bash
# curator and writer handshake with each other:
pilotctl --json handshake <prefix>-writer "setup: newsletter-automation"
pilotctl --json handshake <prefix>-curator "setup: newsletter-automation"
# writer and mailer handshake with each other:
pilotctl --json handshake <prefix>-mailer "setup: newsletter-automation"
pilotctl --json handshake <prefix>-writer "setup: newsletter-automation"
bash
# On writer — subscribe to content digests:
pilotctl --json subscribe <prefix>-curator content-digest
# On mailer — subscribe to newsletter drafts:
pilotctl --json subscribe <prefix>-writer newsletter-draft
# On curator — publish a content digest:
pilotctl --json publish <prefix>-writer content-digest '{"date":"2026-04-10","articles":[{"title":"AI Agents in Production","url":"https://example.com/ai-agents"}],"topic":"AI & DevOps"}'
# On writer — publish a newsletter draft:
pilotctl --json publish <prefix>-mailer newsletter-draft '{"subject":"This Week in AI","sections":[{"heading":"Top Story","body":"AI agents are going mainstream..."}]}'
Requires pilot-protocol skill, pilotctl binary, clawhub binary, and a running daemon.