[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AW8VJ1B6MHGRX7SBHC340X":3,"skill-same:01M7AW8VJ1B6MHGRX7SBHC340X":188},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":55},"01M7AW8VJ1B6MHGRX7SBHC340X","debug",null,"Quick debugging patterns and known production failure traps, including passkey, TOTP\u002F2FA, passwordless-account, session-freshness, reauthentication, and recovery-code failures. Use for common production and account-security issues.","barkleesanders\u002Fclaude-code-starter","barkleesanders","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30680901?v=4","01M7AW019CGBYWDA8MFJEN1JXC","Barklee Sanders","01M7AW01A5H994ASJ2QZPW67AV",4,"MIT","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: debug\nuser-invocable: true\ndescription: \"Quick debugging patterns and known production failure traps, including passkey, TOTP\u002F2FA, passwordless-account, session-freshness, reauthentication, and recovery-code failures. Use for common production and account-security issues.\"\nallowed-tools:\n  - Bash\n  - Read\n  - Edit\n  - Write\n  - Grep\n  - Glob\n  - Skill\nmodel: inherit\n---\n\n# \u002Fdebug - Debugging Quick Reference\n\n## Client lifecycle enforcement (mandatory)\n\nFor asynchronous report\u002Fdraft editing, AI category changes, photos, resubmission,\nbrowser resume, or client storage, read\n[Client lifecycle enforcement](..\u002Fshared\u002Fclient-lifecycle-enforcement.md).\nBehavioral regressions must run before commit and in the actual build\u002Frelease\npath. Prove broken variants block those entry points in an isolated copy; do\nnot claim instructions alone enforce safety. Fix and update confirmed bug\nrecords within the authorized scope, distinguishing committed from deployed.\n\n## IndexedDB submission recovery (mandatory)\n\nFor “database connection is closing”, `IDBDatabase.transaction`, or mobile\nsubmission-queue recovery, read [IndexedDB connection lifecycle](..\u002Fshared\u002Findexeddb-connection-lifecycle.md).\nExercise the real closed-connection path, all shared queue callers, normal submit\nand category-changed resubmit; preserve durable-before-send and never replay\nunknown network outcomes. Ship verifies the deployed queue with isolated storage.\n\n## GUI launch-job lifecycle (mandatory)\n\nBefore temporary macOS GUI jobs, onboarding, or focus\u002Finput debugging, read\n[GUI launch-job lifecycle](..\u002Fshared\u002Fmac-gui-job-lifecycle.md).\nNever use `launchctl submit` as a one-shot launcher or supervise short-lived\n`open -a` with KeepAlive. Inspect repeated-launch jobs before changing capture\nengines or input code; unload task-owned temporary jobs and prove stable input\nbefore handoff. For ship, apply this gate when the release touched Mac automation.\n\n\nFast reference for known production failure patterns. For deep debugging, use `\u002Fcode`.\n\n## Mandatory upstream-protocol check (third-party integrations)\n\nWhen the symptom involves a third-party integration falling back to a worse path (handoff, redirect, \"manual step required\") — Verint dform, Clerk, Stripe, SeeClickFix, OAuth, any SaaS — load `~\u002F.claude\u002Fskills\u002Fshared\u002Fupstream-protocol-investigation.md` BEFORE proposing a fix. Read the upstream's primary client source, capture real network traffic, inspect rendered `data-*` attributes. Treat any \"Verified YYYY-MM-DD\" comment in our codebase as a hypothesis to re-verify, not a fact. Token cost is unlimited for this; user explicitly authorized it (2026-05-09 SF311 graffiti incident: bandaid `0b746a4` → real fix `f27d1e3` after reading dform's `api.js` lines 462–520).\n\n## DocuSeal template-vs-submission gate\n\nWhen a DocuSeal form is missing fixed business values, load\n`~\u002F.claude\u002Fskills\u002Fshared\u002Fdocuseal-template-contract.md`. Prove whether the signer\nused a unique submission URL or the template shared link; inspect both the live\nsubmission and live template because mocked payload tests cannot detect template\ndefault drift. For multi-party templates, a public shared link is unsafe unless\nparty ownership is explicit; AIVA's HIPAA template must keep it disabled.\n`\u002Fdebug` remains read-only for production state.\n\n## Mutating symptom across fixes = wrong premise (MANDATORY — 2026-05-19)\n\nWhen each fix makes the symptom *change* instead of *disappear* — `fetch_error` → `handshake_rejected` → `publicid_timeout`, every \"fix\" peeling back to reveal a new failure one layer deeper — STOP. That staircase is the tell that the whole feature premise is wrong, not that you are three fixes from done. Before fixing layer N+1, verify the premise itself: does the real client even use this code path? Capture live traffic and confirm. Reference incident: the SF311 cable chain — four green-tested fixes (`wss:\u002F\u002F`→`https:\u002F\u002F`, missing `Origin` header, subscription identifier, publicId timeout) each surfaced the next layer; a live mitm capture then proved the real app never opens the WebSocket at all — the whole path was dead code. Many round-trips of \"fix the next layer\" should have been one round-trip of \"verify the premise.\"\n\n## Recurring symptom after a DOCUMENTED remediation = the runbook's causal model is wrong (MANDATORY — 2026-08-03)\n\nThe third sibling of the two rules above. Mutating error = wrong premise. Static\nerror = missing discriminator (#32). **A symptom that keeps COMING BACK on a\nschedule, after you keep applying the documented fix, = the runbook is wrong\nabout what causes it.**\n\nThe trap is that the remediation *appears* to work every time. It restores\nservice, so it never reads as a failed fix — it reads as an unlucky recurrence.\nThat is what lets a wrong causal model survive N repetitions. **Executing a\nrunbook is not debugging, and \"the alert told me to\" is not a diagnosis.**\n\n**Tripwire — fires on the SECOND repetition, not the fifth:** if a documented\nremediation has been applied ≥2 times and the symptom returned, stop executing\nit and ask the two questions that the runbook is silently answering for you:\n\n1. **What actually MINTS the thing I keep replacing, and does my system ever\n   call it?** Replacing an artifact is not the same as participating in its\n   lifecycle. If nothing in your code ever calls the issuer, you are refilling a\n   bucket with a hole and the interval between refills is the hole's size.\n2. **Measure the true survival time, don't inherit the folklore number.** Time\n   the interval yourself; the remembered figure is usually the longest one\n   anyone noticed, and the real number is a much sharper clue.\n\n**Reference incident (2026-08-03, AIVA Google Voice).** An alert said \"session\nexpired — reseed the cookies,\" with a copy-paste command. It was followed three\ntimes in 18 hours. Each reseed restored SMS, so each expiry read as bad luck.\nThe runbook was wrong: `__Secure-1PSIDTS`\u002F`__Secure-3PSIDTS` are minted ONLY by\n`accounts.google.com\u002FRotateCookies` on a ~600s cadence and gate every RPC, while\nthe Worker talked only to `clients6.google.com`, which never returns them.\nNothing in the system ever called the issuer, so reseeding could never have\nfixed it — it just restarted the same clock. The cookie-refresh code was present\nand correct; it simply had nothing to persist. Question 2 mattered too: the\nfolklore said \"about an hour,\" but timing it gave **~20 minutes** (21:51 ok →\n22:11 alerted), which matches the 600s rotation cadence and pointed straight at\nthe mechanism. Fix = call the issuer on the cadence it declares.\n\n**Corollary — \"SAPISID present=true\" class of false-healthy signal.** The alert\nreported the long-lived credential as present while the short-lived one that\nactually gates access had already expired. When a health line reports a\ncredential\u002Fresource as OK during a confirmed outage, check whether it is\nreporting a *different-lifetime* component than the one that fails. Enumerate\nthe credential set by lifetime before trusting any \"present=true\".\n\n**PREMISE-CHECK GATE — run BEFORE the first fix (not just on the staircase). Full rule: `~\u002F.claude\u002Fskills\u002Fshared\u002Fpremise-check.md`.** Two questions, answered against LIVE upstream docs (not a cached `\u002Fskill` note): (1) **Is this approach even valid for THIS runtime\u002FSDK\u002Fplatform?** The browser SDK ≠ native SDK ≠ server SDK — a strategy\u002Foption\u002FAPI documented under one is routinely absent or *forbidden* in another. If every doc\u002Fexample for the thing you want sits under a *different* platform than yours, that's your answer — stop. (2) **What's the cheapest probe** (curl the API \u002F grep the installed bundle \u002F read the doc's \"supported platforms\" line) that proves it's possible here? Run it before coding. **Docs-before-note (always):** a `\u002Fskill` recipe, comment, memory, or prior conclusion is a HYPOTHESIS — re-verify any load-bearing \"API\u002FSDK can\u002Fcan't do X\" claim against the upstream's own *current* docs\u002Fsource before building on it; live source wins, fix the stale note in the same pass. **2026-06-13 reference incident:** hours spent debugging Clerk native `oauth_token_apple` from a Capacitor webview — clerk-js (browser SDK) can never send it (browser-forced `Origin` vs Clerk Native-API `Authorization` conflict), a fact Clerk's docs state plainly under \"Expo only.\" A wrong `\u002Fios` trap-#4 note was trusted as fact; the working web-OAuth fix was a 5-minute live-doc read away. Now also enforced session-wide by the `premise-check-session-start.sh` SessionStart hook.\n\n## \"Every subset passes\" \u002F \"it looks intermittent\" = your manipulation never applied (MANDATORY — 2026-08-25)\n\nThe fourth sibling of the three rules above. Mutating error = wrong premise.\nStatic error = missing discriminator (#32). Recurring-after-remediation = wrong\nrunbook. **Every arm passing, no single change reproducing it, and a growing urge\nto call the bug \"intermittent\" = the change you think you applied never reached\nthe system, and you are A\u002FB-ing A against A.**\n\nA deterministic bug measured through a no-op'd manipulation *presents exactly as\nflakiness*, because you are re-sampling one unchanged condition. So **\"it's\nintermittent\" is a claim requiring evidence**, not a fallback explanation.\n\n**Tripwire — before writing the word \"intermittent\", and before any bisect round\n2:** name an observable that MUST differ between arms, read it back after each\napply, and abort the run if the arms look identical. Not \"the apply exited 0\" —\nan observable in the running system.\n\n**Reference incident (2026-08-25, SmartTube 403).** Bisected 21 profile files to\nfind which setting 403'd every video stream. Every subset passed; the full set\nfailed once then passed twice; I concluded \"the PoToken mint is intermittent, not\na config bug\" and posted it publicly. It was one deterministic line\n(`preferred_dns_type=2` → Google DoH resolver). The app's own *Auto backup*\nrewrote the staged fixture on every launch, so each \"restore\" was a silent no-op\nand every run tested a fresh profile — and I had suppressed the restore step's\noutput, so nothing surfaced it. One post-restore read of the sidebar order\n(custom vs default) would have caught it on run 1. With the fixture-rewriter\ndisabled and each restore verified, the bisect converged in **three rounds**.\n\nFull gate + instrument-trap table: `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md`.\n\n## Route-coverage bugs: get the site's route list before you sample (2026-07-31)\n\nWhen the symptom is **about which pages\u002Fendpoints exist or work** — \"page X 404s in prod\",\n\"some routes broke after the deploy\", \"the new pages aren't live\", \"search can't find our\ndocs\" — do NOT debug from the handful of URLs you happened to click. Get the declared\ninventory first, then diff it against reality:\n\n```bash\ncurl -sL https:\u002F\u002F\u003Chost>\u002Frobots.txt | grep -i sitemap\ncurl -sL https:\u002F\u002F\u003Chost>\u002Fsitemap.xml | grep -o '\u003Cloc>[^\u003C]*' | sed 's|\u003Cloc>||' > \u002Ftmp\u002Fdeclared.txt\n# now diff DECLARED against DEPLOYED — the bug is usually in the gap\nwhile read -r u; do printf '%s %s\\n' \"$(curl -s -o \u002Fdev\u002Fnull -w '%{http_code}' -m 10 \"$u\")\" \"$u\"; done \u003C \u002Ftmp\u002Fdeclared.txt | grep -v '^200'\n```\n\nFor an **API**, the analog is the published spec (`\u002Fopenapi.json`, `\u002Fswagger.json`,\n`\u002Fapi-docs`, GraphQL introspection, or `unbrowse_eval_spec_discover`) — not a sitemap.\n\nThis is the **\"Compared to What?\"** rule applied to debugging: a sampled set of working\nURLs is a delta, the declared route list is the denominator. Two failures it prevents:\ndeclaring \"routes are fine\" after checking the three you remembered, and declaring \"page X\ndoesn't exist\" when it exists but 404s (a very different bug).\n\nDistinct from the security-baseline check below, where a **missing** `sitemap.xml` is itself\nthe finding (#16). Here the sitemap is the *instrument*, not the defect.\n\n## No-Lie Post-Fix Gate (MANDATORY — 2026-05-18)\n\nA \"fixed\" symptom is one that fails to reproduce on the *deployed\u002Fbuilt artifact*, not in the source. After EVERY fix, before declaring root cause resolved, run the **No-Lie Verification Protocol** from `~\u002F.claude\u002Fskills\u002Fshared\u002Fno-lie-verification.md` Checks 3 + 4:\n\n1. **Symptom re-test on the artifact**, not the source. Examples:\n   - \"Stale copy\" bug → cache-busted `curl https:\u002F\u002Fprod-url\u002Fpath` for the OLD string. Expected: 0 matches.\n   - \"API 500 on category X\" bug → `curl -X POST` reproducing the original request with a fresh cache-buster. Expected: 200 or the deliberate fallback, never a regression.\n   - \"Race condition in worker\" bug → run the original repro harness (`tools\u002Frepro\u002F*.sh`) under load and confirm the failure no longer reproduces over N runs (N≥10).\n2. **Whole-repo symptom re-grep**, not just touched files. Proves \"fixed all instances\", not \"fixed the ones I noticed\". The whole-repo grep must return 0 matches OR only matches that are demonstrably unrelated (JSON values, log files, third-party node_modules).\n3. **If the fix is in TRIGGERED behavior** (failover, retry, fallback, circuit-breaker, rate-limit cooldown, error\u002F`catch` branch, conditional cron) — **induce the trigger and watch the path fire** (Check 6 in `no-lie-verification.md`). Don't infer it from \"the parts work\": force the 429 \u002F fail the dependency N times \u002F feed the exact bad input on an isolated copy, confirm the fallback\u002Fretry\u002Ferror-path actually executed, then confirm the live instance is untouched. \"Configured\" ≠ \"fires.\"\n4. **Every claim in the final report cites the command that proves it.** Forbidden without proof: \"fixed\", \"verified\", \"root cause confirmed\", any specific count.\n\n**Reference incident (2026-05-18):** \u002Fcode agent reported \"no stale '10,000' strings — `rg` clean\" but never curl'd the live URL. Old build was still serving until \u002Fship deployed. The fix wasn't a fix until the deployed artifact was re-tested.\n\n## The Mining Sweep — estate-level root cause (MANDATORY procedure — added 2026-10-13, pstack `\u002Fcorrect` derivation)\n\nEverything above debugs ONE symptom. This procedure debugs the *corpus of past symptoms*. Invoke: `\u002Fdebug sweep [domain]`.\n\n**Why it exists.** The standing loop fixes mistakes incident-by-incident and writes each lesson into the owning skill the same day. That loop has a blind spot: nobody periodically asks which mistake *classes* keep recurring ACROSS domains, and why a class with three convictions is still enforced by a prose paragraph instead of a check. A lesson that lives only in prose will be re-learned the hard way (the ship skill's learning loop says the same thing about its own domain). The sweep is the retrospective pass that moves rules up the enforcement ladder. It is the estate-scale sibling of the tripwire above (\"recurring symptom after a documented remediation = the runbook's causal model is wrong\") — same insight, applied to the correction history instead of one runbook.\n\n**Procedure (bounded — one domain per pass):**\n\n1. **Bound the pass.** One domain (e.g. ship\u002Fplayer, records, genealogy). A sweep over everything produces a report about nothing.\n2. **Harvest the corpus.** The domain's correction sources: AGENTS.md dated lessons, `~\u002Fmemory\u002F*.md` + MEMORY.md entries, mission logs and build-progress logs in the domain's goal `hidden_files\u002F`, and the owning skills' own lesson appendices. Read them; do not work from recollection.\n3. **Cluster into classes.** Group incidents by the *mechanism* of the mistake, not the surface symptom. A class needs ≥2 sightings to count as recurring; note explicitly when a class recurs across domains — that is the highest-value finding a single-incident loop can never produce.\n4. **Build the rule → enforcer table.** One row per class: the rule stated once, the sightings (dated, sourced), the CURRENT enforcer, and its level on the ladder: **CLI\u002Fcode gate → scripted proof in a maintained map → named review lens → prose rule**. Prose is the weakest level; every row at prose level after ≥2 sightings is a finding.\n5. **Convert the top classes.** For the top 1–3 prose-only classes, name the concrete structural enforcer (a CLI preflight check, a feature-gate pattern, an evidence-presence check, a review lens) and either implement it in the same pass (if it lives in skill\u002Fworkflow files) or record it as a proposed enforcer with its owning step — never silently leave it as \"we should.\"\n6. **File the pass.** Write the table + findings to `mining-sweeps\u002F\u003Cdate>-\u003Cdomain>.md` next to this skill, and write any rule changes back into the owning skills the same day (the standing write-back rule). A sweep that produces only a report has not happened.\n\n**Cadence:** run one after any domain accumulates ~3 new convicted lessons, or monthly per active domain, whichever comes first. The genealogy loop's a scheduled sweep script is the proven automated shape if a domain wants this on a cadence.\n\n**Worked example:** keep each pass beside this skill under `mining-sweeps\u002F\u003Cdate>-\u003Cdomain>.md`. A real first pass over a shipping\u002Fplayer domain tabled 6 rules; its top prose-only classes were: declared\u002Fproxy state trusted over a live probe of the real artifact, recovery paths that don't record the failure they recover from, and environment preconditions carried in memory instead of preflight checks.\n\n## Usage\n\n```\n\u002Fdebug [pattern name or symptom]\n```\n\n## Examples\n\n- `\u002Fdebug catch-all` -- Catch-all error handling masking root cause\n- `\u002Fdebug react undefined` -- React \"X is not defined\" scope bug\n- `\u002Fdebug silent startup` -- React silently fails to mount\n- `\u002Fdebug auth failed` -- Generic auth error hiding real cause\n- `\u002Fdebug broken icons` -- Third-party icons\u002Fimages missing (CSP blocking)\n- `\u002Fdebug text overflow` -- Text escaping card boundaries on mobile\n- `\u002Fdebug stale data` -- Admin changes not visible to users\n- `\u002Fdebug deploy logout` -- Users logged out after every deploy\n- `\u002Fdebug cloudflare security alert` -- Cloudflare flagged site for missing security.txt \u002F HSTS \u002F CAA \u002F DNSSEC\n- `\u002Fdebug slow page` -- Page\u002Froute slow: full-table scan on the hot path, cron warming the wrong cache, or a lagged-source window returning empty\n- `\u002Fdebug cookies` -- Need cookies for curl\u002Fyt-dlp\u002Fscrape from a logged-in browser session (see \"Cookie extraction\" below)\n\n---\n\n## Pattern numbering (read before adding one)\n\nPattern numbers are **globally unique across all reference files**, not per-file. Before adding\n`## Pattern N:`, claim the next free N:\n\n```bash\ngrep -rhoE \"^## Pattern [0-9]+:\" ~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F*.md \\\n  | grep -oE \"[0-9]+\" | sort -n | tail -1        # highest in use\ngrep -rhoE \"^## Pattern [0-9]+:\" ~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F*.md \\\n  | grep -oE \"[0-9]+\" | sort -n | uniq -d        # existing collisions\n```\n\n`#12` and `#15` are **legacy collisions** (two distinct patterns each). Always cite a pattern as\n*file + number* (`error-handling-patterns.md #29`), never a bare number, so a collision can never\nmisroute an agent.\n\n---\n\n## Pattern Routing\n\nMatch the user's symptom to the right reference file, then load ONLY that file.\n\n| Symptom \u002F Keyword | Pattern | Reference File |\n|--------------------|---------|----------------|\n| iOS app, simulator, Xcode, Swift crash, .ips crash log, Capacitor shell misbehaving, WKWebView rendering wrong (e.g. border-radius not clipping a composited img), in-app sign-in bounced to Safari, app stuck on splash \u002F OTA rollback, webview UA flagged as in-app browser, **Clerk\u002FApple\u002FGoogle social sign-in failing in a Capacitor app — `authorization_invalid` \u002F `native_api_disabled` \u002F `origin_authorization_headers_conflict` \u002F `oauth_token_apple` \u002F \"native social login won't work in the app\", OR a passkey\u002FWebAuthn ceremony failing in the webview — \"passkey registration was cancelled or timed out\", `webcredentials`, associated domains, AASA 404** | iOS App Symptoms — route to the `\u002Fios` skill (dev\u002Fdebug loop, axiom crash\u002Fbuild\u002Fperf agents, webview driving via axe, simulator eyes+hands via `baguette` (`boot` headless, `describe-ui` a11y tree, pt taps, `screenshot`, `logs`) and `\u002Fserve-sim` (60 fps stream, camera injection, CA overlays) — `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-sim-agent-control.md`, AIVA Capacitor traps incl. clerk-js `allowedRedirectProtocols`, notifyAppReady rollback, WKWebView clip bug). **Any in-webview auth\u002Fcredential ceremony fails with a GENERIC error until the app↔domain binding exists — read \u002Fios trap #12's binding matrix and PROBE FIRST: social-OAuth Apple → trap #4 (`allowNavigation`); Google → policy-blocked, hide it; clerk-js scheme → `allowedRedirectProtocols`; passkey \"cancelled or timed out\" → `curl \u003Cdomain>\u002F.well-known\u002Fapple-app-site-association` + grep entitlements for `webcredentials` (improvebayarea `dadfdf3`). Don't debug the JS ceremony before the 30-sec probe.** | `\u002Fios` skill (`~\u002F.claude\u002Fskills\u002Fios\u002FSKILL.md`) |\n| app crashes AT LAUNCH on a real device \u002F new iOS but works in the simulator, `EXC_BREAKPOINT` in `UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`, TestFlight build closes instantly, \"native sign-in sheet returns nowhere\" after adding scenes | iOS 27 scene-lifecycle launch crash — iOS 27 kills iOS-26-SDK apps that don't adopt UIScene; Capacitor 8.4 ships no SceneDelegate. Run `\u002Fbin\u002Fbash ~\u002F.claude\u002Fskills\u002Fship\u002Ftools\u002Fios-scene-lifecycle-check.sh \u003Crepo>` FIRST (0 pass \u002F 1 fail \u002F 2 unmeasured \u002F 4 n\u002Fa) — it names the exact gap (no manifest, missing class, or missing `openURLContexts`\u002Fcold-launch URL forwarding that silently kills Google\u002FOAuth return). Apply the build-15 recipe, then prove launch on the physical phone (devicectl processes + crashes), never on an older-runtime simulator. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-app-dev-release-traps.md` §1–3 |\n| test on my real iPhone, tap\u002Fswipe\u002Fscreenshot the phone, drive TestFlight \u002F the installed app, physical-device acceptance, mobile-mcp `ETIMEDOUT` \u002F `context canceled` \u002F `PairRecord errorcode 22` on a physical iPhone | Physical iPhone control — use `\u002Fcontrolphone` (`~\u002Fprojects\u002Fiphonectl`): `controlphone screenshot` (go-ios screenshotr, no WDA), `iphonectl-setup wda` once (WDA via xcodebuild + ASC-key auto-provisioning, no p12\u002Fkeychain prompt, free port), then `controlphone tap\u002Fswipe\u002Ftype` in POINTS (px\u002F3). Don't retry mobile-mcp on iOS 27 (its capture path times out); a stale go-ios tunnel mimics broken pairing — `controlphone apps` answering proves lockdown is fine; ports 8100\u002F8101 are the mobilecli daemon's. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-app-dev-release-traps.md` §4 |\n| run something on the mini, mac-mini, the cron host, remote Mac, \"check the mini\", Hermes cron, ssh to the mini, Screen Sharing, why does X work on my laptop but not the mini | **remote-mini** | `~\u002F.claude\u002Fskills\u002Fshared\u002Fmac-mini-remote-control.md` — the 6-surface ladder (ssh -> scp -> hermes cron -> launchctl -> fcdp -> Screen Sharing). Climb it; don't start at the GUI. Covers the context traps that make a working tool look broken over SSH (Keychain\u002F`cookies-txt`, `open -a` -600, `osascript` 1002), the nested-heredoc credential hazard (write locally + `scp`), zsh not word-splitting, `hermes cron create` taking a POSITIONAL schedule + bare script filename, and which Chrome profile you actually hit (integer tab id = real Default, hex = headless :9222). |\n| catch-all, generic error, wrong status code, misleading error | Catch-All Error Masking (#1) | `error-handling-patterns.md` |\n| Bitwarden\u002FVaultwarden\u002Fwarden self-hosted login fails before the password is tried, \"KDF config response does not contain a valid KDF type\", prelogin, `KdfSettings` missing, some clients work and others don't after a server change, reimplemented vendor API broke one client generation | **Dual-shape contract (#44)** — mirror the upstream server's response model, emit legacy + new fields together; curl prelogin and check `kdf`,`kdfIterations`,`kdfSettings`,`salt` | `error-handling-patterns.md` (Pattern 44) + `mini-bitwarden` skill |\n| \"is there already a fix for this\", \"did someone fix this\", verify a PR fixes the bug, \"does PR #N actually fix it\", regression history, \"why is this guard here\", \"when did this break\", root-cause report confidence, \"are we sure that's the cause\" | **Bug-fix preflight** — existing-fix check → verify mode (baseline ×2 \u002F patched ×2 → Confirmed \u002F Insufficient \u002F Inconclusive, never a competing patch); regression history (`git log -S`, `--follow`, `gh pr view`) before hypotheses; every root-cause claim tiered Direct \u002F Supported \u002F Inferred \u002F Speculative \u002F Unknown (\"because\"\u002F\"fixes\" need an adjacent citation; the code is not evidence of its own intent; a report with no \"What we don't know\" is suspicious); \"reproduced\" = named correct-vs-broken final state, twice, reset between | `~\u002F.claude\u002Fskills\u002Fshared\u002Fbug-fix-preflight.md` |\n| \"what could this break\", blast radius, \"is this small change safe\", a diff to a shared helper \u002F schema \u002F wire format \u002F middleware \u002F cache key, \"does anything else read this\" | **Blast radius** — find the one fact the change is safe because of and get it to rung 4 (a script that runs the real code and fails loud) or mark it unproven; look where grep stops (pinned library source, timing, JSON\u002FDB\u002FKV shapes, another language reading the same bytes, feature flags, three hops down); risks \u002F cleared \u002F before-you-merge | `~\u002F.claude\u002Fskills\u002Fshared\u002Fblast-radius.md` |\n| \"should we retry CI\", flaky test, CI red after push, \"it passed locally\", failure in a file the diff never touched, \"the bot says\", bugbot \u002F CodeQL \u002F security-reviewer comment triage, \"just make the bot happy\" | **CI + bot triage** — classify before re-running: untouched-code failure ⇒ `git merge-base --is-ancestor` stale-base check (report \"needs rebase\", don't retry); suspected flake ⇒ ONE fresh build of the whole run (never `--failed`); identical 2nd failure was never flake; bot comments ⇒ fix \u002F dismiss \u002F ask, ask-by-default for security\u002Fauth\u002Fbilling\u002Fdata\u002Fmigrations\u002Fidempotency, run the cited test before classifying, never churn code to quiet a bot | `~\u002F.claude\u002Fskills\u002Fshared\u002Freview-verdicts-and-ci-triage.md` |\n| my edit didn't take, reposted\u002Fresubmitted with the OLD value, stale photo filed, repost reuses previous photo\u002Fcategory, edited field reverted silently, user's new value replaced by the default, \"it saved but used the old one\", no error shown | **Implicit precedence — N sources, one winner (#37)** — a collection filled from 2+ sources and consumed at `[0]`\u002F`.find()`; append order picks the winner and nothing declares it. Every gate is green because order is not a type. Run `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsingle-winner-merge-check.sh \u003Crepo>`. **Date the mechanism before blaming the latest deploy** (`git log -L`\u002F`-S`): introduced and became-reachable are usually months apart and different commits. | `error-handling-patterns.md` (Pattern 37) |\n| SF311 save 500, Verint save 500, Improve AI resubmit, category changed 500, request_type_id 500 | External Municipal Form Category Hard-500 (#15) | `error-handling-patterns.md` |\n| ticket description truncated, navFooter dropped, map links missing, address missing on filed ticket, description ends abruptly, external form truncation, Verint dform Request_description, bracket truncation, square bracket strip | External Form Description Truncation by Character (#19) | `error-handling-patterns.md` |\n| 311 ticket missing Location box, Open311 address null, mobile311 viewer shows description but no Location dt\u002Fdd, \"one ticket has location another doesn't\", sf_full_address dropped, Location_description ignored, structured location empty, lat\u002Flong null in Open311, address only in description body not the actual location field, scf location_details, address forwarding broken, coord-string in structured slot, \"hardening 311 address forwarding\", multi-city address never break | 311 Structured-Location Dropped by Long-Form \u002F Coord-String Address (#21, backend-agnostic) | `error-handling-patterns.md` |\n| MyLA311, myla311.lacity.gov, C-04342632, caseAddress blank, \", , CA.\", locator_gis_returned_address missing, All Service Requests vs My Requests, data.lacity.org 2026 2cy6-i7zn, Street_Address__c, addressDetails, LA_AddressController.validateAddress, toastPayload NPE, empty objCaseConfigWrapper, captureFailure, dummy modelFlags, Permit_Number__c, Receptacle_ID__c, fetchCaseTypeDetails, remint IssueTypeId, listed types not fileable, invalid_csrf guest mint | Experience Cloud catalog-and-submit envelope (#36) — listed ≠ fileable; SUCCESS-empty = captureFailure; unwrap toast\u002F`objCaseConfigWrapper`; remint IDs; classify on field API names; named refuse; Apex NPE ≠ city rejection | `error-handling-patterns.md` |\n| DBI complaint reported as validation but city has it, \"DBI re-rendered the form (validation rejected the submission)\" but DataSF shows the case, third-party form rejected but actually recorded, form echoed back on success, parser says failure but the agency received it, external form 200 OK we classified as failure, complaintNumber undefined but submission worked, dform\u002FVerint\u002Faspx false-negative on success, success-detection heuristic matches both success AND failure pages, lblError success vs failure span, signal-extraction tests use synthetic HTML, every IBA-submitted DBI complaint fails | Third-party signal-extractor false-negative due to synthetic fixtures (#23) | `error-handling-patterns.md` + `~\u002F.claude\u002Fskills\u002Fshared\u002Fthird-party-signal-fixtures.md` |\n| CI false positive, grep wrong, CI still fails | CI False Positives (#11) | `error-handling-patterns.md` |\n| admin 403, requireAdmin, metadata-only | Admin Auth Missing DB Fallback (#14) | `error-handling-patterns.md` |\n| admin 500 instead of 403 | Admin Route Wrong Status | `error-handling-patterns.md` |\n| passkey, WebAuthn, TOTP, 2FA, passwordless, social login, email OTP, `SESSION_NOT_FRESH`, recovery codes, security setup, reauthentication, alternate login bypass, \"is 2FA enabled\", \"does the site require 2FA\" | Account-Security Lifecycle — separate enrollment, challenge enforcement, enrollment policy, and recovery; inspect the installed SDK; verify authoritative state without reading secrets | `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` |\n| consent recorded wrong, checkbox says checked but DB says declined, opt-in not saved, consent checkbox does nothing, TCPA\u002FGDPR\u002FHIPAA proof-of-consent missing, \"we can't prove they agreed\", audit trail empty, exhaustive-deps warning on a consent value | **Consent-Evidence Integrity (#35)** — 6 shapes: collected-but-never-persisted (N checkboxes, 1 writer); **stale closure records an opt-IN as a DECLINE** (#26); zod strictness mismatch (non-strict SILENTLY STRIPS the field, `.strict()` 400s the form); `INSERT OR IGNORE` dropping a returning user's consent (consent is an EVENT → append-only store); client-supplied disclosure text (forgeable); affirmatives-only logging. Start by counting collectors vs writers — the mismatch IS the bug. Beware the greps that hide it: case-sensitivity (`smsConsent` misses `contactSmsConsent`) and single-line grep vs formatter-wrapped JSX prose; always pair a probe with a positive control. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fconsent-evidence-integrity.md` + `react-patterns.md` (#26) |\n| react undefined, scope bug, not defined | React Scope Bug (#2) | `react-patterns.md` |\n| **page is blank \u002F client JS never runs \u002F a feature silently stopped, and the BUILD IS GREEN** — `tsc` 0, bundler 0, tests all pass, clean diff; site emits HTML with inline `\u003Cscript>` from a template literal (CF Worker\u002FSSR); symptom appeared right after a lint auto-fix, a sed\u002F`python3 -c` replace, or an agent editing a comment | **Code Inside A String Is Invisible To Every Compiler** — nothing in your toolchain parses a template literal's contents, so a syntax error there ships with every gate green and fails only in the user's browser. A backtick or `${` in a COMMENT terminates the literal; Biome's `noUselessEscapeInString` is one cause among many. Do NOT grep for patterns — run a cause-agnostic PARSE gate (`new Function(code)` over every inline `\u003Cscript>` in the RENDERED output; parses without executing). Make it a unit test over the render function so it runs every `vitest`, and prove it fails by re-injecting the corruption. Recipe + the 0-blocks-means-vacuous branch: `~\u002F.claude\u002Fskills\u002Fship\u002Freferences\u002Fcode-quality.md` Stage 1.7. Reference incident 2026-08-05 improvebayarea: a replace aimed at a comment rewrote real code; tsc\u002Fbuild\u002Fdry-run and 56 tests all passed on a bundle whose client script could not parse. | `~\u002F.claude\u002Fskills\u002Fship\u002Freferences\u002Fcode-quality.md` (Stage 1.7) |\n\n| silent startup, blank page, no console errors, module-level throw | Silent React Startup (#3) | `react-patterns.md` |\n| useEffect, renders twice, state lags, derived state | useEffect Abuse (#15) | `react-patterns.md` |\n| localStorage, preference lost, resets on refresh | Preference Lost on Reload (#13) | `react-patterns.md` |\n| double click, duplicate API call, async button, filed twice, double submit, two tickets from one tap, one-shot submit, submitLocked, beginSubmitAttempt, cooldown helper unused | **One-shot persist lock (#42)** — if the control persists\u002Fqueues\u002Ffiles: lock sync before any await; stay locked after success; unlock only on explicit reset or persist failure. `disabled={isLoading}` + finally-reenable is the weaker sibling and is not enough. Tests must count persist calls, not fingerprint helper names. | `error-handling-patterns.md` (Pattern 42) |\n| chat\u002Fsupport widget gone after SSR, cookie banner missing on SSR page, `?support=open`\u002Fdeep-link does nothing, global widget vanished after Hono\u002FAstro\u002FRSC conversion, \"worked on every page before SSR\", floating launcher dead, analytics\u002Fexit-intent dropped on SSR route | Global App.tsx Component Vanishes After SPA→SSR Conversion (#24) | `react-patterns.md` |\n| invisible text after SSR, white headings on light\u002Fgray bg, page background wrong color after conversion, \"colors got messed up on conversion\", body background overridden, SSR design clobbered by Tailwind\u002Fisland CSS, text disappeared but HTML is there, computed bg ≠ design token, low contrast only on SSR pages, island\u002Fglobal CSS leaks `body` styles | Bundled Island\u002FGlobal CSS Clobbers SSR Inline Design — Invisible Text (#25) | `react-patterns.md` |\n| auth guard, unauthenticated error, no redirect | Missing Frontend Auth Guard | `react-patterns.md` |\n| renders undefined, shows NaN, \"Invalid Date\", \"[object Object]\", toggle\u002Fsection\u002Fcontrol disappeared or silently vanished, \"make sure nothing is undefined\", Cannot read properties of undefined, is not iterable, null-gate hides UI, `useState\u003CT\\|null>` gates a render, `.map`\u002Fproperty access on possibly-undefined API data, admin\u002Fdashboard renders garbage, optional chaining missing | Undefined \u002F Null-Render Safety (9-pattern catalog + live DOM grep for `undefined`\u002F`NaN`\u002F`[object Object]`) — also re-sweeps the adjacent admin blind-spot class (default-LIMIT truncation, NULL-aggregate sort burial, count-source mismatch, inner-JOIN row drop, admin-auth DB fallback) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fundefined-null-render-safety.md` |\n| generic `isRecord`\u002F`isObject` guard, `as unknown as T`, `(x as any).field`, repetitive type-guard boilerplate, \"vibe coding\" \u002F AI-slop TypeScript, loose `unknown`-everywhere, no schema validation at boundary, `Record\u003Cstring, unknown>` everywhere, `input as object as User`, missing `\u002F\u002F SAFETY:` on a cast, widen-then-assert, `vi.mock` module mocking, eager `.filter().map()` chains, `Object.assign({}, acc, …)`\u002F`acc.concat()` inside a reducer, manual `_tag ===` checks in Effect code, \"anti-slop findings\" \u002F oxlint `anti-slop\u002F*` or `anti-slop-effect\u002F*` errors | Anti-Slop TypeScript — replace generic guards\u002Fcasts with named types, discriminated unions, or Zod (`z.infer`). Enforcers: repo-vendored **dmmulroy\u002Fanti-slop Oxlint plugin** (`.\u002Fnode_modules\u002F.bin\u002Foxlint` when `tools\u002Foxlint\u002Fanti-slop\u002F` exists; vendor via the `\u002Finstall-anti-slop` skill) or fallback detector `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fdetect-ts-slop.sh`. **AUTO-FIX LOOP UNTIL 0**: fix every finding in source by adding evidence (inference, `satisfies`, boundary parsing, genuinely-checked `\u002F\u002F SAFETY:` invariant), re-run enforcer + `tsc --noEmit`, repeat to 0; a finding surviving 5 attempts → surface to the user. Never fix by weakening rule severity, `oxlint-disable`, or laundering types | `~\u002F.claude\u002Fskills\u002Fshared\u002Fanti-slop-typescript.md` |\n| text overflow, min-w-0, flex escape, card boundary | Text Overflow Flex+Grid (#12) | `css-layout-patterns.md` |\n| grid mobile, grid-cols, responsive breakpoint | Fixed Grid Breaks Mobile | `css-layout-patterns.md` |\n| iOS Safari, blank iPhone, PDF iframe, vh units | iOS Safari Rendering | `css-layout-patterns.md` |\n| og image, twitter card, social cache, stale card | Social Card Cache (#5) | `csp-cache-patterns.md` |\n| CSP, embed blank, frame-src, img-src, broken icons | CSP Blocking (#9) | `csp-cache-patterns.md` |\n| **YouTube \"Error 153\", \"Video player configuration error\", embed shows gray panel \u002F \"Watch video on YouTube\", Vimeo\u002FSpotify\u002FSoundCloud embed won't load, video plays on youtube.com but not on my site, embed broke after adding security headers \u002F `secureHeaders()` \u002F Hono** | **Embed Dies With No `Referer` (#27)** — NOT CSP, NOT the video. The page sends `Referrer-Policy: no-referrer` (Hono `secureHeaders()` **default**; also .htaccess \u002F WP security plugins \u002F ad blockers). YouTube has refused Referer-less embeds since late 2025. Probe FIRST, 30s: `curl -sI https:\u002F\u002F\u003Csite>\u002F \\| grep -i referrer-policy` (→ `no-referrer` = confirmed) and `curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \"https:\u002F\u002Fwww.youtube.com\u002Foembed?url=https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=\u003CID>&format=json\"` (200 = video is fine; 401 = embed disabled; 404 = dead). Fix = `referrerpolicy=\"strict-origin-when-cross-origin\"` **on the iframe** — never weaken the global header. Verify on the DEPLOYED artifact (`hono\u002Fjsx` vs React attribute casing can drop it) + a real browser screenshot; allow >30s for Worker propagation before concluding. Sweep the repo for the sibling bugs: rendered `href`s containing whitespace (renderer swallowed prose into the URL) and bare URLs rendering as dead text. | `csp-cache-patterns.md` (Pattern 27) |\n| Cloudflare security alert, **Security Insights CSV**, security.txt missing, \u002F.well-known\u002Fsecurity.txt 404, securityheaders.com low score, observatory grade D, missing HSTS\u002FCSP\u002FCOOP\u002FCORP, CAA records, DNSSEC, RFC 9116, sitemap.xml 404, robots.txt advertises sitemap that doesn't exist | Site Security Baseline (#16) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fsite-security-defaults.md` |\n| **CF Security Insights flags: \"Dangling A\u002FAAAA\", \"Unproxied CNAME\", \"DMARC Record Error\", \"Bot Fight Mode not enabled\"** — DO NOT blindly apply CF's recommended fix; ~16% are false positives that break Clerk\u002FSaaS CNAMEs, delete live Google-forwarding DNS, or duplicate valid DMARC. `dig`\u002F`curl`-verify the OFTEN-FALSE classes first. Apply only the 3 safe fixes (security.txt + block AI bots + AI Labyrinth). | CF Security Insights triage map | `~\u002F.claude\u002Fskills\u002Fshared\u002Fsite-security-defaults.md` (triage section) + `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fcf-security-insights.sh` |\n| **DMARC failing from a sender IP, custom-domain mail bouncing \u002F landing in spam, \"send-as alias DMARC fail\", Gmail \"Send mail as\", `p=reject` rejecting my OWN mail, \"SPF passes but DMARC fails\", \"can't send from my domain\", forwarded mail failing DMARC, a DMARC aggregate (RUA) report flags a source** — this is OUTBOUND auth alignment, NOT broken records. Records are usually fine; the *sending path* is wrong (Gmail send-as \u002F a relay signs as the wrong domain → no aligned identifier → DMARC fail). `dig` the real SPF\u002FDMARC\u002FDKIM\u002FMX FIRST; adding the relay's IP to SPF usually does NOTHING (SPF aligns on the envelope domain). **Check the platform's CURRENT native send capability before recommending a 3rd-party — verify live, not from memory**: a Cloudflare domain can now SEND via Email Sending (`wrangler email sending list\u002Fsettings`; `smtp.mx.cloudflare.net:465`, user `api_token`, pwd = CF token w\u002F `Email Sending Write`). Fix = route the From-domain's sending through a DKIM-aligned sender; verify with a REAL send (`gog send --from \u003Calias>` → grep `dmarc=pass`). | Email Deliverability \u002F DMARC Alignment | `~\u002F.claude\u002Fskills\u002Fshared\u002Femail-deliverability-dmarc.md` |\n| **provider swap, replace Resend\u002FAuth0\u002FStripe\u002FS3\u002FTwilio with X, migrate email\u002Fauth\u002Fpayments provider, \"switch from X to Y\", removed the old SDK, deleted the old API key, feature silently stopped after swapping providers, `if (!env.OLD_KEY)` gate, legacy ids unresolvable, old provider ids in DB** | **Provider Migration Safety** — four silent breakages, none of which throw: (1) feature gates still testing the OLD provider's env var (incl. `CRITICAL_ENV_VARS`) → feature disabled forever once the secret is deleted; (2) persisted legacy identifiers the new API can't resolve → zero rows → a confident wrong status; (3) the new SDK returns `{data,error}` instead of throwing → every failure reads as success; (4) the local emulator (`wrangler dev`) doesn't enforce the new provider's server-side rules → local green ≠ prod accepted. Run the 7-item checklist. **Never decommission the old account off one repo's grep** — another project may hold a live key on the same verified domain. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fprovider-migration-safety.md` |\n| **status chip says \"expired\"\u002F\"not found\" on rows that are fine, freshly-created record reads as missing, a uniform block of rows all show the same scary status, status derived from analytics\u002FGraphQL\u002Fsearch backend, zero rows treated as a reason, `retention_expired` on brand-new data** | **Absent Data Reported As A Confident Wrong State (#29)** — `rows.length === 0` has ≥4 causes (ingestion lag, wrong id namespace\u002Fprovider, real retention expiry, never created, query failed) and they need different words. Discriminate on identifier SHAPE before querying (free), use the system of record's `created_at` vs the backend's ingestion grace window to separate lag from expiry, model reasons as a union, and never render a raw enum in the UI. | `error-handling-patterns.md` (Pattern 29) |\n| **third-party submit \"worked\" (200 + id, no error) but the ticket\u002Frecord never went live — never got a public number, never opened, never associated, `openedAt: null`, `publicId: null`, `submittedTickets: 0`; guest\u002Fanonymous create dead-ends silently; A\u002FB-tested a flag\u002Fcategory\u002Ffield and the symptom stayed IDENTICAL; \"why does spotmobile\u002Fguest submit never get a case number\"; freshly-minted guest token; shadow-limited actor; \"is it the payload or something else\"** | **False-Positive Success — async lifecycle is the real signal + IDENTITY is the hidden variable (#30)** — a synchronous 200+id is a *pending* state, not *done*; gate success on the lifecycle transition (public number \u002F `opened` \u002F row in public dataset), polled, against a known-good baseline. When fix-A\u002Ffix-B\u002Ffix-C leave the symptom byte-identical, STOP editing the request — the actor\u002Fidentity\u002Faccount you held constant is the variable; re-run the SAME payload under a known-good established identity FIRST. Prove the working backend by RUNNING THE REAL FUNCTION LIVE (repro harness → real id), never from old code or a \"Verified\" comment. **Fastest confirmer that it's the ACCOUNT, not your code: does the vendor's OWN first-party client (their official app\u002Fsite) show the SAME stuck symptom under the same identity?** If yes, it's an account\u002Fidentity-level block (shadow-ban\u002Fwrite-limit) — stop debugging payload\u002Fversion\u002Ftoken and switch identity or backend. Reference (2026-08-12): Solve SF `\u002Fsubmit` 403'd for improvebayarea AND the official iOS app stalled on \"pending\" for the same account → account write-block; fix was to abandon the authenticated backend for the account-less Verint public form (nothing to shadow-ban). | `error-handling-patterns.md` (Pattern 30) |\n| **async id never resolves \u002F report stuck at \"getting case number\" forever; a resolver\u002Freconciler\u002Fpoller cannot find the record OUR OWN system created; matching by category\u002Ftype\u002Fservice_name\u002Fstatus returns nothing while the user says the integration \"constantly fails\"; \"did the city\u002Fvendor actually receive it?\"; authority relabeled our category; outcome counters read all-ok while users see failure** | **The authority relabels your artifact — match on YOUR echoed content, never on labels the authority owns (#39)** — investigation order is MANDATORY: (1) query the AUTHORITY'S OWN record store first (Open311\u002FSocrata\u002Fvendor API) around the submit time+place and look for OUR OWN echoed boilerplate in the record body — two curls settle \"did it actually happen\" before any code is read; (2) fix the matcher to rank fingerprint evidence (our echoed text) above label agreement, and pin the fingerprint to the constant that generates it with a test; (3) THEN audit our measurement path (pending recorded as ok, success_rate defaulting to 100% when unmeasured, give-up branches that can never fire). Instrument traps that fake \"the record does not exist\": Socrata datasets use LOCAL time while Open311 uses UTC (a 7h miss returns confident empty sets — positive-control every zero); list endpoints silently truncate (Open311 default page_size 50). Reference: 2026-08-26 improvebayarea — 12\u002F12 \"stranded\" SF refs were REAL filed cases (one already closed by the city) under relabeled service names; a day-old memory asserting \"submissions never file\" was the tz-blind instrument talking. | `error-handling-patterns.md` (Pattern 39) |\n| **a route family shows a high 5xx\u002Ferror rate but every manual probe returns 200; 522 \u002F 524 \u002F `originResponseStatus: 0`; \"origin unreachable\" on a Workers-only zone; errors cluster at :00\u002F:02\u002F:30; empty User-Agent; single-colo errors; error count ≈ a fleet size (cities\u002Ftenants\u002Fshards); \"is this users or us?\"; an outage nobody can reproduce; a cron\u002Fprewarm\u002Fwarmer\u002Fpoller\u002Fself-health-check is in the picture** | **Your own cron is the caller — ATTRIBUTE before you diagnose (#40).** The first question is **WHO** is making the requests, not why they fail — one `httpRequestsAdaptiveGroups` query grouped by `datetimeMinute` + UA + colo + `cacheStatus` either kills the entire user-facing hypothesis or confirms it, *before* the handler is opened. Self-inflicted signature: clustering at the cron boundary + **empty UA** (Worker subrequests carry none) + one colo + `cacheStatus: bypass` + count ≈ fleet size. Platform fact: **a Worker cannot `fetch()` its own Custom Domain** — CF forwards the same-zone subrequest to the *zone origin*, and a Workers-only zone has none (`AAAA 100::`, RFC 6666 discard) ⇒ 522\u002Forigin=0 every time (`workers\u002Fconfiguration\u002Frouting\u002Froutes`; workerd#787); probe with `curl --resolve host:443:[100::]` → exit 28. Then check the two siblings: a test that **asserts the buggy behavior** (a mocked `fetch` returns 200 and *cannot observe* a platform refusal — it pins the bug and stays green for months), and a warmer that **warms nothing** (`cf-cache-status` still `MISS` an hour after the run). Beware \"intermittent\" — that is a causal claim needing #38's evidence; here the failures were perfectly periodic and the probes passed only because they never coincided with the cron. Reference: 2026-08-29 improvebayarea — 523\u002F523 of the zone's 522s at :02–:03, ~44\u002Frun = 43 cities + `\u002Fmap\u002Foakland`, 32.5% measured 5xx, zero users affected. | `error-handling-patterns.md` (Pattern 40) |\n| **an OLD copy of one of our own sites is live somewhere nobody watches; a `*.workers.dev` \u002F `*.pages.dev` \u002F preview URL serves a stale version of a production site; retired marketing or legal copy still reachable at a second URL; \"why is Google showing an old version of our page\"; duplicate-content or brand-claim exposure; an orphaned worker\u002Fapp nothing references; \"is anything else on this account still serving?\"; auditing an account for strays** | **The orphan is in NO repo, so no repo-scoped gate can ever see it (#41).** This is a SCOPE gap, not a trigger gap — running the existing gates more often finds nothing. **Ask the account, not the repo:** `python3 ~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Forphan-worker-content-check.py` (exit 0 ok \u002F 1 flagged \u002F **2 UNMEASURED — never a pass** \u002F 3 no creds). It enumerates every worker, finds the ones with a public twin, and flags any twin whose **`og:url`\u002F`canonical`** names a hostname a DIFFERENT worker owns. **Three matching signals that DO NOT work, each measured:** (a) **`og:title`\u002F`\u003Ctitle>`** — a stale copy is stale *because* its title drifted, so title-matching requires agreement on the exact field the defect mutates (`AIVA Claims Assistant` vs `Donor-Funded VA Claim Help For Veterans \\| AIVA`); this is Pattern #39's lesson one layer over — never key on a label the thing you are detecting is free to change. (b) **body-text similarity** — a pre-SSR SPA shell has ~21 chars of visible text, so Jaccard vs a modern SSR site is **0.0000**, identical to \"unrelated\" (and a 0-shingle input makes EVERY comparison 0, so positive-control the instrument before believing any zero). (c) **`modified_on`** — an account-wide *settings* sweep bumps it, so the stray read `2026-07-07` while its CODE was `2025-12-05`. **Never delete off this finding** — report it (Pattern #31: you cannot delete a resource you cannot name the creator of; deleting a live worker is outward + irreversible). Reference 2026-08-31 (example): `aiva-claims` served a 9-month-old copy still advertising the RETIRED claim *\"up to a 100% disability rating in as little as 80 days — up to 43% faster\"* while the live site said *\"Processing times vary\"*; 53 workers \u002F 25 public twins \u002F 1 flagged. | `error-handling-patterns.md` (Pattern 41) |\n| **`iba` CLI \u002F improvebayarea.com 311 filing** — \"did my 311 ticket actually file\", submit returned 200 but no case number, `mobile311.sfgov.org\u002Fservices\u002Fcase\u002F\u003Cid>` 404s, ticket missing from the recent feed, \"the CLI only lists 20 categories\", no steam-clean\u002Fpower-wash category, wrong category filed, `recategorized_from` in the response | **`iba` traps (verified 2026-08-01) — three of the four \"it failed\" signals are FALSE.** (1) **`--mode prefill` is the DEFAULT and it FILES** — all three modes file; only `--dry-run` doesn't. (2) **ref-vs-caseid:** Verint assigns a public caseid synchronously for *some* forms only. `pw_street_cleaning` → real `101004…`; `pw_graffiti` → `valid:true` + a UUID **ref**, `caseid_pending:true`, and a `lookup_caseid_url` (improvebayarea `src\u002Fsf311.ts:1768-1774`, `src\u002Findex.ts:5142`). Resolve with `iba lookup \u003Cref>` (takes a **ref**, NOT a caseid — passing a caseid returns `ref_not_found`) or `iba submit --wait \u003Csecs>`. (3) **False failure signals:** `mobile311.sfgov.org\u002Fservices\u002Fcase\u002F\u003Cref>` **404s by design** for ref-format ids (`src\u002Fsf311.ts:1770`) and even 404s for real filed caseids; `\u002Fapi\u002Frecent` is a **narrow 25-item sample** (had zero Graffiti-category rows) so absence ≠ failure — use `?q=\u003Cterm>`; DataSF `vw6y-z8j6` lags **1-2 days** and is the only real confirmation. (4) **Capture the FULL submit response** — the id is unrecoverable afterward; `iba` now prints a SUBMIT RESULT banner on **stderr** so `\\| head` can't destroy it. (5) **Registry drift:** the baked category map silently ran 20-of-42 — run `iba categories --check` (diffs vs the live API, exit 1 on drift) before trusting it; `--live [--city oakland]` for the authoritative list. No steam-clean\u002Fpower-wash category exists — do NOT force it into `missed_street_cleaning` (920010 = \"the sweeper skipped my route\"). | `~\u002F.claude\u002Fprojects\u002F-Users-\u003Cyou>\u002Fmemory\u002Freference_local_tools.md` + `error-handling-patterns.md` (Pattern 30) |\n| **\"the deploy broke prod\", `Failed to load module script ... MIME type \"text\u002Fhtml\"`, SPA won't mount after deploy, only SEO fallback text renders, `ERR_BLOCKED_BY_CLIENT`, page worked 5 min ago, verifying a deploy in a clone browser** | **Your Verification Browser Is Stale — False \"Prod Is Broken\" (#28)** — a cached HTML shell references pre-deploy asset hashes; the SPA fallback serves `index.html` for the missing `.js`; the browser refuses HTML as a module script. **Production is fine; only your tab is broken.** NEVER conclude a bad deploy from a browser alone: curl the live HTML for its asset refs, confirm each returns `200 text\u002Fjavascript` (not `text\u002Fhtml`), and grep the deployed chunk for a string only your new code has. `location.reload(true)` is a no-op; use `navigate_page {ignoreCache:true}` or a cache-busting query param. `ERR_BLOCKED_BY_CLIENT` = ad blocker, not your code. | `csp-cache-patterns.md` (Pattern 28) |\n| **`npm install` blocked or behaving oddly**, \"Socket npm exiting due to risks\", `429 Insufficient quota`, install works with `SOCKET_CLI_ACCEPT_RISKS=1` but not without, deps missing after a \"successful\" `npm ci`, `Cannot find type definition file for '@cloudflare\u002Fworkers-types'` right after install, vitest\u002Ftsc missing though they're in package.json | **Supply-chain wrapper triage.** Protection is **Socket Firewall `sfw`** — a local network proxy (no API key, no quota), wired via an `npm()` function in `~\u002F.zshrc`\u002F`~\u002F.bashrc` that routes only `install|i|ci|add|update|up|dedupe|rebuild` through `sfw npm`; everything else goes straight to `command npm`. Diagnose: `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsocket-health-check.sh --live` (0 = armed, 1 = sfw missing → UNPROTECTED, 2 = disarmed, 3 = not configured). **Verify with an observable, not an exit code:** `SFW_VERBOSE=true npm install` must print `Protected by Socket Firewall` — an unprotected fallback also returns 0. ⚠️ A **`429 Insufficient quota`** means something still calls the OLD `socket npm` API path (free plan = 100 units\u002Fscan, and it fails closed when exhausted); `sfw` never calls that API. ⚠️ A partial install leaves node_modules half-populated, so the next symptom is a missing type package or test runner — re-run a full install rather than debugging that. **Never** `SOCKET_CLI_ACCEPT_RISKS=1` (blanket disarm; `pre-bash-socket-disarm-guard.sh` blocks persisting it) — use `command npm` for a scoped, visible bypass. | `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsocket-health-check.sh` |\n| dependabot alert, npm audit, CVE, GHSA-xxxx, \"vulnerable dependency\", transitive vuln, \"fix the security\u002Fdependabot page\", overrides, esbuild\u002Ftar\u002Fminimatch\u002Fws\u002Fvite\u002Fuuid vuln, `npm install` fails on override version | Dependency Vulnerability Audit & Fix (7-step: BOTH dependabot-api + per-manifest npm-audit, scan EVERY lockfile, scoped overrides for multi-major packages, verify patched version is published, never blind `npm audit fix --force`, verify build with project's real build) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fdependency-audit.md` |\n| www redirect, cookies lost, auth break | WWW Redirect Auth Break (#4) | `csp-cache-patterns.md` |\n| deploy logout, chunk hash, preloadError | Deploy Logs Users Out | `csp-cache-patterns.md` |\n| stale version, failed deploy, CF Pages | CF Pages Stale Deploy | `csp-cache-patterns.md` |\n| terraform destroy, infra deleted, catastrophic | AI Agent Destroys Infra (#6) | `infrastructure-patterns.md` |\n| prod auth, pk_test, accounts.dev, Clerk production, Wrangler binding, wrong auth instance | Production Auth Instance Drift (#12) | `infrastructure-patterns.md` |\n| AIVA auth drift, retired Clerk fingerprint, `clerk.*`\u002F`pk_live_` still in live HTML or CSP, `\u002Fapi\u002Fauth\u002Fok` fails, wrong-password sign-in returns 500, live artifact differs from dist | AIVA First-Party Better Auth Artifact Drift — old Clerk presence is now the failure, not its absence | `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` + `infrastructure-patterns.md` |\n| wrangler secret put binding already in use, plaintext Worker var, secret_text missing, BREVO_API_KEY in vars | Worker Secret Binding Drift (#12b) | `infrastructure-patterns.md` |\n| **D1 route 500s with generic \"Internal Server Error\", `no such column`\u002F`no such table`, `D1_ERROR`, intake\u002Fany-write save fails for everyone, migration file exists but column missing in prod, `wrangler tail` shows outcome Ok + empty exceptions, schema drift, migration not applied to remote** | **D1 Schema Drift — migration-file-exists-but-not-applied-to-prod** (#26). Detect: `wrangler tail --format json` → grep logs for `D1_ERROR`\u002F`no such column` (it's in `logs[]`, not `exceptions[]`); confirm with `PRAGMA table_info(\u003Ct>)` on `--remote` (the file\u002Flocal-D1 are NOT proof). Fix: additive `ALTER … ADD COLUMN`\u002F`CREATE … IF NOT EXISTS` on remote, then `INSERT OR IGNORE` the filename into `d1_migrations` — NEVER bulk `migrations apply` (re-runs non-idempotent data migrations → corruption). Gate: `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fd1-schema-drift-check.sh \u003Crepo>`. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fd1-schema-drift.md` |\n| **\"the API shows only N records so X is missing\", \"this cert\u002Frecord\u002Froute is redundant, safe to delete\", DNS record missing from the dashboard but working in production, CAA\u002FSPF\u002FDKIM \"absent\" per the provider API, duplicate certificate packs, orphaned resource nothing seems to reference, \"nothing in the repo references this\", a config table that disagrees with observed behavior** | **A Management API Is Not Authoritative State (#31)** — the API returns what was DECLARED; it does not show what the platform INJECTED on your behalf, nor WHY a resource exists. Two modes: (a) **false \"absent\"** — CF `dns_records` returned 5 CAA records with no `issuewild \"pki.goog\"` while `dig` returned 11 including it (CF auto-injects partner-CA CAA, documented as not appearing in the dashboard) → a phantom outage; (b) **false \"redundant\"** — 20 \"stray\" advanced cert packs were Worker custom-domain certs (8 packs ↔ 8 Worker domains; 11 zones with 0 Workers had 0 packs) → deleting them drops TLS on live services. **Probe the CONSUMER view before concluding**: `dig` not `dns_records`; `openssl s_client` not the cert list; the audit log's `actor.type` (`system` = platform-provisioned, something needs it) before calling anything redundant. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md` |\n| **same opaque error after a fix you PROVED is deployed, \"my fix didn't work\" but the error string is byte-identical, `400 {\"error\":\"Invalid\"}` \u002F bare `500` \u002F `{\"ok\":false}` for several unrelated causes, upstream rejects a payload with no field saying WHICH rule broke, fix-probe-fix loop across multiple deploys, \"no events in tail\" \u002F \"the counter didn't move\", a health probe green while 100% of writes fail** | **One Opaque Error, N Independent Causes (#32)** — a static (never-changing) error means your INSTRUMENT is too coarse, not that your premise is wrong (contrast the mutating-symptom tripwire above: `errA→errB→errC` = wrong premise; identical error = missing discriminator). **Stop bisecting and ship a discriminator first** — make the failure report the measurable PROPERTIES of what it sent (flags + lengths, never the payload: PII). When every flag reads false and it still fails, you have positively excluded your hypothesis space, which is the finding. Then: bisect by COMPONENT not character, change exactly ONE variable per probe (a confounded step attributes the pass to the wrong cause), and cross-reference successes as hard as failures (the cause is the property in 100% of failures \u002F 0% of successes). If the failure has no side effect, every failing probe is FREE — order expected-fails first and stop at the first success. **Silence is not evidence**: prove the instrument is alive before trusting \"nothing logged\" (a `wrangler tail` that wrote 0 bytes; `--format json` emitting PRETTY-PRINTED multi-line objects that line-wise grep never matches; KV reads that LAG). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md` |\n| **a bisect where EVERY subset passes, no single change reproduces the bug, the same config gives PASS then FAIL, you are about to call it \"intermittent\"\u002F\"flaky\", a restore\u002Fimport\u002Fapply step that \"succeeded\" but changed nothing, config-restore or backup-restore debugging, an A\u002FB whose arms you never confirmed differ** | **The Manipulation Silently No-Op'd — You A\u002FB'd A Against A (#38)** — a deterministic bug measured through a no-op'd manipulation presents *exactly* as flakiness. **\"Intermittent\" is a claim requiring evidence, not a fallback.** Gate 1: name an observable that MUST differ between arms and read it back after each apply (not \"the apply exited 0\"). Gate 2: the success signal must be direct state or a progression across two samples — never a lagging derived proxy (decoder logs, async counters) or a compositor screenshot (hardware-overlay video screenshots BLACK while playing). Gate 3: >=2 interleaved runs per arm before any causal claim. Gate 4: publish nothing causal until 1-3 pass. Never suppress the output of an apply\u002Frestore\u002Fdeploy step you will draw conclusions from, and disable anything that can rewrite your fixture mid-run. Sibling of #33 (there the check can't fail; here the variable never changed). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md` |\n| **\"everything is green but users report it's broken\", a health check \u002F validator \u002F drift job that has NEVER gone red, \"N\u002FN verified\", \"30 of 30 match\", \"all healthy\", 100% pass rate, a monitor that missed a real outage, about to RETRACT a finding because a different measurement came back clean, a hardcoded `verified:`\u002F`lastChecked:` date on data harvested from an upstream, a record \"missing\" from an upstream you join by id, a dataset field whose absence degrades silently (`continue`, `?? undefined`, skipped row)** | **A check that cannot fail is not a check (#33)** — the mirror of the Negative-Result Rule: that one runs a *positive* control on a negative result; this runs a **negative** control on a positive one. Feed the instrument a known-bad input (corrupted token, mutated id, nonexistent resource) and require RED. If the known-bad also passes, the instrument is vacuous and every green it ever produced is worthless. Always three outcomes, never two: `ok` \u002F `genuinely bad` \u002F `could not measure`. **Echo is not validation** — an upstream that reflects your value back has not checked it. Corollaries: `verified:` stamps decay (re-ask on a cadence, mark stale past ~2 intervals); check upstream ALIAS keys before concluding absence; silently-degrading dataset fields need a completeness invariant. Reference incident 2026-08-10 nps-report: a probe reported 20\u002F20 park mailboxes healthy while `o=DEADBEEF00` also returned HTTP 200 + a full form; the real sweep found 5 of 435 drifted, and an earlier CORRECT drift finding had been retracted in favour of that vacuous probe. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md` |\n| **report\u002Fupload attributed to the wrong place or time, \"it picked the wrong location\", location correct on the phone but wrong on the record, EXIF, geotag, DateTimeOriginal, metadata gone after a resize\u002Foptimise\u002Fconvert, a slow async GPS\u002Flookup overwriting a good value** | **Use the artifact's own provenance, not ambient state (#34)** — derive the attribute from the uploaded artifact (EXIF GPS\u002Ftimestamp, document date, mail `Date`), not from `navigator.geolocation`\u002F`now()` at processing time. Read provenance from the ORIGINAL bytes BEFORE any re-encode (canvas\u002Foptimiser strips metadata) and assert that ordering in a test; funnel every writer through one precedence helper so a late async value can't clobber the artifact's; show the user which source won. Reference incident: reports photographed on a trail and submitted from a hotel routed to the park nearest the hotel — silently, with a plausible park name on screen. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md` (Pattern #34) |\n| rust clippy, cross-platform, cfg, unused_mut | Rust Cross-Platform Lint (#7) | `infrastructure-patterns.md` |\n| homebrew, keg-only, launchd, cron PATH | Homebrew Keg-Only PATH (#8) | `infrastructure-patterns.md` |\n| launchd\u002Fcron watchdog false alerts, \"job-not-loaded\" but service is up, gateway DOWN alert spam, bootstrap rc=5, `launchctl list` empty in launchd context, health-check passes interactively but fails on schedule, watchdog restarting a healthy service | launchd-Context Health-Check False Positive (#19) | `infrastructure-patterns.md` |\n| serde, deny_unknown_fields, config crash | Serde Config Crash (#10) | `infrastructure-patterns.md` |\n| innerHTML, XSS, dangerouslySetInnerHTML | XSS via innerHTML | `infrastructure-patterns.md` |\n| JSON-LD, script breakout | JSON-LD Breakout | `infrastructure-patterns.md` |\n| **Python SIGABRT \u002F \"Abort trap: 6\" at finalization, parent `sshd-session`, `_enter_buffered_busy`, `Py_Finalize`\u002F`_io_TextIOWrapper_close` in the stack, a Thread blocked in `read()`, recurring `Python-*.ips`, \"crash over SSH\", MCP bridge\u002Fserver crashes on disconnect, cross-device `ssh host python …`, crash survives swapping the python interpreter** | Python finalization SIGABRT over SSH — daemon-thread-blocked-in-read SCRIPT bug, usually a cross-device MCP stdio server (NOT the interpreter; NOT scheduled — on-demand). Forensic capture via `~\u002F.zshenv` SSH-cmd logger + WatchPaths crash-watcher correlated by **parentPid**. Fix: run the MCP server locally where the resource lives + `os._exit(0)` after the work loop (#22) | `infrastructure-patterns.md` |\n| cannot find module, postinstall, npm install broke, every update breaks | File Extension Mismatch \u002F Broken Postinstall (#17\u002F#18) | `infrastructure-patterns.md` |\n| npm-cli.js, shell script, SyntaxError unexpected string | npm-cli.js Shell Script Corruption (#17) | `infrastructure-patterns.md` |\n| installing deps one by one, each reveals another missing | Non-Fatal Postinstall Cascade (#18) | `infrastructure-patterns.md` |\n| stale data, admin user sync, visibilitychange | Data Stale Admin\u002FUser (#16) | `debugging-discipline.md` |\n| slow page, slow route, slow dashboard, 8M rows, COUNT(*) on every request, full table scan, why is X so slow, route reads wrong cache, cron warms wrong KV key, prewarm warms wrong thing, 24h\u002Flast-N window empty, lagged data source, requested_datetime lag | Hot-Path Data-Volume & Cache-Topology (#20) | `debugging-discipline.md` |\n| systematic, 4-phase, root cause, discipline | Debugging Discipline | `debugging-discipline.md` |\n| lint, biome, npm audit, security cleanup | Lint & Security Cleanup | `debugging-discipline.md` |\n| **Workers Cache leak \u002F wrong data after enabling `cache.enabled`** — user A sees user B's data, authed JSON route returns someone else's response, `cf-cache-status: HIT` on a per-user route, stale per-user data exactly ~2h old, data leak after enabling the new CF Workers Cache, cache flag \"not doing anything\" (wrangler \u003C4.69 silently ignores it), `Unexpected fields found in top-level field: \"cache\"` | Workers Cache heuristic-caching cross-user leak — a 200 with NO Cache-Control is heuristically cached 2h; cookie auth (Clerk `__session`) does NOT auto-bypass. Fix: fail-safe default `private, no-store` + explicit `public` opt-ins; verify with `~\u002F.claude\u002Fskills\u002Fship\u002Ftools\u002Fworkers-cache-check.sh \u003Crepo>` + live `curl -sI \\| grep -i cf-cache-status`. Wrangler must be ≥4.69 in the repo's node_modules or the flag is inert. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fworkers-cache-safety.md` |\n| **Sitewide redirect loop \u002F site down right after enabling Workers Cache** — `ERR_TOO_MANY_REDIRECTS`, every path 301s to its own URL, all UAs affected, `Location:` equals the requested URL, 301s explode in zone analytics right after a cache-enable deploy, HSTS header disappeared, worker logs show `http:\u002F\u002F` in `request.url` while `cf-visitor` says `{\"scheme\":\"https\"}`, \"I disabled the flag and it didn't fix it\" (checked within seconds) | Workers Cache **scheme-presentation** class (2026-07-06 example ~25-min outage): the cache front-layer hands the Worker `http:\u002F\u002F` for HTTPS visitors → any `url.protocol === \"http:\"` canonicalize middleware 301-loops the whole site, and `url.protocol === \"https:\"`-gated HSTS silently never fires. **Diagnose in ONE probe**: `wrangler tail --format json` → `event.request.url` scheme for a live HTTPS request. **Fix**: derive the client scheme from `cf-visitor` (authoritative) — `visitorIsHttps()` pattern, AIVA `src\u002Fworker\u002Fmiddleware\u002FsecurityHeaders.ts`; `url.protocol` only as local-dev fallback. **Triage rules**: disable\u002Frollback propagates in >30s — a \u003C60s check is NOT evidence (a 3s check false-negatived during the incident and caused an unneeded rollback; verify over ≥60s); zone SSL mode, Page Rules, and Config Rules are red herrings (the presentation comes from the cache layer itself). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fworkers-cache-safety.md` |\n| error too vague to act on, ambiguous error message, \"can't tell what failed\", same error fires 100s of times, log noise \u002F superfluous log entries, no log at the failure point, silent failure, \"why are these errors so unclear\", add debug attributes, clean up the logs, assess the logs, improve log output | Observability \u002F Log Hygiene — make ambiguous errors actionable (what was attempted + actual values + likely cause\u002Fbranch + disambiguation: a vague error is usually two root causes sharing one string — split them), reduce noise by *downgrading* level (never delete), add the one attribute that names the failure. For a **proactive scheduled** pass over a window of logs, use the `\u002Flog-hygiene` skill instead. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md` (+ `\u002Flog-hygiene` skill) |\n\nAll reference files are in `~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F`.\n\n---\n\n## Reference Files Index\n\n| File | Content |\n|------|---------|\n| `error-handling-patterns.md` | Catch-all masking (#1), external municipal form hard-500 (#15), CI false positives (#11), admin auth DB fallback (#14), admin 500 vs 403, Experience Cloud catalog-and-submit (#36), one-shot persist lock (#42) |\n| `react-patterns.md` | Scope bug (#2), silent startup (#3), useEffect abuse (#15), localStorage persistence (#13), async double-click (weaker sibling of #42), missing auth guard |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fundefined-null-render-safety.md` | **Undefined\u002Fnull-render bug class** — 9 patterns (null-gate hides UI, unguarded property access, `.map`\u002Fstring\u002F`Date` on possibly-undefined, JSON.parse, raw-undefined render, missing loading\u002Fempty states, backend omits a field) + live DOM grep for rendered `undefined`\u002F`NaN`\u002F`[object Object]`. Cross-refs the admin blind-spot class (truncation, NULL-aggregate sort, count mismatch, inner-JOIN drop, admin-auth DB fallback). Reference incident: AIVA admin \"Test account\" toggle hidden by an `isTest !== null` gate (2026-06-01) |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fanti-slop-typescript.md` | **Anti-slop TypeScript** — ban generic `isRecord`\u002F`isObject` guards, `as unknown as T` launder-casts, `(x as any).field` reach-casts; require named types \u002F discriminated unions \u002F Zod schemas (`z.infer`) at trust boundaries; targeted predicate only as last resort. Enforcers: repo-vendored dmmulroy\u002Fanti-slop Oxlint plugin (18 generic rules + 5 opt-in Effect rules, upstream c44ef22; `\u002Finstall-anti-slop` skill vendors it, then `.\u002Fnode_modules\u002F.bin\u002Foxlint` is the gate — `--fix` first for `require-readable-spacing`, the only autofixable rule) or fallback `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fdetect-ts-slop.sh`. |\n| `css-layout-patterns.md` | Text overflow flex+grid (#12), fixed grid mobile, iOS Safari rendering (PDF, vh, fixed) |\n| `csp-cache-patterns.md` | Social card cache (#5), CSP multi-layer blocking (#9), www redirect (#4), deploy chunk invalidation, CF Pages stale deploy |\n| `infrastructure-patterns.md` | Infra destruction (#6), Rust cross-platform lint (#7), Homebrew keg-only (#8), serde config crash (#10), XSS innerHTML, JSON-LD breakout |\n| `debugging-discipline.md` | 4-phase workflow, diagnostic checklist (23 items), lint\u002Fsecurity cleanup, data stale admin\u002Fuser (#16), hot-path data-volume & cache-topology (#20) |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` | Passkey\u002FTOTP\u002Fpasswordless lifecycle: alternate-login enforcement, fresh-session management, safe recovery, authoritative status, recovery-code custody, and leaked-token response |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md` | **Observability \u002F log hygiene**: 4-part actionable error-message design, boundary\u002Fdecision-point logging, downgrade-noise-never-delete, instrument-on-fix attribute heuristic, stack log sources. Proactive scheduled counterpart: `\u002Flog-hygiene` skill. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md` | **Pattern #32 — one opaque error, N independent causes**: discriminator-first protocol (ship the properties-report before the next fix), free-bisect rule when failures have no side effect, one-variable-per-probe (anti-confound), component bisect, cross-reference successes, instrument-liveness table (dead `tail`, pretty-printed JSON, lagging KV), and why a health probe that stops before the failing step is blind by construction. Reference incident 2026-08-03: Solve SF `\u002Fsubmit` — five causes behind one `{\"error\":\"Invalid\"}`, ~6 deploys. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md` | **Pattern #38 — the manipulation silently no-op'd**: the four gates (applied \u002F not-lagging \u002F repeated \u002F don't-publish), why \"it looks intermittent\" is the tell, and an instrument-trap table (`set -o pipefail` + `grep -q` SIGPIPE false-failures, suppressed apply output, silently-failing alert paths, lagging derived signals, overlay screenshots, features that rewrite your fixture). Reference incident 2026-08-25: SmartTube 403 — 21-file bisect invalidated because the app's own Auto backup clobbered the staged fixture on every launch; real cause was one line, `preferred_dns_type=2`. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md` | **Pattern #31 — management API ≠ authoritative state**: declared-vs-consumer probe table (DNS, TLS, secrets, schema, deps, email auth, deployed code), the two questions before any \"absent\"\u002F\"redundant\" conclusion, audit-log provenance check (`actor.type`). Reference incidents 2026-07-28: phantom CAA outage (API 5 records vs `dig` 11) and 20 \"redundant\" cert packs that were live Worker custom-domain certs. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fant-verification-protocol.md` | **Ant-level quality gates**: OWASP sweep, truthfulness protocol, closed-loop verification |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fcloudflare-data-ceilings.md` | **Cloudflare storage ceilings + D1 query-shape traps** — the 10 GB\u002Fdb cap (no documented increase path), 30 s query timeout, and four MEASURED traps: combined `MIN(x), MAX(x)` disables SQLite's sole-aggregate index optimization (9,984,941 rows read vs **1** when split into two queries); `COUNT(*)` walks the heap (~37× costlier\u002Frow than an indexed range scan); `dbstat` and `pragma_freelist_count` are unavailable\u002F`SQLITE_AUTH`-blocked in D1, so per-table bytes and free-page bloat are **unmeasurable** — use `meta.size_after` (returned on every D1 response); and D1 never documents whether `DELETE` reclaims space, so a post-archive size drop is unverified until measured on a copy. Also the agent-facing tooling: **Local Explorer API at `\u002Fcdn-cgi\u002Fexplorer\u002Fapi`** (auto-captured OTel traces under `wrangler dev` — query it BEFORE adding temporary logging and redeploying). Reference measurements 2026-08-13: `improvebayarea` D1 at 57.5% of cap, `reports` = 9,984,941 rows, `COUNT(*)` = 21,957 ms. |\n\n---\n\n## Cookie extraction (curl \u002F yt-dlp \u002F scrape with logged-in session)\n\nWhen you need browser cookies for a non-browser tool (curl `--cookie`, yt-dlp `--cookies`, requests `cookies={}`, scrapers, n8n nodes), pick by where the live session is:\n\n| Where the session is | Best tool | Why |\n|---|---|---|\n| Live REAL Chrome (fcdp-driven) | **`~\u002Ftools\u002Ffcdp\u002Ffcdp raw Network.getCookies '{\"urls\":[…]}'`** | Includes session-only cookies not yet flushed to SQLite; no Keychain prompt; aligned with `\u002Ffeedback_browser_default_chrome_profile`. |\n| Regular Chrome profile (`~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FDefault`) | **`~\u002Ftools\u002Fcookies-txt \u003Curl>`** | Reads SQLite + macOS Keychain. Works headless \u002F from cron \u002F without any browser attached. Outputs Netscape, JSON, or `Cookie:` header. |\n| Brave \u002F Edge \u002F Chromium | `~\u002Ftools\u002Fcookies-txt --browser brave \\| edge \\| chromium \u003Curl>` | Same code, different Keychain entry. |\n| One-shot, don't care about reuse | `yt-dlp --cookies-from-browser chrome:Default \u003Curl>` | Already installed; bypasses the question entirely if all you need is yt-dlp. |\n\n### ⚠️ Which machine — fcdp runs BOTH, but by different transports (verified 2026-07-29)\n\n| Machine | How fcdp reaches Chrome | Notes |\n|---|---|---|\n| **Laptop** (interactive) | **extension + bridge** — the REAL Default profile | The only way in: Chrome 136+ refuses `--remote-debugging-port` on the Default profile. Includes session-only cookies. |\n| **mac-mini** (crons) | **BOTH** — extension+bridge by default; direct CDP opt-in | On PATH (`~\u002F.local\u002Fbin\u002Ffcdp`). **Default (unset `FCDP_CDP_URL`) = extension+bridge → the REAL Default profile**, same as the laptop. Opt into the headless instance per-command with `FCDP_CDP_URL=http:\u002F\u002F127.0.0.1:9222` (Chrome headless on `--user-data-dir ~\u002F.kuri\u002Fchrome-cdp-nextrequest`, KeepAlive-supervised by `com.barklee.kuri-cdp-nextrequest`; holds the logged-in NextRequest session). Note `[::1]:9222` does NOT answer — use the IPv4 form. |\n\n**Both transports are live on the mini (2026-07-29).** `--load-extension` really is INERT on Chrome 150 (scratch profile registered 0 extensions, no service-worker target) — but the manual `chrome:\u002F\u002Fextensions → Load unpacked` route **works over Screen Sharing** against the mini's *GUI* Default Chrome (only its `:9222` instance is headless). Bridge agent `com.barklee.fcdp-bridge` is loaded; `bridge.log` shows `ext#1 connected (1 profile(s) live)`.\n\nSo on the mini: **bridge\u002Fextension → the real Default profile** (`chrome.tabs` **integer** ids), **direct CDP → the headless `:9222` profile** (**hex** target ids). The id shape tells you which profile you actually hit — check it before trusting a result.\n\n⚠️ **`FCDP_CDP_URL` was briefly pinned in `~\u002F.zshenv` + `~\u002F.hermes\u002F.env`, and that was wrong — REMOVED 2026-07-29.** A global pin silently routed *every* Hermes cron to the **headless** profile, which does not have the user's real logins. Anything cookie- or session-dependent would read a logged-out browser and report \"logged out\" instead of failing loudly. Set the variable **per command**, never globally.\n\n### 🛑 Concurrency + memory rules for cron-driven fcdp (mandatory — 2026-07-29)\n\nTwo failure modes, both verified on the mini, both silent:\n\n1. **Clobbering.** fcdp caches \"the active tab\" in **one shared file** (`~\u002F.cache\u002Ffcdp-tab`), last-writer-wins. Two concurrent jobs: A opens (cache=A), B opens (cache=B), then **A's next tabId-less command drives B's tab** — A scrapes B's page with no error and wrong data. Proven by watching the file change under two sequential opens.\n2. **Tab leaks → memory.** A job that opens a tab and dies before closing leaks it permanently. Chrome on the mini runs ~4 GB across ~30 processes of **16 GB total**; three duplicate `chrome:\u002F\u002Fextensions` tabs accumulated from setup work alone.\n\n**Always drive cron browser work through `fcdp-job`** (`~\u002Ftools\u002Ffcdp\u002Ffcdp-job`, on PATH). It gives the job a private tab cache (`FCDP_TAB_CACHE`, the anti-clobber mechanism), exports `$FCDP_JOB_TAB`, and closes the tab via `trap EXIT` on **any** exit path — success, failure, timeout, or Ctrl-C:\n\n```bash\nfcdp-job https:\u002F\u002Fexample.com bash -c 'fcdp js \"$FCDP_JOB_TAB\" \"document.title\"'\nfcdp-job --keep \u003Curl> \u003Ccmd>      # leave the tab open while debugging\nFCDP_CDP_URL=http:\u002F\u002F127.0.0.1:9222 fcdp-job \u003Curl> \u003Ccmd>   # headless profile\n```\n\nVerified: two concurrent jobs each read their own page; a job exiting `1` still leaves the tab count unchanged.\n\n**Backstop:** `~\u002Ftools\u002Ffcdp-tabkeep\u002Ffcdp-tabkeep.sh` prunes junk (`about:blank`, `chrome:\u002F\u002Fnewtab`), duplicate URLs, and anything past `MAX_TABS` (default 10) on **both** profiles. It **never** closes a URL matching `PROTECT` (default `nextrequest\\.com` — sf-nr depends on that session) and never closes a profile's last tab. Dry-runs by default; `--apply` to act. Hermes cron `fcdp-tabkeep` (`04a06f080be9`) runs it hourly at :37 via `~\u002F.hermes\u002Fscripts\u002Ffcdp-tabkeep-cron.sh` (the wrapper exists because the script dry-runs by default). Log: `~\u002FLibrary\u002FLogs\u002Ffcdp-tabkeep.log`, which also records Chrome's RSS + process count each run.\n\n**Layering:** `fcdp-job` *prevents* leaks; the pruner only *catches repeated* ones (duplicates + cap). A single stale non-duplicate tab under the cap survives by design — that conservatism is what keeps the NextRequest session safe. Don't \"fix\" it by making the pruner more aggressive.\n\n**Trap when closing on direct CDP:** Chrome's `\u002Fjson\u002Fclose\u002F\u003Cid>` replies with the plain string `Target is closing`, **not JSON**. fcdp used to crash on it *after* the close had already succeeded — so callers logged `FAILED` for tabs that were in fact closed. Fixed 2026-07-29 (`_http_text`, 404 = already-closed = success). If you see a close \"fail\", re-list the tabs before believing it.\n\n**Driving Screen Sharing (hard-won, 2026-07-29):**\n- `left_click` does **not** forward to the remote. `mouse_move` + separate `left_mouse_down` \u002F `left_mouse_up` **does**. A ~1s hold between them opens Dock context menus — press fast.\n- Typing forwards but **drops characters** on longer strings, and `~` triggers the accent picker which then **swallows all input** (Escape will not clear it). Navigate with AppleScript over ssh instead: `osascript -e 'tell application \"Google Chrome\" to set URL of active tab of front window to \"chrome:\u002F\u002Fextensions\"'`.\n- `osascript` can *query* System Events but **cannot send keystrokes** (`error 1002`) without Accessibility; `launchctl asuser` fails with `Could not switch to audit session`.\n- If the remote window renders stale\u002Finvisible, **reconnect Screen Sharing** — it forces a fresh framebuffer.\n- Drop a symlink where the file picker lands (`ln -s \u003Ctarget> ~\u002FDesktop\u002F\u003Cname>`) to cut deep folder navigation to two clicks.\n\n**Cookies specifically:** `cookies-txt` remains the right tool for a *file* of cookies on the mini — but note it **fails over SSH** (`keychain: could not read 'Chrome Safe Storage'`) while succeeding under launchd in the GUI session. That is an SSH-session artifact, not a broken tool; run the probe in the context the cron will actually use before concluding cookies are unavailable.\n\n**The mini's trap:** `cookies-txt` **fails over SSH** with `keychain: could not read 'Chrome Safe Storage'` — an SSH-session artifact, NOT a broken tool. The same binary **succeeds under launchd** in the user's GUI session (verified: 24 cookies returned via `launchctl submit`). So never conclude \"cookies are unavailable on the mini\" from an ssh test; run the probe in the context the cron will actually use.\n\n**Corollary for portable tooling:** a capture step that requires a browser belongs on the laptop; ship the result to the cron host (e.g. `caltrans-pra push-session mac-mini`) rather than trying to run the browser where the cron lives.\n\n\n**`~\u002Ftools\u002Fcookies-txt` reference** (ported from the \"Get cookies.txt LOCALLY\" Chrome extension, source at `~\u002Fre\u002Fcookies-txt-locally\u002F`):\n\n```bash\ncookies-txt github.com                            # Netscape → stdout\ncookies-txt github.com -o \u002Ftmp\u002Fcookies.txt        # → file\ncookies-txt --all -f json                         # every cookie, JSON\ncookies-txt example.com -f header                 # \"name=value; name=value;\"\ncookies-txt --browser brave --profile \"Profile 1\" foo.com\n```\n\nExit codes: `0` ok, `3` no DB at expected path, `4` Keychain entry missing\u002Fdenied, `5` decrypt failure.\n\n**fcdp path** for the REAL Chrome profile — request CDP `Network.getCookies` with `{urls: [\"https:\u002F\u002Fgithub.com\"]}`; format the returned cookie array with the same Netscape mapper the extension uses (`\u003Cdomain>\\t\u003CTRUE\u002FFALSE includeSubDomain>\\t\u003Cpath>\\t\u003CTRUE\u002FFALSE secure>\\t\u003Cexpiry>\\t\u003Cname>\\t\u003Cvalue>`).\n\n**Don't use `unbrowse` \u002F `agent-browser`** for cookie extraction — those launch separate browser instances with no logged-in state.\n\n---\n\n## Quick Diagnostic Checklist\n\nWhen debugging any production error, check in order:\n\n0. **Does a fix already exist, and what does the history say?** (`~\u002F.claude\u002Fskills\u002Fshared\u002Fbug-fix-preflight.md`, ported from pstack 2026-09-17.) Before the first hypothesis: `gh pr list --state all --search \"\u003Csymptom>\"`, `git log --oneline -S'\u003Ctoken>' -- \u003Cpath>`, `git log --oneline -20 -- \u003Cfile>` + `gh pr view \u003Cn> --json body,comments` for the substantive commits. An open PR or merged commit that plausibly fixes it switches you to **verify mode** (baseline reproduces ×2, patched build passes ×2 → Confirmed \u002F Insufficient \u002F Inconclusive) — never author a competing fix. A guard that looks wrong is often the fix for a prior incident; read its PR before removing it. And \"reproduced\" means: correct-vs-broken final state named in advance, observed **twice with a reset between**, one real state value cross-checked — one observation is an anecdote.\n1. Is the error message accurate? (catch-all masking?)\n2. Check runtime logs: `wrangler tail` or Cloudflare dashboard\n3. Reproduce locally with same endpoint + token\n4. Check external services and the installed auth adapter\u002Fprovider (Better Auth\u002FStripe\u002FDB responding?)\n5. Check env vars in deployment environment\n6. Check www redirect (losing cookies?)\n7. Check third-party IDs (stale template\u002Fproduct IDs?)\n8. Check CSP (all six directives for embeds?)\n9. Text overflow on mobile? (`min-w-0` missing, `grid-cols-2` without `sm:`)\n10. Preference not persisting? (localStorage writer without App.tsx reader)\n11. \"Cannot find module\" after every update? Run `file \u003Cpath>.js` — may be a shell script (#17)\n12. Installing missing deps one-by-one, each reveals another? STOP — postinstall is broken (#18)\n13. External city form 500 after category change? Probe the failing category and a known-good category through the same first-party save path before blaming auth\u002Fphoto.\n13a. Experience Cloud \u002F Aura 311 catalog or submit NPE (`toastPayload`, empty `objCaseConfigWrapper`, dummy `modelFlags`, \"listed types not filing\")? Load Pattern #36 **before** another envelope guess. Listed ≠ fileable; SUCCESS-empty = `captureFailure`; unwrap before send; remint IDs; classify on field API names; named refuse; Apex NPE ≠ city rejection. Flatten the live JSON with `gron` (`gron body.json | rg toastPayload`) before guessing keys; replay with `hurl --test`.\n14. Production auth configured? Verify Worker dry-run bindings and live HTML do not expose `pk_test`, `sk_test`, or `.accounts.dev`.\n15. Live artifact matches production? Fetch cache-busted HTML and CSP headers; compare live response, not only local `dist`.\n16. Worker secrets correct? Sensitive bindings must appear as `secret_text` from `wrangler secret list`; no key\u002Ftoken\u002Fpassword literal should remain in `wrangler.json` `vars`.\n17. `wrangler secret put` says binding already exists? Remove the plaintext var from config, deploy without `--keep-vars`, put the secret, and re-list secrets before trusting it.\n18. AIVA deployed? AIVA uses first-party Better Auth. Verify retired Clerk fingerprints are absent from live HTML\u002FCSP\u002Fbindings, `GET \u002Fapi\u002Fauth\u002Fok` returns 200, wrong-password sign-in returns 401 rather than 500, and `npm run test:integration:prod` passes if available.\n18a. Passkey\u002FTOTP\u002F2FA problem or status claim? Load `account-security-lifecycle.md`; enumerate every session-creation and security-management path; distinguish account enrollment from sign-in enforcement and site-wide enrollment policy; reproduce a stale session; and use only PII-minimal authoritative counts for production status.\n19. **Page\u002Froute slow?** (a) Enumerate every query that runs *before the response* — measure each `COUNT(*)`\u002F`SUM(CASE...)`\u002Fwhole-partition aggregate with `wrangler d1 execute --json` → `meta.rows_read`; >~100k rows on a per-request path = the bug. (b) Does it read a cache? Then `grep` for who *writes* that exact key — if nothing does (or only a manual script, no cron), it's a permanent MISS. (c) Cron warming a cache? `grep` for who *reads* those keys — a warmer that warms keys nothing reads (or a different key-shape than the route reads) is the bug. (d) `WHERE ts >= now() - N` against a lagged source returns empty — anchor on `MAX(ts)`. See Pattern #20.\n20. **Third-party submit reported as failed but the agency received it?** (DBI complaint flow, Verint dform save, OAuth callback, any webhook receiver, any reverse-engineered API replay.) Run `ls src\u002F__fixtures__\u002F\u003Cintegration>\u002F 2>\u002Fdev\u002Fnull`. If there is no `*-success.*` AND `*-failure.*` pair captured from the LIVE system, you cannot trust the detector — the test suite is asserting against fiction. Write `tools\u002Frepro\u002F\u003Cintegration>-probe.{sh,mjs}`, run it once for a known-good and a known-bad request, save both responses, then diff them to find the actual distinguishing feature (anchored DOM id \u002F JSON field, NOT a substring that appears in both). Don't ship detector code without real fixtures. See Pattern #23 + `~\u002F.claude\u002Fskills\u002Fshared\u002Fthird-party-signal-fixtures.md`. Reference incident (2026-05-27): every IBA-submitted DBI complaint was reported as `validation` error for ~10 days while the city actually recorded every one of them — synthetic test fixture (`\u003Chtml>\u003Cbody>\u003Ch1>Thank you\u003C\u002Fh1>...`) didn't contain the form layout strings (`Sub_Button0`, `CheckBox1`) that the real DBI success page does contain, so the detector's `looksLikeEchoedForm` heuristic was never exercised against reality.\n\n21. **Error too vague to act on, firing repeatedly, or no log at the failure point?** Don't just patch this one instance — make the message actionable (what was attempted + actual values + likely cause\u002Fbranch + disambiguation; a vague error is usually two root causes sharing one string), add the one attribute that would have named the failure, and *downgrade* noisy lines rather than deleting them. Standard: `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md`. For a scheduled sweep over a window of logs, use the `\u002Flog-hygiene` skill.\n\n22. **About to conclude \"X is absent\" or \"X is redundant \u002F safe to delete\" from a provider\u002Fmanagement API?** STOP — that API shows what was *declared*, not what the platform *injected*, and never *why* a resource exists. Two questions before the conclusion: (1) **Is my view complete?** Name the consumer (resolver \u002F CA \u002F browser \u002F runtime \u002F MTA) and probe it directly — `dig` not `dns_records`, `openssl s_client` not the cert list, a real delivered message's `Authentication-Results` not your SPF records. A count mismatch between the declared and authoritative views **is the finding**. (2) **Do I know what created it?** Check the audit log's `actor.type` — `system` means the platform provisioned it and something probably depends on it. **You cannot call a resource redundant until you can name what created it.** Deletion recommendations built on a management-API read are the dangerous output here: the false-\"absent\" mode wastes a cycle, the false-\"redundant\" mode causes an outage. Pattern #31: `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md`.\n\nFor the full checklist, load `debugging-discipline.md`.\n\n---\n\n## Hard Rules\n\n### Deployment Prohibition (MANDATORY)\n\n`\u002Fdebug` is for investigation, local reproduction, local\u002Freviewable fixes, and verification only. Production release authority belongs to `\u002Fship`, not this skill.\n\nNEVER deploy, promote, release, or mutate production traffic while operating under `\u002Fdebug`, even if the user also mentions \"ship\", \"prod\", \"deploy\", \"push live\", or \"fix and deploy\" in the same request. Do not run production deployment commands and do not invoke `\u002Fship` autonomously.\n\nForbidden examples include `wrangler deploy`, `wrangler versions deploy`, `wrangler pages deploy`, `npm run deploy`, `pnpm deploy`, `vercel deploy --prod`, `netlify deploy --prod`, `firebase deploy`, `fly deploy`, `railway up`, `render deploy`, Docker image push\u002Fpromote commands, production migration\u002Fapply commands, and any Cloudflare\u002FVercel\u002FGitHub release promotion that changes live traffic.\n\nAllowed under `\u002Fdebug`: inspect logs, reproduce failures, patch locally, run bounded tests, and commit changes if the user asked for code changes and git safety checks pass. After implementing a fix, STOP and tell the user: \"Fix is committed and ready. Run `\u002Fship` to deploy to production.\" If the user wants production deployment, they must invoke `\u002Fship` explicitly in a separate step.\n\n### Installed-Source Ground-Truth Guard (MANDATORY — 2026-06-12)\n\nBefore proposing any fix that touches a dependency\u002Fplugin\u002Fframework\u002Fthird-party widget, load `~\u002F.claude\u002Fskills\u002Fshared\u002Finstalled-source-ground-truth.md` and follow it: read the installed package's types+JSDoc in `node_modules\u002F` for real option semantics, read the native platform implementation when platform support matters, and probe the live DOM\u002Ftraffic for third-party widgets. Cite file+symbol in the fix. (2026-06-12: three CSS workarounds failed against the Brevo widget; the real fix — StatusBar `overlaysWebView:false` on iOS — was found by reading the installed plugin's Swift source.)\n\n### Semantic Security Review Gate — LOOP UNTIL CLEAN (MANDATORY — 2026-07-22)\n\n**When a `\u002Fdebug` session lands a code fix, run the built-in `security-review` skill on the fix before declaring it resolved, and loop until it is clean.** A debug fix that patches the symptom but introduces (or leaves) an injection \u002F XSS \u002F SSRF \u002F auth-bypass \u002F secret-exposure \u002F logic flaw is not done. This is AI\u002Fsemantic dataflow analysis — it catches the vulnerability class the pattern-routing tables above do not.\n\n**⚠️ OPERATIONAL (verified 2026-07-22):** `security-review` runs against the CURRENT WORKING DIRECTORY's git repo (no path arg; hard-fails `\"needs to run inside a git repository\"` if cwd is wrong — `cd \u003Crepo-root>` FIRST) and reviews the **COMMITTED** branch diff vs the base, NOT uncommitted working-tree edits (proven: unstaged changes → empty diff). **Commit the fix before running this gate**, or it reviews nothing. It returns a markdown report (file:line, severity, confidence 1–10) with its own false-positive filter at confidence ≥8. If the Skill returns unknown-skill, tell the user the gate couldn't run rather than passing silently.\n\n**The loop:** (1) `cd` into the repo root, invoke the `security-review` skill (Skill tool) on the changed code; (2) triage its reported (confidence-≥8) findings real vs. genuine-false-positive; (3) FIX every real finding inline, obeying the No-Suppression Rule (no `@ts-ignore`\u002F`eslint-disable`\u002F`biome-ignore` — remove the actual vulnerability); (4) re-invoke `security-review`; (5) repeat until the report is **empty**. Document any genuine false positive inline with its reason; fix everything else, never defer. **Loop guard:** same finding surviving 5 attempts → STOP and surface it to the user. This runs entirely within `\u002Fdebug`'s allowed scope (local fix + verify) — it does NOT deploy (Deployment Prohibition still holds); the code is left security-clean and committed, and `\u002Fship`'s Phase 1.29 re-runs the same loop at deploy time. Skip only when the session made no code change (pure investigation\u002Freference).\n\n### Test Safety (CRITICAL)\n\nVitest fork workers leak ~5GB memory each when they hang:\n1. ALWAYS wrap test commands: `timeout 120 npx vitest run src\u002Fspecific\u002Ftest.ts 2>&1`\n2. NEVER run full test suite (`npm test`, `npx vitest run` with no args)\n3. Maximum 3 test runs per investigation phase\n4. Clean up: `pgrep -f vitest | xargs kill 2>\u002Fdev\u002Fnull`\n\n### Infrastructure Safety\n\n- NEVER execute `terraform destroy`, `terraform apply -auto-approve`, `DROP TABLE\u002FDATABASE`, or cloud CLI delete\u002Fterminate commands\n- NEVER modify .tfstate files\n- ALWAYS show `terraform plan` output and get approval before any `apply`\n\n---\n\n## Instructions\n\nWhen this skill is invoked:\n\n1. Parse the user's symptom or pattern name against the **Pattern Routing** table above\n2. Read ONLY the matching reference file from `~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F`\n   - For account-security symptoms, the matching file is `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md`; also read the installed auth SDK\u002Fplugin source before proposing a fix.\n3. **Load `~\u002F.claude\u002Fskills\u002Fshared\u002Fant-verification-protocol.md`** and apply:\n   - Truthfulness Protocol (Section 2): never guess root causes — gather evidence first\n   - Closed-Loop Verification (Section 3): reproduce failure BEFORE and AFTER fix\n   - Security Review Gate (Section 1): if symptom touches auth\u002Finput\u002Fdata handling\n4. Show the relevant pattern section to the user\n5. If the symptom doesn't match any pattern, show the **Quick Diagnostic Checklist** and recommend `\u002Fcode` for deep investigation\n6. If a fix is needed, follow the 4-phase debugging discipline (load `debugging-discipline.md`)\n7. After any fix: run lint + security cleanup (load `debugging-discipline.md` for the commands)\n8. **Ant verification**: never say \"fixed\" without running the verification checklist from Section 2\n\n```\nLoad the matching reference file and show the relevant pattern.\nIf the issue needs deep investigation beyond known patterns, recommend \u002Fcode.\nCRITICAL: Do NOT deploy, promote, release, or invoke \u002Fship from \u002Fdebug. Production shipping belongs only to \u002Fship, invoked separately by the user.\n```\n\n\n## Script false-failures that make a WORKING thing look broken — MANDATORY (2026-08-25)\n\nSibling of the PATH section below: there the script can't find a binary; here the\nscript finds it, runs it correctly, and **reports failure anyway**. Both waste a\ndebugging session on a non-bug.\n\n- **`set -o pipefail` + `grep -q` \u002F `head` = guaranteed false failure on valid input.**\n  `grep -q` exits at the first match, the upstream producer gets **SIGPIPE**, and\n  `pipefail` propagates that as a failed pipeline. Signature: *\"it fails inside my\n  script but the exact same command works when I paste it in the terminal\"* (your\n  shell has no `pipefail`). **⚠️ INPUT-SIZE DEPENDENT — the producer must still be\n  writing when grep exits, so a SMALL test fixture will NOT reproduce it.** Measured\n  2026-08-25: a 2-entry zip reproduced 0\u002F3; a 4,007-line listing with the match early\n  reproduced 3\u002F3. Size the repro like production or you will 'disprove' a real bug.\n  Fix — count instead of short-circuiting, since `grep -c`\n  drains all input:\n  ```bash\n  if ! unzip -l \"$f\" | grep -q AndroidManifest; then   # ❌ SIGPIPE -> false failure\n  n=$(unzip -l \"$f\" | grep -c AndroidManifest || true) # ✅ drains input\n  [ \"${n:-0}\" -ge 1 ] || die \"not a valid APK\"\n  ```\n- **Never `>\u002Fdev\u002Fnull 2>&1` an apply \u002F restore \u002F deploy \u002F install step** you will draw\n  conclusions from. A silent no-op is indistinguishable from success.\n- **An alert path that can fail silently is worse than no alert.** Capture rc + output\n  of the send and log `alert sent: …` vs `ALERT-FAILED rc=…`; otherwise \"alerting is\n  configured\" is untested folklore. (Configured ≠ fires — see the No-Lie gate Check 6.)\n- **Downloading a GitHub release asset:** `curl` with an `Authorization:` header\n  following the redirect to S3 is flaky (the header is re-sent to a host that rejects\n  it). Use `gh release download` — it handles auth + redirect.\n\nReference incident 2026-08-25: a valid 25 MB APK was rejected as \"not a valid APK\"\nby the first rule above, in a cron script that was otherwise correct.\nFull table of instrument traps: `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md`.\n\n## Non-interactive \u002F remote PATH false-negatives (ssh · launchd · cron · Hermes) — MANDATORY (2026-06-19)\n\n`ssh host 'cmd'` (BatchMode), launchd agents, and cron run with a **bare PATH** that excludes\nHomebrew (`\u002Fopt\u002Fhomebrew\u002Fbin`) and `~\u002F.local\u002Fbin`. The failures below are NOT real — they are PATH:\n\n- `ssh host 'which node'` \u002F `which hermes` \u002F `which brew` → \"not found\" even when installed\n  (`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode`, `~\u002F.local\u002Fbin\u002Fhermes`). **Probe explicit absolute paths**; never\n  conclude \"not installed\" from `which` in a non-interactive shell.\n- A tool invoked by launchd\u002Fcron dies with \"command not found\" → **pin the absolute interpreter\n  path** in the shim\u002Fplist (`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode script.mjs`) and set `PATH` in the plist\n  `EnvironmentVariables`. A `#!\u002Fusr\u002Fbin\u002Fenv node` shebang fails under launchd.\n- Verifying a remote agent job: `ssh host 'PATH=$HOME\u002F.local\u002Fbin:\u002Fopt\u002Fhomebrew\u002Fbin:$PATH \u003Ctool> ...'`\n  — a plain `ssh host '\u003Ctool> ...'` false-negatives (\"NO-JOB\" when the job exists).\n- Remote **zsh aborts the whole `ssh 'script'`** on an unmatched glob (`\u002Fpath\u002F*\u002Fbin`) — quote globs\n  or wrap in `bash -lc`.\n\nReference incident (caltrans-pra → mac-mini): `ssh mac-mini 'which node'` said \"not found\" (node was\n`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode v26`); `hermes cron list | grep caltrans` said NO-JOB (hermes at\n`~\u002F.local\u002Fbin`, off the BatchMode PATH) — the job WAS registered. Both were PATH false-negatives,\nnot missing artifacts. Verify on the runner via the **real invocation path**, with an explicit PATH.\n\n24. **Is the thing telling you \"healthy\" capable of ever saying otherwise?** Before you accept a green probe \u002F validator \u002F drift-job \u002F \"N\u002FN verified\" sweep — or retract a finding because a second measurement came back clean — construct a **known-bad input** and require the instrument to go RED. A corrupted token, a mutated id, a nonexistent resource. If the known-bad also passes, stop: the instrument is vacuous, that is now the P0, and every green it has produced is worthless. This is the mirror of the Negative-Result Rule (positive control on a *negative*; negative control on a *positive*) — and the green direction is more dangerous, because nothing about it prompts you to look. **Echo is not validation**: an upstream that reflects your value back into its response has not checked it. Report three outcomes, never two — `ok` \u002F `genuinely bad` \u002F `could not measure` — and commit the negative control as a test with its reason in the body. Also: a clean *sample* is not a clean *population* (a 30-park sample read `stale=0` against a real 1.1% drift rate), and a `verified:` date on harvested data is a decaying claim, not a health signal. Pattern #33: `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md`.\n\n23. **Did your fix leave the error string byte-identical?** That is Pattern #32, not a failed fix — the error is not a discriminator. Do NOT attempt fix N+1 blind. (a) Ship a **discriminator**: have the failure path report the measurable properties of what it sent (`len=`, boolean flags; never the payload — PII). Every flag reading false while it still fails positively excludes your hypothesis space. (b) Bisect by **component**, one variable per probe — if a probe flips fail→pass, ask what ELSE changed in that step (a confounded step is the most expensive error in this class). (c) Build a **property→result table** across all probes; the cause is the property in 100% of failures and 0% of successes. (d) If failures have no side effect, probing prod is **free** — order expected-fails first, stop at the first success, and say so. (e) **Never conclude from an instrument you haven't proven alive** — `wc -c` the tail capture, count parsed objects (`wrangler tail --format json` is PRETTY-PRINTED, not JSONL), and re-poll KV (reads lag). Pattern #32: `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md`.\n\n---\n\n## Incidents-as-Eval — the Reviewer Case Set (added 2026-10-26 — Anthropic code-review adoption)\n\nThe Mining Sweep above asks which mistake *classes* keep recurring. This section gives the reviewer an exam built from those mistakes, so a \"better\" review prompt or gate has to prove it — on the incidents that already hurt — before it is adopted. (Adapted from the Claude Code team's code-review practice, Oct 15, 2026: reviewer changes are scored against a maintained set of incident-causing changes, and kept only when the score improves.)\n\n**The case set.** Every production incident, revert, or fix-forward that a review layer should have caught becomes one case, stored next to this skill in `incident-cases\u002F` (one file per case):\n\n- **The change** — the diff, or a faithful description of it when the diff no longer exists.\n- **The bug location** — the `file:line` (or mechanism) where the defect actually was, verified by whoever diagnosed the incident. Expert-verified means the person who found the real cause, not the first plausible suspect.\n- **The layer that missed it** — which review step, gate, or check saw this change and passed it (or \"no layer saw it,\" which is itself the finding).\n\n**Scoring rule (binding).** Any change to a review prompt, a reviewer skill, or a review gate is run against the FULL case set before adoption, and the scores are recorded with the change:\n\n1. **Recall:** the changed reviewer must flag the verified bug location in each case it is shown. Keep the change only if recall improves (or holds at 100%) against the previous reviewer.\n2. **Noise:** the changed reviewer is also run over known-clean changes. A recall gain bought with new false flags on clean diffs is not an improvement — if false flags rise, the change is rejected or reworked, whatever its recall. Human reactions to findings (accepted vs. dismissed-with-reason) are the standing noise signal between formal scorings.\n3. A change that cannot be scored (no runnable reviewer, no clean set) is not adopted on intuition; it waits until it can be scored.\n\n**Seeding and upkeep.** The set is seeded from this skill's existing reference incidents — among them: the fix \"verified\" in source but never re-tested on the deployed artifact (see the No-Lie Post-Fix Gate); the valid artifact rejected by an otherwise-correct checker whose own manipulation never applied (see the script false-failures section); and the non-interactive PATH false-negatives that made installed tools and registered jobs look missing. Every new incident that reaches root cause adds its case the same day, under the standing write-back rule — the mining sweep harvests classes, and each convicted class's worst incident becomes a case. The set only grows; a case is removed only when its bug class becomes structurally impossible, and that removal is recorded with the reason.\n","# \u002Fdebug - Debugging Quick Reference\n\n## Client lifecycle enforcement (mandatory)\n\nFor asynchronous report\u002Fdraft editing, AI category changes, photos, resubmission,\nbrowser resume, or client storage, read\n[Client lifecycle enforcement](..\u002Fshared\u002Fclient-lifecycle-enforcement.md).\nBehavioral regressions must run before commit and in the actual build\u002Frelease\npath. Prove broken variants block those entry points in an isolated copy; do\nnot claim instructions alone enforce safety. Fix and update confirmed bug\nrecords within the authorized scope, distinguishing committed from deployed.\n\n## IndexedDB submission recovery (mandatory)\n\nFor “database connection is closing”, `IDBDatabase.transaction`, or mobile\nsubmission-queue recovery, read [IndexedDB connection lifecycle](..\u002Fshared\u002Findexeddb-connection-lifecycle.md).\nExercise the real closed-connection path, all shared queue callers, normal submit\nand category-changed resubmit; preserve durable-before-send and never replay\nunknown network outcomes. Ship verifies the deployed queue with isolated storage.\n\n## GUI launch-job lifecycle (mandatory)\n\nBefore temporary macOS GUI jobs, onboarding, or focus\u002Finput debugging, read\n[GUI launch-job lifecycle](..\u002Fshared\u002Fmac-gui-job-lifecycle.md).\nNever use `launchctl submit` as a one-shot launcher or supervise short-lived\n`open -a` with KeepAlive. Inspect repeated-launch jobs before changing capture\nengines or input code; unload task-owned temporary jobs and prove stable input\nbefore handoff. For ship, apply this gate when the release touched Mac automation.\n\n\nFast reference for known production failure patterns. For deep debugging, use `\u002Fcode`.\n\n## Mandatory upstream-protocol check (third-party integrations)\n\nWhen the symptom involves a third-party integration falling back to a worse path (handoff, redirect, \"manual step required\") — Verint dform, Clerk, Stripe, SeeClickFix, OAuth, any SaaS — load `~\u002F.claude\u002Fskills\u002Fshared\u002Fupstream-protocol-investigation.md` BEFORE proposing a fix. Read the upstream's primary client source, capture real network traffic, inspect rendered `data-*` attributes. Treat any \"Verified YYYY-MM-DD\" comment in our codebase as a hypothesis to re-verify, not a fact. Token cost is unlimited for this; user explicitly authorized it (2026-05-09 SF311 graffiti incident: bandaid `0b746a4` → real fix `f27d1e3` after reading dform's `api.js` lines 462–520).\n\n## DocuSeal template-vs-submission gate\n\nWhen a DocuSeal form is missing fixed business values, load\n`~\u002F.claude\u002Fskills\u002Fshared\u002Fdocuseal-template-contract.md`. Prove whether the signer\nused a unique submission URL or the template shared link; inspect both the live\nsubmission and live template because mocked payload tests cannot detect template\ndefault drift. For multi-party templates, a public shared link is unsafe unless\nparty ownership is explicit; AIVA's HIPAA template must keep it disabled.\n`\u002Fdebug` remains read-only for production state.\n\n## Mutating symptom across fixes = wrong premise (MANDATORY — 2026-05-19)\n\nWhen each fix makes the symptom *change* instead of *disappear* — `fetch_error` → `handshake_rejected` → `publicid_timeout`, every \"fix\" peeling back to reveal a new failure one layer deeper — STOP. That staircase is the tell that the whole feature premise is wrong, not that you are three fixes from done. Before fixing layer N+1, verify the premise itself: does the real client even use this code path? Capture live traffic and confirm. Reference incident: the SF311 cable chain — four green-tested fixes (`wss:\u002F\u002F`→`https:\u002F\u002F`, missing `Origin` header, subscription identifier, publicId timeout) each surfaced the next layer; a live mitm capture then proved the real app never opens the WebSocket at all — the whole path was dead code. Many round-trips of \"fix the next layer\" should have been one round-trip of \"verify the premise.\"\n\n## Recurring symptom after a DOCUMENTED remediation = the runbook's causal model is wrong (MANDATORY — 2026-08-03)\n\nThe third sibling of the two rules above. Mutating error = wrong premise. Static\nerror = missing discriminator (#32). **A symptom that keeps COMING BACK on a\nschedule, after you keep applying the documented fix, = the runbook is wrong\nabout what causes it.**\n\nThe trap is that the remediation *appears* to work every time. It restores\nservice, so it never reads as a failed fix — it reads as an unlucky recurrence.\nThat is what lets a wrong causal model survive N repetitions. **Executing a\nrunbook is not debugging, and \"the alert told me to\" is not a diagnosis.**\n\n**Tripwire — fires on the SECOND repetition, not the fifth:** if a documented\nremediation has been applied ≥2 times and the symptom returned, stop executing\nit and ask the two questions that the runbook is silently answering for you:\n\n1. **What actually MINTS the thing I keep replacing, and does my system ever\n   call it?** Replacing an artifact is not the same as participating in its\n   lifecycle. If nothing in your code ever calls the issuer, you are refilling a\n   bucket with a hole and the interval between refills is the hole's size.\n2. **Measure the true survival time, don't inherit the folklore number.** Time\n   the interval yourself; the remembered figure is usually the longest one\n   anyone noticed, and the real number is a much sharper clue.\n\n**Reference incident (2026-08-03, AIVA Google Voice).** An alert said \"session\nexpired — reseed the cookies,\" with a copy-paste command. It was followed three\ntimes in 18 hours. Each reseed restored SMS, so each expiry read as bad luck.\nThe runbook was wrong: `__Secure-1PSIDTS`\u002F`__Secure-3PSIDTS` are minted ONLY by\n`accounts.google.com\u002FRotateCookies` on a ~600s cadence and gate every RPC, while\nthe Worker talked only to `clients6.google.com`, which never returns them.\nNothing in the system ever called the issuer, so reseeding could never have\nfixed it — it just restarted the same clock. The cookie-refresh code was present\nand correct; it simply had nothing to persist. Question 2 mattered too: the\nfolklore said \"about an hour,\" but timing it gave **~20 minutes** (21:51 ok →\n22:11 alerted), which matches the 600s rotation cadence and pointed straight at\nthe mechanism. Fix = call the issuer on the cadence it declares.\n\n**Corollary — \"SAPISID present=true\" class of false-healthy signal.** The alert\nreported the long-lived credential as present while the short-lived one that\nactually gates access had already expired. When a health line reports a\ncredential\u002Fresource as OK during a confirmed outage, check whether it is\nreporting a *different-lifetime* component than the one that fails. Enumerate\nthe credential set by lifetime before trusting any \"present=true\".\n\n**PREMISE-CHECK GATE — run BEFORE the first fix (not just on the staircase). Full rule: `~\u002F.claude\u002Fskills\u002Fshared\u002Fpremise-check.md`.** Two questions, answered against LIVE upstream docs (not a cached `\u002Fskill` note): (1) **Is this approach even valid for THIS runtime\u002FSDK\u002Fplatform?** The browser SDK ≠ native SDK ≠ server SDK — a strategy\u002Foption\u002FAPI documented under one is routinely absent or *forbidden* in another. If every doc\u002Fexample for the thing you want sits under a *different* platform than yours, that's your answer — stop. (2) **What's the cheapest probe** (curl the API \u002F grep the installed bundle \u002F read the doc's \"supported platforms\" line) that proves it's possible here? Run it before coding. **Docs-before-note (always):** a `\u002Fskill` recipe, comment, memory, or prior conclusion is a HYPOTHESIS — re-verify any load-bearing \"API\u002FSDK can\u002Fcan't do X\" claim against the upstream's own *current* docs\u002Fsource before building on it; live source wins, fix the stale note in the same pass. **2026-06-13 reference incident:** hours spent debugging Clerk native `oauth_token_apple` from a Capacitor webview — clerk-js (browser SDK) can never send it (browser-forced `Origin` vs Clerk Native-API `Authorization` conflict), a fact Clerk's docs state plainly under \"Expo only.\" A wrong `\u002Fios` trap-#4 note was trusted as fact; the working web-OAuth fix was a 5-minute live-doc read away. Now also enforced session-wide by the `premise-check-session-start.sh` SessionStart hook.\n\n## \"Every subset passes\" \u002F \"it looks intermittent\" = your manipulation never applied (MANDATORY — 2026-08-25)\n\nThe fourth sibling of the three rules above. Mutating error = wrong premise.\nStatic error = missing discriminator (#32). Recurring-after-remediation = wrong\nrunbook. **Every arm passing, no single change reproducing it, and a growing urge\nto call the bug \"intermittent\" = the change you think you applied never reached\nthe system, and you are A\u002FB-ing A against A.**\n\nA deterministic bug measured through a no-op'd manipulation *presents exactly as\nflakiness*, because you are re-sampling one unchanged condition. So **\"it's\nintermittent\" is a claim requiring evidence**, not a fallback explanation.\n\n**Tripwire — before writing the word \"intermittent\", and before any bisect round\n2:** name an observable that MUST differ between arms, read it back after each\napply, and abort the run if the arms look identical. Not \"the apply exited 0\" —\nan observable in the running system.\n\n**Reference incident (2026-08-25, SmartTube 403).** Bisected 21 profile files to\nfind which setting 403'd every video stream. Every subset passed; the full set\nfailed once then passed twice; I concluded \"the PoToken mint is intermittent, not\na config bug\" and posted it publicly. It was one deterministic line\n(`preferred_dns_type=2` → Google DoH resolver). The app's own *Auto backup*\nrewrote the staged fixture on every launch, so each \"restore\" was a silent no-op\nand every run tested a fresh profile — and I had suppressed the restore step's\noutput, so nothing surfaced it. One post-restore read of the sidebar order\n(custom vs default) would have caught it on run 1. With the fixture-rewriter\ndisabled and each restore verified, the bisect converged in **three rounds**.\n\nFull gate + instrument-trap table: `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md`.\n\n## Route-coverage bugs: get the site's route list before you sample (2026-07-31)\n\nWhen the symptom is **about which pages\u002Fendpoints exist or work** — \"page X 404s in prod\",\n\"some routes broke after the deploy\", \"the new pages aren't live\", \"search can't find our\ndocs\" — do NOT debug from the handful of URLs you happened to click. Get the declared\ninventory first, then diff it against reality:\n\n```bash\ncurl -sL https:\u002F\u002F\u003Chost>\u002Frobots.txt | grep -i sitemap\ncurl -sL https:\u002F\u002F\u003Chost>\u002Fsitemap.xml | grep -o '\u003Cloc>[^\u003C]*' | sed 's|\u003Cloc>||' > \u002Ftmp\u002Fdeclared.txt\n# now diff DECLARED against DEPLOYED — the bug is usually in the gap\nwhile read -r u; do printf '%s %s\\n' \"$(curl -s -o \u002Fdev\u002Fnull -w '%{http_code}' -m 10 \"$u\")\" \"$u\"; done \u003C \u002Ftmp\u002Fdeclared.txt | grep -v '^200'\n```\n\nFor an **API**, the analog is the published spec (`\u002Fopenapi.json`, `\u002Fswagger.json`,\n`\u002Fapi-docs`, GraphQL introspection, or `unbrowse_eval_spec_discover`) — not a sitemap.\n\nThis is the **\"Compared to What?\"** rule applied to debugging: a sampled set of working\nURLs is a delta, the declared route list is the denominator. Two failures it prevents:\ndeclaring \"routes are fine\" after checking the three you remembered, and declaring \"page X\ndoesn't exist\" when it exists but 404s (a very different bug).\n\nDistinct from the security-baseline check below, where a **missing** `sitemap.xml` is itself\nthe finding (#16). Here the sitemap is the *instrument*, not the defect.\n\n## No-Lie Post-Fix Gate (MANDATORY — 2026-05-18)\n\nA \"fixed\" symptom is one that fails to reproduce on the *deployed\u002Fbuilt artifact*, not in the source. After EVERY fix, before declaring root cause resolved, run the **No-Lie Verification Protocol** from `~\u002F.claude\u002Fskills\u002Fshared\u002Fno-lie-verification.md` Checks 3 + 4:\n\n1. **Symptom re-test on the artifact**, not the source. Examples:\n   - \"Stale copy\" bug → cache-busted `curl https:\u002F\u002Fprod-url\u002Fpath` for the OLD string. Expected: 0 matches.\n   - \"API 500 on category X\" bug → `curl -X POST` reproducing the original request with a fresh cache-buster. Expected: 200 or the deliberate fallback, never a regression.\n   - \"Race condition in worker\" bug → run the original repro harness (`tools\u002Frepro\u002F*.sh`) under load and confirm the failure no longer reproduces over N runs (N≥10).\n2. **Whole-repo symptom re-grep**, not just touched files. Proves \"fixed all instances\", not \"fixed the ones I noticed\". The whole-repo grep must return 0 matches OR only matches that are demonstrably unrelated (JSON values, log files, third-party node_modules).\n3. **If the fix is in TRIGGERED behavior** (failover, retry, fallback, circuit-breaker, rate-limit cooldown, error\u002F`catch` branch, conditional cron) — **induce the trigger and watch the path fire** (Check 6 in `no-lie-verification.md`). Don't infer it from \"the parts work\": force the 429 \u002F fail the dependency N times \u002F feed the exact bad input on an isolated copy, confirm the fallback\u002Fretry\u002Ferror-path actually executed, then confirm the live instance is untouched. \"Configured\" ≠ \"fires.\"\n4. **Every claim in the final report cites the command that proves it.** Forbidden without proof: \"fixed\", \"verified\", \"root cause confirmed\", any specific count.\n\n**Reference incident (2026-05-18):** \u002Fcode agent reported \"no stale '10,000' strings — `rg` clean\" but never curl'd the live URL. Old build was still serving until \u002Fship deployed. The fix wasn't a fix until the deployed artifact was re-tested.\n\n## The Mining Sweep — estate-level root cause (MANDATORY procedure — added 2026-10-13, pstack `\u002Fcorrect` derivation)\n\nEverything above debugs ONE symptom. This procedure debugs the *corpus of past symptoms*. Invoke: `\u002Fdebug sweep [domain]`.\n\n**Why it exists.** The standing loop fixes mistakes incident-by-incident and writes each lesson into the owning skill the same day. That loop has a blind spot: nobody periodically asks which mistake *classes* keep recurring ACROSS domains, and why a class with three convictions is still enforced by a prose paragraph instead of a check. A lesson that lives only in prose will be re-learned the hard way (the ship skill's learning loop says the same thing about its own domain). The sweep is the retrospective pass that moves rules up the enforcement ladder. It is the estate-scale sibling of the tripwire above (\"recurring symptom after a documented remediation = the runbook's causal model is wrong\") — same insight, applied to the correction history instead of one runbook.\n\n**Procedure (bounded — one domain per pass):**\n\n1. **Bound the pass.** One domain (e.g. ship\u002Fplayer, records, genealogy). A sweep over everything produces a report about nothing.\n2. **Harvest the corpus.** The domain's correction sources: AGENTS.md dated lessons, `~\u002Fmemory\u002F*.md` + MEMORY.md entries, mission logs and build-progress logs in the domain's goal `hidden_files\u002F`, and the owning skills' own lesson appendices. Read them; do not work from recollection.\n3. **Cluster into classes.** Group incidents by the *mechanism* of the mistake, not the surface symptom. A class needs ≥2 sightings to count as recurring; note explicitly when a class recurs across domains — that is the highest-value finding a single-incident loop can never produce.\n4. **Build the rule → enforcer table.** One row per class: the rule stated once, the sightings (dated, sourced), the CURRENT enforcer, and its level on the ladder: **CLI\u002Fcode gate → scripted proof in a maintained map → named review lens → prose rule**. Prose is the weakest level; every row at prose level after ≥2 sightings is a finding.\n5. **Convert the top classes.** For the top 1–3 prose-only classes, name the concrete structural enforcer (a CLI preflight check, a feature-gate pattern, an evidence-presence check, a review lens) and either implement it in the same pass (if it lives in skill\u002Fworkflow files) or record it as a proposed enforcer with its owning step — never silently leave it as \"we should.\"\n6. **File the pass.** Write the table + findings to `mining-sweeps\u002F\u003Cdate>-\u003Cdomain>.md` next to this skill, and write any rule changes back into the owning skills the same day (the standing write-back rule). A sweep that produces only a report has not happened.\n\n**Cadence:** run one after any domain accumulates ~3 new convicted lessons, or monthly per active domain, whichever comes first. The genealogy loop's a scheduled sweep script is the proven automated shape if a domain wants this on a cadence.\n\n**Worked example:** keep each pass beside this skill under `mining-sweeps\u002F\u003Cdate>-\u003Cdomain>.md`. A real first pass over a shipping\u002Fplayer domain tabled 6 rules; its top prose-only classes were: declared\u002Fproxy state trusted over a live probe of the real artifact, recovery paths that don't record the failure they recover from, and environment preconditions carried in memory instead of preflight checks.\n\n## Usage\n\n```\n\u002Fdebug [pattern name or symptom]\n```\n\n## Examples\n\n- `\u002Fdebug catch-all` -- Catch-all error handling masking root cause\n- `\u002Fdebug react undefined` -- React \"X is not defined\" scope bug\n- `\u002Fdebug silent startup` -- React silently fails to mount\n- `\u002Fdebug auth failed` -- Generic auth error hiding real cause\n- `\u002Fdebug broken icons` -- Third-party icons\u002Fimages missing (CSP blocking)\n- `\u002Fdebug text overflow` -- Text escaping card boundaries on mobile\n- `\u002Fdebug stale data` -- Admin changes not visible to users\n- `\u002Fdebug deploy logout` -- Users logged out after every deploy\n- `\u002Fdebug cloudflare security alert` -- Cloudflare flagged site for missing security.txt \u002F HSTS \u002F CAA \u002F DNSSEC\n- `\u002Fdebug slow page` -- Page\u002Froute slow: full-table scan on the hot path, cron warming the wrong cache, or a lagged-source window returning empty\n- `\u002Fdebug cookies` -- Need cookies for curl\u002Fyt-dlp\u002Fscrape from a logged-in browser session (see \"Cookie extraction\" below)\n\n---\n\n## Pattern numbering (read before adding one)\n\nPattern numbers are **globally unique across all reference files**, not per-file. Before adding\n`## Pattern N:`, claim the next free N:\n\n```bash\ngrep -rhoE \"^## Pattern [0-9]+:\" ~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F*.md \\\n  | grep -oE \"[0-9]+\" | sort -n | tail -1        # highest in use\ngrep -rhoE \"^## Pattern [0-9]+:\" ~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F*.md \\\n  | grep -oE \"[0-9]+\" | sort -n | uniq -d        # existing collisions\n```\n\n`#12` and `#15` are **legacy collisions** (two distinct patterns each). Always cite a pattern as\n*file + number* (`error-handling-patterns.md #29`), never a bare number, so a collision can never\nmisroute an agent.\n\n---\n\n## Pattern Routing\n\nMatch the user's symptom to the right reference file, then load ONLY that file.\n\n| Symptom \u002F Keyword | Pattern | Reference File |\n|--------------------|---------|----------------|\n| iOS app, simulator, Xcode, Swift crash, .ips crash log, Capacitor shell misbehaving, WKWebView rendering wrong (e.g. border-radius not clipping a composited img), in-app sign-in bounced to Safari, app stuck on splash \u002F OTA rollback, webview UA flagged as in-app browser, **Clerk\u002FApple\u002FGoogle social sign-in failing in a Capacitor app — `authorization_invalid` \u002F `native_api_disabled` \u002F `origin_authorization_headers_conflict` \u002F `oauth_token_apple` \u002F \"native social login won't work in the app\", OR a passkey\u002FWebAuthn ceremony failing in the webview — \"passkey registration was cancelled or timed out\", `webcredentials`, associated domains, AASA 404** | iOS App Symptoms — route to the `\u002Fios` skill (dev\u002Fdebug loop, axiom crash\u002Fbuild\u002Fperf agents, webview driving via axe, simulator eyes+hands via `baguette` (`boot` headless, `describe-ui` a11y tree, pt taps, `screenshot`, `logs`) and `\u002Fserve-sim` (60 fps stream, camera injection, CA overlays) — `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-sim-agent-control.md`, AIVA Capacitor traps incl. clerk-js `allowedRedirectProtocols`, notifyAppReady rollback, WKWebView clip bug). **Any in-webview auth\u002Fcredential ceremony fails with a GENERIC error until the app↔domain binding exists — read \u002Fios trap #12's binding matrix and PROBE FIRST: social-OAuth Apple → trap #4 (`allowNavigation`); Google → policy-blocked, hide it; clerk-js scheme → `allowedRedirectProtocols`; passkey \"cancelled or timed out\" → `curl \u003Cdomain>\u002F.well-known\u002Fapple-app-site-association` + grep entitlements for `webcredentials` (improvebayarea `dadfdf3`). Don't debug the JS ceremony before the 30-sec probe.** | `\u002Fios` skill (`~\u002F.claude\u002Fskills\u002Fios\u002FSKILL.md`) |\n| app crashes AT LAUNCH on a real device \u002F new iOS but works in the simulator, `EXC_BREAKPOINT` in `UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`, TestFlight build closes instantly, \"native sign-in sheet returns nowhere\" after adding scenes | iOS 27 scene-lifecycle launch crash — iOS 27 kills iOS-26-SDK apps that don't adopt UIScene; Capacitor 8.4 ships no SceneDelegate. Run `\u002Fbin\u002Fbash ~\u002F.claude\u002Fskills\u002Fship\u002Ftools\u002Fios-scene-lifecycle-check.sh \u003Crepo>` FIRST (0 pass \u002F 1 fail \u002F 2 unmeasured \u002F 4 n\u002Fa) — it names the exact gap (no manifest, missing class, or missing `openURLContexts`\u002Fcold-launch URL forwarding that silently kills Google\u002FOAuth return). Apply the build-15 recipe, then prove launch on the physical phone (devicectl processes + crashes), never on an older-runtime simulator. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-app-dev-release-traps.md` §1–3 |\n| test on my real iPhone, tap\u002Fswipe\u002Fscreenshot the phone, drive TestFlight \u002F the installed app, physical-device acceptance, mobile-mcp `ETIMEDOUT` \u002F `context canceled` \u002F `PairRecord errorcode 22` on a physical iPhone | Physical iPhone control — use `\u002Fcontrolphone` (`~\u002Fprojects\u002Fiphonectl`): `controlphone screenshot` (go-ios screenshotr, no WDA), `iphonectl-setup wda` once (WDA via xcodebuild + ASC-key auto-provisioning, no p12\u002Fkeychain prompt, free port), then `controlphone tap\u002Fswipe\u002Ftype` in POINTS (px\u002F3). Don't retry mobile-mcp on iOS 27 (its capture path times out); a stale go-ios tunnel mimics broken pairing — `controlphone apps` answering proves lockdown is fine; ports 8100\u002F8101 are the mobilecli daemon's. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fios-app-dev-release-traps.md` §4 |\n| run something on the mini, mac-mini, the cron host, remote Mac, \"check the mini\", Hermes cron, ssh to the mini, Screen Sharing, why does X work on my laptop but not the mini | **remote-mini** | `~\u002F.claude\u002Fskills\u002Fshared\u002Fmac-mini-remote-control.md` — the 6-surface ladder (ssh -> scp -> hermes cron -> launchctl -> fcdp -> Screen Sharing). Climb it; don't start at the GUI. Covers the context traps that make a working tool look broken over SSH (Keychain\u002F`cookies-txt`, `open -a` -600, `osascript` 1002), the nested-heredoc credential hazard (write locally + `scp`), zsh not word-splitting, `hermes cron create` taking a POSITIONAL schedule + bare script filename, and which Chrome profile you actually hit (integer tab id = real Default, hex = headless :9222). |\n| catch-all, generic error, wrong status code, misleading error | Catch-All Error Masking (#1) | `error-handling-patterns.md` |\n| Bitwarden\u002FVaultwarden\u002Fwarden self-hosted login fails before the password is tried, \"KDF config response does not contain a valid KDF type\", prelogin, `KdfSettings` missing, some clients work and others don't after a server change, reimplemented vendor API broke one client generation | **Dual-shape contract (#44)** — mirror the upstream server's response model, emit legacy + new fields together; curl prelogin and check `kdf`,`kdfIterations`,`kdfSettings`,`salt` | `error-handling-patterns.md` (Pattern 44) + `mini-bitwarden` skill |\n| \"is there already a fix for this\", \"did someone fix this\", verify a PR fixes the bug, \"does PR #N actually fix it\", regression history, \"why is this guard here\", \"when did this break\", root-cause report confidence, \"are we sure that's the cause\" | **Bug-fix preflight** — existing-fix check → verify mode (baseline ×2 \u002F patched ×2 → Confirmed \u002F Insufficient \u002F Inconclusive, never a competing patch); regression history (`git log -S`, `--follow`, `gh pr view`) before hypotheses; every root-cause claim tiered Direct \u002F Supported \u002F Inferred \u002F Speculative \u002F Unknown (\"because\"\u002F\"fixes\" need an adjacent citation; the code is not evidence of its own intent; a report with no \"What we don't know\" is suspicious); \"reproduced\" = named correct-vs-broken final state, twice, reset between | `~\u002F.claude\u002Fskills\u002Fshared\u002Fbug-fix-preflight.md` |\n| \"what could this break\", blast radius, \"is this small change safe\", a diff to a shared helper \u002F schema \u002F wire format \u002F middleware \u002F cache key, \"does anything else read this\" | **Blast radius** — find the one fact the change is safe because of and get it to rung 4 (a script that runs the real code and fails loud) or mark it unproven; look where grep stops (pinned library source, timing, JSON\u002FDB\u002FKV shapes, another language reading the same bytes, feature flags, three hops down); risks \u002F cleared \u002F before-you-merge | `~\u002F.claude\u002Fskills\u002Fshared\u002Fblast-radius.md` |\n| \"should we retry CI\", flaky test, CI red after push, \"it passed locally\", failure in a file the diff never touched, \"the bot says\", bugbot \u002F CodeQL \u002F security-reviewer comment triage, \"just make the bot happy\" | **CI + bot triage** — classify before re-running: untouched-code failure ⇒ `git merge-base --is-ancestor` stale-base check (report \"needs rebase\", don't retry); suspected flake ⇒ ONE fresh build of the whole run (never `--failed`); identical 2nd failure was never flake; bot comments ⇒ fix \u002F dismiss \u002F ask, ask-by-default for security\u002Fauth\u002Fbilling\u002Fdata\u002Fmigrations\u002Fidempotency, run the cited test before classifying, never churn code to quiet a bot | `~\u002F.claude\u002Fskills\u002Fshared\u002Freview-verdicts-and-ci-triage.md` |\n| my edit didn't take, reposted\u002Fresubmitted with the OLD value, stale photo filed, repost reuses previous photo\u002Fcategory, edited field reverted silently, user's new value replaced by the default, \"it saved but used the old one\", no error shown | **Implicit precedence — N sources, one winner (#37)** — a collection filled from 2+ sources and consumed at `[0]`\u002F`.find()`; append order picks the winner and nothing declares it. Every gate is green because order is not a type. Run `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsingle-winner-merge-check.sh \u003Crepo>`. **Date the mechanism before blaming the latest deploy** (`git log -L`\u002F`-S`): introduced and became-reachable are usually months apart and different commits. | `error-handling-patterns.md` (Pattern 37) |\n| SF311 save 500, Verint save 500, Improve AI resubmit, category changed 500, request_type_id 500 | External Municipal Form Category Hard-500 (#15) | `error-handling-patterns.md` |\n| ticket description truncated, navFooter dropped, map links missing, address missing on filed ticket, description ends abruptly, external form truncation, Verint dform Request_description, bracket truncation, square bracket strip | External Form Description Truncation by Character (#19) | `error-handling-patterns.md` |\n| 311 ticket missing Location box, Open311 address null, mobile311 viewer shows description but no Location dt\u002Fdd, \"one ticket has location another doesn't\", sf_full_address dropped, Location_description ignored, structured location empty, lat\u002Flong null in Open311, address only in description body not the actual location field, scf location_details, address forwarding broken, coord-string in structured slot, \"hardening 311 address forwarding\", multi-city address never break | 311 Structured-Location Dropped by Long-Form \u002F Coord-String Address (#21, backend-agnostic) | `error-handling-patterns.md` |\n| MyLA311, myla311.lacity.gov, C-04342632, caseAddress blank, \", , CA.\", locator_gis_returned_address missing, All Service Requests vs My Requests, data.lacity.org 2026 2cy6-i7zn, Street_Address__c, addressDetails, LA_AddressController.validateAddress, toastPayload NPE, empty objCaseConfigWrapper, captureFailure, dummy modelFlags, Permit_Number__c, Receptacle_ID__c, fetchCaseTypeDetails, remint IssueTypeId, listed types not fileable, invalid_csrf guest mint | Experience Cloud catalog-and-submit envelope (#36) — listed ≠ fileable; SUCCESS-empty = captureFailure; unwrap toast\u002F`objCaseConfigWrapper`; remint IDs; classify on field API names; named refuse; Apex NPE ≠ city rejection | `error-handling-patterns.md` |\n| DBI complaint reported as validation but city has it, \"DBI re-rendered the form (validation rejected the submission)\" but DataSF shows the case, third-party form rejected but actually recorded, form echoed back on success, parser says failure but the agency received it, external form 200 OK we classified as failure, complaintNumber undefined but submission worked, dform\u002FVerint\u002Faspx false-negative on success, success-detection heuristic matches both success AND failure pages, lblError success vs failure span, signal-extraction tests use synthetic HTML, every IBA-submitted DBI complaint fails | Third-party signal-extractor false-negative due to synthetic fixtures (#23) | `error-handling-patterns.md` + `~\u002F.claude\u002Fskills\u002Fshared\u002Fthird-party-signal-fixtures.md` |\n| CI false positive, grep wrong, CI still fails | CI False Positives (#11) | `error-handling-patterns.md` |\n| admin 403, requireAdmin, metadata-only | Admin Auth Missing DB Fallback (#14) | `error-handling-patterns.md` |\n| admin 500 instead of 403 | Admin Route Wrong Status | `error-handling-patterns.md` |\n| passkey, WebAuthn, TOTP, 2FA, passwordless, social login, email OTP, `SESSION_NOT_FRESH`, recovery codes, security setup, reauthentication, alternate login bypass, \"is 2FA enabled\", \"does the site require 2FA\" | Account-Security Lifecycle — separate enrollment, challenge enforcement, enrollment policy, and recovery; inspect the installed SDK; verify authoritative state without reading secrets | `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` |\n| consent recorded wrong, checkbox says checked but DB says declined, opt-in not saved, consent checkbox does nothing, TCPA\u002FGDPR\u002FHIPAA proof-of-consent missing, \"we can't prove they agreed\", audit trail empty, exhaustive-deps warning on a consent value | **Consent-Evidence Integrity (#35)** — 6 shapes: collected-but-never-persisted (N checkboxes, 1 writer); **stale closure records an opt-IN as a DECLINE** (#26); zod strictness mismatch (non-strict SILENTLY STRIPS the field, `.strict()` 400s the form); `INSERT OR IGNORE` dropping a returning user's consent (consent is an EVENT → append-only store); client-supplied disclosure text (forgeable); affirmatives-only logging. Start by counting collectors vs writers — the mismatch IS the bug. Beware the greps that hide it: case-sensitivity (`smsConsent` misses `contactSmsConsent`) and single-line grep vs formatter-wrapped JSX prose; always pair a probe with a positive control. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fconsent-evidence-integrity.md` + `react-patterns.md` (#26) |\n| react undefined, scope bug, not defined | React Scope Bug (#2) | `react-patterns.md` |\n| **page is blank \u002F client JS never runs \u002F a feature silently stopped, and the BUILD IS GREEN** — `tsc` 0, bundler 0, tests all pass, clean diff; site emits HTML with inline `\u003Cscript>` from a template literal (CF Worker\u002FSSR); symptom appeared right after a lint auto-fix, a sed\u002F`python3 -c` replace, or an agent editing a comment | **Code Inside A String Is Invisible To Every Compiler** — nothing in your toolchain parses a template literal's contents, so a syntax error there ships with every gate green and fails only in the user's browser. A backtick or `${` in a COMMENT terminates the literal; Biome's `noUselessEscapeInString` is one cause among many. Do NOT grep for patterns — run a cause-agnostic PARSE gate (`new Function(code)` over every inline `\u003Cscript>` in the RENDERED output; parses without executing). Make it a unit test over the render function so it runs every `vitest`, and prove it fails by re-injecting the corruption. Recipe + the 0-blocks-means-vacuous branch: `~\u002F.claude\u002Fskills\u002Fship\u002Freferences\u002Fcode-quality.md` Stage 1.7. Reference incident 2026-08-05 improvebayarea: a replace aimed at a comment rewrote real code; tsc\u002Fbuild\u002Fdry-run and 56 tests all passed on a bundle whose client script could not parse. | `~\u002F.claude\u002Fskills\u002Fship\u002Freferences\u002Fcode-quality.md` (Stage 1.7) |\n\n| silent startup, blank page, no console errors, module-level throw | Silent React Startup (#3) | `react-patterns.md` |\n| useEffect, renders twice, state lags, derived state | useEffect Abuse (#15) | `react-patterns.md` |\n| localStorage, preference lost, resets on refresh | Preference Lost on Reload (#13) | `react-patterns.md` |\n| double click, duplicate API call, async button, filed twice, double submit, two tickets from one tap, one-shot submit, submitLocked, beginSubmitAttempt, cooldown helper unused | **One-shot persist lock (#42)** — if the control persists\u002Fqueues\u002Ffiles: lock sync before any await; stay locked after success; unlock only on explicit reset or persist failure. `disabled={isLoading}` + finally-reenable is the weaker sibling and is not enough. Tests must count persist calls, not fingerprint helper names. | `error-handling-patterns.md` (Pattern 42) |\n| chat\u002Fsupport widget gone after SSR, cookie banner missing on SSR page, `?support=open`\u002Fdeep-link does nothing, global widget vanished after Hono\u002FAstro\u002FRSC conversion, \"worked on every page before SSR\", floating launcher dead, analytics\u002Fexit-intent dropped on SSR route | Global App.tsx Component Vanishes After SPA→SSR Conversion (#24) | `react-patterns.md` |\n| invisible text after SSR, white headings on light\u002Fgray bg, page background wrong color after conversion, \"colors got messed up on conversion\", body background overridden, SSR design clobbered by Tailwind\u002Fisland CSS, text disappeared but HTML is there, computed bg ≠ design token, low contrast only on SSR pages, island\u002Fglobal CSS leaks `body` styles | Bundled Island\u002FGlobal CSS Clobbers SSR Inline Design — Invisible Text (#25) | `react-patterns.md` |\n| auth guard, unauthenticated error, no redirect | Missing Frontend Auth Guard | `react-patterns.md` |\n| renders undefined, shows NaN, \"Invalid Date\", \"[object Object]\", toggle\u002Fsection\u002Fcontrol disappeared or silently vanished, \"make sure nothing is undefined\", Cannot read properties of undefined, is not iterable, null-gate hides UI, `useState\u003CT\\|null>` gates a render, `.map`\u002Fproperty access on possibly-undefined API data, admin\u002Fdashboard renders garbage, optional chaining missing | Undefined \u002F Null-Render Safety (9-pattern catalog + live DOM grep for `undefined`\u002F`NaN`\u002F`[object Object]`) — also re-sweeps the adjacent admin blind-spot class (default-LIMIT truncation, NULL-aggregate sort burial, count-source mismatch, inner-JOIN row drop, admin-auth DB fallback) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fundefined-null-render-safety.md` |\n| generic `isRecord`\u002F`isObject` guard, `as unknown as T`, `(x as any).field`, repetitive type-guard boilerplate, \"vibe coding\" \u002F AI-slop TypeScript, loose `unknown`-everywhere, no schema validation at boundary, `Record\u003Cstring, unknown>` everywhere, `input as object as User`, missing `\u002F\u002F SAFETY:` on a cast, widen-then-assert, `vi.mock` module mocking, eager `.filter().map()` chains, `Object.assign({}, acc, …)`\u002F`acc.concat()` inside a reducer, manual `_tag ===` checks in Effect code, \"anti-slop findings\" \u002F oxlint `anti-slop\u002F*` or `anti-slop-effect\u002F*` errors | Anti-Slop TypeScript — replace generic guards\u002Fcasts with named types, discriminated unions, or Zod (`z.infer`). Enforcers: repo-vendored **dmmulroy\u002Fanti-slop Oxlint plugin** (`.\u002Fnode_modules\u002F.bin\u002Foxlint` when `tools\u002Foxlint\u002Fanti-slop\u002F` exists; vendor via the `\u002Finstall-anti-slop` skill) or fallback detector `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fdetect-ts-slop.sh`. **AUTO-FIX LOOP UNTIL 0**: fix every finding in source by adding evidence (inference, `satisfies`, boundary parsing, genuinely-checked `\u002F\u002F SAFETY:` invariant), re-run enforcer + `tsc --noEmit`, repeat to 0; a finding surviving 5 attempts → surface to the user. Never fix by weakening rule severity, `oxlint-disable`, or laundering types | `~\u002F.claude\u002Fskills\u002Fshared\u002Fanti-slop-typescript.md` |\n| text overflow, min-w-0, flex escape, card boundary | Text Overflow Flex+Grid (#12) | `css-layout-patterns.md` |\n| grid mobile, grid-cols, responsive breakpoint | Fixed Grid Breaks Mobile | `css-layout-patterns.md` |\n| iOS Safari, blank iPhone, PDF iframe, vh units | iOS Safari Rendering | `css-layout-patterns.md` |\n| og image, twitter card, social cache, stale card | Social Card Cache (#5) | `csp-cache-patterns.md` |\n| CSP, embed blank, frame-src, img-src, broken icons | CSP Blocking (#9) | `csp-cache-patterns.md` |\n| **YouTube \"Error 153\", \"Video player configuration error\", embed shows gray panel \u002F \"Watch video on YouTube\", Vimeo\u002FSpotify\u002FSoundCloud embed won't load, video plays on youtube.com but not on my site, embed broke after adding security headers \u002F `secureHeaders()` \u002F Hono** | **Embed Dies With No `Referer` (#27)** — NOT CSP, NOT the video. The page sends `Referrer-Policy: no-referrer` (Hono `secureHeaders()` **default**; also .htaccess \u002F WP security plugins \u002F ad blockers). YouTube has refused Referer-less embeds since late 2025. Probe FIRST, 30s: `curl -sI https:\u002F\u002F\u003Csite>\u002F \\| grep -i referrer-policy` (→ `no-referrer` = confirmed) and `curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \"https:\u002F\u002Fwww.youtube.com\u002Foembed?url=https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=\u003CID>&format=json\"` (200 = video is fine; 401 = embed disabled; 404 = dead). Fix = `referrerpolicy=\"strict-origin-when-cross-origin\"` **on the iframe** — never weaken the global header. Verify on the DEPLOYED artifact (`hono\u002Fjsx` vs React attribute casing can drop it) + a real browser screenshot; allow >30s for Worker propagation before concluding. Sweep the repo for the sibling bugs: rendered `href`s containing whitespace (renderer swallowed prose into the URL) and bare URLs rendering as dead text. | `csp-cache-patterns.md` (Pattern 27) |\n| Cloudflare security alert, **Security Insights CSV**, security.txt missing, \u002F.well-known\u002Fsecurity.txt 404, securityheaders.com low score, observatory grade D, missing HSTS\u002FCSP\u002FCOOP\u002FCORP, CAA records, DNSSEC, RFC 9116, sitemap.xml 404, robots.txt advertises sitemap that doesn't exist | Site Security Baseline (#16) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fsite-security-defaults.md` |\n| **CF Security Insights flags: \"Dangling A\u002FAAAA\", \"Unproxied CNAME\", \"DMARC Record Error\", \"Bot Fight Mode not enabled\"** — DO NOT blindly apply CF's recommended fix; ~16% are false positives that break Clerk\u002FSaaS CNAMEs, delete live Google-forwarding DNS, or duplicate valid DMARC. `dig`\u002F`curl`-verify the OFTEN-FALSE classes first. Apply only the 3 safe fixes (security.txt + block AI bots + AI Labyrinth). | CF Security Insights triage map | `~\u002F.claude\u002Fskills\u002Fshared\u002Fsite-security-defaults.md` (triage section) + `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fcf-security-insights.sh` |\n| **DMARC failing from a sender IP, custom-domain mail bouncing \u002F landing in spam, \"send-as alias DMARC fail\", Gmail \"Send mail as\", `p=reject` rejecting my OWN mail, \"SPF passes but DMARC fails\", \"can't send from my domain\", forwarded mail failing DMARC, a DMARC aggregate (RUA) report flags a source** — this is OUTBOUND auth alignment, NOT broken records. Records are usually fine; the *sending path* is wrong (Gmail send-as \u002F a relay signs as the wrong domain → no aligned identifier → DMARC fail). `dig` the real SPF\u002FDMARC\u002FDKIM\u002FMX FIRST; adding the relay's IP to SPF usually does NOTHING (SPF aligns on the envelope domain). **Check the platform's CURRENT native send capability before recommending a 3rd-party — verify live, not from memory**: a Cloudflare domain can now SEND via Email Sending (`wrangler email sending list\u002Fsettings`; `smtp.mx.cloudflare.net:465`, user `api_token`, pwd = CF token w\u002F `Email Sending Write`). Fix = route the From-domain's sending through a DKIM-aligned sender; verify with a REAL send (`gog send --from \u003Calias>` → grep `dmarc=pass`). | Email Deliverability \u002F DMARC Alignment | `~\u002F.claude\u002Fskills\u002Fshared\u002Femail-deliverability-dmarc.md` |\n| **provider swap, replace Resend\u002FAuth0\u002FStripe\u002FS3\u002FTwilio with X, migrate email\u002Fauth\u002Fpayments provider, \"switch from X to Y\", removed the old SDK, deleted the old API key, feature silently stopped after swapping providers, `if (!env.OLD_KEY)` gate, legacy ids unresolvable, old provider ids in DB** | **Provider Migration Safety** — four silent breakages, none of which throw: (1) feature gates still testing the OLD provider's env var (incl. `CRITICAL_ENV_VARS`) → feature disabled forever once the secret is deleted; (2) persisted legacy identifiers the new API can't resolve → zero rows → a confident wrong status; (3) the new SDK returns `{data,error}` instead of throwing → every failure reads as success; (4) the local emulator (`wrangler dev`) doesn't enforce the new provider's server-side rules → local green ≠ prod accepted. Run the 7-item checklist. **Never decommission the old account off one repo's grep** — another project may hold a live key on the same verified domain. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fprovider-migration-safety.md` |\n| **status chip says \"expired\"\u002F\"not found\" on rows that are fine, freshly-created record reads as missing, a uniform block of rows all show the same scary status, status derived from analytics\u002FGraphQL\u002Fsearch backend, zero rows treated as a reason, `retention_expired` on brand-new data** | **Absent Data Reported As A Confident Wrong State (#29)** — `rows.length === 0` has ≥4 causes (ingestion lag, wrong id namespace\u002Fprovider, real retention expiry, never created, query failed) and they need different words. Discriminate on identifier SHAPE before querying (free), use the system of record's `created_at` vs the backend's ingestion grace window to separate lag from expiry, model reasons as a union, and never render a raw enum in the UI. | `error-handling-patterns.md` (Pattern 29) |\n| **third-party submit \"worked\" (200 + id, no error) but the ticket\u002Frecord never went live — never got a public number, never opened, never associated, `openedAt: null`, `publicId: null`, `submittedTickets: 0`; guest\u002Fanonymous create dead-ends silently; A\u002FB-tested a flag\u002Fcategory\u002Ffield and the symptom stayed IDENTICAL; \"why does spotmobile\u002Fguest submit never get a case number\"; freshly-minted guest token; shadow-limited actor; \"is it the payload or something else\"** | **False-Positive Success — async lifecycle is the real signal + IDENTITY is the hidden variable (#30)** — a synchronous 200+id is a *pending* state, not *done*; gate success on the lifecycle transition (public number \u002F `opened` \u002F row in public dataset), polled, against a known-good baseline. When fix-A\u002Ffix-B\u002Ffix-C leave the symptom byte-identical, STOP editing the request — the actor\u002Fidentity\u002Faccount you held constant is the variable; re-run the SAME payload under a known-good established identity FIRST. Prove the working backend by RUNNING THE REAL FUNCTION LIVE (repro harness → real id), never from old code or a \"Verified\" comment. **Fastest confirmer that it's the ACCOUNT, not your code: does the vendor's OWN first-party client (their official app\u002Fsite) show the SAME stuck symptom under the same identity?** If yes, it's an account\u002Fidentity-level block (shadow-ban\u002Fwrite-limit) — stop debugging payload\u002Fversion\u002Ftoken and switch identity or backend. Reference (2026-08-12): Solve SF `\u002Fsubmit` 403'd for improvebayarea AND the official iOS app stalled on \"pending\" for the same account → account write-block; fix was to abandon the authenticated backend for the account-less Verint public form (nothing to shadow-ban). | `error-handling-patterns.md` (Pattern 30) |\n| **async id never resolves \u002F report stuck at \"getting case number\" forever; a resolver\u002Freconciler\u002Fpoller cannot find the record OUR OWN system created; matching by category\u002Ftype\u002Fservice_name\u002Fstatus returns nothing while the user says the integration \"constantly fails\"; \"did the city\u002Fvendor actually receive it?\"; authority relabeled our category; outcome counters read all-ok while users see failure** | **The authority relabels your artifact — match on YOUR echoed content, never on labels the authority owns (#39)** — investigation order is MANDATORY: (1) query the AUTHORITY'S OWN record store first (Open311\u002FSocrata\u002Fvendor API) around the submit time+place and look for OUR OWN echoed boilerplate in the record body — two curls settle \"did it actually happen\" before any code is read; (2) fix the matcher to rank fingerprint evidence (our echoed text) above label agreement, and pin the fingerprint to the constant that generates it with a test; (3) THEN audit our measurement path (pending recorded as ok, success_rate defaulting to 100% when unmeasured, give-up branches that can never fire). Instrument traps that fake \"the record does not exist\": Socrata datasets use LOCAL time while Open311 uses UTC (a 7h miss returns confident empty sets — positive-control every zero); list endpoints silently truncate (Open311 default page_size 50). Reference: 2026-08-26 improvebayarea — 12\u002F12 \"stranded\" SF refs were REAL filed cases (one already closed by the city) under relabeled service names; a day-old memory asserting \"submissions never file\" was the tz-blind instrument talking. | `error-handling-patterns.md` (Pattern 39) |\n| **a route family shows a high 5xx\u002Ferror rate but every manual probe returns 200; 522 \u002F 524 \u002F `originResponseStatus: 0`; \"origin unreachable\" on a Workers-only zone; errors cluster at :00\u002F:02\u002F:30; empty User-Agent; single-colo errors; error count ≈ a fleet size (cities\u002Ftenants\u002Fshards); \"is this users or us?\"; an outage nobody can reproduce; a cron\u002Fprewarm\u002Fwarmer\u002Fpoller\u002Fself-health-check is in the picture** | **Your own cron is the caller — ATTRIBUTE before you diagnose (#40).** The first question is **WHO** is making the requests, not why they fail — one `httpRequestsAdaptiveGroups` query grouped by `datetimeMinute` + UA + colo + `cacheStatus` either kills the entire user-facing hypothesis or confirms it, *before* the handler is opened. Self-inflicted signature: clustering at the cron boundary + **empty UA** (Worker subrequests carry none) + one colo + `cacheStatus: bypass` + count ≈ fleet size. Platform fact: **a Worker cannot `fetch()` its own Custom Domain** — CF forwards the same-zone subrequest to the *zone origin*, and a Workers-only zone has none (`AAAA 100::`, RFC 6666 discard) ⇒ 522\u002Forigin=0 every time (`workers\u002Fconfiguration\u002Frouting\u002Froutes`; workerd#787); probe with `curl --resolve host:443:[100::]` → exit 28. Then check the two siblings: a test that **asserts the buggy behavior** (a mocked `fetch` returns 200 and *cannot observe* a platform refusal — it pins the bug and stays green for months), and a warmer that **warms nothing** (`cf-cache-status` still `MISS` an hour after the run). Beware \"intermittent\" — that is a causal claim needing #38's evidence; here the failures were perfectly periodic and the probes passed only because they never coincided with the cron. Reference: 2026-08-29 improvebayarea — 523\u002F523 of the zone's 522s at :02–:03, ~44\u002Frun = 43 cities + `\u002Fmap\u002Foakland`, 32.5% measured 5xx, zero users affected. | `error-handling-patterns.md` (Pattern 40) |\n| **an OLD copy of one of our own sites is live somewhere nobody watches; a `*.workers.dev` \u002F `*.pages.dev` \u002F preview URL serves a stale version of a production site; retired marketing or legal copy still reachable at a second URL; \"why is Google showing an old version of our page\"; duplicate-content or brand-claim exposure; an orphaned worker\u002Fapp nothing references; \"is anything else on this account still serving?\"; auditing an account for strays** | **The orphan is in NO repo, so no repo-scoped gate can ever see it (#41).** This is a SCOPE gap, not a trigger gap — running the existing gates more often finds nothing. **Ask the account, not the repo:** `python3 ~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Forphan-worker-content-check.py` (exit 0 ok \u002F 1 flagged \u002F **2 UNMEASURED — never a pass** \u002F 3 no creds). It enumerates every worker, finds the ones with a public twin, and flags any twin whose **`og:url`\u002F`canonical`** names a hostname a DIFFERENT worker owns. **Three matching signals that DO NOT work, each measured:** (a) **`og:title`\u002F`\u003Ctitle>`** — a stale copy is stale *because* its title drifted, so title-matching requires agreement on the exact field the defect mutates (`AIVA Claims Assistant` vs `Donor-Funded VA Claim Help For Veterans \\| AIVA`); this is Pattern #39's lesson one layer over — never key on a label the thing you are detecting is free to change. (b) **body-text similarity** — a pre-SSR SPA shell has ~21 chars of visible text, so Jaccard vs a modern SSR site is **0.0000**, identical to \"unrelated\" (and a 0-shingle input makes EVERY comparison 0, so positive-control the instrument before believing any zero). (c) **`modified_on`** — an account-wide *settings* sweep bumps it, so the stray read `2026-07-07` while its CODE was `2025-12-05`. **Never delete off this finding** — report it (Pattern #31: you cannot delete a resource you cannot name the creator of; deleting a live worker is outward + irreversible). Reference 2026-08-31 (example): `aiva-claims` served a 9-month-old copy still advertising the RETIRED claim *\"up to a 100% disability rating in as little as 80 days — up to 43% faster\"* while the live site said *\"Processing times vary\"*; 53 workers \u002F 25 public twins \u002F 1 flagged. | `error-handling-patterns.md` (Pattern 41) |\n| **`iba` CLI \u002F improvebayarea.com 311 filing** — \"did my 311 ticket actually file\", submit returned 200 but no case number, `mobile311.sfgov.org\u002Fservices\u002Fcase\u002F\u003Cid>` 404s, ticket missing from the recent feed, \"the CLI only lists 20 categories\", no steam-clean\u002Fpower-wash category, wrong category filed, `recategorized_from` in the response | **`iba` traps (verified 2026-08-01) — three of the four \"it failed\" signals are FALSE.** (1) **`--mode prefill` is the DEFAULT and it FILES** — all three modes file; only `--dry-run` doesn't. (2) **ref-vs-caseid:** Verint assigns a public caseid synchronously for *some* forms only. `pw_street_cleaning` → real `101004…`; `pw_graffiti` → `valid:true` + a UUID **ref**, `caseid_pending:true`, and a `lookup_caseid_url` (improvebayarea `src\u002Fsf311.ts:1768-1774`, `src\u002Findex.ts:5142`). Resolve with `iba lookup \u003Cref>` (takes a **ref**, NOT a caseid — passing a caseid returns `ref_not_found`) or `iba submit --wait \u003Csecs>`. (3) **False failure signals:** `mobile311.sfgov.org\u002Fservices\u002Fcase\u002F\u003Cref>` **404s by design** for ref-format ids (`src\u002Fsf311.ts:1770`) and even 404s for real filed caseids; `\u002Fapi\u002Frecent` is a **narrow 25-item sample** (had zero Graffiti-category rows) so absence ≠ failure — use `?q=\u003Cterm>`; DataSF `vw6y-z8j6` lags **1-2 days** and is the only real confirmation. (4) **Capture the FULL submit response** — the id is unrecoverable afterward; `iba` now prints a SUBMIT RESULT banner on **stderr** so `\\| head` can't destroy it. (5) **Registry drift:** the baked category map silently ran 20-of-42 — run `iba categories --check` (diffs vs the live API, exit 1 on drift) before trusting it; `--live [--city oakland]` for the authoritative list. No steam-clean\u002Fpower-wash category exists — do NOT force it into `missed_street_cleaning` (920010 = \"the sweeper skipped my route\"). | `~\u002F.claude\u002Fprojects\u002F-Users-\u003Cyou>\u002Fmemory\u002Freference_local_tools.md` + `error-handling-patterns.md` (Pattern 30) |\n| **\"the deploy broke prod\", `Failed to load module script ... MIME type \"text\u002Fhtml\"`, SPA won't mount after deploy, only SEO fallback text renders, `ERR_BLOCKED_BY_CLIENT`, page worked 5 min ago, verifying a deploy in a clone browser** | **Your Verification Browser Is Stale — False \"Prod Is Broken\" (#28)** — a cached HTML shell references pre-deploy asset hashes; the SPA fallback serves `index.html` for the missing `.js`; the browser refuses HTML as a module script. **Production is fine; only your tab is broken.** NEVER conclude a bad deploy from a browser alone: curl the live HTML for its asset refs, confirm each returns `200 text\u002Fjavascript` (not `text\u002Fhtml`), and grep the deployed chunk for a string only your new code has. `location.reload(true)` is a no-op; use `navigate_page {ignoreCache:true}` or a cache-busting query param. `ERR_BLOCKED_BY_CLIENT` = ad blocker, not your code. | `csp-cache-patterns.md` (Pattern 28) |\n| **`npm install` blocked or behaving oddly**, \"Socket npm exiting due to risks\", `429 Insufficient quota`, install works with `SOCKET_CLI_ACCEPT_RISKS=1` but not without, deps missing after a \"successful\" `npm ci`, `Cannot find type definition file for '@cloudflare\u002Fworkers-types'` right after install, vitest\u002Ftsc missing though they're in package.json | **Supply-chain wrapper triage.** Protection is **Socket Firewall `sfw`** — a local network proxy (no API key, no quota), wired via an `npm()` function in `~\u002F.zshrc`\u002F`~\u002F.bashrc` that routes only `install|i|ci|add|update|up|dedupe|rebuild` through `sfw npm`; everything else goes straight to `command npm`. Diagnose: `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsocket-health-check.sh --live` (0 = armed, 1 = sfw missing → UNPROTECTED, 2 = disarmed, 3 = not configured). **Verify with an observable, not an exit code:** `SFW_VERBOSE=true npm install` must print `Protected by Socket Firewall` — an unprotected fallback also returns 0. ⚠️ A **`429 Insufficient quota`** means something still calls the OLD `socket npm` API path (free plan = 100 units\u002Fscan, and it fails closed when exhausted); `sfw` never calls that API. ⚠️ A partial install leaves node_modules half-populated, so the next symptom is a missing type package or test runner — re-run a full install rather than debugging that. **Never** `SOCKET_CLI_ACCEPT_RISKS=1` (blanket disarm; `pre-bash-socket-disarm-guard.sh` blocks persisting it) — use `command npm` for a scoped, visible bypass. | `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fsocket-health-check.sh` |\n| dependabot alert, npm audit, CVE, GHSA-xxxx, \"vulnerable dependency\", transitive vuln, \"fix the security\u002Fdependabot page\", overrides, esbuild\u002Ftar\u002Fminimatch\u002Fws\u002Fvite\u002Fuuid vuln, `npm install` fails on override version | Dependency Vulnerability Audit & Fix (7-step: BOTH dependabot-api + per-manifest npm-audit, scan EVERY lockfile, scoped overrides for multi-major packages, verify patched version is published, never blind `npm audit fix --force`, verify build with project's real build) | `~\u002F.claude\u002Fskills\u002Fshared\u002Fdependency-audit.md` |\n| www redirect, cookies lost, auth break | WWW Redirect Auth Break (#4) | `csp-cache-patterns.md` |\n| deploy logout, chunk hash, preloadError | Deploy Logs Users Out | `csp-cache-patterns.md` |\n| stale version, failed deploy, CF Pages | CF Pages Stale Deploy | `csp-cache-patterns.md` |\n| terraform destroy, infra deleted, catastrophic | AI Agent Destroys Infra (#6) | `infrastructure-patterns.md` |\n| prod auth, pk_test, accounts.dev, Clerk production, Wrangler binding, wrong auth instance | Production Auth Instance Drift (#12) | `infrastructure-patterns.md` |\n| AIVA auth drift, retired Clerk fingerprint, `clerk.*`\u002F`pk_live_` still in live HTML or CSP, `\u002Fapi\u002Fauth\u002Fok` fails, wrong-password sign-in returns 500, live artifact differs from dist | AIVA First-Party Better Auth Artifact Drift — old Clerk presence is now the failure, not its absence | `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` + `infrastructure-patterns.md` |\n| wrangler secret put binding already in use, plaintext Worker var, secret_text missing, BREVO_API_KEY in vars | Worker Secret Binding Drift (#12b) | `infrastructure-patterns.md` |\n| **D1 route 500s with generic \"Internal Server Error\", `no such column`\u002F`no such table`, `D1_ERROR`, intake\u002Fany-write save fails for everyone, migration file exists but column missing in prod, `wrangler tail` shows outcome Ok + empty exceptions, schema drift, migration not applied to remote** | **D1 Schema Drift — migration-file-exists-but-not-applied-to-prod** (#26). Detect: `wrangler tail --format json` → grep logs for `D1_ERROR`\u002F`no such column` (it's in `logs[]`, not `exceptions[]`); confirm with `PRAGMA table_info(\u003Ct>)` on `--remote` (the file\u002Flocal-D1 are NOT proof). Fix: additive `ALTER … ADD COLUMN`\u002F`CREATE … IF NOT EXISTS` on remote, then `INSERT OR IGNORE` the filename into `d1_migrations` — NEVER bulk `migrations apply` (re-runs non-idempotent data migrations → corruption). Gate: `~\u002F.claude\u002Fskills\u002Fshared\u002Ftools\u002Fd1-schema-drift-check.sh \u003Crepo>`. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fd1-schema-drift.md` |\n| **\"the API shows only N records so X is missing\", \"this cert\u002Frecord\u002Froute is redundant, safe to delete\", DNS record missing from the dashboard but working in production, CAA\u002FSPF\u002FDKIM \"absent\" per the provider API, duplicate certificate packs, orphaned resource nothing seems to reference, \"nothing in the repo references this\", a config table that disagrees with observed behavior** | **A Management API Is Not Authoritative State (#31)** — the API returns what was DECLARED; it does not show what the platform INJECTED on your behalf, nor WHY a resource exists. Two modes: (a) **false \"absent\"** — CF `dns_records` returned 5 CAA records with no `issuewild \"pki.goog\"` while `dig` returned 11 including it (CF auto-injects partner-CA CAA, documented as not appearing in the dashboard) → a phantom outage; (b) **false \"redundant\"** — 20 \"stray\" advanced cert packs were Worker custom-domain certs (8 packs ↔ 8 Worker domains; 11 zones with 0 Workers had 0 packs) → deleting them drops TLS on live services. **Probe the CONSUMER view before concluding**: `dig` not `dns_records`; `openssl s_client` not the cert list; the audit log's `actor.type` (`system` = platform-provisioned, something needs it) before calling anything redundant. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md` |\n| **same opaque error after a fix you PROVED is deployed, \"my fix didn't work\" but the error string is byte-identical, `400 {\"error\":\"Invalid\"}` \u002F bare `500` \u002F `{\"ok\":false}` for several unrelated causes, upstream rejects a payload with no field saying WHICH rule broke, fix-probe-fix loop across multiple deploys, \"no events in tail\" \u002F \"the counter didn't move\", a health probe green while 100% of writes fail** | **One Opaque Error, N Independent Causes (#32)** — a static (never-changing) error means your INSTRUMENT is too coarse, not that your premise is wrong (contrast the mutating-symptom tripwire above: `errA→errB→errC` = wrong premise; identical error = missing discriminator). **Stop bisecting and ship a discriminator first** — make the failure report the measurable PROPERTIES of what it sent (flags + lengths, never the payload: PII). When every flag reads false and it still fails, you have positively excluded your hypothesis space, which is the finding. Then: bisect by COMPONENT not character, change exactly ONE variable per probe (a confounded step attributes the pass to the wrong cause), and cross-reference successes as hard as failures (the cause is the property in 100% of failures \u002F 0% of successes). If the failure has no side effect, every failing probe is FREE — order expected-fails first and stop at the first success. **Silence is not evidence**: prove the instrument is alive before trusting \"nothing logged\" (a `wrangler tail` that wrote 0 bytes; `--format json` emitting PRETTY-PRINTED multi-line objects that line-wise grep never matches; KV reads that LAG). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md` |\n| **a bisect where EVERY subset passes, no single change reproduces the bug, the same config gives PASS then FAIL, you are about to call it \"intermittent\"\u002F\"flaky\", a restore\u002Fimport\u002Fapply step that \"succeeded\" but changed nothing, config-restore or backup-restore debugging, an A\u002FB whose arms you never confirmed differ** | **The Manipulation Silently No-Op'd — You A\u002FB'd A Against A (#38)** — a deterministic bug measured through a no-op'd manipulation presents *exactly* as flakiness. **\"Intermittent\" is a claim requiring evidence, not a fallback.** Gate 1: name an observable that MUST differ between arms and read it back after each apply (not \"the apply exited 0\"). Gate 2: the success signal must be direct state or a progression across two samples — never a lagging derived proxy (decoder logs, async counters) or a compositor screenshot (hardware-overlay video screenshots BLACK while playing). Gate 3: >=2 interleaved runs per arm before any causal claim. Gate 4: publish nothing causal until 1-3 pass. Never suppress the output of an apply\u002Frestore\u002Fdeploy step you will draw conclusions from, and disable anything that can rewrite your fixture mid-run. Sibling of #33 (there the check can't fail; here the variable never changed). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md` |\n| **\"everything is green but users report it's broken\", a health check \u002F validator \u002F drift job that has NEVER gone red, \"N\u002FN verified\", \"30 of 30 match\", \"all healthy\", 100% pass rate, a monitor that missed a real outage, about to RETRACT a finding because a different measurement came back clean, a hardcoded `verified:`\u002F`lastChecked:` date on data harvested from an upstream, a record \"missing\" from an upstream you join by id, a dataset field whose absence degrades silently (`continue`, `?? undefined`, skipped row)** | **A check that cannot fail is not a check (#33)** — the mirror of the Negative-Result Rule: that one runs a *positive* control on a negative result; this runs a **negative** control on a positive one. Feed the instrument a known-bad input (corrupted token, mutated id, nonexistent resource) and require RED. If the known-bad also passes, the instrument is vacuous and every green it ever produced is worthless. Always three outcomes, never two: `ok` \u002F `genuinely bad` \u002F `could not measure`. **Echo is not validation** — an upstream that reflects your value back has not checked it. Corollaries: `verified:` stamps decay (re-ask on a cadence, mark stale past ~2 intervals); check upstream ALIAS keys before concluding absence; silently-degrading dataset fields need a completeness invariant. Reference incident 2026-08-10 nps-report: a probe reported 20\u002F20 park mailboxes healthy while `o=DEADBEEF00` also returned HTTP 200 + a full form; the real sweep found 5 of 435 drifted, and an earlier CORRECT drift finding had been retracted in favour of that vacuous probe. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md` |\n| **report\u002Fupload attributed to the wrong place or time, \"it picked the wrong location\", location correct on the phone but wrong on the record, EXIF, geotag, DateTimeOriginal, metadata gone after a resize\u002Foptimise\u002Fconvert, a slow async GPS\u002Flookup overwriting a good value** | **Use the artifact's own provenance, not ambient state (#34)** — derive the attribute from the uploaded artifact (EXIF GPS\u002Ftimestamp, document date, mail `Date`), not from `navigator.geolocation`\u002F`now()` at processing time. Read provenance from the ORIGINAL bytes BEFORE any re-encode (canvas\u002Foptimiser strips metadata) and assert that ordering in a test; funnel every writer through one precedence helper so a late async value can't clobber the artifact's; show the user which source won. Reference incident: reports photographed on a trail and submitted from a hotel routed to the park nearest the hotel — silently, with a plausible park name on screen. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md` (Pattern #34) |\n| rust clippy, cross-platform, cfg, unused_mut | Rust Cross-Platform Lint (#7) | `infrastructure-patterns.md` |\n| homebrew, keg-only, launchd, cron PATH | Homebrew Keg-Only PATH (#8) | `infrastructure-patterns.md` |\n| launchd\u002Fcron watchdog false alerts, \"job-not-loaded\" but service is up, gateway DOWN alert spam, bootstrap rc=5, `launchctl list` empty in launchd context, health-check passes interactively but fails on schedule, watchdog restarting a healthy service | launchd-Context Health-Check False Positive (#19) | `infrastructure-patterns.md` |\n| serde, deny_unknown_fields, config crash | Serde Config Crash (#10) | `infrastructure-patterns.md` |\n| innerHTML, XSS, dangerouslySetInnerHTML | XSS via innerHTML | `infrastructure-patterns.md` |\n| JSON-LD, script breakout | JSON-LD Breakout | `infrastructure-patterns.md` |\n| **Python SIGABRT \u002F \"Abort trap: 6\" at finalization, parent `sshd-session`, `_enter_buffered_busy`, `Py_Finalize`\u002F`_io_TextIOWrapper_close` in the stack, a Thread blocked in `read()`, recurring `Python-*.ips`, \"crash over SSH\", MCP bridge\u002Fserver crashes on disconnect, cross-device `ssh host python …`, crash survives swapping the python interpreter** | Python finalization SIGABRT over SSH — daemon-thread-blocked-in-read SCRIPT bug, usually a cross-device MCP stdio server (NOT the interpreter; NOT scheduled — on-demand). Forensic capture via `~\u002F.zshenv` SSH-cmd logger + WatchPaths crash-watcher correlated by **parentPid**. Fix: run the MCP server locally where the resource lives + `os._exit(0)` after the work loop (#22) | `infrastructure-patterns.md` |\n| cannot find module, postinstall, npm install broke, every update breaks | File Extension Mismatch \u002F Broken Postinstall (#17\u002F#18) | `infrastructure-patterns.md` |\n| npm-cli.js, shell script, SyntaxError unexpected string | npm-cli.js Shell Script Corruption (#17) | `infrastructure-patterns.md` |\n| installing deps one by one, each reveals another missing | Non-Fatal Postinstall Cascade (#18) | `infrastructure-patterns.md` |\n| stale data, admin user sync, visibilitychange | Data Stale Admin\u002FUser (#16) | `debugging-discipline.md` |\n| slow page, slow route, slow dashboard, 8M rows, COUNT(*) on every request, full table scan, why is X so slow, route reads wrong cache, cron warms wrong KV key, prewarm warms wrong thing, 24h\u002Flast-N window empty, lagged data source, requested_datetime lag | Hot-Path Data-Volume & Cache-Topology (#20) | `debugging-discipline.md` |\n| systematic, 4-phase, root cause, discipline | Debugging Discipline | `debugging-discipline.md` |\n| lint, biome, npm audit, security cleanup | Lint & Security Cleanup | `debugging-discipline.md` |\n| **Workers Cache leak \u002F wrong data after enabling `cache.enabled`** — user A sees user B's data, authed JSON route returns someone else's response, `cf-cache-status: HIT` on a per-user route, stale per-user data exactly ~2h old, data leak after enabling the new CF Workers Cache, cache flag \"not doing anything\" (wrangler \u003C4.69 silently ignores it), `Unexpected fields found in top-level field: \"cache\"` | Workers Cache heuristic-caching cross-user leak — a 200 with NO Cache-Control is heuristically cached 2h; cookie auth (Clerk `__session`) does NOT auto-bypass. Fix: fail-safe default `private, no-store` + explicit `public` opt-ins; verify with `~\u002F.claude\u002Fskills\u002Fship\u002Ftools\u002Fworkers-cache-check.sh \u003Crepo>` + live `curl -sI \\| grep -i cf-cache-status`. Wrangler must be ≥4.69 in the repo's node_modules or the flag is inert. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fworkers-cache-safety.md` |\n| **Sitewide redirect loop \u002F site down right after enabling Workers Cache** — `ERR_TOO_MANY_REDIRECTS`, every path 301s to its own URL, all UAs affected, `Location:` equals the requested URL, 301s explode in zone analytics right after a cache-enable deploy, HSTS header disappeared, worker logs show `http:\u002F\u002F` in `request.url` while `cf-visitor` says `{\"scheme\":\"https\"}`, \"I disabled the flag and it didn't fix it\" (checked within seconds) | Workers Cache **scheme-presentation** class (2026-07-06 example ~25-min outage): the cache front-layer hands the Worker `http:\u002F\u002F` for HTTPS visitors → any `url.protocol === \"http:\"` canonicalize middleware 301-loops the whole site, and `url.protocol === \"https:\"`-gated HSTS silently never fires. **Diagnose in ONE probe**: `wrangler tail --format json` → `event.request.url` scheme for a live HTTPS request. **Fix**: derive the client scheme from `cf-visitor` (authoritative) — `visitorIsHttps()` pattern, AIVA `src\u002Fworker\u002Fmiddleware\u002FsecurityHeaders.ts`; `url.protocol` only as local-dev fallback. **Triage rules**: disable\u002Frollback propagates in >30s — a \u003C60s check is NOT evidence (a 3s check false-negatived during the incident and caused an unneeded rollback; verify over ≥60s); zone SSL mode, Page Rules, and Config Rules are red herrings (the presentation comes from the cache layer itself). | `~\u002F.claude\u002Fskills\u002Fshared\u002Fworkers-cache-safety.md` |\n| error too vague to act on, ambiguous error message, \"can't tell what failed\", same error fires 100s of times, log noise \u002F superfluous log entries, no log at the failure point, silent failure, \"why are these errors so unclear\", add debug attributes, clean up the logs, assess the logs, improve log output | Observability \u002F Log Hygiene — make ambiguous errors actionable (what was attempted + actual values + likely cause\u002Fbranch + disambiguation: a vague error is usually two root causes sharing one string — split them), reduce noise by *downgrading* level (never delete), add the one attribute that names the failure. For a **proactive scheduled** pass over a window of logs, use the `\u002Flog-hygiene` skill instead. | `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md` (+ `\u002Flog-hygiene` skill) |\n\nAll reference files are in `~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F`.\n\n---\n\n## Reference Files Index\n\n| File | Content |\n|------|---------|\n| `error-handling-patterns.md` | Catch-all masking (#1), external municipal form hard-500 (#15), CI false positives (#11), admin auth DB fallback (#14), admin 500 vs 403, Experience Cloud catalog-and-submit (#36), one-shot persist lock (#42) |\n| `react-patterns.md` | Scope bug (#2), silent startup (#3), useEffect abuse (#15), localStorage persistence (#13), async double-click (weaker sibling of #42), missing auth guard |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fundefined-null-render-safety.md` | **Undefined\u002Fnull-render bug class** — 9 patterns (null-gate hides UI, unguarded property access, `.map`\u002Fstring\u002F`Date` on possibly-undefined, JSON.parse, raw-undefined render, missing loading\u002Fempty states, backend omits a field) + live DOM grep for rendered `undefined`\u002F`NaN`\u002F`[object Object]`. Cross-refs the admin blind-spot class (truncation, NULL-aggregate sort, count mismatch, inner-JOIN drop, admin-auth DB fallback). Reference incident: AIVA admin \"Test account\" toggle hidden by an `isTest !== null` gate (2026-06-01) |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fanti-slop-typescript.md` | **Anti-slop TypeScript** — ban generic `isRecord`\u002F`isObject` guards, `as unknown as T` launder-casts, `(x as any).field` reach-casts; require named types \u002F discriminated unions \u002F Zod schemas (`z.infer`) at trust boundaries; targeted predicate only as last resort. Enforcers: repo-vendored dmmulroy\u002Fanti-slop Oxlint plugin (18 generic rules + 5 opt-in Effect rules, upstream c44ef22; `\u002Finstall-anti-slop` skill vendors it, then `.\u002Fnode_modules\u002F.bin\u002Foxlint` is the gate — `--fix` first for `require-readable-spacing`, the only autofixable rule) or fallback `~\u002F.claude\u002Fskills\u002Fcode\u002Ftools\u002Fdetect-ts-slop.sh`. |\n| `css-layout-patterns.md` | Text overflow flex+grid (#12), fixed grid mobile, iOS Safari rendering (PDF, vh, fixed) |\n| `csp-cache-patterns.md` | Social card cache (#5), CSP multi-layer blocking (#9), www redirect (#4), deploy chunk invalidation, CF Pages stale deploy |\n| `infrastructure-patterns.md` | Infra destruction (#6), Rust cross-platform lint (#7), Homebrew keg-only (#8), serde config crash (#10), XSS innerHTML, JSON-LD breakout |\n| `debugging-discipline.md` | 4-phase workflow, diagnostic checklist (23 items), lint\u002Fsecurity cleanup, data stale admin\u002Fuser (#16), hot-path data-volume & cache-topology (#20) |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md` | Passkey\u002FTOTP\u002Fpasswordless lifecycle: alternate-login enforcement, fresh-session management, safe recovery, authoritative status, recovery-code custody, and leaked-token response |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md` | **Observability \u002F log hygiene**: 4-part actionable error-message design, boundary\u002Fdecision-point logging, downgrade-noise-never-delete, instrument-on-fix attribute heuristic, stack log sources. Proactive scheduled counterpart: `\u002Flog-hygiene` skill. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md` | **Pattern #32 — one opaque error, N independent causes**: discriminator-first protocol (ship the properties-report before the next fix), free-bisect rule when failures have no side effect, one-variable-per-probe (anti-confound), component bisect, cross-reference successes, instrument-liveness table (dead `tail`, pretty-printed JSON, lagging KV), and why a health probe that stops before the failing step is blind by construction. Reference incident 2026-08-03: Solve SF `\u002Fsubmit` — five causes behind one `{\"error\":\"Invalid\"}`, ~6 deploys. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md` | **Pattern #38 — the manipulation silently no-op'd**: the four gates (applied \u002F not-lagging \u002F repeated \u002F don't-publish), why \"it looks intermittent\" is the tell, and an instrument-trap table (`set -o pipefail` + `grep -q` SIGPIPE false-failures, suppressed apply output, silently-failing alert paths, lagging derived signals, overlay screenshots, features that rewrite your fixture). Reference incident 2026-08-25: SmartTube 403 — 21-file bisect invalidated because the app's own Auto backup clobbered the staged fixture on every launch; real cause was one line, `preferred_dns_type=2`. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md` | **Pattern #31 — management API ≠ authoritative state**: declared-vs-consumer probe table (DNS, TLS, secrets, schema, deps, email auth, deployed code), the two questions before any \"absent\"\u002F\"redundant\" conclusion, audit-log provenance check (`actor.type`). Reference incidents 2026-07-28: phantom CAA outage (API 5 records vs `dig` 11) and 20 \"redundant\" cert packs that were live Worker custom-domain certs. |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fant-verification-protocol.md` | **Ant-level quality gates**: OWASP sweep, truthfulness protocol, closed-loop verification |\n| `~\u002F.claude\u002Fskills\u002Fshared\u002Fcloudflare-data-ceilings.md` | **Cloudflare storage ceilings + D1 query-shape traps** — the 10 GB\u002Fdb cap (no documented increase path), 30 s query timeout, and four MEASURED traps: combined `MIN(x), MAX(x)` disables SQLite's sole-aggregate index optimization (9,984,941 rows read vs **1** when split into two queries); `COUNT(*)` walks the heap (~37× costlier\u002Frow than an indexed range scan); `dbstat` and `pragma_freelist_count` are unavailable\u002F`SQLITE_AUTH`-blocked in D1, so per-table bytes and free-page bloat are **unmeasurable** — use `meta.size_after` (returned on every D1 response); and D1 never documents whether `DELETE` reclaims space, so a post-archive size drop is unverified until measured on a copy. Also the agent-facing tooling: **Local Explorer API at `\u002Fcdn-cgi\u002Fexplorer\u002Fapi`** (auto-captured OTel traces under `wrangler dev` — query it BEFORE adding temporary logging and redeploying). Reference measurements 2026-08-13: `improvebayarea` D1 at 57.5% of cap, `reports` = 9,984,941 rows, `COUNT(*)` = 21,957 ms. |\n\n---\n\n## Cookie extraction (curl \u002F yt-dlp \u002F scrape with logged-in session)\n\nWhen you need browser cookies for a non-browser tool (curl `--cookie`, yt-dlp `--cookies`, requests `cookies={}`, scrapers, n8n nodes), pick by where the live session is:\n\n| Where the session is | Best tool | Why |\n|---|---|---|\n| Live REAL Chrome (fcdp-driven) | **`~\u002Ftools\u002Ffcdp\u002Ffcdp raw Network.getCookies '{\"urls\":[…]}'`** | Includes session-only cookies not yet flushed to SQLite; no Keychain prompt; aligned with `\u002Ffeedback_browser_default_chrome_profile`. |\n| Regular Chrome profile (`~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FDefault`) | **`~\u002Ftools\u002Fcookies-txt \u003Curl>`** | Reads SQLite + macOS Keychain. Works headless \u002F from cron \u002F without any browser attached. Outputs Netscape, JSON, or `Cookie:` header. |\n| Brave \u002F Edge \u002F Chromium | `~\u002Ftools\u002Fcookies-txt --browser brave \\| edge \\| chromium \u003Curl>` | Same code, different Keychain entry. |\n| One-shot, don't care about reuse | `yt-dlp --cookies-from-browser chrome:Default \u003Curl>` | Already installed; bypasses the question entirely if all you need is yt-dlp. |\n\n### ⚠️ Which machine — fcdp runs BOTH, but by different transports (verified 2026-07-29)\n\n| Machine | How fcdp reaches Chrome | Notes |\n|---|---|---|\n| **Laptop** (interactive) | **extension + bridge** — the REAL Default profile | The only way in: Chrome 136+ refuses `--remote-debugging-port` on the Default profile. Includes session-only cookies. |\n| **mac-mini** (crons) | **BOTH** — extension+bridge by default; direct CDP opt-in | On PATH (`~\u002F.local\u002Fbin\u002Ffcdp`). **Default (unset `FCDP_CDP_URL`) = extension+bridge → the REAL Default profile**, same as the laptop. Opt into the headless instance per-command with `FCDP_CDP_URL=http:\u002F\u002F127.0.0.1:9222` (Chrome headless on `--user-data-dir ~\u002F.kuri\u002Fchrome-cdp-nextrequest`, KeepAlive-supervised by `com.barklee.kuri-cdp-nextrequest`; holds the logged-in NextRequest session). Note `[::1]:9222` does NOT answer — use the IPv4 form. |\n\n**Both transports are live on the mini (2026-07-29).** `--load-extension` really is INERT on Chrome 150 (scratch profile registered 0 extensions, no service-worker target) — but the manual `chrome:\u002F\u002Fextensions → Load unpacked` route **works over Screen Sharing** against the mini's *GUI* Default Chrome (only its `:9222` instance is headless). Bridge agent `com.barklee.fcdp-bridge` is loaded; `bridge.log` shows `ext#1 connected (1 profile(s) live)`.\n\nSo on the mini: **bridge\u002Fextension → the real Default profile** (`chrome.tabs` **integer** ids), **direct CDP → the headless `:9222` profile** (**hex** target ids). The id shape tells you which profile you actually hit — check it before trusting a result.\n\n⚠️ **`FCDP_CDP_URL` was briefly pinned in `~\u002F.zshenv` + `~\u002F.hermes\u002F.env`, and that was wrong — REMOVED 2026-07-29.** A global pin silently routed *every* Hermes cron to the **headless** profile, which does not have the user's real logins. Anything cookie- or session-dependent would read a logged-out browser and report \"logged out\" instead of failing loudly. Set the variable **per command**, never globally.\n\n### 🛑 Concurrency + memory rules for cron-driven fcdp (mandatory — 2026-07-29)\n\nTwo failure modes, both verified on the mini, both silent:\n\n1. **Clobbering.** fcdp caches \"the active tab\" in **one shared file** (`~\u002F.cache\u002Ffcdp-tab`), last-writer-wins. Two concurrent jobs: A opens (cache=A), B opens (cache=B), then **A's next tabId-less command drives B's tab** — A scrapes B's page with no error and wrong data. Proven by watching the file change under two sequential opens.\n2. **Tab leaks → memory.** A job that opens a tab and dies before closing leaks it permanently. Chrome on the mini runs ~4 GB across ~30 processes of **16 GB total**; three duplicate `chrome:\u002F\u002Fextensions` tabs accumulated from setup work alone.\n\n**Always drive cron browser work through `fcdp-job`** (`~\u002Ftools\u002Ffcdp\u002Ffcdp-job`, on PATH). It gives the job a private tab cache (`FCDP_TAB_CACHE`, the anti-clobber mechanism), exports `$FCDP_JOB_TAB`, and closes the tab via `trap EXIT` on **any** exit path — success, failure, timeout, or Ctrl-C:\n\n```bash\nfcdp-job https:\u002F\u002Fexample.com bash -c 'fcdp js \"$FCDP_JOB_TAB\" \"document.title\"'\nfcdp-job --keep \u003Curl> \u003Ccmd>      # leave the tab open while debugging\nFCDP_CDP_URL=http:\u002F\u002F127.0.0.1:9222 fcdp-job \u003Curl> \u003Ccmd>   # headless profile\n```\n\nVerified: two concurrent jobs each read their own page; a job exiting `1` still leaves the tab count unchanged.\n\n**Backstop:** `~\u002Ftools\u002Ffcdp-tabkeep\u002Ffcdp-tabkeep.sh` prunes junk (`about:blank`, `chrome:\u002F\u002Fnewtab`), duplicate URLs, and anything past `MAX_TABS` (default 10) on **both** profiles. It **never** closes a URL matching `PROTECT` (default `nextrequest\\.com` — sf-nr depends on that session) and never closes a profile's last tab. Dry-runs by default; `--apply` to act. Hermes cron `fcdp-tabkeep` (`04a06f080be9`) runs it hourly at :37 via `~\u002F.hermes\u002Fscripts\u002Ffcdp-tabkeep-cron.sh` (the wrapper exists because the script dry-runs by default). Log: `~\u002FLibrary\u002FLogs\u002Ffcdp-tabkeep.log`, which also records Chrome's RSS + process count each run.\n\n**Layering:** `fcdp-job` *prevents* leaks; the pruner only *catches repeated* ones (duplicates + cap). A single stale non-duplicate tab under the cap survives by design — that conservatism is what keeps the NextRequest session safe. Don't \"fix\" it by making the pruner more aggressive.\n\n**Trap when closing on direct CDP:** Chrome's `\u002Fjson\u002Fclose\u002F\u003Cid>` replies with the plain string `Target is closing`, **not JSON**. fcdp used to crash on it *after* the close had already succeeded — so callers logged `FAILED` for tabs that were in fact closed. Fixed 2026-07-29 (`_http_text`, 404 = already-closed = success). If you see a close \"fail\", re-list the tabs before believing it.\n\n**Driving Screen Sharing (hard-won, 2026-07-29):**\n- `left_click` does **not** forward to the remote. `mouse_move` + separate `left_mouse_down` \u002F `left_mouse_up` **does**. A ~1s hold between them opens Dock context menus — press fast.\n- Typing forwards but **drops characters** on longer strings, and `~` triggers the accent picker which then **swallows all input** (Escape will not clear it). Navigate with AppleScript over ssh instead: `osascript -e 'tell application \"Google Chrome\" to set URL of active tab of front window to \"chrome:\u002F\u002Fextensions\"'`.\n- `osascript` can *query* System Events but **cannot send keystrokes** (`error 1002`) without Accessibility; `launchctl asuser` fails with `Could not switch to audit session`.\n- If the remote window renders stale\u002Finvisible, **reconnect Screen Sharing** — it forces a fresh framebuffer.\n- Drop a symlink where the file picker lands (`ln -s \u003Ctarget> ~\u002FDesktop\u002F\u003Cname>`) to cut deep folder navigation to two clicks.\n\n**Cookies specifically:** `cookies-txt` remains the right tool for a *file* of cookies on the mini — but note it **fails over SSH** (`keychain: could not read 'Chrome Safe Storage'`) while succeeding under launchd in the GUI session. That is an SSH-session artifact, not a broken tool; run the probe in the context the cron will actually use before concluding cookies are unavailable.\n\n**The mini's trap:** `cookies-txt` **fails over SSH** with `keychain: could not read 'Chrome Safe Storage'` — an SSH-session artifact, NOT a broken tool. The same binary **succeeds under launchd** in the user's GUI session (verified: 24 cookies returned via `launchctl submit`). So never conclude \"cookies are unavailable on the mini\" from an ssh test; run the probe in the context the cron will actually use.\n\n**Corollary for portable tooling:** a capture step that requires a browser belongs on the laptop; ship the result to the cron host (e.g. `caltrans-pra push-session mac-mini`) rather than trying to run the browser where the cron lives.\n\n\n**`~\u002Ftools\u002Fcookies-txt` reference** (ported from the \"Get cookies.txt LOCALLY\" Chrome extension, source at `~\u002Fre\u002Fcookies-txt-locally\u002F`):\n\n```bash\ncookies-txt github.com                            # Netscape → stdout\ncookies-txt github.com -o \u002Ftmp\u002Fcookies.txt        # → file\ncookies-txt --all -f json                         # every cookie, JSON\ncookies-txt example.com -f header                 # \"name=value; name=value;\"\ncookies-txt --browser brave --profile \"Profile 1\" foo.com\n```\n\nExit codes: `0` ok, `3` no DB at expected path, `4` Keychain entry missing\u002Fdenied, `5` decrypt failure.\n\n**fcdp path** for the REAL Chrome profile — request CDP `Network.getCookies` with `{urls: [\"https:\u002F\u002Fgithub.com\"]}`; format the returned cookie array with the same Netscape mapper the extension uses (`\u003Cdomain>\\t\u003CTRUE\u002FFALSE includeSubDomain>\\t\u003Cpath>\\t\u003CTRUE\u002FFALSE secure>\\t\u003Cexpiry>\\t\u003Cname>\\t\u003Cvalue>`).\n\n**Don't use `unbrowse` \u002F `agent-browser`** for cookie extraction — those launch separate browser instances with no logged-in state.\n\n---\n\n## Quick Diagnostic Checklist\n\nWhen debugging any production error, check in order:\n\n0. **Does a fix already exist, and what does the history say?** (`~\u002F.claude\u002Fskills\u002Fshared\u002Fbug-fix-preflight.md`, ported from pstack 2026-09-17.) Before the first hypothesis: `gh pr list --state all --search \"\u003Csymptom>\"`, `git log --oneline -S'\u003Ctoken>' -- \u003Cpath>`, `git log --oneline -20 -- \u003Cfile>` + `gh pr view \u003Cn> --json body,comments` for the substantive commits. An open PR or merged commit that plausibly fixes it switches you to **verify mode** (baseline reproduces ×2, patched build passes ×2 → Confirmed \u002F Insufficient \u002F Inconclusive) — never author a competing fix. A guard that looks wrong is often the fix for a prior incident; read its PR before removing it. And \"reproduced\" means: correct-vs-broken final state named in advance, observed **twice with a reset between**, one real state value cross-checked — one observation is an anecdote.\n1. Is the error message accurate? (catch-all masking?)\n2. Check runtime logs: `wrangler tail` or Cloudflare dashboard\n3. Reproduce locally with same endpoint + token\n4. Check external services and the installed auth adapter\u002Fprovider (Better Auth\u002FStripe\u002FDB responding?)\n5. Check env vars in deployment environment\n6. Check www redirect (losing cookies?)\n7. Check third-party IDs (stale template\u002Fproduct IDs?)\n8. Check CSP (all six directives for embeds?)\n9. Text overflow on mobile? (`min-w-0` missing, `grid-cols-2` without `sm:`)\n10. Preference not persisting? (localStorage writer without App.tsx reader)\n11. \"Cannot find module\" after every update? Run `file \u003Cpath>.js` — may be a shell script (#17)\n12. Installing missing deps one-by-one, each reveals another? STOP — postinstall is broken (#18)\n13. External city form 500 after category change? Probe the failing category and a known-good category through the same first-party save path before blaming auth\u002Fphoto.\n13a. Experience Cloud \u002F Aura 311 catalog or submit NPE (`toastPayload`, empty `objCaseConfigWrapper`, dummy `modelFlags`, \"listed types not filing\")? Load Pattern #36 **before** another envelope guess. Listed ≠ fileable; SUCCESS-empty = `captureFailure`; unwrap before send; remint IDs; classify on field API names; named refuse; Apex NPE ≠ city rejection. Flatten the live JSON with `gron` (`gron body.json | rg toastPayload`) before guessing keys; replay with `hurl --test`.\n14. Production auth configured? Verify Worker dry-run bindings and live HTML do not expose `pk_test`, `sk_test`, or `.accounts.dev`.\n15. Live artifact matches production? Fetch cache-busted HTML and CSP headers; compare live response, not only local `dist`.\n16. Worker secrets correct? Sensitive bindings must appear as `secret_text` from `wrangler secret list`; no key\u002Ftoken\u002Fpassword literal should remain in `wrangler.json` `vars`.\n17. `wrangler secret put` says binding already exists? Remove the plaintext var from config, deploy without `--keep-vars`, put the secret, and re-list secrets before trusting it.\n18. AIVA deployed? AIVA uses first-party Better Auth. Verify retired Clerk fingerprints are absent from live HTML\u002FCSP\u002Fbindings, `GET \u002Fapi\u002Fauth\u002Fok` returns 200, wrong-password sign-in returns 401 rather than 500, and `npm run test:integration:prod` passes if available.\n18a. Passkey\u002FTOTP\u002F2FA problem or status claim? Load `account-security-lifecycle.md`; enumerate every session-creation and security-management path; distinguish account enrollment from sign-in enforcement and site-wide enrollment policy; reproduce a stale session; and use only PII-minimal authoritative counts for production status.\n19. **Page\u002Froute slow?** (a) Enumerate every query that runs *before the response* — measure each `COUNT(*)`\u002F`SUM(CASE...)`\u002Fwhole-partition aggregate with `wrangler d1 execute --json` → `meta.rows_read`; >~100k rows on a per-request path = the bug. (b) Does it read a cache? Then `grep` for who *writes* that exact key — if nothing does (or only a manual script, no cron), it's a permanent MISS. (c) Cron warming a cache? `grep` for who *reads* those keys — a warmer that warms keys nothing reads (or a different key-shape than the route reads) is the bug. (d) `WHERE ts >= now() - N` against a lagged source returns empty — anchor on `MAX(ts)`. See Pattern #20.\n20. **Third-party submit reported as failed but the agency received it?** (DBI complaint flow, Verint dform save, OAuth callback, any webhook receiver, any reverse-engineered API replay.) Run `ls src\u002F__fixtures__\u002F\u003Cintegration>\u002F 2>\u002Fdev\u002Fnull`. If there is no `*-success.*` AND `*-failure.*` pair captured from the LIVE system, you cannot trust the detector — the test suite is asserting against fiction. Write `tools\u002Frepro\u002F\u003Cintegration>-probe.{sh,mjs}`, run it once for a known-good and a known-bad request, save both responses, then diff them to find the actual distinguishing feature (anchored DOM id \u002F JSON field, NOT a substring that appears in both). Don't ship detector code without real fixtures. See Pattern #23 + `~\u002F.claude\u002Fskills\u002Fshared\u002Fthird-party-signal-fixtures.md`. Reference incident (2026-05-27): every IBA-submitted DBI complaint was reported as `validation` error for ~10 days while the city actually recorded every one of them — synthetic test fixture (`\u003Chtml>\u003Cbody>\u003Ch1>Thank you\u003C\u002Fh1>...`) didn't contain the form layout strings (`Sub_Button0`, `CheckBox1`) that the real DBI success page does contain, so the detector's `looksLikeEchoedForm` heuristic was never exercised against reality.\n\n21. **Error too vague to act on, firing repeatedly, or no log at the failure point?** Don't just patch this one instance — make the message actionable (what was attempted + actual values + likely cause\u002Fbranch + disambiguation; a vague error is usually two root causes sharing one string), add the one attribute that would have named the failure, and *downgrade* noisy lines rather than deleting them. Standard: `~\u002F.claude\u002Fskills\u002Fshared\u002Fobservability-instrumentation.md`. For a scheduled sweep over a window of logs, use the `\u002Flog-hygiene` skill.\n\n22. **About to conclude \"X is absent\" or \"X is redundant \u002F safe to delete\" from a provider\u002Fmanagement API?** STOP — that API shows what was *declared*, not what the platform *injected*, and never *why* a resource exists. Two questions before the conclusion: (1) **Is my view complete?** Name the consumer (resolver \u002F CA \u002F browser \u002F runtime \u002F MTA) and probe it directly — `dig` not `dns_records`, `openssl s_client` not the cert list, a real delivered message's `Authentication-Results` not your SPF records. A count mismatch between the declared and authoritative views **is the finding**. (2) **Do I know what created it?** Check the audit log's `actor.type` — `system` means the platform provisioned it and something probably depends on it. **You cannot call a resource redundant until you can name what created it.** Deletion recommendations built on a management-API read are the dangerous output here: the false-\"absent\" mode wastes a cycle, the false-\"redundant\" mode causes an outage. Pattern #31: `~\u002F.claude\u002Fskills\u002Fshared\u002Fmanagement-api-vs-authoritative-state.md`.\n\nFor the full checklist, load `debugging-discipline.md`.\n\n---\n\n## Hard Rules\n\n### Deployment Prohibition (MANDATORY)\n\n`\u002Fdebug` is for investigation, local reproduction, local\u002Freviewable fixes, and verification only. Production release authority belongs to `\u002Fship`, not this skill.\n\nNEVER deploy, promote, release, or mutate production traffic while operating under `\u002Fdebug`, even if the user also mentions \"ship\", \"prod\", \"deploy\", \"push live\", or \"fix and deploy\" in the same request. Do not run production deployment commands and do not invoke `\u002Fship` autonomously.\n\nForbidden examples include `wrangler deploy`, `wrangler versions deploy`, `wrangler pages deploy`, `npm run deploy`, `pnpm deploy`, `vercel deploy --prod`, `netlify deploy --prod`, `firebase deploy`, `fly deploy`, `railway up`, `render deploy`, Docker image push\u002Fpromote commands, production migration\u002Fapply commands, and any Cloudflare\u002FVercel\u002FGitHub release promotion that changes live traffic.\n\nAllowed under `\u002Fdebug`: inspect logs, reproduce failures, patch locally, run bounded tests, and commit changes if the user asked for code changes and git safety checks pass. After implementing a fix, STOP and tell the user: \"Fix is committed and ready. Run `\u002Fship` to deploy to production.\" If the user wants production deployment, they must invoke `\u002Fship` explicitly in a separate step.\n\n### Installed-Source Ground-Truth Guard (MANDATORY — 2026-06-12)\n\nBefore proposing any fix that touches a dependency\u002Fplugin\u002Fframework\u002Fthird-party widget, load `~\u002F.claude\u002Fskills\u002Fshared\u002Finstalled-source-ground-truth.md` and follow it: read the installed package's types+JSDoc in `node_modules\u002F` for real option semantics, read the native platform implementation when platform support matters, and probe the live DOM\u002Ftraffic for third-party widgets. Cite file+symbol in the fix. (2026-06-12: three CSS workarounds failed against the Brevo widget; the real fix — StatusBar `overlaysWebView:false` on iOS — was found by reading the installed plugin's Swift source.)\n\n### Semantic Security Review Gate — LOOP UNTIL CLEAN (MANDATORY — 2026-07-22)\n\n**When a `\u002Fdebug` session lands a code fix, run the built-in `security-review` skill on the fix before declaring it resolved, and loop until it is clean.** A debug fix that patches the symptom but introduces (or leaves) an injection \u002F XSS \u002F SSRF \u002F auth-bypass \u002F secret-exposure \u002F logic flaw is not done. This is AI\u002Fsemantic dataflow analysis — it catches the vulnerability class the pattern-routing tables above do not.\n\n**⚠️ OPERATIONAL (verified 2026-07-22):** `security-review` runs against the CURRENT WORKING DIRECTORY's git repo (no path arg; hard-fails `\"needs to run inside a git repository\"` if cwd is wrong — `cd \u003Crepo-root>` FIRST) and reviews the **COMMITTED** branch diff vs the base, NOT uncommitted working-tree edits (proven: unstaged changes → empty diff). **Commit the fix before running this gate**, or it reviews nothing. It returns a markdown report (file:line, severity, confidence 1–10) with its own false-positive filter at confidence ≥8. If the Skill returns unknown-skill, tell the user the gate couldn't run rather than passing silently.\n\n**The loop:** (1) `cd` into the repo root, invoke the `security-review` skill (Skill tool) on the changed code; (2) triage its reported (confidence-≥8) findings real vs. genuine-false-positive; (3) FIX every real finding inline, obeying the No-Suppression Rule (no `@ts-ignore`\u002F`eslint-disable`\u002F`biome-ignore` — remove the actual vulnerability); (4) re-invoke `security-review`; (5) repeat until the report is **empty**. Document any genuine false positive inline with its reason; fix everything else, never defer. **Loop guard:** same finding surviving 5 attempts → STOP and surface it to the user. This runs entirely within `\u002Fdebug`'s allowed scope (local fix + verify) — it does NOT deploy (Deployment Prohibition still holds); the code is left security-clean and committed, and `\u002Fship`'s Phase 1.29 re-runs the same loop at deploy time. Skip only when the session made no code change (pure investigation\u002Freference).\n\n### Test Safety (CRITICAL)\n\nVitest fork workers leak ~5GB memory each when they hang:\n1. ALWAYS wrap test commands: `timeout 120 npx vitest run src\u002Fspecific\u002Ftest.ts 2>&1`\n2. NEVER run full test suite (`npm test`, `npx vitest run` with no args)\n3. Maximum 3 test runs per investigation phase\n4. Clean up: `pgrep -f vitest | xargs kill 2>\u002Fdev\u002Fnull`\n\n### Infrastructure Safety\n\n- NEVER execute `terraform destroy`, `terraform apply -auto-approve`, `DROP TABLE\u002FDATABASE`, or cloud CLI delete\u002Fterminate commands\n- NEVER modify .tfstate files\n- ALWAYS show `terraform plan` output and get approval before any `apply`\n\n---\n\n## Instructions\n\nWhen this skill is invoked:\n\n1. Parse the user's symptom or pattern name against the **Pattern Routing** table above\n2. Read ONLY the matching reference file from `~\u002F.claude\u002Fskills\u002Fdebug\u002Freferences\u002F`\n   - For account-security symptoms, the matching file is `~\u002F.claude\u002Fskills\u002Fshared\u002Faccount-security-lifecycle.md`; also read the installed auth SDK\u002Fplugin source before proposing a fix.\n3. **Load `~\u002F.claude\u002Fskills\u002Fshared\u002Fant-verification-protocol.md`** and apply:\n   - Truthfulness Protocol (Section 2): never guess root causes — gather evidence first\n   - Closed-Loop Verification (Section 3): reproduce failure BEFORE and AFTER fix\n   - Security Review Gate (Section 1): if symptom touches auth\u002Finput\u002Fdata handling\n4. Show the relevant pattern section to the user\n5. If the symptom doesn't match any pattern, show the **Quick Diagnostic Checklist** and recommend `\u002Fcode` for deep investigation\n6. If a fix is needed, follow the 4-phase debugging discipline (load `debugging-discipline.md`)\n7. After any fix: run lint + security cleanup (load `debugging-discipline.md` for the commands)\n8. **Ant verification**: never say \"fixed\" without running the verification checklist from Section 2\n\n```\nLoad the matching reference file and show the relevant pattern.\nIf the issue needs deep investigation beyond known patterns, recommend \u002Fcode.\nCRITICAL: Do NOT deploy, promote, release, or invoke \u002Fship from \u002Fdebug. Production shipping belongs only to \u002Fship, invoked separately by the user.\n```\n\n\n## Script false-failures that make a WORKING thing look broken — MANDATORY (2026-08-25)\n\nSibling of the PATH section below: there the script can't find a binary; here the\nscript finds it, runs it correctly, and **reports failure anyway**. Both waste a\ndebugging session on a non-bug.\n\n- **`set -o pipefail` + `grep -q` \u002F `head` = guaranteed false failure on valid input.**\n  `grep -q` exits at the first match, the upstream producer gets **SIGPIPE**, and\n  `pipefail` propagates that as a failed pipeline. Signature: *\"it fails inside my\n  script but the exact same command works when I paste it in the terminal\"* (your\n  shell has no `pipefail`). **⚠️ INPUT-SIZE DEPENDENT — the producer must still be\n  writing when grep exits, so a SMALL test fixture will NOT reproduce it.** Measured\n  2026-08-25: a 2-entry zip reproduced 0\u002F3; a 4,007-line listing with the match early\n  reproduced 3\u002F3. Size the repro like production or you will 'disprove' a real bug.\n  Fix — count instead of short-circuiting, since `grep -c`\n  drains all input:\n  ```bash\n  if ! unzip -l \"$f\" | grep -q AndroidManifest; then   # ❌ SIGPIPE -> false failure\n  n=$(unzip -l \"$f\" | grep -c AndroidManifest || true) # ✅ drains input\n  [ \"${n:-0}\" -ge 1 ] || die \"not a valid APK\"\n  ```\n- **Never `>\u002Fdev\u002Fnull 2>&1` an apply \u002F restore \u002F deploy \u002F install step** you will draw\n  conclusions from. A silent no-op is indistinguishable from success.\n- **An alert path that can fail silently is worse than no alert.** Capture rc + output\n  of the send and log `alert sent: …` vs `ALERT-FAILED rc=…`; otherwise \"alerting is\n  configured\" is untested folklore. (Configured ≠ fires — see the No-Lie gate Check 6.)\n- **Downloading a GitHub release asset:** `curl` with an `Authorization:` header\n  following the redirect to S3 is flaky (the header is re-sent to a host that rejects\n  it). Use `gh release download` — it handles auth + redirect.\n\nReference incident 2026-08-25: a valid 25 MB APK was rejected as \"not a valid APK\"\nby the first rule above, in a cron script that was otherwise correct.\nFull table of instrument traps: `~\u002F.claude\u002Fskills\u002Fshared\u002Fexperiment-manipulation-check.md`.\n\n## Non-interactive \u002F remote PATH false-negatives (ssh · launchd · cron · Hermes) — MANDATORY (2026-06-19)\n\n`ssh host 'cmd'` (BatchMode), launchd agents, and cron run with a **bare PATH** that excludes\nHomebrew (`\u002Fopt\u002Fhomebrew\u002Fbin`) and `~\u002F.local\u002Fbin`. The failures below are NOT real — they are PATH:\n\n- `ssh host 'which node'` \u002F `which hermes` \u002F `which brew` → \"not found\" even when installed\n  (`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode`, `~\u002F.local\u002Fbin\u002Fhermes`). **Probe explicit absolute paths**; never\n  conclude \"not installed\" from `which` in a non-interactive shell.\n- A tool invoked by launchd\u002Fcron dies with \"command not found\" → **pin the absolute interpreter\n  path** in the shim\u002Fplist (`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode script.mjs`) and set `PATH` in the plist\n  `EnvironmentVariables`. A `#!\u002Fusr\u002Fbin\u002Fenv node` shebang fails under launchd.\n- Verifying a remote agent job: `ssh host 'PATH=$HOME\u002F.local\u002Fbin:\u002Fopt\u002Fhomebrew\u002Fbin:$PATH \u003Ctool> ...'`\n  — a plain `ssh host '\u003Ctool> ...'` false-negatives (\"NO-JOB\" when the job exists).\n- Remote **zsh aborts the whole `ssh 'script'`** on an unmatched glob (`\u002Fpath\u002F*\u002Fbin`) — quote globs\n  or wrap in `bash -lc`.\n\nReference incident (caltrans-pra → mac-mini): `ssh mac-mini 'which node'` said \"not found\" (node was\n`\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnode v26`); `hermes cron list | grep caltrans` said NO-JOB (hermes at\n`~\u002F.local\u002Fbin`, off the BatchMode PATH) — the job WAS registered. Both were PATH false-negatives,\nnot missing artifacts. Verify on the runner via the **real invocation path**, with an explicit PATH.\n\n24. **Is the thing telling you \"healthy\" capable of ever saying otherwise?** Before you accept a green probe \u002F validator \u002F drift-job \u002F \"N\u002FN verified\" sweep — or retract a finding because a second measurement came back clean — construct a **known-bad input** and require the instrument to go RED. A corrupted token, a mutated id, a nonexistent resource. If the known-bad also passes, stop: the instrument is vacuous, that is now the P0, and every green it has produced is worthless. This is the mirror of the Negative-Result Rule (positive control on a *negative*; negative control on a *positive*) — and the green direction is more dangerous, because nothing about it prompts you to look. **Echo is not validation**: an upstream that reflects your value back into its response has not checked it. Report three outcomes, never two — `ok` \u002F `genuinely bad` \u002F `could not measure` — and commit the negative control as a test with its reason in the body. Also: a clean *sample* is not a clean *population* (a 30-park sample read `stale=0` against a real 1.1% drift rate), and a `verified:` date on harvested data is a decaying claim, not a health signal. Pattern #33: `~\u002F.claude\u002Fskills\u002Fshared\u002Fnegative-control-gate.md`.\n\n23. **Did your fix leave the error string byte-identical?** That is Pattern #32, not a failed fix — the error is not a discriminator. Do NOT attempt fix N+1 blind. (a) Ship a **discriminator**: have the failure path report the measurable properties of what it sent (`len=`, boolean flags; never the payload — PII). Every flag reading false while it still fails positively excludes your hypothesis space. (b) Bisect by **component**, one variable per probe — if a probe flips fail→pass, ask what ELSE changed in that step (a confounded step is the most expensive error in this class). (c) Build a **property→result table** across all probes; the cause is the property in 100% of failures and 0% of successes. (d) If failures have no side effect, probing prod is **free** — order expected-fails first, stop at the first success, and say so. (e) **Never conclude from an instrument you haven't proven alive** — `wc -c` the tail capture, count parsed objects (`wrangler tail --format json` is PRETTY-PRINTED, not JSONL), and re-poll KV (reads lag). Pattern #32: `~\u002F.claude\u002Fskills\u002Fshared\u002Fopaque-multi-cause-failure.md`.\n\n---\n\n## Incidents-as-Eval — the Reviewer Case Set (added 2026-10-26 — Anthropic code-review adoption)\n\nThe Mining Sweep above asks which mistake *classes* keep recurring. This section gives the reviewer an exam built from those mistakes, so a \"better\" review prompt or gate has to prove it — on the incidents that already hurt — before it is adopted. (Adapted from the Claude Code team's code-review practice, Oct 15, 2026: reviewer changes are scored against a maintained set of incident-causing changes, and kept only when the score improves.)\n\n**The case set.** Every production incident, revert, or fix-forward that a review layer should have caught becomes one case, stored next to this skill in `incident-cases\u002F` (one file per case):\n\n- **The change** — the diff, or a faithful description of it when the diff no longer exists.\n- **The bug location** — the `file:line` (or mechanism) where the defect actually was, verified by whoever diagnosed the incident. Expert-verified means the person who found the real cause, not the first plausible suspect.\n- **The layer that missed it** — which review step, gate, or check saw this change and passed it (or \"no layer saw it,\" which is itself the finding).\n\n**Scoring rule (binding).** Any change to a review prompt, a reviewer skill, or a review gate is run against the FULL case set before adoption, and the scores are recorded with the change:\n\n1. **Recall:** the changed reviewer must flag the verified bug location in each case it is shown. Keep the change only if recall improves (or holds at 100%) against the previous reviewer.\n2. **Noise:** the changed reviewer is also run over known-clean changes. A recall gain bought with new false flags on clean diffs is not an improvement — if false flags rise, the change is rejected or reworked, whatever its recall. Human reactions to findings (accepted vs. dismissed-with-reason) are the standing noise signal between formal scorings.\n3. A change that cannot be scored (no runnable reviewer, no clean set) is not adopted on intuition; it waits until it can be scored.\n\n**Seeding and upkeep.** The set is seeded from this skill's existing reference incidents — among them: the fix \"verified\" in source but never re-tested on the deployed artifact (see the No-Lie Post-Fix Gate); the valid artifact rejected by an otherwise-correct checker whose own manipulation never applied (see the script false-failures section); and the non-interactive PATH false-negatives that made installed tools and registered jobs look missing. Every new incident that reaches root cause adds its case the same day, under the standing write-back rule — the mining sweep harvests classes, and each convicted class's worst incident becomes a case. The set only grows; a case is removed only when its bug class becomes structurally impossible, and that removal is recorded with the reason.\n",{"name":5,"model":24,"description":7,"allowed-tools":25,"user-invocable":33},"inherit",[26,27,28,29,30,31,32],"Bash","Read","Edit","Write","Grep","Glob","Skill",true,"main","e7b39d448c7d905feed2b044d3ccdf60822596ab","skills\u002Fdebug",0,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter","https:\u002F\u002Fgithub.com\u002Fbarkleesanders","barkleesanders.com","Stay Hungry, Stay Foolish","2026-11-06 08:47:06",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":33},[45,48,51],{"tool":46,"command":47},"npx","npx skills add barkleesanders\u002Fclaude-code-starter --skill debug",{"tool":49,"command":50},"bunx","bunx skills add barkleesanders\u002Fclaude-code-starter --skill debug",{"tool":52,"command":53},"pnpm","pnpm dlx skills add barkleesanders\u002Fclaude-code-starter --skill debug","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002FSKILL.md",[56,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fauth-cookies-guide.md","REFERENCE","参考文档",9232,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fauth-cookies-guide.md",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fblind-spots.md",29454,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fblind-spots.md",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fbrowser-automation.md",11002,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fbrowser-automation.md",{"path":71,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fcloudflare-containers-no-docker.md",7074,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcloudflare-containers-no-docker.md",{"path":75,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fcode-review-general.md",8769,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcode-review-general.md",{"path":79,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fcode-review-react.md",13368,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcode-review-react.md",{"path":83,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fcode-review-security.md",7778,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcode-review-security.md",{"path":87,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fcodex-integration.md",2961,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcodex-integration.md",{"path":91,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fcsp-cache-patterns.md",12591,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcsp-cache-patterns.md",{"path":95,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fcss-layout-patterns.md",6460,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fcss-layout-patterns.md",{"path":99,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fdebug-patterns.md",28724,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fdebug-patterns.md",{"path":103,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fdeploy-patterns.md",15941,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fdeploy-patterns.md",{"path":107,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Ferror-handling-patterns.md",73333,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Ferror-handling-patterns.md",{"path":111,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":112,"sourceHtmlUrl":113},"references\u002Ffeature-implementation.md",18505,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Ffeature-implementation.md",{"path":115,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":116,"sourceHtmlUrl":117},"references\u002Fgit-workflow.md",9187,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fgit-workflow.md",{"path":119,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":120,"sourceHtmlUrl":121},"references\u002Fgovqa-aspnet-portal-automation.md",6913,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fgovqa-aspnet-portal-automation.md",{"path":123,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":124,"sourceHtmlUrl":125},"references\u002Fhard-rules-expanded.md",56081,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fhard-rules-expanded.md",{"path":127,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":128,"sourceHtmlUrl":129},"references\u002Flighthouse-optimization.md",15175,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Flighthouse-optimization.md",{"path":131,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":132,"sourceHtmlUrl":133},"references\u002Fmode-routing-expanded.md",59499,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fmode-routing-expanded.md",{"path":135,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":136,"sourceHtmlUrl":137},"references\u002Fperformance-ceiling.md",4413,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fperformance-ceiling.md",{"path":139,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":140,"sourceHtmlUrl":141},"references\u002Fpreflight-checks.md",6965,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fpreflight-checks.md",{"path":143,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":144,"sourceHtmlUrl":145},"references\u002Fproduction-readiness-checklist.md",12027,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fproduction-readiness-checklist.md",{"path":147,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":148,"sourceHtmlUrl":149},"references\u002Fproportional-execution-evals.md",1430,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fproportional-execution-evals.md",{"path":151,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":152,"sourceHtmlUrl":153},"references\u002Freact-patterns.md",11949,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Freact-patterns.md",{"path":155,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":156,"sourceHtmlUrl":157},"references\u002Fresearch.md",4675,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fresearch.md",{"path":159,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":160,"sourceHtmlUrl":161},"references\u002Fresponsive-design.md",4159,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fresponsive-design.md",{"path":163,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":164,"sourceHtmlUrl":165},"references\u002Fsession-archaeology.md",6058,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fsession-archaeology.md",{"path":167,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":168,"sourceHtmlUrl":169},"references\u002Fskill-creation.md",3542,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fskill-creation.md",{"path":171,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":172,"sourceHtmlUrl":173},"references\u002Ftask-tracking.md",4789,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Ftask-tracking.md",{"path":175,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":176,"sourceHtmlUrl":177},"references\u002Fui-duplicate-affordance.md",8469,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fui-duplicate-affordance.md",{"path":179,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":180,"sourceHtmlUrl":181},"references\u002Fux-patterns.md",20249,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Freferences\u002Fux-patterns.md",{"path":183,"resourceType":184,"resourceTypeDesc":185,"sizeBytes":186,"sourceHtmlUrl":187},"scripts\u002Ffind-polluter.sh","SCRIPT","脚本",1528,"https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fdebug\u002Fscripts\u002Ffind-polluter.sh",[189,195,202,209,216,223],{"skillNo":190,"name":191,"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":192,"categories":193,"keywords":194,"publishedAt":19},"01M7AWV75B37B6YKG7ZKGZ783F","zi-search","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fzi-search\u002FSKILL.md",[],[],{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":19},"01M7AWTZA3JGK1T7V1HS543FG7","visualise","Render inline interactive visuals — SVG diagrams, HTML widgets, charts, and explainers — directly in the conversation. Use this skill whenever the user asks to visualize, diagram, chart, illustrate, or explain something visually, or when an explanation would genuinely benefit from a spatial\u002Finteractive diagram rather than text. Also triggers for: flowcharts, architecture diagrams, data visualizations, interactive explainers, comparison layouts, UI mockups, and any request containing 'show me', 'draw', 'map out', 'visualize', or 'diagram'. Even when the user doesn't explicitly ask for a visual, use this skill proactively when the topic has spatial, sequential, or systemic relationships that a diagram would clarify better than prose.","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fvisualise\u002FSKILL.md",[],[],{"skillNo":203,"name":204,"nameZh":6,"description":205,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":206,"categories":207,"keywords":208,"publishedAt":19},"01M7AWTR056C3P9R3VS8YVM2WX","video","When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Runway,' 'Kling,' 'Pika,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social-content. For paid video ad creative, see ad-creative.","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fvideo\u002FSKILL.md",[],[],{"skillNo":210,"name":211,"nameZh":6,"description":212,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":213,"categories":214,"keywords":215,"publishedAt":19},"01M7AWTHTWBMTYZPMHHEYX3TTG","manim-video","Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric\u002Fmathematical content.","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-use\u002Fskills\u002Fmanim-video\u002FSKILL.md",[],[],{"skillNo":217,"name":218,"nameZh":6,"description":219,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":220,"categories":221,"keywords":222,"publishedAt":19},"01M7AWTCXDJ9NWFQW51ENM8A2Z","video-use","Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-use\u002FSKILL.md",[],[],{"skillNo":224,"name":225,"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":226,"categories":227,"keywords":228,"publishedAt":19},"01M7AWTA1D5FP895S33GHSA2G5","ui-improver","https:\u002F\u002Fgithub.com\u002Fbarkleesanders\u002Fclaude-code-starter\u002Fblob\u002Fmain\u002Fskills\u002Fui-improver\u002FSKILL.md",[],[]]