Communitygithub.com

金丝雀监控

使用此技能在发布后监控和验证部署的URL——检查HTTP端点、SSE流、静态资源、控制台错误以及在部署、合并或依赖升级后的性能回归。烟雾/金丝雀/部署后验证。

金丝雀监控 是什么?

金丝雀监控(Canary Watch)是一项专为AI代理(如Claude Code、Cursor、Codex)设计的技能,用于在部署后对目标URL进行全面的回归检测。它支持快速单次检查、定时持续监控以及差异对比模式(如staging vs production)。该技能会检查HTTP状态、控制台错误、网络故障、LCP/CLS/INP性能指标、关键内容元素是否存在、API健康度、静态资源响应以及SSE流连接情况。用户可自定义严重、警告和信息三级阈值,当触达关键阈值时会发送桌面通知或可选的Slack/Discord webhook警报。该技能可与browser-qa技能配合用于预部署验证,也可作为PostToolUse钩子在git push后自动运行,并支持在GitHub Actions中作为CI/CD流程的一环执行。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/canary-watch

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

金丝雀监控 — 部署后监控

使用时机

  • 部署到生产或预发布环境后
  • 合并高风险PR后
  • 想要验证修复是否确实生效时
  • 在发布窗口期间持续监控
  • 依赖升级后

工作原理

监控已部署的URL是否有回归。循环运行,直到被停止或监控窗口到期。

监控内容

1. HTTP 状态 — 页面是否返回200?
2. 控制台错误 — 是否出现了之前没有的新错误?
3. 网络故障 — 失败的API调用、5xx响应?
4. 性能 — LCP/CLS/INP与基线相比是否有回归?
5. 内容 — 关键元素是否消失?(h1、导航、页脚、CTA)
6. API 健康 — 关键端点是否在SLA内响应?
7. 静态资源 — JS、CSS、图像和字体请求是否返回2xx/3xx并带有预期的内容类型?
8. SSE 流 — 事件流端点是否成功连接并接收到初始事件或心跳?

监控模式

快速检查(默认):单次通过,报告结果

/canary-watch https://myapp.com

持续监控:每隔N分钟检查一次,持续M小时

/canary-watch https://myapp.com --interval 5m --duration 2h

差异模式:比较预发布与生产环境

/canary-watch --compare https://staging.myapp.com https://myapp.com

警报阈值

critical:  # 立即警报
  - HTTP状态 != 200
  - 控制台错误计数 > 5(仅新错误)
  - LCP > 4s
  - API端点返回5xx
  - 静态资源返回4xx/5xx
  - SSE端点无法连接或在首次心跳前断开

warning:   # 在报告中标记
  - LCP比基线增加超过500ms
  - CLS > 0.1
  - 新的控制台警告
  - 响应时间超过基线2倍
  - 静态资源内容类型意外改变
  - SSE心跳延迟超过基线2倍

info:      # 仅记录日志
  - 微小的性能差异
  - 新的网络请求(添加了第三方脚本?)

通知方式

当触达关键阈值时:

  • 桌面通知(macOS/Linux)
  • 可选:Slack/Discord webhook
  • 记录到 ~/.claude/canary-watch.log

输出

## 金丝雀报告 — myapp.com — 2026-03-23 03:15 PST

### 状态:健康 ✓

| 检查项 | 结果 | 基线 | 差异 |
|--------|------|------|------|
| HTTP | 200 ✓ | 200 | — |
| 控制台错误 | 0 ✓ | 0 | — |
| LCP | 1.8s ✓ | 1.6s | +200ms |
| CLS | 0.01 ✓ | 0.01 | — |
| API /health | 145ms ✓ | 120ms | +25ms |
| 静态资源 | 42/42 ✓ | 42/42 | — |
| SSE /events | 已连接 ✓ | 已连接 | +80ms 心跳 |

### 未检测到回归。部署干净。

集成

配合使用:

  • /browser-qa 用于部署前验证
  • 钩子:作为 git push 上的 PostToolUse 钩子添加,在部署后自动检查
  • CI:在部署步骤后的 GitHub Actions 中运行

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能