Agent Audit — 代理 审计
v1.0.0审计 your AI 代理 设置up for performance, cost, and ROI. 扫描s OpenClaw config, cron jobs, 会话 历史, and 模型 usage to find waste and recommend optimizations. Works with any 模型 提供者 (Anthropic, OpenAI, Google, xAI, etc.). Use when: (1) user says "审计 my 代理s", "优化 my costs", "am I overspending on AI", "检查 my 模型 usage", "代理 审计", "cost optimization", (2) user wants to know which cron jobs are expensive vs cheap, (3) user wants 模型-task fit recommendations, (4) user wants ROI analysis of their 代理 设置up, (5) user says "where am I wasting 令牌s".
运行时依赖
安装命令
点击复制技能文档
代理 审计
扫描 your entire OpenClaw 设置up and 获取 actionable cost/performance recommendations.
What This 技能 Does 扫描s config — reads OpenClaw config to map 模型s to 代理s/tasks Analyzes cron 历史 — 检查s every cron job's 模型, 令牌 usage, 运行time, 成功 rate Classifies tasks — determines complexity level of each task Calculates costs — per 代理, per cron, per task type using 提供者 pricing Recommends changes — with confidence levels and risk 警告s 生成s 报告 — markdown 报告 with specific savings estimates 运行ning the 审计 python3 {baseDir}/scripts/审计.py
Options:
python3 {baseDir}/scripts/审计.py --格式化 markdown # Full 报告 (default) python3 {baseDir}/scripts/审计.py --格式化 summary # Quick summary only python3 {baseDir}/scripts/审计.py --dry-运行 # Show what would be analyzed python3 {baseDir}/scripts/审计.py --输出 /path/to/报告.md # Save to file
How It Works Phase 1: Discovery Read OpenClaw config (~/.OpenClaw/OpenClaw.json or similar) 列出 all cron jobs and their configurations 列出 all 代理s and their default 模型s 检测 提供者 (Anthropic, OpenAI, Google, xAI) from 模型 names Phase 2: 历史 Analysis Pull cron job 运行 历史 (last 7 days by default) Calculate per-job: avg 令牌s, avg 运行time, 成功 rate, 模型 used Pull 会话 历史 where avAIlable Calculate total 令牌 spend by 模型 tier Phase 3: Task Classification
Classify each task into complexity tiers:
Tier Examples Recommended 模型s Simple 健康 检查s, 状态 报告s, reminders, 通知 Cheapest tier (HAIku, GPT-4o-mini, Flash, Grok-mini) Medium Content drafts, re搜索, summarization, data analysis Mid tier (Sonnet, GPT-4o, Pro, Grok) Complex Coding, architecture, security review, nuanced writing Top tier (Opus, GPT-4.5, Ultra, Grok-2)
Classification 签名als:
Simple: Short 输出 (<500 令牌s), low thinking requirement, repetitive pattern, 状态/健康 tasks Medium: Medium 输出, some reasoning needed, creative but templated, re搜索 tasks Complex: Long 输出, multi-step reasoning, code generation, security-critical, tasks that previously fAIled on weaker 模型s Phase 4: Recommendations
For each task where the 模型 tier doesn't match complexity:
⚠️ RECOMMENDATION: 降级 "Knox 机器人 健康 检查" from opus to hAIku Current: anthropic/claude-opus-4 ($15/M 输入, $75/M 输出) Suggested: anthropic/claude-hAIku ($0.25/M 输入, $1.25/M 输出) Reason: Simple 状态 检查 averaging 300 输出 令牌s Estimated savings: $X.XX/month Risk: LOW — task is simple pattern matching Confidence: HIGH
Safety Rules — NEVER Recommend Downgrading: Coding/development tasks Security reviews or 审计s Tasks that have previously fAIled on weaker 模型s Tasks where the user explicitly chose a higher 模型 Complex multi-step reasoning tasks Anything the user flagged as critical Phase 5: 报告 Generation
输出 a 清理 markdown 报告 with:
Overview — total 代理s, crons, monthly spend estimate Per-代理 breakdown — 模型, usage, cost Per-cron breakdown — 模型, frequency, avg 令牌s, cost Recommendations — 排序ed by savings potential Total potential savings — monthly estimate One-liner config changes — exact 模型 strings to swap 模型 Pricing Reference
See references/模型-pricing.md for current pricing across all 提供者s. 更新 this file when prices change.
Task Classification DetAIls
See references/task-classification.md for detAIled heuristics on how tasks are classified into complexity tiers.
导入ant Notes This 技能 is read-only — it never changes your config automatically All recommendations include risk levels and confidence scores When unsure about a task's complexity, it defaults to keeping the current 模型 The 审计 should be re-运行 periodically (monthly) as usage patterns change 令牌 counts are estimates based on cron 历史 — actual costs depend on your 提供者's billing