跳到正文
cccskills
免费在 GitHub 公开

canary

Monitor a live application after deployment and compare it with a saved baseline, a record of its earlier state. Check page responses, loading times, and new errors, flag persistent changes, and produce a per-page health report.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Post-deploy monitoring: watch production after a deploy and alert on regressions

集成工具VercelNetlify
查看安装方法

适用场景

  • Recording a healthy baseline before deployment
  • Monitoring production immediately after deployment
  • Checking key pages for slower responses or failures
  • Saving a post-deployment health report

包含的文件(1)

  • SKILL.md7.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Canary: Post-Deploy monitoring

Watch a live application after deployment. Alert on errors and regressions. Compare against a pre-deploy baseline.

Two modes:

  • --baseline: capture the current state BEFORE deploying
  • (default): monitor AFTER deploying and compare against baseline

Instructions

Phase 1: Setup

Parse the user's arguments and detect the deployment context.

# Detect current branch and recent deploy commit
git branch --show-current
git log --oneline -5

# Auto-detect platform from config files
[ -f fly.toml ]         && echo "PLATFORM: fly"
[ -f render.yaml ]      && echo "PLATFORM: render"
[ -f vercel.json ]      && echo "PLATFORM: vercel"
[ -f netlify.toml ]     && echo "PLATFORM: netlify"
[ -f Procfile ]         && echo "PLATFORM: heroku"
[ -f railway.toml ]     && echo "PLATFORM: railway"

# Check for health endpoint
curl -sf "${URL}/health" -w "\n%{http_code}" 2>/dev/null | tail -1
curl -sf "${URL}/api/health" -w "\n%{http_code}" 2>/dev/null | tail -1

Create the working directory:

mkdir -p .canary/baselines .canary/reports .canary/screenshots

Phase 2: Baseline Capture (--baseline mode)

Run this BEFORE deploying to capture the current healthy state.

For each page to monitor, record:

  1. HTTP status: is the page returning 200?
  2. Response time: how long does it take to load?
  3. Content snapshot: key text content to detect blank pages later
# For each page URL
for PAGE_PATH in "/" "/dashboard" "/settings" "/api/health"; do
  SLUG=$(echo "$PAGE_PATH" | tr '/' '_' | tr -d '?&=')
  RESULT=$(curl -sf -o /dev/null -w "%{http_code}|%{time_total}" "${BASE_URL}${PAGE_PATH}" 2>/dev/null)
  STATUS=$(echo "$RESULT" | cut -d'|' -f1)
  TIME_MS=$(echo "$RESULT" | awk -F'|' '{printf "%.0f", $2 * 1000}')
  echo "  ${PAGE_PATH}: HTTP ${STATUS}, ${TIME_MS}ms"
done

Save baseline to .canary/baselines/baseline.json:

{
  "url": "<base-url>",
  "timestamp": "<ISO-8601>",
  "branch": "<branch-name>",
  "commit": "<git-SHA>",
  "pages": {
    "/": { "status": 200, "time_ms": 450 },
    "/dashboard": { "status": 200, "time_ms": 680 },
    "/api/health": { "status": 200, "time_ms": 45 }
  }
}

Then STOP and tell the user: "Baseline captured. Deploy your changes, then run /canary <url> to monitor."


Phase 3: Page discovery

If no pages were specified, auto-discover pages to monitor.

From the application:

# Check sitemap if available
curl -sf "${URL}/sitemap.xml" 2>/dev/null | grep -oP '(?<=<loc>)[^<]+' | head -10

# Check robots.txt for known paths
curl -sf "${URL}/robots.txt" 2>/dev/null | grep -i "allow\|disallow" | head -10

# Common paths to always check
echo "Always check: / /login /dashboard /settings /api/health"

Default pages to monitor if nothing found: /, and the homepage only.


Phase 4: Monitoring loop

Monitor for the specified duration (default: 10 minutes). Run a check every 60 seconds.

Each check cycle:

TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
CHECK_NUM=$((CHECK_NUM + 1))

for PAGE_PATH in "${PAGES[@]}"; do
  # Check HTTP status and response time
  RESULT=$(curl -sf -o /dev/null -w "%{http_code}|%{time_total}" \
    --max-time 10 "${BASE_URL}${PAGE_PATH}" 2>/dev/null || echo "0|0")
  STATUS=$(echo "$RESULT" | cut -d'|' -f1)
  TIME_MS=$(echo "$RESULT" | awk -F'|' '{printf "%.0f", $2 * 1000}')

  # Compare against baseline
  BASELINE_STATUS=$(jq -r ".pages[\"${PAGE_PATH}\"].status // 200" .canary/baselines/baseline.json 2>/dev/null)
  BASELINE_TIME=$(jq -r ".pages[\"${PAGE_PATH}\"].time_ms // 1000" .canary/baselines/baseline.json 2>/dev/null)

  echo "  [Check #${CHECK_NUM}] ${PAGE_PATH}: HTTP ${STATUS} (${TIME_MS}ms)"
done

Alert levels:

LevelConditionTrigger
CRITICALPage load failureHTTP status is not 2xx, curl timeout, DNS failure
HIGHNew errorsError rate increased vs baseline (console errors, 5xx responses)
MEDIUMPerformance regressionResponse time exceeds 2x baseline
LOWNew broken linksPreviously-working routes now return 404

Key principles:

  • Alert on changes, not absolutes. A page with 3 errors in baseline is fine if still 3. One NEW error is an alert.
  • Transient tolerance. Only alert on patterns persisting across 2+ consecutive checks. A single network blip is not an alert.

