[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71GNM64YQRTPV3V71DGQGSE":3,"skill-same:01M71GNM64YQRTPV3V71DGQGSE":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M71GNM64YQRTPV3V71DGQGSE","canary",null,"Post-deploy canary monitoring: watch the live app for console errors, slowdowns and page failures.","timurgaleev\u002Fvibestack","timurgaleev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F32696429?v=4","01M71GMS53Z9B4JQTCQEFXAE9E","Timur Galeev","01M71GMS5S1Q7BEYB3Z7GY3E85",8,"MIT","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Fskills\u002Fcanary\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"watch","deploy","console","deploy canary","post","check","monitor","page","for","live","write","read","monitoring","Bash","errors","app","2026-11-10 10:12:30",false,"---\nname: canary\ndescription: |\n  Post-deploy canary monitoring: watch the live app for console errors, slowdowns and page failures.\nallowed-tools:\n  - Bash\n  - Read\n  - Write\n  - Glob\n  - AskUserQuestion\ntriggers:\n  - monitor after deploy\n  - canary check\n  - watch for errors post-deploy\n---\n\nIf this session was compacted, the copy of this skill in context may be cut off.\nRead `${CLAUDE_SKILL_DIR}\u002FSKILL.md` from disk and resume at the step you are on.\n\n## When to invoke\n\nUse when: \"monitor deploy\", \"canary\", \"post-deploy check\", \"watch production\", \"verify deploy\".\n\n## Preamble\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" 2>\u002Fdev\u002Fnull || SLUG=\"unknown\"\n_LEARN_FILE=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Flearnings.jsonl\"\nif [ -f \"$_LEARN_FILE\" ]; then\n  _LEARN_COUNT=$(wc -l \u003C \"$_LEARN_FILE\" 2>\u002Fdev\u002Fnull | tr -d ' ')\n  echo \"LEARNINGS: $_LEARN_COUNT entries loaded\"\n  if [ \"$_LEARN_COUNT\" -gt 5 ] 2>\u002Fdev\u002Fnull; then\n    \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-learnings-search\" --limit 5 2>\u002Fdev\u002Fnull || true\n  fi\nelse\n  echo \"LEARNINGS: none yet\"\nfi\n```\n\n{{include lib\u002Fsnippets\u002Fsession-host.md}}\n\n{{include lib\u002Fsnippets\u002Fdecision-brief.md}}\n\n{{include lib\u002Fsnippets\u002Fworking-protocols.md}}\n\n{{include lib\u002Fsnippets\u002Fstate-protocols.md}}\n\n## SETUP\n\n{{include lib\u002Fsnippets\u002Fbrowse-detect.md}}\n\n## Step 0: Detect platform and base branch\n\nFirst, detect the git hosting platform from the remote URL:\n\n```bash\ngit remote get-url origin 2>\u002Fdev\u002Fnull\n```\n\n- If the URL contains \"github.com\" → platform is **GitHub**\n- If the URL contains \"gitlab\" → platform is **GitLab**\n- Otherwise, check CLI availability:\n  - `gh auth status 2>\u002Fdev\u002Fnull` succeeds → platform is **GitHub** (covers GitHub Enterprise)\n  - `glab auth status 2>\u002Fdev\u002Fnull` succeeds → platform is **GitLab** (covers self-hosted)\n  - Neither → **unknown** (use git-native commands only)\n\nDetermine which branch this PR\u002FMR targets, or the repo's default branch if no\nPR\u002FMR exists. Use the result as \"the base branch\" in all subsequent steps.\n\n**If GitHub:**\n1. `gh pr view --json baseRefName -q .baseRefName` — if succeeds, use it\n2. `gh repo view --json defaultBranchRef -q .defaultBranchRef.name` — if succeeds, use it\n\n**If GitLab:**\n1. `glab mr view -F json 2>\u002Fdev\u002Fnull` and extract the `target_branch` field — if succeeds, use it\n2. `glab repo view -F json 2>\u002Fdev\u002Fnull` and extract the `default_branch` field — if succeeds, use it\n\n{{include lib\u002Fsnippets\u002Fbase-branch-detect.md}}\n\n\u002Fcanary reads no diff, so a `BASE_CONTAINS_HEAD` line (a merged branch still checked\nout) is not a stop here: take the base from its `origin\u002F\u003Cname>`, say so in one line,\nand carry on.\n\nPrint the detected base branch name. In every subsequent `git diff`, `git log`,\n`git fetch`, `git merge`, and PR\u002FMR creation command, substitute the detected\nbranch name wherever the instructions say \"the base branch\" or `\u003Cdefault>`.\n\n---\n\n# \u002Fcanary — Post-Deploy Visual Monitor\n\nYou are a **Release Reliability Engineer** watching production after a deploy. You've seen deploys that pass CI but break in production — a missing environment variable, a CDN cache serving stale assets, a database migration that's slower than expected on real data. Your job is to catch these in the first 10 minutes, not 10 hours.\n\nYou use the browse daemon to watch the live app, take screenshots, check console errors, and compare against baselines. You are the safety net between \"shipped\" and \"verified.\"\n\n## User-invocable\nWhen the user types `\u002Fcanary`, run this skill.\n\n## Arguments\n- `\u002Fcanary \u003Curl>` — monitor a URL for 10 minutes after deploy\n- `\u002Fcanary \u003Curl> --duration 5m` — custom monitoring duration (1m to 30m)\n- `\u002Fcanary \u003Curl> --baseline` — capture baseline screenshots (run BEFORE deploying)\n- `\u002Fcanary \u003Curl> --pages \u002F,\u002Fdashboard,\u002Fsettings` — specify pages to monitor\n- `\u002Fcanary \u003Curl> --quick` — single-pass health check (no continuous monitoring)\n- `\u002Fcanary \u003Curl> --sse \u003Cendpoint-url>` — also probe a server-sent events endpoint for its first event\n\n## Instructions\n\n### Phase 1: Setup\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull || echo \"SLUG=unknown\")\"\nmkdir -p .vibestack\u002Fcanary-reports\nmkdir -p .vibestack\u002Fcanary-reports\u002Fbaselines\nmkdir -p .vibestack\u002Fcanary-reports\u002Fscreenshots\n```\n\nParse the user's arguments. Default duration is 10 minutes. Default pages: auto-discover from the app's navigation.\n\n### Phase 2: Baseline Capture (--baseline mode)\n\nIf the user passed `--baseline`, capture the current state BEFORE deploying.\n\nThe browse console buffer is shared across every page and every check, and only\n`console --clear` empties it — navigation does not. Every block below that reads\n`console --errors` therefore clears the buffer first, so the errors it reports belong\nto that one page load. `--errors` also returns warnings: keep only lines tagged\n`[error]` and drop `[warning]` lines before any comparison. Each line reads\n`[\u003Ctimestamp>] [error] \u003Cmessage>`; store and compare only `\u003Cmessage>` — the timestamp\ndiffers on every load, so keeping it would make every error look new.\n\nFor each page (either from `--pages` or the homepage):\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.png\"\n$B console --errors\n$B perf\n$B text > \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.txt\"\n$B links\n```\n\nThen run the link check (below) on the `links` output, and the asset and stream\nprobes (below).\n\nCollect for each page: the screenshot path, the list of `[error]` message strings (the\nmessages themselves, not a count), the broken links, the saved text snapshot path and\nthe page load time from `perf`. A baseline that already serves HTML for an asset, or an\nSSE endpoint that already sends no first event, is reported to the user at capture time\n— it is a live failure, not a reference to compare against.\n\nSave the baseline manifest to `.vibestack\u002Fcanary-reports\u002Fbaseline.json`:\n\n```json\n{\n  \"url\": \"\u003Curl>\",\n  \"timestamp\": \"\u003CISO>\",\n  \"branch\": \"\u003Ccurrent branch>\",\n  \"pages\": {\n    \"\u002F\": {\n      \"screenshot\": \"baselines\u002Fhome.png\",\n      \"console_errors\": [\"Uncaught TypeError: x is undefined\"],\n      \"broken_links\": [\"https:\u002F\u002Fexample.com\u002Fold-pricing\"],\n      \"text_snapshot\": \"baselines\u002Fhome.txt\",\n      \"load_time_ms\": 450\n    }\n  }\n}\n```\n\nThen STOP and tell the user: \"Baseline captured. Deploy your changes, then run `\u002Fcanary \u003Curl>` to monitor.\"\n\n#### Link check\n\nUsed by Phase 2, Phase 4 and every round of Phase 5. From the `$B links` output keep\nsame-origin links only, and drop any URL whose path matches\n`logout|signout|delete|remove|cancel|unsubscribe` (case-insensitive). Filter BEFORE\nfetching anything: such links are never visited with `goto` or HEAD, because the\nbrowse session may carry imported cookies and a request to one of them changes real\nproduction state.\n\nWrite the filtered absolute URLs, one per line, to\n`.vibestack\u002Fcanary-reports\u002Flinks-\u003Cpage-name>.txt` with the Write tool, then:\n\n```bash\ngrep -Eiv '^[a-z]+:\u002F\u002F[^\u002F]+\u002F.*(logout|signout|delete|remove|cancel|unsubscribe)' \".vibestack\u002Fcanary-reports\u002Flinks-\u003Cpage-name>.txt\" | while IFS= read -r u; do\n  code=$(curl -sI -o \u002Fdev\u002Fnull -w '%{http_code}' \"$u\" 2>\u002Fdev\u002Fnull) || code=000\n  printf '%s %s\\n' \"$code\" \"$u\"\ndone\n```\n\n`404` or `410` is broken. Any other code outside 2xx\u002F3xx, or a curl failure (`000`), is\n`unknown` — report it, never alert on it.\n\n#### Asset and stream probes\n\nUsed by Phase 2 and every round of Phase 5: the asset probe per page, right after that\npage's `$B goto`; the SSE probe once per round. Both are absolute checks — a broken asset\nor a silent stream is a failure whatever the baseline held — but they still need 2\nconsecutive checks before an alert is confirmed.\n\n**Static-asset content type.** A single-page app whose server falls back to\n`index.html` answers a missing bundle with an HTML 200, so the status code looks fine\nwhile the page is dead. For every `\u003Cscript src>` and stylesheet `\u003Clink>` on the loaded\npage, send a HEAD from the page itself and read the content type:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B js \"Promise.all([...document.querySelectorAll('script[src],link[rel~=stylesheet][href]')].map(e=>{const u=e.src||e.href;const k=e.tagName==='SCRIPT'?'js':'css';return fetch(u,{method:'HEAD'}).then(r=>({url:u,kind:k,status:r.status,type:r.headers.get('content-type')})).catch(()=>({url:u,kind:k,status:0,type:null}))})).then(a=>JSON.stringify(a))\"\n```\n\nHEAD reads headers only and changes nothing. A `js` entry passes when its status is 2xx\nand its type names `javascript` or `ecmascript`; a `css` entry when its status is 2xx and\nits type names `text\u002Fcss`. The status decides first, whatever the type: a 404, 410 or\n5xx is a broken asset — HIGH. A 2xx whose type is `text\u002Fhtml` is an SPA fallback serving\nHTML for an asset — HIGH. Status `0` (a cross-origin asset whose server sends no CORS\nheaders, or a network error), a 401 or 403, and any other status or type are `unknown`:\nreport them, never alert on them.\n\n**SSE first event** — only when the user named an SSE endpoint with `--sse`. Never guess\none from the page. Write that URL, one line, to\n`.vibestack\u002Fcanary-reports\u002Fsse-url.txt` with the Write tool, then:\n\n```bash\nsse_url=$(head -n1 \".vibestack\u002Fcanary-reports\u002Fsse-url.txt\")\nhdr=\".vibestack\u002Fcanary-reports\u002Fsse-headers.txt\"\ncase \"$sse_url\" in\n  http:\u002F\u002F*|https:\u002F\u002F*)\n    : > \"$hdr\"\n    if curl -N -sS --max-time 10 -D \"$hdr\" -- \"$sse_url\" 2>\u002Fdev\u002Fnull | head -c 65536 | grep -q -m1 -E '^(event|data):'; then\n      echo \"SSE_FIRST_EVENT: yes\"\n    else\n      status=$(awk 'toupper($(1)) ~ \u002F^HTTP\\\u002F\u002F {s = $(2)} END {print s}' \"$hdr\")\n      case \"$status\" in\n        3[0-9][0-9]|401|403) echo \"SSE_FIRST_EVENT: unknown (HTTP $status)\" ;;\n        *) echo \"SSE_FIRST_EVENT: no\" ;;\n      esac\n    fi ;;\n  *) echo \"SSE_URL_INVALID: not an http(s) URL\" ;;\nesac\n```\n\nThe connection is bounded at 10 seconds and 64 KB. `SSE_FIRST_EVENT: no` — the stream\ndid not connect, or sent no `event:` or `data:` line inside those bounds — is CRITICAL.\n`SSE_FIRST_EVENT: unknown` — a redirect, 401 or 403 — means the stream wants a login the\nprobe cannot send: curl carries none of the browse session's cookies. Report it once,\nnever alert on it, the same as an `unknown` link. `SSE_URL_INVALID` is not a probe result: tell the user and skip the SSE probe.\n\n### Phase 3: Page Discovery\n\nIf no `--pages` were specified, auto-discover pages to monitor:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B goto \u003Curl>\n$B links\n$B snapshot -i\n```\n\nFrom the `links` output keep same-origin links only and drop any URL whose path matches\n`logout|signout|delete|remove|cancel|unsubscribe` (case-insensitive) before building the\nlist — those pages are never proposed and never visited, because an imported session\nwould change real production state. Take the top 5 internal navigation links from the\nfiltered set. Always include the homepage. Present the page list via AskUserQuestion:\n\n- **Context:** Monitoring the production site at the given URL after a deploy.\n- **Question:** Which pages should the canary monitor?\n- **RECOMMENDATION:** Choose A — these are the main navigation targets.\n- A) Monitor these pages: [list the filtered pages]\n- B) Add more pages (user specifies)\n- C) Monitor homepage only (quick check)\n\n### Phase 4: Monitoring-Start Reference (if no baseline exists)\n\nIf no `baseline.json` exists, take a snapshot now as the monitoring-start reference. It\nis taken after the deploy, not before it: an error the deploy already introduced is in\nit and will never read as new. The report says so (see Phase 6).\n\nFor each page to monitor:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002Fpre-\u003Cpage-name>.png\"\n$B console --errors\n$B perf\n$B text > \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002Fpre-\u003Cpage-name>.txt\"\n$B links\n```\n\nRun the link check on the `links` output. Collect the same fields as the baseline\n(`screenshot`, `console_errors` as the list of `[error]` messages, `broken_links`,\n`text_snapshot`, `load_time_ms`) and write them in the same shape to\n`.vibestack\u002Fcanary-reports\u002Fpre-monitor.json`. Never write this snapshot to\n`baseline.json`. It is the reference for detecting regressions during monitoring.\n\n### Phase 5: Continuous Monitoring Loop\n\nMonitor for the specified duration in rounds; each round checks every page:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002F\u003Cpage-name>-\u003Ccheck-number>.png\"\n$B console --errors\n$B perf\n$B links\n```\n\nRun the link check on the `links` output and the asset and stream probes. Keep only\n`[error]` console lines.\n\n**Cadence.** Before the first round, record the start time and the deadline (start plus\nthe duration) with `date -u +%s`, and note each round's start and end the same way.\nAfter a round, wait `max(0, 60 − \u003Cround seconds>)` seconds in a bounded background wait —\nforeground `sleep` is blocked on some hosts, so run the `sleep` as a background command\nwhose timeout is a few seconds longer, and start the next round when it exits.\nRounds never overlap: a round that took 60 seconds or more is followed straight away by\nthe next. Once the deadline has passed, finish the current round and stop; never start a\nround after it, except the one confirming round a pending CRITICAL or HIGH finding gets. The report gives the cadence actually achieved, not the nominal one.\n\nAfter each check, compare results against `baseline.json` (or `pre-monitor.json`):\n\n1. **Page load failure** — `goto` returns error or timeout → CRITICAL ALERT\n2. **New console errors** — an `[error]` message not in the page's `console_errors` list → HIGH ALERT\n3. **Performance regression** — load time exceeds 2x baseline → MEDIUM ALERT\n4. **Broken links** — a 404\u002F410 URL not in the page's `broken_links` list → LOW ALERT\n5. **Broken asset** — a script or stylesheet URL answering 404, 410 or 5xx, or 2xx with\n   `text\u002Fhtml` → HIGH ALERT\n6. **SSE stream silent** — `SSE_FIRST_EVENT: no` for an endpoint named with `--sse` → CRITICAL ALERT\n\n**Alert on changes, not absolutes** (items 5 and 6 excepted — they are absolute checks). Errors are compared by message, not by count. A page whose baseline holds 3 error messages is fine if it still shows those 3. One NEW message is an alert, even if another one went away.\n\n**Don't cry wolf.** Only alert on patterns that persist across 2 or more consecutive checks. A single transient network blip is not an alert.\n\n**Notify once confirmed.** A CRITICAL or HIGH finding reaches the user only when it is\nconfirmed on two consecutive checks. A first occurrence is **pending**: record its time,\npage and evidence, say nothing, and run the next check; if that check clears it, it goes\nunder `observations`. A finding still pending at the deadline gets one more confirming round,\nso a short run can still alert. Under `--quick` there is no second check:\nreport each CRITICAL or HIGH finding of the single pass as a finding and set the status\nfrom it. On confirmation, notify via AskUserQuestion:\n\n```\nCANARY ALERT\n════════════\nTime:     [timestamp, e.g., confirmed on check #4 at 240s]\nSeen:     [check #3 and check #4]\nPage:     [page URL]\nType:     [CRITICAL \u002F HIGH]\nFinding:  [what changed — be specific]\nEvidence: [screenshot path]\nBaseline: [baseline value]\nCurrent:  [current value]\n```\n\n- **Context:** Canary monitoring detected an issue on [page] after [duration].\n- **RECOMMENDATION:** Choose based on severity — A for CRITICAL, B to keep watching a HIGH.\n- A) Investigate now — stop monitoring, focus on this issue\n- B) Continue monitoring — watch whether it clears\n- C) Rollback — revert the deploy immediately\n- D) Dismiss — false positive, continue monitoring\n\n### Phase 6: Health Report\n\nAn alert is **confirmed** once it is seen on 2 or more consecutive checks. Derive the\nstatus from confirmed alerts only:\n\n- **BROKEN** — any CRITICAL alert was confirmed\n- **DEGRADED** — any other alert was confirmed\n- **HEALTHY** — no alert was confirmed\n\nA confirmed alert that later clears stays in the report with `resolved: true`; it still\ncounts toward the status. A finding that clears and comes back — seen on 3 or more checks,\nnever twice in a row — confirms as **intermittent**: it counts toward the status like any\nconfirmed alert, and the report lists the checks it appeared on. Findings seen on a single\ncheck never confirm — they go under `observations`. Under `--quick` the single pass is the whole run: its findings count as\nconfirmed for the status (a CRITICAL makes it BROKEN), and the report says they were seen once.\n\nAfter monitoring completes (or if the user stops early), produce a summary:\n\n```\nCANARY REPORT — [url]\n═════════════════════\nDuration:     [X minutes]\nPages:        [N pages monitored]\nChecks:       [N total checks performed]\nCadence:      [N rounds, mean interval between round starts Xs]\nReference:    [baseline.json from \u003Ctimestamp> \u002F monitoring-start reference]\nStatus:       [HEALTHY \u002F DEGRADED \u002F BROKEN]\n\nPer-Page Results:\n─────────────────────────────────────────────────────\n  Page            Status      Errors    Avg Load\n  \u002F               HEALTHY     0         450ms\n  \u002Fdashboard      DEGRADED    2 new     1200ms (was 400ms)\n  \u002Fsettings       HEALTHY     0         380ms\n\nAlerts Fired:  [N] (X critical, Y high, Z medium)\nScreenshots:   .vibestack\u002Fcanary-reports\u002Fscreenshots\u002F\n\nVERDICT: [DEPLOY IS HEALTHY \u002F DEPLOY HAS ISSUES — details above]\n```\n\nWith the monitoring-start reference, add one line under `Reference:`: \"Errors already\npresent when monitoring started cannot be detected without `--baseline`.\"\n\nSave report to `.vibestack\u002Fcanary-reports\u002F{date}-canary.md` and `.vibestack\u002Fcanary-reports\u002F{date}-canary.json`. The JSON report has this shape:\n\n```json\n{\n  \"skill\": \"canary\",\n  \"timestamp\": \"\u003CISO>\",\n  \"url\": \"\u003Curl>\",\n  \"duration_min\": 10,\n  \"status\": \"DEGRADED\",\n  \"pages\": {\n    \"\u002Fdashboard\": {\n      \"checks\": 10,\n      \"new_errors\": [\"Uncaught TypeError: x is undefined\"],\n      \"new_404s\": [\"https:\u002F\u002Fexample.com\u002Fold-pricing\"],\n      \"load_avg_ms\": 1200,\n      \"load_baseline_ms\": 400\n    }\n  },\n  \"alerts\": [\n    {\n      \"type\": \"new_console_error\",\n      \"page\": \"\u002Fdashboard\",\n      \"severity\": \"HIGH\",\n      \"first_seen\": \"\u003CISO>\",\n      \"confirmed_at\": \"\u003CISO>\",\n      \"resolved\": false,\n      \"evidence\": \"screenshots\u002Fdashboard-3.png\"\n    }\n  ],\n  \"observations\": [\"transient findings that never confirmed\"]\n}\n```\n\nLog the result for the review dashboard by appending one line to the project's canary\nhistory. The line holds model-authored summary fields only — `skill`, `timestamp`,\n`status`, `url`, `duration_min`, `alerts` (the confirmed alert count) — never page text.\nThe file is appended to, never overwritten:\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull || echo SLUG=unknown)\"\n_H=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\"\nmkdir -p \"$_H\"\nprintf '%s\\n' '{\"skill\":\"canary\",\"timestamp\":\"\u003CISO>\",\"status\":\"\u003CHEALTHY\u002FDEGRADED\u002FBROKEN>\",\"url\":\"\u003Curl>\",\"duration_min\":\u003CN>,\"alerts\":\u003CN>}' >> \"$_H\u002Fcanary-history.jsonl\"\n```\n\n### Phase 7: Baseline Update\n\nIf the deploy is healthy, offer to update the baseline:\n\n- **Context:** Canary monitoring completed. The deploy is healthy.\n- **RECOMMENDATION:** Choose A — deploy is healthy, new baseline reflects current production.\n- A) Update baseline with current screenshots\n- B) Keep old baseline\n\nIf the user chooses A, copy the latest screenshots to the baselines directory and save each page's current text:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B goto \u003Cpage-url>\n$B text > \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.txt\"\n```\n\nThen rewrite `baseline.json` with the full field set per page: `screenshot`, `console_errors` (the current `[error]` messages), `broken_links`, `text_snapshot` and `load_time_ms`.\n\n{{include lib\u002Fsnippets\u002Fcapture-learnings.md}}\nCanary runs learn things nothing else sees — which page is slow only under real traffic,\nwhich console error the CDN produces after every deploy, which route needs a warm-up\nrequest before it answers. Log those, so the next canary starts with the last one's map\ninstead of a blank baseline.\n\n## Important Rules\n\n- **Speed matters.** Start monitoring as soon as the pages are chosen. Don't over-analyze before monitoring.\n- **Alert on changes, not absolutes.** Compare against baseline, not industry standards.\n- **Screenshots are evidence.** Every alert includes a screenshot path. No exceptions.\n- **Transient tolerance.** Only alert on patterns that persist across 2+ consecutive checks.\n- **Baseline is king.** Without a baseline, canary is a health check. Encourage `--baseline` before deploying.\n- **Performance thresholds are relative.** 2x baseline is a regression. 1.5x might be normal variance.\n- **Read-only.** Observe and report. Don't modify code unless the user explicitly asks to investigate and fix.\n","If this session was compacted, the copy of this skill in context may be cut off.\nRead `${CLAUDE_SKILL_DIR}\u002FSKILL.md` from disk and resume at the step you are on.\n\n## When to invoke\n\nUse when: \"monitor deploy\", \"canary\", \"post-deploy check\", \"watch production\", \"verify deploy\".\n\n## Preamble\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" 2>\u002Fdev\u002Fnull || SLUG=\"unknown\"\n_LEARN_FILE=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Flearnings.jsonl\"\nif [ -f \"$_LEARN_FILE\" ]; then\n  _LEARN_COUNT=$(wc -l \u003C \"$_LEARN_FILE\" 2>\u002Fdev\u002Fnull | tr -d ' ')\n  echo \"LEARNINGS: $_LEARN_COUNT entries loaded\"\n  if [ \"$_LEARN_COUNT\" -gt 5 ] 2>\u002Fdev\u002Fnull; then\n    \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-learnings-search\" --limit 5 2>\u002Fdev\u002Fnull || true\n  fi\nelse\n  echo \"LEARNINGS: none yet\"\nfi\n```\n\n{{include lib\u002Fsnippets\u002Fsession-host.md}}\n\n{{include lib\u002Fsnippets\u002Fdecision-brief.md}}\n\n{{include lib\u002Fsnippets\u002Fworking-protocols.md}}\n\n{{include lib\u002Fsnippets\u002Fstate-protocols.md}}\n\n## SETUP\n\n{{include lib\u002Fsnippets\u002Fbrowse-detect.md}}\n\n## Step 0: Detect platform and base branch\n\nFirst, detect the git hosting platform from the remote URL:\n\n```bash\ngit remote get-url origin 2>\u002Fdev\u002Fnull\n```\n\n- If the URL contains \"github.com\" → platform is **GitHub**\n- If the URL contains \"gitlab\" → platform is **GitLab**\n- Otherwise, check CLI availability:\n  - `gh auth status 2>\u002Fdev\u002Fnull` succeeds → platform is **GitHub** (covers GitHub Enterprise)\n  - `glab auth status 2>\u002Fdev\u002Fnull` succeeds → platform is **GitLab** (covers self-hosted)\n  - Neither → **unknown** (use git-native commands only)\n\nDetermine which branch this PR\u002FMR targets, or the repo's default branch if no\nPR\u002FMR exists. Use the result as \"the base branch\" in all subsequent steps.\n\n**If GitHub:**\n1. `gh pr view --json baseRefName -q .baseRefName` — if succeeds, use it\n2. `gh repo view --json defaultBranchRef -q .defaultBranchRef.name` — if succeeds, use it\n\n**If GitLab:**\n1. `glab mr view -F json 2>\u002Fdev\u002Fnull` and extract the `target_branch` field — if succeeds, use it\n2. `glab repo view -F json 2>\u002Fdev\u002Fnull` and extract the `default_branch` field — if succeeds, use it\n\n{{include lib\u002Fsnippets\u002Fbase-branch-detect.md}}\n\n\u002Fcanary reads no diff, so a `BASE_CONTAINS_HEAD` line (a merged branch still checked\nout) is not a stop here: take the base from its `origin\u002F\u003Cname>`, say so in one line,\nand carry on.\n\nPrint the detected base branch name. In every subsequent `git diff`, `git log`,\n`git fetch`, `git merge`, and PR\u002FMR creation command, substitute the detected\nbranch name wherever the instructions say \"the base branch\" or `\u003Cdefault>`.\n\n---\n\n# \u002Fcanary — Post-Deploy Visual Monitor\n\nYou are a **Release Reliability Engineer** watching production after a deploy. You've seen deploys that pass CI but break in production — a missing environment variable, a CDN cache serving stale assets, a database migration that's slower than expected on real data. Your job is to catch these in the first 10 minutes, not 10 hours.\n\nYou use the browse daemon to watch the live app, take screenshots, check console errors, and compare against baselines. You are the safety net between \"shipped\" and \"verified.\"\n\n## User-invocable\nWhen the user types `\u002Fcanary`, run this skill.\n\n## Arguments\n- `\u002Fcanary \u003Curl>` — monitor a URL for 10 minutes after deploy\n- `\u002Fcanary \u003Curl> --duration 5m` — custom monitoring duration (1m to 30m)\n- `\u002Fcanary \u003Curl> --baseline` — capture baseline screenshots (run BEFORE deploying)\n- `\u002Fcanary \u003Curl> --pages \u002F,\u002Fdashboard,\u002Fsettings` — specify pages to monitor\n- `\u002Fcanary \u003Curl> --quick` — single-pass health check (no continuous monitoring)\n- `\u002Fcanary \u003Curl> --sse \u003Cendpoint-url>` — also probe a server-sent events endpoint for its first event\n\n## Instructions\n\n### Phase 1: Setup\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull || echo \"SLUG=unknown\")\"\nmkdir -p .vibestack\u002Fcanary-reports\nmkdir -p .vibestack\u002Fcanary-reports\u002Fbaselines\nmkdir -p .vibestack\u002Fcanary-reports\u002Fscreenshots\n```\n\nParse the user's arguments. Default duration is 10 minutes. Default pages: auto-discover from the app's navigation.\n\n### Phase 2: Baseline Capture (--baseline mode)\n\nIf the user passed `--baseline`, capture the current state BEFORE deploying.\n\nThe browse console buffer is shared across every page and every check, and only\n`console --clear` empties it — navigation does not. Every block below that reads\n`console --errors` therefore clears the buffer first, so the errors it reports belong\nto that one page load. `--errors` also returns warnings: keep only lines tagged\n`[error]` and drop `[warning]` lines before any comparison. Each line reads\n`[\u003Ctimestamp>] [error] \u003Cmessage>`; store and compare only `\u003Cmessage>` — the timestamp\ndiffers on every load, so keeping it would make every error look new.\n\nFor each page (either from `--pages` or the homepage):\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.png\"\n$B console --errors\n$B perf\n$B text > \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.txt\"\n$B links\n```\n\nThen run the link check (below) on the `links` output, and the asset and stream\nprobes (below).\n\nCollect for each page: the screenshot path, the list of `[error]` message strings (the\nmessages themselves, not a count), the broken links, the saved text snapshot path and\nthe page load time from `perf`. A baseline that already serves HTML for an asset, or an\nSSE endpoint that already sends no first event, is reported to the user at capture time\n— it is a live failure, not a reference to compare against.\n\nSave the baseline manifest to `.vibestack\u002Fcanary-reports\u002Fbaseline.json`:\n\n```json\n{\n  \"url\": \"\u003Curl>\",\n  \"timestamp\": \"\u003CISO>\",\n  \"branch\": \"\u003Ccurrent branch>\",\n  \"pages\": {\n    \"\u002F\": {\n      \"screenshot\": \"baselines\u002Fhome.png\",\n      \"console_errors\": [\"Uncaught TypeError: x is undefined\"],\n      \"broken_links\": [\"https:\u002F\u002Fexample.com\u002Fold-pricing\"],\n      \"text_snapshot\": \"baselines\u002Fhome.txt\",\n      \"load_time_ms\": 450\n    }\n  }\n}\n```\n\nThen STOP and tell the user: \"Baseline captured. Deploy your changes, then run `\u002Fcanary \u003Curl>` to monitor.\"\n\n#### Link check\n\nUsed by Phase 2, Phase 4 and every round of Phase 5. From the `$B links` output keep\nsame-origin links only, and drop any URL whose path matches\n`logout|signout|delete|remove|cancel|unsubscribe` (case-insensitive). Filter BEFORE\nfetching anything: such links are never visited with `goto` or HEAD, because the\nbrowse session may carry imported cookies and a request to one of them changes real\nproduction state.\n\nWrite the filtered absolute URLs, one per line, to\n`.vibestack\u002Fcanary-reports\u002Flinks-\u003Cpage-name>.txt` with the Write tool, then:\n\n```bash\ngrep -Eiv '^[a-z]+:\u002F\u002F[^\u002F]+\u002F.*(logout|signout|delete|remove|cancel|unsubscribe)' \".vibestack\u002Fcanary-reports\u002Flinks-\u003Cpage-name>.txt\" | while IFS= read -r u; do\n  code=$(curl -sI -o \u002Fdev\u002Fnull -w '%{http_code}' \"$u\" 2>\u002Fdev\u002Fnull) || code=000\n  printf '%s %s\\n' \"$code\" \"$u\"\ndone\n```\n\n`404` or `410` is broken. Any other code outside 2xx\u002F3xx, or a curl failure (`000`), is\n`unknown` — report it, never alert on it.\n\n#### Asset and stream probes\n\nUsed by Phase 2 and every round of Phase 5: the asset probe per page, right after that\npage's `$B goto`; the SSE probe once per round. Both are absolute checks — a broken asset\nor a silent stream is a failure whatever the baseline held — but they still need 2\nconsecutive checks before an alert is confirmed.\n\n**Static-asset content type.** A single-page app whose server falls back to\n`index.html` answers a missing bundle with an HTML 200, so the status code looks fine\nwhile the page is dead. For every `\u003Cscript src>` and stylesheet `\u003Clink>` on the loaded\npage, send a HEAD from the page itself and read the content type:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B js \"Promise.all([...document.querySelectorAll('script[src],link[rel~=stylesheet][href]')].map(e=>{const u=e.src||e.href;const k=e.tagName==='SCRIPT'?'js':'css';return fetch(u,{method:'HEAD'}).then(r=>({url:u,kind:k,status:r.status,type:r.headers.get('content-type')})).catch(()=>({url:u,kind:k,status:0,type:null}))})).then(a=>JSON.stringify(a))\"\n```\n\nHEAD reads headers only and changes nothing. A `js` entry passes when its status is 2xx\nand its type names `javascript` or `ecmascript`; a `css` entry when its status is 2xx and\nits type names `text\u002Fcss`. The status decides first, whatever the type: a 404, 410 or\n5xx is a broken asset — HIGH. A 2xx whose type is `text\u002Fhtml` is an SPA fallback serving\nHTML for an asset — HIGH. Status `0` (a cross-origin asset whose server sends no CORS\nheaders, or a network error), a 401 or 403, and any other status or type are `unknown`:\nreport them, never alert on them.\n\n**SSE first event** — only when the user named an SSE endpoint with `--sse`. Never guess\none from the page. Write that URL, one line, to\n`.vibestack\u002Fcanary-reports\u002Fsse-url.txt` with the Write tool, then:\n\n```bash\nsse_url=$(head -n1 \".vibestack\u002Fcanary-reports\u002Fsse-url.txt\")\nhdr=\".vibestack\u002Fcanary-reports\u002Fsse-headers.txt\"\ncase \"$sse_url\" in\n  http:\u002F\u002F*|https:\u002F\u002F*)\n    : > \"$hdr\"\n    if curl -N -sS --max-time 10 -D \"$hdr\" -- \"$sse_url\" 2>\u002Fdev\u002Fnull | head -c 65536 | grep -q -m1 -E '^(event|data):'; then\n      echo \"SSE_FIRST_EVENT: yes\"\n    else\n      status=$(awk 'toupper($(1)) ~ \u002F^HTTP\\\u002F\u002F {s = $(2)} END {print s}' \"$hdr\")\n      case \"$status\" in\n        3[0-9][0-9]|401|403) echo \"SSE_FIRST_EVENT: unknown (HTTP $status)\" ;;\n        *) echo \"SSE_FIRST_EVENT: no\" ;;\n      esac\n    fi ;;\n  *) echo \"SSE_URL_INVALID: not an http(s) URL\" ;;\nesac\n```\n\nThe connection is bounded at 10 seconds and 64 KB. `SSE_FIRST_EVENT: no` — the stream\ndid not connect, or sent no `event:` or `data:` line inside those bounds — is CRITICAL.\n`SSE_FIRST_EVENT: unknown` — a redirect, 401 or 403 — means the stream wants a login the\nprobe cannot send: curl carries none of the browse session's cookies. Report it once,\nnever alert on it, the same as an `unknown` link. `SSE_URL_INVALID` is not a probe result: tell the user and skip the SSE probe.\n\n### Phase 3: Page Discovery\n\nIf no `--pages` were specified, auto-discover pages to monitor:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B goto \u003Curl>\n$B links\n$B snapshot -i\n```\n\nFrom the `links` output keep same-origin links only and drop any URL whose path matches\n`logout|signout|delete|remove|cancel|unsubscribe` (case-insensitive) before building the\nlist — those pages are never proposed and never visited, because an imported session\nwould change real production state. Take the top 5 internal navigation links from the\nfiltered set. Always include the homepage. Present the page list via AskUserQuestion:\n\n- **Context:** Monitoring the production site at the given URL after a deploy.\n- **Question:** Which pages should the canary monitor?\n- **RECOMMENDATION:** Choose A — these are the main navigation targets.\n- A) Monitor these pages: [list the filtered pages]\n- B) Add more pages (user specifies)\n- C) Monitor homepage only (quick check)\n\n### Phase 4: Monitoring-Start Reference (if no baseline exists)\n\nIf no `baseline.json` exists, take a snapshot now as the monitoring-start reference. It\nis taken after the deploy, not before it: an error the deploy already introduced is in\nit and will never read as new. The report says so (see Phase 6).\n\nFor each page to monitor:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002Fpre-\u003Cpage-name>.png\"\n$B console --errors\n$B perf\n$B text > \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002Fpre-\u003Cpage-name>.txt\"\n$B links\n```\n\nRun the link check on the `links` output. Collect the same fields as the baseline\n(`screenshot`, `console_errors` as the list of `[error]` messages, `broken_links`,\n`text_snapshot`, `load_time_ms`) and write them in the same shape to\n`.vibestack\u002Fcanary-reports\u002Fpre-monitor.json`. Never write this snapshot to\n`baseline.json`. It is the reference for detecting regressions during monitoring.\n\n### Phase 5: Continuous Monitoring Loop\n\nMonitor for the specified duration in rounds; each round checks every page:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B console --clear\n$B goto \u003Cpage-url>\n$B snapshot -i -a -o \".vibestack\u002Fcanary-reports\u002Fscreenshots\u002F\u003Cpage-name>-\u003Ccheck-number>.png\"\n$B console --errors\n$B perf\n$B links\n```\n\nRun the link check on the `links` output and the asset and stream probes. Keep only\n`[error]` console lines.\n\n**Cadence.** Before the first round, record the start time and the deadline (start plus\nthe duration) with `date -u +%s`, and note each round's start and end the same way.\nAfter a round, wait `max(0, 60 − \u003Cround seconds>)` seconds in a bounded background wait —\nforeground `sleep` is blocked on some hosts, so run the `sleep` as a background command\nwhose timeout is a few seconds longer, and start the next round when it exits.\nRounds never overlap: a round that took 60 seconds or more is followed straight away by\nthe next. Once the deadline has passed, finish the current round and stop; never start a\nround after it, except the one confirming round a pending CRITICAL or HIGH finding gets. The report gives the cadence actually achieved, not the nominal one.\n\nAfter each check, compare results against `baseline.json` (or `pre-monitor.json`):\n\n1. **Page load failure** — `goto` returns error or timeout → CRITICAL ALERT\n2. **New console errors** — an `[error]` message not in the page's `console_errors` list → HIGH ALERT\n3. **Performance regression** — load time exceeds 2x baseline → MEDIUM ALERT\n4. **Broken links** — a 404\u002F410 URL not in the page's `broken_links` list → LOW ALERT\n5. **Broken asset** — a script or stylesheet URL answering 404, 410 or 5xx, or 2xx with\n   `text\u002Fhtml` → HIGH ALERT\n6. **SSE stream silent** — `SSE_FIRST_EVENT: no` for an endpoint named with `--sse` → CRITICAL ALERT\n\n**Alert on changes, not absolutes** (items 5 and 6 excepted — they are absolute checks). Errors are compared by message, not by count. A page whose baseline holds 3 error messages is fine if it still shows those 3. One NEW message is an alert, even if another one went away.\n\n**Don't cry wolf.** Only alert on patterns that persist across 2 or more consecutive checks. A single transient network blip is not an alert.\n\n**Notify once confirmed.** A CRITICAL or HIGH finding reaches the user only when it is\nconfirmed on two consecutive checks. A first occurrence is **pending**: record its time,\npage and evidence, say nothing, and run the next check; if that check clears it, it goes\nunder `observations`. A finding still pending at the deadline gets one more confirming round,\nso a short run can still alert. Under `--quick` there is no second check:\nreport each CRITICAL or HIGH finding of the single pass as a finding and set the status\nfrom it. On confirmation, notify via AskUserQuestion:\n\n```\nCANARY ALERT\n════════════\nTime:     [timestamp, e.g., confirmed on check #4 at 240s]\nSeen:     [check #3 and check #4]\nPage:     [page URL]\nType:     [CRITICAL \u002F HIGH]\nFinding:  [what changed — be specific]\nEvidence: [screenshot path]\nBaseline: [baseline value]\nCurrent:  [current value]\n```\n\n- **Context:** Canary monitoring detected an issue on [page] after [duration].\n- **RECOMMENDATION:** Choose based on severity — A for CRITICAL, B to keep watching a HIGH.\n- A) Investigate now — stop monitoring, focus on this issue\n- B) Continue monitoring — watch whether it clears\n- C) Rollback — revert the deploy immediately\n- D) Dismiss — false positive, continue monitoring\n\n### Phase 6: Health Report\n\nAn alert is **confirmed** once it is seen on 2 or more consecutive checks. Derive the\nstatus from confirmed alerts only:\n\n- **BROKEN** — any CRITICAL alert was confirmed\n- **DEGRADED** — any other alert was confirmed\n- **HEALTHY** — no alert was confirmed\n\nA confirmed alert that later clears stays in the report with `resolved: true`; it still\ncounts toward the status. A finding that clears and comes back — seen on 3 or more checks,\nnever twice in a row — confirms as **intermittent**: it counts toward the status like any\nconfirmed alert, and the report lists the checks it appeared on. Findings seen on a single\ncheck never confirm — they go under `observations`. Under `--quick` the single pass is the whole run: its findings count as\nconfirmed for the status (a CRITICAL makes it BROKEN), and the report says they were seen once.\n\nAfter monitoring completes (or if the user stops early), produce a summary:\n\n```\nCANARY REPORT — [url]\n═════════════════════\nDuration:     [X minutes]\nPages:        [N pages monitored]\nChecks:       [N total checks performed]\nCadence:      [N rounds, mean interval between round starts Xs]\nReference:    [baseline.json from \u003Ctimestamp> \u002F monitoring-start reference]\nStatus:       [HEALTHY \u002F DEGRADED \u002F BROKEN]\n\nPer-Page Results:\n─────────────────────────────────────────────────────\n  Page            Status      Errors    Avg Load\n  \u002F               HEALTHY     0         450ms\n  \u002Fdashboard      DEGRADED    2 new     1200ms (was 400ms)\n  \u002Fsettings       HEALTHY     0         380ms\n\nAlerts Fired:  [N] (X critical, Y high, Z medium)\nScreenshots:   .vibestack\u002Fcanary-reports\u002Fscreenshots\u002F\n\nVERDICT: [DEPLOY IS HEALTHY \u002F DEPLOY HAS ISSUES — details above]\n```\n\nWith the monitoring-start reference, add one line under `Reference:`: \"Errors already\npresent when monitoring started cannot be detected without `--baseline`.\"\n\nSave report to `.vibestack\u002Fcanary-reports\u002F{date}-canary.md` and `.vibestack\u002Fcanary-reports\u002F{date}-canary.json`. The JSON report has this shape:\n\n```json\n{\n  \"skill\": \"canary\",\n  \"timestamp\": \"\u003CISO>\",\n  \"url\": \"\u003Curl>\",\n  \"duration_min\": 10,\n  \"status\": \"DEGRADED\",\n  \"pages\": {\n    \"\u002Fdashboard\": {\n      \"checks\": 10,\n      \"new_errors\": [\"Uncaught TypeError: x is undefined\"],\n      \"new_404s\": [\"https:\u002F\u002Fexample.com\u002Fold-pricing\"],\n      \"load_avg_ms\": 1200,\n      \"load_baseline_ms\": 400\n    }\n  },\n  \"alerts\": [\n    {\n      \"type\": \"new_console_error\",\n      \"page\": \"\u002Fdashboard\",\n      \"severity\": \"HIGH\",\n      \"first_seen\": \"\u003CISO>\",\n      \"confirmed_at\": \"\u003CISO>\",\n      \"resolved\": false,\n      \"evidence\": \"screenshots\u002Fdashboard-3.png\"\n    }\n  ],\n  \"observations\": [\"transient findings that never confirmed\"]\n}\n```\n\nLog the result for the review dashboard by appending one line to the project's canary\nhistory. The line holds model-authored summary fields only — `skill`, `timestamp`,\n`status`, `url`, `duration_min`, `alerts` (the confirmed alert count) — never page text.\nThe file is appended to, never overwritten:\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull || echo SLUG=unknown)\"\n_H=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\"\nmkdir -p \"$_H\"\nprintf '%s\\n' '{\"skill\":\"canary\",\"timestamp\":\"\u003CISO>\",\"status\":\"\u003CHEALTHY\u002FDEGRADED\u002FBROKEN>\",\"url\":\"\u003Curl>\",\"duration_min\":\u003CN>,\"alerts\":\u003CN>}' >> \"$_H\u002Fcanary-history.jsonl\"\n```\n\n### Phase 7: Baseline Update\n\nIf the deploy is healthy, offer to update the baseline:\n\n- **Context:** Canary monitoring completed. The deploy is healthy.\n- **RECOMMENDATION:** Choose A — deploy is healthy, new baseline reflects current production.\n- A) Update baseline with current screenshots\n- B) Keep old baseline\n\nIf the user chooses A, copy the latest screenshots to the baselines directory and save each page's current text:\n\n```bash\nB='\u003CBROWSE_BIN>'\n$B goto \u003Cpage-url>\n$B text > \".vibestack\u002Fcanary-reports\u002Fbaselines\u002F\u003Cpage-name>.txt\"\n```\n\nThen rewrite `baseline.json` with the full field set per page: `screenshot`, `console_errors` (the current `[error]` messages), `broken_links`, `text_snapshot` and `load_time_ms`.\n\n{{include lib\u002Fsnippets\u002Fcapture-learnings.md}}\nCanary runs learn things nothing else sees — which page is slow only under real traffic,\nwhich console error the CDN produces after every deploy, which route needs a warm-up\nrequest before it answers. Log those, so the next canary starts with the last one's map\ninstead of a blank baseline.\n\n## Important Rules\n\n- **Speed matters.** Start monitoring as soon as the pages are chosen. Don't over-analyze before monitoring.\n- **Alert on changes, not absolutes.** Compare against baseline, not industry standards.\n- **Screenshots are evidence.** Every alert includes a screenshot path. No exceptions.\n- **Transient tolerance.** Only alert on patterns that persist across 2+ consecutive checks.\n- **Baseline is king.** Without a baseline, canary is a health check. Encourage `--baseline` before deploying.\n- **Performance thresholds are relative.** 2x baseline is a regression. 1.5x might be normal variance.\n- **Read-only.** Observe and report. Don't modify code unless the user explicitly asks to investigate and fix.\n",{"name":5,"triggers":40,"description":44,"allowed-tools":45},[41,42,43],"monitor after deploy","canary check","watch for errors post-deploy","Post-deploy canary monitoring: watch the live app for console errors, slowdowns and page failures.\n",[32,46,47,48,49],"Read","Write","Glob","AskUserQuestion","main","777ec643a83c17a0955856b2eb7f596601709fda","skills\u002Fcanary",0,"https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack","https:\u002F\u002Fgithub.com\u002Ftimurgaleev","https:\u002F\u002Ftgaleev.com\u002F","Forward Deployed Engineer \u002F\r\nAWS Community Builder \u002F Cloud Architect ","2026-11-11 15:42:25",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add timurgaleev\u002Fvibestack --skill canary",{"tool":65,"command":66},"bunx","bunx skills add timurgaleev\u002Fvibestack --skill canary",{"tool":68,"command":69},"pnpm","pnpm dlx skills add timurgaleev\u002Fvibestack --skill canary","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Fskills\u002Fcanary\u002FSKILL.md",true,[],[74,80,86,92,98,104],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":35},"01M71GVHCCSQCCPVM8XPSPTA73","docs","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F15-backtick-info-string\u002Fskills\u002Fdocs\u002FSKILL.md",[],[76],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":35},"01M71GVFT1S5MRNM0AYRT2E6VQ","fences","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F14-indented-tilde-fence\u002Fskills\u002Ffences\u002FSKILL.md",[],[82],{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":35},"01M71GVEYB54K1S83FGRNKN8CF","dirty","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F10-check-with-drift\u002Fskills\u002Fdirty\u002FSKILL.md",[],[88],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":35},"01M71GVDX9PMND1337C4388DK4","clean","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F09-check-no-drift\u002Fskills\u002Fclean\u002FSKILL.md",[],[94],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":35},"01M71GVC3VM66F1ZQT2G8JXDR0","bare","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F08-no-frontmatter\u002Fskills\u002Fbare\u002FSKILL.md",[],[100],{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":35},"01M71GV9T8DAYZT0PX52QX0TE1","idem","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F07-idempotent-rerender\u002Fskills\u002Fidem\u002FSKILL.md",[],[106]]