agent-diff-guard: Skill for Claude Code

.claude/skills/morning-guard-triage/SKILL.md

morning-guard-triage is a skill for Claude Code from cubxxw/agent-diff-guard. It costs 62 tokens per session (2,696 once invoked), scanned A, original, MIT.

An automated morning review for coding-agent work sessions that ran recently, summarizing risky findings and their status.

In plain words
What is it for?
Use it as a scheduled job or after repeated agent runs to create a local report, optionally prepare isolated work areas, or send summaries to Slack or Linear.
Why use it?
It saves developers from reading many session logs and highlights issues marked as warnings or blockers that may need attention.

Skill for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: mentions Claude Code.

This is cubxxw/agent-diff-guard's own configuration. It tells Claude Code how to work on agent-diff-guard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-diff-guard configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git worktree add "../worktrees/$BRANCH" -b "$BRANCH".

Reuse

Borrowing it

Nothing to install: this file belongs to cubxxw/agent-diff-guard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cubxxw/agent-diff-guard/main/.claude/skills/morning-guard-triage/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/cubxxw/agent-diff-guard

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for morning-guard-triage

README.md
[![agentmods](https://agentmods.dev/badge/skills/cubxxw/agent-diff-guard/morning-guard-triage/github.svg)](https://agentmods.dev/skills/cubxxw/agent-diff-guard/morning-guard-triage)
Your own site
<a href="https://agentmods.dev/skills/cubxxw/agent-diff-guard/morning-guard-triage"><img src="https://agentmods.dev/badge/skills/cubxxw/agent-diff-guard/morning-guard-triage/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for morning-guard-triage

Your own site · 80×15
<a href="https://agentmods.dev/skills/cubxxw/agent-diff-guard/morning-guard-triage"><img src="https://agentmods.dev/badge/skills/cubxxw/agent-diff-guard/morning-guard-triage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.02696
Opus 5 $0.00031 $0.01348
Sonnet 5 $0.00012 $0.00539
Haiku 4.5 $0.00006 $0.00270

Measured 11d ago against content hash 954797e8593e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

morning-guard-triage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/morning-guard-triage/SKILL.md · 264 lines

How it starts

The opening of the file, as written. The whole thing — 264 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/morning-guard-triage

设计一次,每天自动跑。这是 agent-diff-guard Loop Guard 层的标准晨间巡查 skill——呼应 Loop Engineering 的核心理念:agent 在你睡觉时持续迭代,你醒来时需要一份精确到"该看什么"的简报,而不是翻阅 50 条 commit log。


标准 Morning Triage Loop 形状(Osmani 框架)

┌────────────────────────────────────────────────────────┐
│  Morning Triage Loop                                   │
│                                                        │
│  1. list sessions   →  找出昨日 / 活跃的 loop session  │
│  2. report per session  →  生成晨报(drift/budget/findings)│
│  3. aggregate        →  汇总 block/warn 项到 PROGRESS.md│
│  4. [可选] worktree  →  为值得修复的项创建隔离分支      │
│  5. [可选] notify    →  推送摘要到 Slack / Linear       │
└────────────────────────────────────────────────────────┘

每个步骤独立可跳过,无副作用(只读 + 写本地文件),适合作为 cron job 或 Claude Code /loop 的 post-iteration hook 运行。


步骤详解与 Bash 命令示例

步骤 1:读昨日所有 loop session

# 列出所有 session(JSON 格式便于后续处理)
SESSIONS=$(agent-diff-guard loop list --json)

# 筛选昨日活跃 / 今日仍在运行的 session(jq 过滤)
ACTIVE_IDS=$(echo "$SESSIONS" | jq -r '.[] | select(.status == "active" or .status == "emergency-braked") | .id')

echo "待巡查 sessions:"
echo "$ACTIVE_IDS"

步骤 2:对每个 session 生成晨报

REPORT_DIR=".agent-guard/morning-$(date +%Y%m%d)"
mkdir -p "$REPORT_DIR"

for SID in $ACTIVE_IDS; do
  # 生成 JSON 晨报(含 topFindings / driftSummary / budgetSummary / recommendation)
  agent-diff-guard loop report --session "$SID" --json > "$REPORT_DIR/$SID.json"

  # 同时生成人类可读版本
  agent-diff-guard loop report --session "$SID" > "$REPORT_DIR/$SID.txt"

  echo "✓ $SID 晨报已写入 $REPORT_DIR/"
done

generateReport() 输出字段说明(来自 src/loop/report.ts):

字段 含义
topFindings Top-5 高频发现(rule × path × count)
driftSummary.status stable / drifting / diverged
budgetSummary.budgetPct token 消耗百分比
recommendation continue / review-and-continue / rollback / stop
emergencyBrakeTriggered 是否触发了紧急制动

步骤 3:汇总高风险项 → PROGRESS.md 状态文件

PROGRESS_FILE="MORNING-TRIAGE-$(date +%Y%m%d).md"

{
  echo "# Morning Guard Triage — $(date +%Y-%m-%d)"
  echo ""
  echo "> 自动生成。verdict=block 的项需人工确认。"
  echo ""

  for SID in $ACTIVE_IDS; do
    R="$REPORT_DIR/$SID.json"
    echo "## $SID"
    echo "- recommendation: $(jq -r '.recommendation' "$R")"
    echo "- drift: $(jq -r '.driftSummary.status' "$R") / $(jq -r '(.driftSummary.currentDrift * 100 | floor | tostring) + "%"' "$R")"
    echo "- budget: $(jq -r '(.budgetSummary.budgetPct * 100 | floor | tostring) + "%"' "$R") used"
    echo "- emergency_brake: $(jq -r '.emergencyBrakeTriggered' "$R")"
    echo ""
    echo "### wake-you-up 发现"
    jq -r '.topFindings[] | select(.severity=="wake-you-up") | "- [ ] `\(.rule)` @ `\(.path)` ×\(.count)"' "$R"
    echo ""
  done
} > "$PROGRESS_FILE"

echo "✓ 状态文件:$PROGRESS_FILE"

Read the full file on GitHub · 264 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 264 lines · 62 tokens per session scan A 954797e8593e

Subscribe to this mod's changes

morning-guard-triage is a skill published in the GitHub repository cubxxw/agent-diff-guard (0 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 2,696 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

learning-from-experience

Turns incidents, near misses, bad handoffs, review surprises, escaped bugs, and signals from real use into lasting fixes to your safeguards. Use after something went wrong or nearly did and a future safeguard should change. Do not use during a live incident, which comes first, or to blame someone.

FlyFission/nuclear-grade-context-engineering · 65 tokens

reporting-shared-defects

Routes a defect found in a shared or supplied artifact (a shared prompt, skill, dependency, model, eval, or template) to the downstream teams, agents, and releases that depend on it, not just a local fix. Use when a discovered defect affects others who consume the same artifact. Do not use for a defect local to your…

FlyFission/nuclear-grade-context-engineering · 93 tokens

responding-to-incidents

Runs a live incident the stabilize-first way — name a commander, separate facts from hypotheses, prefer reversible actions, communicate on a cadence, and drive corrective actions to closure. Use when production is broken, data is at risk, or an agent action caused harm. Do not use for routine non-incident work, or as…

FlyFission/nuclear-grade-context-engineering · 80 tokens

thumbgate-doctor

Health-check whether ThumbGate is actually wired into this agent — PreToolUse/SessionStart hooks installed, MCP server reachable, lesson store present, statusline, and overall agent-readiness — then report exactly what to fix. Runs the existing npx thumbgate doctor audit and the checkoperationalintegrity MCP tool. Use…

IgorGanapolsky/ThumbGate · 168 tokens

prevention-rules

Generate and review prevention rules auto-promoted from repeated failure patterns.

IgorGanapolsky/ThumbGate · 18 tokens

sodam-harness-self-check

A self-checking instruction set for an AI agent. It tells the agent to verify important work, show evidence, and clearly disclose anything it could not check.

sodam-ai/SoDam-Harness-Eng · 51 tokens