⚠️ 入行提示:本文档为官方英文原版文献,社区中文精翻版本正在筹备中。
动态仪表板与子代理生成
• 同时监控多个数据源(API、数据库、GitHub、社交媒体) • 为每个数据源生成子代理,以避免阻塞并分散 API 负载 • 将结果聚合到统一的仪表板中(文本、HTML 或 Canvas) • 每 N 分钟更新一次最新数据 • 当指标超过阈值时发送警报 • 在数据库中维护历史趋势以便可视化
痛点
功能说明
示例仪表板版块:
- GitHub:stars、forks、open issues、近期 commits
- 社交媒体:Twitter 提及、Reddit 讨论、Discord 活跃度
- 市场:Polymarket 交易量、预测趋势
- 系统健康:CPU、内存、磁盘使用率、服务状态
所需技能
- 用于并行执行的子代理生成
- 用于 GitHub 指标的
github(gh CLI) - 用于社交数据的
bird(Twitter) - 用于外部 API 的
web_search或web_fetch - 用于存储历史指标的
postgres - 用于渲染仪表板的 Discord 或 Canvas
- 用于定时更新的 Cron 任务
如何进行设置
- 设置一个指标数据库:
CREATE TABLE metrics (
id SERIAL PRIMARY KEY,
source TEXT, -- e.g., "github", "twitter", "polymarket"
metric_name TEXT,
metric_value NUMERIC,
timestamp TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE alerts (
id SERIAL PRIMARY KEY,
source TEXT,
condition TEXT,
threshold NUMERIC,
last_triggered TIMESTAMPTZ
);
-
创建一个用于仪表板更新的 Discord 频道(例如 #dashboard)。
-
向 OpenClaw 发送如下提示词:
本页中文翻译尚未完成。以下保留同步时的完整英文原文,供核对全部步骤与限制。
完整英文原文
⚠️ 入行提示:本文档为官方英文原版文献,社区中文精翻版本正在筹备中。
Dynamic Dashboard with Sub-agent Spawning
Static dashboards show stale data and require constant manual updates. You want real-time visibility across multiple data sources without building a custom frontend or hitting API rate limits.
This workflow creates a live dashboard that spawns sub-agents to fetch and process data in parallel:
• Monitors multiple data sources simultaneously (APIs, databases, GitHub, social media) • Spawns sub-agents for each data source to avoid blocking and distribute API load • Aggregates results into a unified dashboard (text, HTML, or Canvas) • Updates every N minutes with fresh data • Sends alerts when metrics cross thresholds • Maintains historical trends in a database for visualization
Pain Point
Building a custom dashboard takes weeks. By the time it's done, requirements have changed. Polling multiple APIs sequentially is slow and hits rate limits. You need insight now, not after a weekend of coding.
What It Does
You define what you want to monitor conversationally: "Track GitHub stars, Twitter mentions, Polymarket volume, and system health." OpenClaw spawns sub-agents to fetch each data source in parallel, aggregates the results, and delivers a formatted dashboard to Discord or as an HTML file. Updates run automatically on a cron schedule.
Example dashboard sections:
- GitHub: stars, forks, open issues, recent commits
- Social Media: Twitter mentions, Reddit discussions, Discord activity
- Markets: Polymarket volume, prediction trends
- System Health: CPU, memory, disk usage, service status
Skills Needed
- Sub-agent spawning for parallel execution
github(gh CLI) for GitHub metricsbird(Twitter) for social dataweb_searchorweb_fetchfor external APIspostgresfor storing historical metrics- Discord or Canvas for rendering the dashboard
- Cron jobs for scheduled updates
How to Set it Up
- Set up a metrics database:
CREATE TABLE metrics (
id SERIAL PRIMARY KEY,
source TEXT, -- e.g., "github", "twitter", "polymarket"
metric_name TEXT,
metric_value NUMERIC,
timestamp TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE alerts (
id SERIAL PRIMARY KEY,
source TEXT,
condition TEXT,
threshold NUMERIC,
last_triggered TIMESTAMPTZ
);
-
Create a Discord channel for dashboard updates (e.g., #dashboard).
-
Prompt OpenClaw:
You are my dynamic dashboard manager. Every 15 minutes, run a cron job to:
1. Spawn sub-agents in parallel to fetch data from:
- GitHub: stars, forks, open issues, commits (past 24h)
- Twitter: mentions of "@username", sentiment analysis
- Polymarket: volume for tracked markets
- System: CPU, memory, disk usage via shell commands
2. Each sub-agent writes results to the metrics database.
3. Aggregate all results and format a dashboard:
📊 **Dashboard Update** — [timestamp]
**GitHub**
- ⭐ Stars: [count] (+[change])
- 🍴 Forks: [count]
- 🐛 Open Issues: [count]
- 💻 Commits (24h): [count]
**Social Media**
- 🐦 Twitter Mentions: [count]
- 📈 Sentiment: [positive/negative/neutral]
**Markets**
- 📊 Polymarket Volume: $[amount]
- 🔥 Trending: [market names]
**System Health**
- 💻 CPU: [usage]%
- 🧠 Memory: [usage]%
- 💾 Disk: [usage]%
4. Post to Discord #dashboard.
5. Check alert conditions:
- If GitHub stars change > 50 in 1 hour → ping me
- If system CPU > 90% → alert
- If negative sentiment spike on Twitter → notify
Store all metrics in the database for historical analysis.
-
Optional: Use Canvas to render an HTML dashboard with charts and graphs.
-
Query historical data: "Show me GitHub star growth over the past 30 days."