← 返回 Skills 市场
Agent Ops
作者
_silhouette
· GitHub ↗
· v1.1.0
· MIT-0
105
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install agent-ops
功能描述
Agent session 运维工具。当需要检测和恢复 API 限速、回收死 session 的知识、在破坏性操作前自动快照、或监控 context 使用率时使用。不用于安装 hook 脚本(用 agent-hooks)或架构设计(用 harness-design-patterns)。
使用说明 (SKILL.md)
Agent Ops
Agent session 运维工具集。监控、恢复、保护运行中的 agent session。
When to Use
- tmux 中的 agent 遇到 API 限速后挂死 → Rate Limit 恢复
- Session 静默死亡,需要回收其知识 → Stale Session Daemon
- Bash 命令可能造成不可逆破坏 → Checkpoint + Rollback
- Context 快用完,需要预算管理 → Token Budget / Context 估算
- 模型反复失败需要切换 → Auto Model Fallback
When NOT to Use
- 安装 Stop/PreToolUse hook → 用
agent-hooks - 设计 agent 架构 → 用
harness-design-patterns
工具概览
| 工具 | 类型 | 功能 | 详情 |
|---|---|---|---|
| Rate Limit 恢复 | bash 脚本 / cron | 扫描 tmux pane 检测限速,自动发 Enter 恢复 | 详情 |
| Context 估算 | bash 脚本 | 读 transcript 尾部 4KB 提取 token 使用率 | 详情 |
| Stale Session Daemon | daemon / cron | Heartbeat 检测 + 死 session 知识回收 | 详情 |
| Checkpoint + Rollback | hook 脚本 | PreToolUse git stash + PostToolUseFailure 自动回滚 | 详情 |
| Token Budget | hook 脚本 | UserPromptSubmit 注入预算感知指令 | 详情 |
| Auto Model Fallback | hook 脚本 | 3 次连续失败后升级 Haiku→Sonnet→Opus | 详情 |
Scripts
| 脚本 | 用途 |
|---|---|
scripts/context-usage.sh \x3Ctranscript> |
从 transcript JSONL 尾部估算 context 使用率 |
Session State
所有状态统一在 sessions/\x3Csession-id>/ 下。详见 session-state-layout.md。
条件判断规则
- 如果只有 1-2 个 session 在跑 → Rate Limit 恢复手动即可,不需要 daemon
- 如果 session 预计 \x3C 30 分钟 → 不需要 Stale Session Daemon
- 如果没有破坏性 Bash 命令 → 不需要 Checkpoint
- 如果不确定 context 够不够 → 先跑
context-usage.sh检查再决定
安全使用建议
This skill is coherent with its stated goal of managing agent sessions, but it assumes and performs actions you should review before installing. Before you proceed:
- Inspect the scripts (context-usage.sh and the reference patterns) yourself. They are small and readable.
- Ensure the environment where you run this has tmux, git, and jq installed; the package metadata should declare these but currently does not. Don't run it on a system lacking those tools or on production hosts without testing.
- Understand side effects: the skill will read transcripts, write files to sessions/<session-id>/, create git checkpoints with `git add -A` (temporarily changing the index), and may apply stashes on rollback. Back up repositories or test in an isolated workspace.
- Pay attention to the tmux recovery logic: although it checks pane contents before sending Enter, regex checks can miss prompts. Prefer manual recovery when sessions run destructive shells; consider limiting which sessions the daemon scans.
- If you plan to enable a daemon/cron, control its user account and file permissions (sessions/ should be accessible only to the intended user) to avoid leaking transcripts or scavenged data.
- Ask the publisher to update metadata: list required binaries (tmux, jq, git) and explicitly document the directories it writes to and the daemon behavior. If you are not comfortable with automatic keystrokes or automatic git operations, do not install or run these components.
功能分析
Type: OpenClaw Skill
Name: agent-ops
Version: 1.1.0
The skill bundle provides tools for monitoring and recovering AI agent sessions, including a script for token usage estimation (scripts/context-usage.sh) and several design patterns. While the intent is operational maintenance, the bundle is classified as suspicious due to high-risk capabilities described in the documentation (references/04-rate-limit.md and references/19-checkpoint-rollback.md). Specifically, it instructs the agent to use 'tmux send-keys' to inject Enter commands into active terminal panes and 'git add -A' followed by 'git stash' to automate state snapshots. These behaviors, particularly automated keystroke injection into other terminal sessions, represent a significant risk of unintended command execution or state corruption if the safety filters (regex-based checks for confirmation prompts) are bypassed or fail.
能力标签
能力评估
Purpose & Capability
The declared purpose (rate-limit recovery, stale-session scavenging, checkpoint/rollback, token budgeting, model fallback) aligns with the scripts and reference docs: they operate on tmux panes, transcripts, and session files. However the skill metadata lists no required binaries or environment variables while the instructions and scripts clearly rely on external tools (tmux, git, jq, cron/systemd for daemons). The missing declaration is a coherence/packaging omission.
Instruction Scope
Runtime instructions include scanning tmux panes and sending Enter keys into panes, creating git checkpoints via `git add -A` and `git stash create`, running a stale-session daemon that reads transcripts and writes scavenged artifacts. These actions are within the stated domain but have nontrivial risk: blind or mistaken keystrokes can confirm destructive prompts, `git add -A` temporarily changes index state, and daemon transcript analysis may read and persist sensitive session data. The skill does include some safety checks (e.g., grep for confirmation prompts before sending Enter), but those checks are regex-based and can miss edge cases.
Install Mechanism
No install spec (instruction-only plus two small files). This is lower risk from a code-install perspective because nothing is downloaded or executed outside the repository. Files are small and human-readable. There is no packaged installer that would fetch arbitrary remote code.
Credentials
The skill requests no credentials or env vars, which is appropriate. That said, it expects access to local session state under sessions/<session-id>/ and to system tools (tmux, git, jq). Those local filesystem and binary accesses are consistent with its purpose but should be explicitly declared so users can evaluate permissions and side effects.
Persistence & Privilege
The skill recommends running daemons or cron jobs and writes state to sessions/* (heartbeat, checkpoint, failure-tracker.json, scavenged files, PID/state files). It does not set always:true or require platform-level privileges, but it does request persistent local presence and will create/modify files under session directories; users should consider where those directories live and who can read them.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-ops - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-ops触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Version bump, consistency fixes
v1.0.0
Initial release: context estimation, rate limit recovery, checkpoint rollback, token budget
元数据
常见问题
Agent Ops 是什么?
Agent session 运维工具。当需要检测和恢复 API 限速、回收死 session 的知识、在破坏性操作前自动快照、或监控 context 使用率时使用。不用于安装 hook 脚本(用 agent-hooks)或架构设计(用 harness-design-patterns)。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 105 次。
如何安装 Agent Ops?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-ops」即可一键安装,无需额外配置。
Agent Ops 是免费的吗?
是的,Agent Ops 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent Ops 支持哪些平台?
Agent Ops 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Ops?
由 _silhouette(@lanyasheng)开发并维护,当前版本 v1.1.0。
推荐 Skills