When a CRITICAL or HIGH alert fires (2 consecutive checks):

CANARY ALERT
=====================================
Time:     [check #N at Xs elapsed]
Page:     [URL]
Level:    [CRITICAL / HIGH / MEDIUM / LOW]
Finding:  [what changed, be specific]
Baseline: [baseline value]
Current:  [current value]
=====================================
Options:
  A) Investigate now: stop monitoring, focus on this issue
  B) Continue monitoring: wait for next check to confirm
  C) Rollback: revert the deploy
  D) Dismiss: known issue, continue monitoring

Phase 5: Health report

After monitoring completes (or user stops), produce a summary.

CANARY REPORT: [url]
=========================================
Duration:    [X minutes]
Checks:      [N total per page]
Pages:       [N pages monitored]
Commit:      [deployed SHA]
Status:      [HEALTHY / DEGRADED / BROKEN]

Per-Page Results:
-----------------------------------------
  Page           Status      Avg Time   Alerts
  /              HEALTHY     450ms      0
  /dashboard     DEGRADED    1100ms     1 medium (was 450ms)
  /settings      HEALTHY     380ms      0
  /api/health    HEALTHY     45ms       0

Alerts Fired: [N] (X critical, Y high, Z medium, W low)

VERDICT: [DEPLOY HEALTHY / DEPLOY HAS ISSUES (see alerts above)]
=========================================

Save report to .canary/reports/<date>-canary.md.


Phase 6: Baseline update

If the deploy is healthy and the user wants to update the baseline:

cp .canary/reports/latest-snapshot.json .canary/baselines/baseline.json
echo "Baseline updated to commit $(git rev-parse --short HEAD)"

Output format

See Phase 5 above for the full CANARY REPORT template.

Inline alert format (during monitoring):

[08:42:15] Check #3: /dashboard: ALERT HIGH, response time 1250ms (baseline: 420ms)
[08:43:15] Check #4: /dashboard: ALERT HIGH, response time 1180ms (baseline: 420ms)
-> Consistent across 2 checks. Firing alert.

Usage

/canary https://app.example.com                # Monitor homepage for 10 min
/canary https://app.example.com --baseline     # Capture baseline before deploying
/canary https://app.example.com --duration 5m  # Monitor for 5 minutes
/canary https://app.example.com --quick        # Single-pass health check (no loop)
/canary https://app.example.com --pages /,/dashboard,/api/health

Tips

  1. Always capture a baseline before deploying to production: run /canary <url> --baseline
  2. Start monitoring immediately after deploy; the first 5 minutes catch 90% of regressions
  3. CRITICAL alerts require immediate investigation; don't wait for the monitoring to finish
  4. MEDIUM alerts (performance) may be cache warming; give it 2-3 more checks before acting
  5. Keep .canary/baselines/ in git so any team member can run canary against the same baseline

Related commands

  • /ship: pre-deploy checklist (run before deploying)
  • /land-and-deploy: full merge-to-verify pipeline (runs canary automatically)
  • /qa: interactive QA testing before shipping

$ARGUMENTS

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Evaluate Claude Code agents, skills, and commands with weighted quality criteria. Get scores, readiness grades, template comparisons, and practical improvement suggestions in Markdown or JSON reports to guide reviews before release.

中文简介正在准备中。当前显示英语简介。

  • Review skills before release
  • Compare agent definitions with reference templates
  • Quickly check critical quality criteria
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

Assess a codebase across seven areas, including exposed credentials, security, dependencies, structure, and tests. Receive category scores, findings tied to file locations, and a prioritized improvement plan with smaller tasks that can be completed quickly.

中文简介正在准备中。当前显示英语简介。

  • Assessing the overall health of an inherited project
  • Reviewing exposed credentials and security risks
  • Identifying dependency and test coverage gaps
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

Measure code patterns such as casts to any or disabled lint rules, then run repeated, targeted edits. Keep changes that improve the chosen metric, revert unsuccessful changes, and track results for each improvement loop.

中文简介正在准备中。当前显示英语简介。

  • Finding code patterns to prioritize for cleanup
  • Preparing measurement files for an improvement loop
  • Repeating targeted edits to reduce casts to any
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

best-of-n

免费

Generate several separate solutions, compare them against criteria fixed in advance, and verify the selected result through executable checks or an independent reviewer. Keep a proof log documenting candidates, evidence, failures, and remaining limits.

中文简介正在准备中。当前显示英语简介。

  • Comparing implementation options before choosing one
  • Verifying a solution when a wrong choice would be costly
  • Keeping evaluation evidence for delivery or audit
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

catchup

免费

Rebuild project context after clearing a conversation or returning to work. Review recent Git history, uncommitted changes, and TODO markers to get a structured summary of project status and suggested next steps.

中文简介正在准备中。当前显示英语简介。

  • Restoring project context after /clear
  • Reviewing recent changes after a long break
  • Checking unfinished work before choosing the next task
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

ccboard

免费

Launch a terminal or web dashboard to inspect Claude Code activity across projects. Browse sessions, search messages, track token usage and estimated costs, and check MCP servers that connect external tools to the agent.

中文简介正在准备中。当前显示英语简介。

  • Checking daily usage and estimated costs
  • Searching past conversations across projects
  • Investigating MCP server status
FlorianBruniaux/claude-code-ultimate-guide62042026年10月18日 更新

查看 FlorianBruniaux 的全部技能

报告此技能的问题