# 发布后金丝雀监控 (canary-watch)

> 监控已部署的网址，检查 HTTP 状态、控制台错误、网络失败、性能、关键内容、API、静态资源和 SSE 流是否回归。

- 分类: [监控与运维](https://www.myskills.tools/zh/categories/monitoring-ops/)
- 来源: 社区 · Affaan Mustafa
- 代码仓库: https://github.com/affaan-m/ECC/tree/main/skills/canary-watch (commit db7f2a6)
- SKILL.md: https://github.com/affaan-m/ECC/blob/main/skills/canary-watch/SKILL.md
- 安装命令: `npx skills add affaan-m/ECC --skill canary-watch`
- 许可证: MIT
- 兼容工具: Claude Code, Codex, Cursor, Copilot, OpenCode
- 权限: read-repo ✗, write-files ✓, shell ✓, network ✓
- 状态: 扫描通过
- 规则扫描无法覆盖所有风险，安装前请阅读此技能的 SKILL.md，确认权限后再使用。
- ⚠ 若配置了 Slack 或 Discord webhook，监控结果会发送到这些第三方服务。

## 核心规则

只要越过任一严重阈值（如状态码非 200 或 API 返回 5xx）就立即告警。

## 执行阶段

1. **选择监控模式** — 默认单次快速检查，也可按间隔和时长持续监控，或对比预发与生产。
2. **执行各项检查** — 依次检查 HTTP 状态、控制台错误、网络请求、LCP/CLS/INP、关键页面元素、API 健康、静态资源和 SSE 心跳。
3. **按阈值分级** — 把结果与基线比较，分为严重、警告和信息三级。
4. **通知与报告** — 越过严重阈值时发送桌面通知并写入日志，可选推送到 Slack 或 Discord，最后输出金丝雀报告表格。

## 权限说明（据 SKILL.md 整理）

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 部分需要 | 仅把告警记录写入 ~/.claude/canary-watch.log。 |
| 命令执行 | 部分需要 | 用于在 macOS 或 Linux 上发送桌面通知以及按间隔循环检查。 |
| 网络外发 | 需要 | 请求被监控的网址及其 API、静态资源和 SSE 端点，并可选调用 Slack 或 Discord webhook。 |

## SKILL.md 头部信息（YAML）

```yaml
---
name: canary-watch
description: Use this skill to monitor and verify a deployed URL after releases — checks HTTP endpoints, SSE streams, static assets, console errors, and performance regressions after deploys, merges, or dependency upgrades. Smoke / canary / post-deploy verification.
metadata:
  origin: ECC
---
```

首页: https://www.myskills.tools/zh/ · URL: https://www.myskills.tools/zh/skills/canary-watch/
