task-supervisor

$npx mdskill add aAAaqwq/AGI-Super-Team/task-supervisor

Monitor agent tasks and auto-remediate failures.

  • Detects stuck, aborted, or silent agents to prevent task failure.
  • Uses session lists, message logs, and custom cron triggers.
  • Classifies issues by severity to trigger alerts or auto-retry.
  • Posts concise status reports to group channels for human review.

SKILL.md

.github/skills/task-supervisorView on GitHub ↗
---
name: task-supervisor
description: 定时巡检 agent 任务执行状态,识别卡住、abort、无产出等异常并触发催促或告警。
---

# Task Supervisor Skill — 任务监工

## 概述
每 15 分钟自动巡检所有 agent 的工作状态,发现偷懒/卡死/abort 立即告警。

## 触发
- Cron: 每 15 分钟
- 手动: `task-supervisor check`

## 巡检流程

### Step 1: 获取活跃 session 列表
```
sessions_list(activeMinutes=20, messageLimit=1)
```

### Step 2: 逐个检查
对每个 agent session:
1. **是否活跃** — updatedAt 在 15min 内?
2. **是否 abort** — lastMessage.stopReason == "aborted"?
3. **是否完成** — 有没有发群汇报?
4. **是否偷懒** — 收到任务但没有产出文件?

### Step 3: 异常分类
| 等级 | 情况 | 动作 |
|------|------|------|
| 🔴 P0 | session aborted/crash | 重发任务 + 告警 |
| 🟡 P1 | 15min 无进展 | 发催促 |
| 🟢 OK | 正常工作中 | 不打扰 |

### Step 4: 汇报
发到群里(accountId=default, target=-1003890797239):
```
🔍 监工巡检 [HH:MM]
━━━━━━━━━━━━━━
✅ 小quant: [状态]
✅ 小content: [状态]
❌ 小code: [问题] → [处理]
...
```

### Step 5: 自动处理
- abort 的 session: 自动用 sessions_send 重发最近的任务
- 超时的 agent: 发催促消息
- 全部正常: 静默不汇报(不打扰 Daniel)

## 关键规则
1. **全部正常时不汇报** — 只在发现问题时告警
2. **不重复催促** — 同一 agent 15min 内只催一次
3. **深夜模式** — 23:00-08:00 不催促,只记录
4. **汇报精简** — ≤200字,只说问题和处理

More from aAAaqwq/AGI-Super-Team

SkillDescription
a-fund-monitor监控 A 股基金实时估值与盘后净值,自动判断交易日并生成提醒或分析。
add-leadAdd company/person/relationship to CRM
ads-agentAI-агент для управления Facebook рекламой. Вызывай для анализа, оптимизации, создания кампаний и отчётов.
afrexai-compliance-auditRun internal compliance audits against major governance and security
afrexai-personal-financeComplete personal finance system — budgeting, debt payoff, investing, tax optimization, net worth tracking, and financial independence planning. Use when managing money, building wealth, paying off debt, planning retirement, or optimizing taxes. Zero dependencies.
after-salesUse when managing post-purchase experience, building customer loyalty, or increasing repeat purchases
agent-contactsAI agent contacts — add, list, remove MCP contacts. Use when someone gives an agent URL, or when you need to view/remove contacts.
agent-model-switcher批量查看和切换子 agent 的模型配置,用于统一调整多 agent 的 provider/model 设置。
agent-patternsFormat SPAWN REQUEST messages to launch parallel agents, generate structured agent status reports, and define communication protocols within the sprint system. Use when the user needs to coordinate multiple agents, format spawn requests, produce agent reports, or establish inter-agent communication patterns.
agent-task-confirmUse when confirming whether a dispatched agent task was actually received, activated, and progressing after sessions_send or other task handoff actions.