Agent审计
- 作者仓库星标 430
- 作者更新于 实时读取
- 作者仓库 aeon
- 领域
- 安全 · meta
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @aaronjmars · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
---
name: Skill Health
description: Audit skill metrics, file/resolve issues in memory/issues/, and notify on state change only <!--…
category: 安全
runtime: 无特殊运行时
---
# Skill Health 输出预览
## PART A: 任务判断
- 适用问题:安全审计、密钥扫描、权限检查或风险分析。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Purpose / Data sources / Steps”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于安全审计、密钥扫描、权限检查或风险分析,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Purpose / Data sources / Steps”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Purpose / Data sources / Steps”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: Skill Health
description: Audit skill metrics, file/resolve issues in memory/issues/, and notify on state change only <!--…
category: 安全
source: aaronjmars/aeon
---
# Skill Health
## 什么时候使用
- 把安全方向的常用动作沉淀成 Agent 可调用的技能 适合处理安全审计、密钥扫描、权限检查和风险分析,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 围绕 meta 组织上下文、步骤和验收口径;通常不…
- 面向安全审计、密钥扫描、权限检查或风险分析,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Purpose / Data sources / Steps」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "Skill Health" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Purpose / Data sources / Steps
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} ${var} — Skill name to check. If empty, checks all scheduled skills.
If ${var} is set, only check that specific skill.
Purpose
Audit skill quality metrics, detect API degradation, file issues for new failures and resolve them when skills recover, and notify only when fleet health state actually changes.
Data sources
memory/cron-state.json— Per-skill quality metrics (as before).memory/skill-health/*.json— Per-skill quality analysis (Haiku post-run).memory/skill-health/last-report.json— Last run's classification snapshot (this skill writes it). Used to dedup notifications and detect flapping.aeon.yml— Enabled skills and schedules.memory/issues/INDEX.mdandmemory/issues/ISS-*.md— Open issues tracker. Check before filing, update on recovery../scripts/skill-runs --hours 168 --failures --json— Fallback source for failures that never wrote to cron-state (sandbox blocks, etc.). Run once, parse JSON.memory/logs/YYYY-MM-DD.md(last 3 days) — Grep forSKILL_*_ERRORorEMPTYsignatures keyed to skills missing from skill-health/*.json.
Steps
1. Gather state
- Parse
aeon.yml→ list of enabled skills with schedules. If${var}set, filter to just that skill. - Load
memory/cron-state.json(if missing or unparseable, treat as empty — first run, not failure). - Load every
memory/skill-health/*.json(exceptlast-report.json). - Load
memory/skill-health/last-report.jsonif present →prev_report. If missing,prev_report = {}. - Run
./scripts/skill-runs --hours 168 --failures --json 2>/dev/null || echo '{}'→ extract any skill with failures in the last 7d that isn't in cron-state (sandbox-blocked state writes). - Parse
memory/issues/INDEX.md→ extract open issues withdetected_by: skill-healthand their affected skills. If missing, treat as empty.
2. Classify each enabled skill
For each enabled skill, assign one status using the first matching rule:
| Status | Trigger |
|---|---|
| CRITICAL | consecutive_failures >= 3 OR (status==failed AND days_since_last_success >= 3) |
| DEGRADED | success_rate < 0.6 OR (latest skill-health/*.json avg_score < 2.5 over ≥3 runs) |
| FLAPPING | 3+ status transitions (success↔failed) in last 7 days per cron-state history or skill-runs output |
| WARNING | success_rate < 0.8 OR consecutive_failures >= 1 |
| HEALTHY | success_rate >= 0.8 AND consecutive_failures == 0 AND (no skill-health data OR avg_score >= 3) |
| NO DATA | no entry in cron-state AND never seen in skill-runs |
Compute severity score for sorting: consecutive_failures × (1 + days_since_last_success/7). Ties broken by days_since_last_success desc.
For each CRITICAL/DEGRADED/FLAPPING skill, record:
last_error(from cron-state or nearest log signature)api_hostif the error clearly names one (e.g.api.coingecko.com,api.github.com)suggested_action— one of:FIX CONFIG(missing secret, bad arg),WAIT-API(rate limit, 5xx, timeout on third-party host),INVESTIGATE(unrecognised error),DISPATCH-SKILL(NO DATA but scheduled — scheduler gap)
3. Detect systemic patterns
Group non-HEALTHY skills by shared api_host OR shared last_error signature. If ≥2 skills share one:
- Emit a single
SYSTEMIC:callout (e.g.SYSTEMIC: 3 skills failing on api.coingecko.com (rate_limit)). - Do not duplicate the same error across per-skill rows — reference the systemic line.
4. Reconcile with memory/issues/
Precondition guard: only perform issue filing/resolution if memory/issues/INDEX.md already exists. If it is missing, the operator has not opted into the issue-tracker contract yet — log SKILL_HEALTH_ISSUE_TRACKER_MISSING to memory/logs/${today}.md, skip this entire step (and the reconciliation side of step 5), and continue with classification + notification only. Do not auto-create INDEX.md.
For each CRITICAL or FLAPPING skill, check if an open issue already exists with this skill in affected_skills AND a matching root_cause signature:
- Open issue exists, same root cause → do nothing (no new file, no notification for this skill).
- Open issue exists, different root cause → append a note to the existing ISS file's body:
Update YYYY-MM-DD: new signature: <error>. Do not file a new issue. - No open issue → file a new one (see below).
For each skill now HEALTHY whose name appears in any open issue's affected_skills:
- Remove it from that issue's
affected_skills. If the list becomes empty, setstatus: resolved, setresolved_at: <now ISO>, and move the row from Open to Resolved in INDEX.md.
Filing a new issue:
- Find next ID: scan
memory/issues/ISS-*.md, take maxNNN, add 1. Format as zero-padded 3 digits (ISS-042). - Write
memory/issues/ISS-NNN.mdwith YAML frontmatter:--- id: ISS-NNN title: <skill> <concise failure> status: open severity: critical | high | medium | low # critical=CRITICAL status, high=FLAPPING, medium=DEGRADED category: rate-limit | timeout | missing-secret | config | api-change | sandbox-limitation | unknown detected_by: skill-health detected_at: <ISO timestamp> affected_skills: [<skill>, ...] # may grow later root_cause: <error signature, 1 line> fix_pr: null --- ## What happened <2-3 line summary> ## Signal - consecutive_failures: N - days_since_last_success: N - last_error: "<error>" - related skills: <list or "none"> - Append a row to
memory/issues/INDEX.mdunder Open:| ISS-NNN | title | severity | category | YYYY-MM-DD | skill-a, skill-b |.
All issue writes must be atomic per file — never partial updates mid-run.
5. Decide whether to notify
Build a stable signature from the current classification: sorted list of CRITICAL+FLAPPING+DEGRADED skill names + SYSTEMIC callouts. SHA-256 it → current_hash.
- If
current_hash == prev_report.hashANDnow - prev_report.last_notified_at < 24h→ do not notify. State unchanged. - Otherwise → notify (there's new signal or the daily reminder cadence elapsed).
Always write memory/skill-health/last-report.json:
{
"hash": "<current_hash>",
"last_notified_at": "<ISO if notified this run, else previous value>",
"last_run_at": "<ISO now>",
"classification": { "critical": [...], "degraded": [...], "flapping": [...], "warning": [...], "healthy_count": N, "no_data": [...] }
}
6. Format the report
Top line: HEALTH: OK | HEALTH: WARNING(W) | HEALTH: DEGRADED(D) | HEALTH: CRITICAL(C) — most severe wins.
Body (notify-channel format, max 1 message):
*Skill Health — ${today}*
HEALTH: CRITICAL(2) [systemic: api.coingecko.com rate_limit — 3 skills]
🔴 CRITICAL
- token-movers — 5 fails, 3d down — WAIT-API (rate_limit) → ISS-042
- defi-monitor — 4 fails, 2d down — WAIT-API (rate_limit) → ISS-042
🟡 DEGRADED / FLAPPING
- digest — 52% success (14d), avg quality 2.1 — INVESTIGATE → ISS-043
⚪ NO DATA (2): skill-x, skill-y — DISPATCH-SKILL
🟢 HEALTHY: 34
Open issues: 2 · Resolved this run: 1 (rss-digest)
Rules for formatting:
- Cap per-section rows at 5; collapse the rest as
+N more — see memory/issues/INDEX.md. - Omit HEALTHY list (count only). Omit any empty section.
- Always end with
Open issues: X · Resolved this run: Y. - If NO CRITICAL/DEGRADED/FLAPPING and no new/resolved issues → body is just
HEALTH: OK — N skills healthy.
7. Notify and log
- If the gate in step 5 said notify →
./notify "<report body>". Updatelast_notified_atin last-report.json to now. - If gate said skip → do not call
./notify. Log to memory/logs/${today}.md:### skill-health - SKILL_HEALTH_NOOP — state unchanged since <prev_run_at>, hash=<short>
On notify, log to memory/logs/${today}.md:
### skill-health
- HEALTH: <OK|WARNING|DEGRADED|CRITICAL>
- filed: [ISS-NNN, ...]
- resolved: [ISS-NNN, ...]
- open: N
- systemic: <pattern or none>
If all skills healthy, the body-only shortcut from step 6 still fires (once per 24h, per gate) so the operator gets confirmation the audit actually ran — but suppress if last-report.json shows a notify <24h ago with the same OK hash.
Sandbox note
The sandbox may block outbound curl. This skill does not fetch URLs directly — all data is local or via gh / ./scripts/skill-runs (which uses gh api). No curl fallback needed. If ./scripts/skill-runs fails, log SKILL_HEALTH_PARTIAL — skill-runs unavailable and continue with cron-state only.
Constraints
- Never file two open issues for the same
(skill, root_cause)pair — always check INDEX.md first. - Never edit a Resolved issue. If a previously-resolved issue re-fires, file a new ISS with a pointer (
related: ISS-NNN) in the body. - Do not notify on pure HEALTHY runs more than once per 24h.
- If
${var}is set (single-skill mode), skip INDEX.md updates only if the single skill is HEALTHY — otherwise file/resolve as normal. - Never touch
memory/issues/INDEX.mdResolved section except to move rows into it; never delete rows.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核