← 返回 Skills 市场
sharbelayy

Agent Audit

作者 sharbel · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1753
总下载
0
收藏
19
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-audit
功能描述
Audit your AI agent setup for performance, cost, and ROI. Scans OpenClaw config, cron jobs, session history, and model usage to find waste and recommend opti...
使用说明 (SKILL.md)

Agent Audit

Scan your entire OpenClaw setup and get actionable cost/performance recommendations.

What This Skill Does

  1. Scans config — reads OpenClaw config to map models to agents/tasks
  2. Analyzes cron history — checks every cron job's model, token usage, runtime, success rate
  3. Classifies tasks — determines complexity level of each task
  4. Calculates costs — per agent, per cron, per task type using provider pricing
  5. Recommends changes — with confidence levels and risk warnings
  6. Generates report — markdown report with specific savings estimates

Running the Audit

python3 {baseDir}/scripts/audit.py

Options:

python3 {baseDir}/scripts/audit.py --format markdown    # Full report (default)
python3 {baseDir}/scripts/audit.py --format summary     # Quick summary only
python3 {baseDir}/scripts/audit.py --dry-run             # Show what would be analyzed
python3 {baseDir}/scripts/audit.py --output /path/to/report.md  # Save to file

How It Works

Phase 1: Discovery

  • Read OpenClaw config (~/.openclaw/openclaw.json or similar)
  • List all cron jobs and their configurations
  • List all agents and their default models
  • Detect provider (Anthropic, OpenAI, Google, xAI) from model names

Phase 2: History Analysis

  • Pull cron job run history (last 7 days by default)
  • Calculate per-job: avg tokens, avg runtime, success rate, model used
  • Pull session history where available
  • Calculate total token spend by model tier

Phase 3: Task Classification

Classify each task into complexity tiers:

Tier Examples Recommended Models
Simple Health checks, status reports, reminders, notifications Cheapest tier (Haiku, GPT-4o-mini, Flash, Grok-mini)
Medium Content drafts, research, 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 signals:

  • Simple: Short output (\x3C500 tokens), low thinking requirement, repetitive pattern, status/health tasks
  • Medium: Medium output, some reasoning needed, creative but templated, research tasks
  • Complex: Long output, multi-step reasoning, code generation, security-critical, tasks that previously failed on weaker models

Phase 4: Recommendations

For each task where the model tier doesn't match complexity:

⚠️ RECOMMENDATION: Downgrade "Knox Bot Health Check" from opus to haiku
   Current: anthropic/claude-opus-4 ($15/M input, $75/M output)
   Suggested: anthropic/claude-haiku ($0.25/M input, $1.25/M output)
   Reason: Simple status check averaging 300 output tokens
   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 audits
  • Tasks that have previously failed on weaker models
  • Tasks where the user explicitly chose a higher model
  • Complex multi-step reasoning tasks
  • Anything the user flagged as critical

Phase 5: Report Generation

Output a clean markdown report with:

  1. Overview — total agents, crons, monthly spend estimate
  2. Per-agent breakdown — model, usage, cost
  3. Per-cron breakdown — model, frequency, avg tokens, cost
  4. Recommendations — sorted by savings potential
  5. Total potential savings — monthly estimate
  6. One-liner config changes — exact model strings to swap

Model Pricing Reference

See references/model-pricing.md for current pricing across all providers. Update this file when prices change.

Task Classification Details

See references/task-classification.md for detailed heuristics on how tasks are classified into complexity tiers.

Important Notes

  • This skill 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 model
  • The audit should be re-run periodically (monthly) as usage patterns change
  • Token counts are estimates based on cron history — actual costs depend on your provider's billing
安全使用建议
This skill appears to be what it says: a read-only audit that reads your OpenClaw config and (when available) cron/session history to estimate token usage and recommend model tier changes. Before running: (1) review scripts/audit.py yourself (it runs locally and will read files under ~/.openclaw and related config locations); (2) run with --dry-run and --output to inspect results without making changes (the tool claims it never writes config automatically); (3) be aware that the tool estimates costs using the included pricing table — it does not access provider billing APIs or require API keys, so its cost estimates are approximate unless you supply cron/session histories that include accurate token counts; (4) if you plan to grant it access to an OpenClaw cron API or other telemetry, understand what those endpoints expose (session contents, logs, or tokens may contain sensitive data). If you want absolute assurance, run the script in a safe environment or audit the code line-by-line; otherwise the skill is coherent and proportionate for its purpose.
功能分析
Type: OpenClaw Skill Name: agent-audit Version: 1.0.0 The OpenClaw Agent Audit skill is designed to analyze agent configurations and usage for cost optimization. It reads OpenClaw configuration files (e.g., `~/.openclaw/openclaw.json`) to identify models and agent setups, which is necessary for its stated purpose. The `scripts/audit.py` code does not perform any network requests, execute arbitrary system commands, or modify any files other than optionally writing a markdown report to a user-specified path. The `SKILL.md` instructions are clear, align with the script's functionality, and contain no evidence of prompt injection attempts to subvert the agent's behavior for malicious purposes. The skill explicitly states it is 'read-only' and the code confirms this, focusing solely on analysis and reporting without making changes or exfiltrating sensitive data.
能力评估
Purpose & Capability
Name and description match the code and SKILL.md: the skill reads OpenClaw config, enumerates agents/crons, classifies tasks, and estimates cost using an embedded pricing table. It does not request unexpected credentials or binaries.
Instruction Scope
SKILL.md and the script instruct the agent to read OpenClaw config files (e.g. ~/.openclaw/openclaw.json) and cron run history/session history. The shipped script reads local config and contains placeholders for cron API calls; pulling remote provider billing would require extra permissions not requested here. This is within scope for an audit tool, but 'pull session history' and 'cron API access' are ambiguous and may require additional explicit permissions when fully enabled.
Install Mechanism
Instruction-only skill with no install spec and one readable Python script. No downloads, no package installs, and no extract/run of remote code are present.
Credentials
The skill declares no environment variables, no credentials, and no config paths beyond OpenClaw locations. The required access (reading OpenClaw config and local cron history) is proportionate to the stated purpose. It does not request cloud provider credentials (note: that would be needed for billing-level accuracy, but the skill does not claim to use them).
Persistence & Privilege
The skill is not always-enabled and does not modify system or other skills' configs. SKILL.md states it is read-only and the code does not persist changes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-audit
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-audit 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of agent-audit skill. - Audits AI agent setups for performance, cost, and ROI across all major model providers. - Scans OpenClaw config, cron jobs, session history, and model usage to detect inefficiencies and overspending. - Classifies tasks by complexity and matches them to appropriate model tiers. - Generates actionable recommendations with risk and confidence ratings, as well as potential cost savings. - Produces a detailed markdown report with per-agent and per-cron breakdowns and suggested config changes. - Read-only tool—no automatic changes to your setup.
元数据
Slug agent-audit
版本 1.0.0
许可证
累计安装 22
当前安装数 19
历史版本数 1
常见问题

Agent Audit 是什么?

Audit your AI agent setup for performance, cost, and ROI. Scans OpenClaw config, cron jobs, session history, and model usage to find waste and recommend opti... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1753 次。

如何安装 Agent Audit?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-audit」即可一键安装,无需额外配置。

Agent Audit 是免费的吗?

是的,Agent Audit 完全免费(开源免费),可自由下载、安装和使用。

Agent Audit 支持哪些平台?

Agent Audit 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agent Audit?

由 sharbel(@sharbelayy)开发并维护,当前版本 v1.0.0。

💬 留言讨论