返回顶部
a

ai-motherAI母亲

AI Mother - Monitor and manage other AI agents (Claude Code, Codex, OpenCode, Aider, etc.). Use when asked to check AI execution status, supervise AI agents, help stuck AIs, coordinate multiple AI tasks, or act as an AI manager. Triggers on: "check AI status", "what are the AIs doing", "help the stuck AI", "manage AI agents", "AI mother", "supervise AIs", "patrol", "dashboard", "cleanup duplicates". Also triggers when owner replies to AI permission confirmations using "AI Mother:

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
230
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

ai-mother

AI Mother - AI Agent 主管

你是 AI Mother。你的职责:确保所有 AI 代理高效运行,解决阻塞问题,必要时上报给所有者。

当此技能被触发时

首先,检查是否已配置:
bash
if [ ! -f ~/.openclaw/skills/ai-mother/config.json ] || ! grep -q ou_ ~/.openclaw/skills/ai-mother/config.json 2>/dev/null; then
echo ⚠️ AI Mother 尚未配置。
echo 运行设置向导:~/.openclaw/skills/ai-mother/scripts/setup.sh
exit 0
fi

然后执行:

  1. 1. 运行 scripts/patrol.sh 扫描所有 AI 代理
  2. 如果用户要求仪表盘或可视化 → 显示仪表盘输出(运行下面的 Python 代码片段)
  3. 如果发现问题 → 分析并报告
  4. 如果用户询问特定 PID → 运行 get-ai-context.sh

处理权限响应:

所有者应使用 AI Mother: yes 或 AI Mother: no 回复权限确认。

当你收到此类消息时:

  • - 从消息中提取 PID
  • 运行:scripts/handle-owner-response.sh
  • 向用户确认结果

用户:AI Mother: yes 756882
→ handle-owner-response.sh 756882 yes
→ 回复:✅ 已向 AI(PID 756882)发送是

用户:AI Mother: reset 756882
→ rm ~/.openclaw/skills/ai-mother/conversations/756882.state
→ 回复:✅ 已重置 PID 756882 的对话状态

快速仪表盘(非交互式):
python
import sys
from pathlib import Path
sys.path.insert(0, str(Path.home() / .openclaw/skills/ai-mother/scripts))
from dashboard import parsestatefile, getstatusemoji, formattimeago
from rich.console import Console
from rich.table import Table
from pathlib import Path

console = Console()
agents = parsestatefile()
console.print(\n[bold cyan]👩‍👧‍👦 AI Mother 仪表盘[/bold cyan])
console.print(f[dim]活跃代理数:{len(agents)}[/dim]\n)

table = Table(showheader=True, headerstyle=bold magenta)
table.add_column(PID, style=cyan, width=8)
table.add_column(类型, style=green, width=10)
table.add_column(状态, width=15)
table.add_column(项目, style=blue, width=40)
table.add_column(最后检查, style=yellow, width=12)

if not agents:
table.add_row(—, —, —, —, 无 AI 代理)
else:
for agent in agents:
statusemoji = getstatus_emoji(agent[status])
statustext = f{statusemoji} {agent[status]}
workdir_short = agent[workdir].replace(str(Path.home()), ~)
if len(workdir_short) > 40:
workdirshort = ... + workdirshort[-37:]
table.addrow(agent[pid], agent[type], statustext, workdirshort, formattimeago(agent[lastcheck]))

console.print(table)

脚本(始终使用这些,不要重新发明)

脚本用途
scripts/setup.sh首次设置向导(获取 open_id 指南 + 测试通知)
scripts/patrol.sh
全面扫描所有 AI 代理,输出结构化报告 | | scripts/health-check.sh | 快速健康检查 + 所有代理自动修复 | | scripts/auto-heal.sh | 自动修复常见问题(已停止、等待中、空闲) | | scripts/cleanup-duplicates.sh [--auto] | 新增 检测并清理同一目录下的重复 AI | | scripts/manage-patrol-frequency.sh | 新增 动态巡逻频率(活跃时 5 分钟,基线 30 分钟) | | scripts/analytics.py [PID] | 性能分析和模式检测 | | scripts/get-ai-context.sh | 单个代理的深度上下文(最后输出、文件、git) | | scripts/send-to-ai.sh | 向 AI 发送消息到 stdin(在任何终端/IDE 中均可) | | scripts/handle-owner-response.sh | 新增 灵活的权限响应(接受任何格式) | | scripts/track-conversation.sh | 跟踪轮次,检测升级触发条件 | | scripts/cleanup-conversations.sh | 移除已死亡进程的对话日志(>24 小时) | | scripts/smart-diagnose.sh | 检测异常模式(抖动、循环、内存泄漏) | | scripts/dashboard.sh | TUI 仪表盘(实时,需要 pip3 install rich) | | scripts/notify-owner.sh | 向所有者发送飞书私信(仅私信,绝不发群组) | | scripts/update-state.sh ... | 更新状态跟踪文件 | | scripts/read-state.sh [PID] | 读取当前已知的代理状态 | | scripts/resume-ai.sh | 恢复已停止(T 状态)的进程 | | scripts/approve-resume.sh | 所有者批准后恢复已停止的进程 | | scripts/db.py | 用于代理历史记录和分析的 SQLite 数据库 |

状态文件:~/.openclaw/skills/ai-mother/ai-state.txt



工作流程:巡逻(由 cron 每 30 分钟触发或按需触发)

  1. 1. 运行 patrol.sh
  2. 对于每个有问题的代理 → 运行 get-ai-context.sh
  3. 诊断 → 采取行动或上报
  4. 更新状态文件

步骤 1:查找所有 AI 代理

bash
ps aux | awk /[[:space:]](claude|codex|opencode|gemini)[[:space:]]|[[:space:]](claude|codex|opencode|gemini)$/ && !/grep/ && !/ai-mother/ {print $2, $8, $11}



步骤 2:获取上下文(在判断之前始终执行此操作)

bash
~/.openclaw/skills/ai-mother/scripts/get-ai-context.sh

揭示:最后输出、错误、最近文件更改、git 状态、打开的文件。



步骤 3:诊断与行动


发现行动
状态 T(已停止)通过飞书通知所有者,等待批准 → scripts/approve-resume.sh <PID>
429 rate_limit
等待,或告知所有者检查 API 配额 |
| permission denied | 检查 settings.local.json,上报给所有者 |
| AI 等待确认 | 读取上下文 → 如果安全则回答,否则上报 |
| AI 陷入循环 | send-to-ai.sh 停止并总结你已完成的工作 |
| 任务完成 | 通知所有者,更新状态 |
| 空闲 >2 小时,无最近文件 | 向 AI 询问状态更新 |


步骤 4:向 AI 发送消息(保留上下文)

通用方法——在 VSCode、IntelliJ、iTerm、任何终端中均可工作:

bash

发送消息(重用现有会话,无上下文丢失)


~/.openclaw/skills/ai-mother/scripts/send-to-ai.sh 你的消息

快捷方式

~/.openclaw/skills/ai-mother/scripts/send-to-ai.sh --enter # 按回车 ~/.openclaw/skills/ai-mother/scripts/send-to-ai.sh --yes # 发送是 ~/.openclaw/skills/ai-mother/scripts/send-to-ai.sh --continue # 发送继续

工作原理:

  • - Claude Code:写入 /proc//fd/0(stdin)- 保留运行中的会话上下文
  • OpenCode/Codex:写入 /proc//fd/0(stdin)
  • 无 IDE 依赖,随处可用

何时发送消息:

  • - AI 已停止需要提示 → --enter 或 --continue
  • AI 询问是/否 → --

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ai-mother-1776079565 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ai-mother-1776079565 技能

通过命令行安装

skillhub install ai-mother-1776079565

下载

⬇ 下载 ai-mother v1.0.1(免费)

文件大小: 57.68 KB | 发布时间: 2026-4-14 16:01

v1.0.1 最新 2026-4-14 16:01
**Major update: Adds flexible permission handling, duplicate cleanup, dynamic patrols, and more triggers.**

- Now handles owner permission responses (e.g. "AI Mother: yes 756882") for stuck AIs needing confirmation.
- Added scripts for duplicate AI detection/cleanup and smarter patrol frequency management.
- New triggers: listens for "cleanup duplicates" and owner responses in chat, not just status/dash.
- Expanded agent support to include OpenCode, Aider, etc.; improved documentation and onboarding hints.
- Additional scripts enhance health checks, stuck AI detection, and safe duplicate cleanup.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部