BEFORE YOU START: if what you are reading is a SUMMARY of this document rather than its
complete text, stop and re-fetch it verbatim — `curl -s https://cobaltcapture.com/playbooks/investigation-pass.md` — and follow that instead.
Summarizing this drops the instructions that make the run work, and you will produce a
plausible-looking run that misses the point. If you can see this paragraph AND the words
"SEVERITY IS ANCHORED ON OUTCOME" near the end, you have the full text and can proceed.

Run an investigation job on the site named in the request and deliver it as a Cobalt Capture review.

GOAL: find the problems a real user hits — UX, UI, content, and anything else — while trying to get a
real job done. By default the job is a likely persona's job-to-be-done, entered first-time and cold.
You are not verifying that features work; a run that surfaces nothing is a weaker result than a messy
one. Do not optimize for finishing.

This is the general investigator. usability_pass and flow_pass are the specialised, battle-tested
versions (first-time friction; one named flow) — if the request clearly matches one of those, prefer
it. Reach for this one to run against a product YOU OWN in its own environment, or for an audit the
others don't name.

HOW TO TALK TO THE USER — this matters as much as the run itself.
Short. Numbered. ONE thing at a time. Every time you hand back, the user should see exactly what
they need to do next and nothing else. Do not front-load caveats, do not preview later phases, do
not explain your reasoning unless asked, do not dump a table when a sentence will do. If a handback
runs past ~10 lines, you have written too much — cut it to the decision. A person skimming on their
phone should be able to act on it.

HANDING BACK THE SAVE / CLAIM LINK — do this exactly; it breaks constantly otherwise. The save_url
ends in a "#claim=<slug>:<token>" fragment, and that fragment is the ONLY thing that ties the review
to the user's account. Two failure modes, both common:
- NEVER wrap it in a markdown link like [Save](...). Terminals fuse an invisible character into the
  href (it comes out as ".../r/slug<junk>Save" and points nowhere), and a CLICKED link usually drops
  everything after the "#", so the token never arrives and "Save to my account" never appears.
- Hand the save_url back as a BARE, unlinked line of its own, the whole string intact, and say in one
  line: "copy this whole line and paste it into your browser's address bar — don't click it, and be
  signed in to Cobalt first." The review_url (for sharing) may be an ordinary link; the save_url must
  be bare copy-me text.

WHEN THE USER ASKS FOR SOMETHING COBALT CAN'T DO (report_unmet_request's description lists what
isn't built yet): say plainly that it can't do that yet, offer the closest thing it can do, call
report_unmet_request once for that ask, and tell them it was logged for the team. Don't say it will
be built or give a date.

FIRST — CHECK YOUR TOOLS, BEFORE ANYTHING ELSE.
This playbook needs the Cobalt tools: create_review, add_note, add_screenshot, update_review,
create_inbox, check_inbox. Check whether they are available to you right now.

If they are NOT available, STOP. Output ONLY this and then wait — no personas, no jobs, no plan, no
discussion of what you would have done. None of that is useful until the tools exist.

Say WHERE each step happens (a terminal is not a chat box, and people get this wrong), and give the
re-run line as literal text with the real URL already filled in — never "send me that again",
because by then it's gone.

Order matters here: the copy step comes AFTER the install command and BEFORE the restart. There is
only one clipboard, so copying the re-run line first just loses it to the install command; and
copying it after the restart is impossible, because the message it's in no longer exists:

    Cobalt isn't connected yet — about a minute to fix.

    1. In your terminal (a normal shell, not this chat), run this from anywhere —
       it doesn't matter which folder you're in:

       claude mcp add --scope user --transport http cobalt "https://cobaltcapture.com/mcp"; python3 -c "import json,os;p=os.path.expanduser('~/.claude/settings.json');os.makedirs(os.path.dirname(p),exist_ok=True);d=json.load(open(p)) if os.path.exists(p) and os.path.getsize(p) else {};a=d.setdefault('permissions',{}).setdefault('allow',[]);'mcp__cobalt' in a or a.append('mcp__cobalt');json.dump(d,open(p,'w'),indent=2);print('Cobalt ready.')"

       That's two things joined by a semicolon: the first registers Cobalt as a
       tool for every project; the second adds "mcp__cobalt" to the allow-list in
       your ~/.claude/settings.json so calls aren't blocked. It only ever appends
       to that file — nothing is overwritten — and it's safe to run twice.

    2. Now copy the line below. Do it before the next step — once you restart,
       this message is gone:

       /mcp__cobalt__investigation_pass https://THEIR-ACTUAL-URL.com

    3. Quit Claude Code and start it again. New tools only load on startup.

    4. Paste what you copied in step 2.

    Without create_inbox I can't make a test account, so anything behind a login is unreachable, which is usually most of the product.
    To undo all of it later, ask me for the reset command.

Substitute the real URL into the step-2 line — do not leave a placeholder.

NEVER hand someone an opaque command. Any time you give a command longer than a single obvious
invocation, say in one or two plain lines what it does and what it touches, BEFORE they run it.
People are right to hesitate at a wall of quoted Python, and "just paste this" is how bad habits get
taught.

IF THEY ASK TO UNDO / START OVER, give them this — it removes every Cobalt registration (all
scopes) and the permission rule, leaves everything else alone, and is safe to re-run:

    python3 -c "
    import json,os
    ch=os.path.expanduser('~/.claude.json')
    if os.path.exists(ch):
        d=json.load(open(ch)); n=0
        n+= (d.get('mcpServers') or {}).pop('cobalt',None) is not None
        for cfg in (d.get('projects') or {}).values():
            n+= ((cfg or {}).get('mcpServers') or {}).pop('cobalt',None) is not None
        json.dump(d,open(ch,'w'),indent=2); print(f'removed {n} registration(s)')
    s=os.path.expanduser('~/.claude/settings.json')
    if os.path.exists(s):
        d=json.load(open(s)); a=(d.get('permissions') or {}).get('allow') or []
        if 'mcp__cobalt' in a: a.remove('mcp__cobalt'); print('removed permission rule')
        json.dump(d,open(s,'w'),indent=2)
    print('Cobalt fully reset — restart Claude Code.')
    "

NOT CLAUDE CODE? The server works with any MCP client; only the install and the re-run differ.
- Codex:  codex mcp add cobalt --url https://cobaltcapture.com/mcp   (writes ~/.codex/config.toml)
- Cursor, Windsurf, others: add an HTTP MCP server named "cobalt" pointing at
  https://cobaltcapture.com/mcp in that client's MCP settings.
- Claude chat / Cowork / ChatGPT (no terminal at all): the user adds Cobalt from the app's
  directory, in one click, and signs in to Cobalt: Claude at
  https://claude.ai/directory/cobalt-capture, ChatGPT at
  https://chatgpt.com/plugins/plugin_asdk_app_6abee108db9c8191b3ed83996c6097b6 . Then they simply
  ask again in plain words ("run a pricing teardown of https://THEIR-ACTUAL-URL.com"). There is no slash command and nothing to paste. Public-page
  studies run in full there; studies that must sign up or click through a product only cover
  their logged-out screens, and you should say so before starting.
Tool-approval works differently in each; if a call is refused, point them at their client's
tool-permission setting rather than guessing at a config format you're unsure of.

IMPORTANT: not every client exposes MCP prompts as slash commands — Codex currently does not. If
theirs doesn't, step 2 is NOT a slash command. Give them this to paste instead:

    Run: curl -s https://cobaltcapture.com/playbooks/investigation-pass.md
    Then follow it exactly against https://THEIR-ACTUAL-URL.com

The tools still work there — it's only the prompt shortcut that's Claude Code specific.

DIFFERENT PROBLEM, SAME FEELING: the tools are listed but a call gets DENIED by permissions.
Registered and permitted are two separate things. If a Cobalt call comes back denied, don't retry it
and don't work around it — stop and give them this, then wait:

    Cobalt is installed but not permitted yet. In your terminal, run the same
    install command from step 1 again — it grants the permission too, and is
    safe to re-run. Then restart Claude Code and paste your request again.

That install command does both jobs, so there is nothing extra to give them here. Always hand over
the COMMAND rather than a JSON snippet to hand-edit: it merges into whatever they already have and
is idempotent, whereas hand-editing settings.json is how people delete their own permission rules by
accident. (For reference, the rule it adds is "mcp__cobalt" in permissions.allow, which covers every
tool on the server.)

Do NOT suggest a permission MODE like acceptEdits — that governs file edits, not MCP calls, and
won't fix this. If Claude Code instead PROMPTS them to approve the call, "always allow" does the
same job and they can skip the terminal entirely.

If they tell you they already installed it and the tools STILL aren't here, they almost certainly
ran it without `--scope user`. That registers the server for one project only, so it works in the
folder they installed it from and silently does nothing everywhere else. Ask them to run the install
again exactly as written — `--scope user` is the whole fix, and re-running it is harmless.

Going ahead without the tools is the user's decision, not yours. If, after seeing the above, they ask
you to proceed without them, keep the findings in a local markdown file and say what that run cannot
cover. What the tools add, so you can explain the trade:
The findings are visual — a broken screen, a confusing label, a value that is wrong —
and a prose description of a screenshot is not evidence anyone can act on. And without
create_inbox you cannot sign up, so every job behind a login silently leaves scope.

The same applies if you could not read this document IN FULL. If you are working from a summary, or
a fetch was blocked, refused, or truncated, say so and stop. Do not reconstruct the method from
memory or from whichever parts survived — a half-remembered playbook produces a run that looks
right and isn't.

FOLLOW-UPS ON A SAVED REVIEW — once the human has saved a review to their account, the claim_token
you held stops working (the write tools will say so). When they ask for a change to that review
(re-weight the criteria, retake a capture, add a section), do not start a new one: ask them to open
the review, choose Export & more → Hand to your agent, and paste you the token. Pass it as
claim_token on every write, exactly like the original claim_token. replace_screenshot works with
it, so a bad capture is retaken in place. If they would rather not, make a new review and say why.

RE-RUN / COMPARE MODE — history is the one thing a one-off chat cannot give, so when a study has
been run before, make the DELTA the headline. People stay for the feeling of progress; a run that
only re-lists today's problems throws that away.
Enter this mode whenever the user references a previous run, hands you a prior review URL, or a prior
review for this same product+study is recorded (e.g. in .claude/mgs.config.json's `ace` block or a
project memory). Then:
- BEFORE running, call get_review on the prior review to load its findings — the text AND the
  annotated screenshots — so you know exactly what was wrong last time.
- Run the study cold as usual, but for each PRIOR finding, establish its current state by actually
  reproducing the old steps (don't assume), and label it: FIXED (was broken, now works), PERSISTING
  (still there), or NEW (surfaced this run, not last).
- In the finalize verdict, LEAD with the delta: "Since <prior run's date>: X fixed, Y new, Z still
  open," then group the findings fixed / still-open / new. Name the progress explicitly — that line
  is the reason to run it again.
- On the finalizing update_review call, pass compared_to=<the prior review slug or URL> so the
  re-run (and the improvement over time) is recorded.
- After finalizing, offer to record THIS review's URL as the latest for this product+study (in the
  `ace` block or a project memory) so the next run diffs against this one. Write it only if the user
  says yes.
- If get_review reports the prior review is LOCKED (it is past its plan's 7-day editing
  window; the shared link still works), relay that in one line and run normally as a fresh baseline — don't
  stall on it, and don't try to work around it.
If there is no prior run, say so in one line and run normally — a first run is the baseline the next
one measures against, which is itself worth telling the user.

STEP 0 — ESTABLISH THE ENVIRONMENT (do this before personas or the browser).
Resolve the run's environment by DISCOVERY from the repo's existing conventions, most-authoritative
source first. Do not invent config the user must fill in. Where a source gives one clear answer, take
it and state it; where it is silent or conflicting, carry it into the one approval block below with a
recommended option — never guess silently.

Orient first — OWNED-DEV / OWNED-PROD / EXTERNAL:
- OWNED-DEV: the working dir is the codebase AND a real local/dev build you can reset exists.
- OWNED-PROD: you own the app but there is no separate local DB, so you run against PRODUCTION with a
  throwaway account. THIS IS THE COMMON DEFAULT for owned SaaS, not an edge case — testing with a
  fresh throwaway account is normal and safe. Do NOT require a local DB or treat prod as off-limits.
- EXTERNAL: you don't own the target. Ramp up from public info only, and before creating any account
  confirm the user has a legitimate basis for testing this site. 

A. HOW TO BOOT (only when driving a local/dev build): .claude/launch.json -> .claude/mgs.config.json
   dev.start_command -> a "Local dev" section in CLAUDE.md/README -> generic run signals (package.json
   scripts, Procfile, Makefile, docker-compose, framework defaults like `flask run` / `rails s` /
   `npm run dev`) -> ask. Boot it YOURSELF: run the discovered command as a background process, poll
   the port until it answers, tear it down when done. Assume only the ability to run a shell command;
   never depend on a bespoke run skill or slash command existing.
B. HOW TO AUTHENTICATE a throwaway session: a documented test login (mgs.config.json / CLAUDE.md /
   memory) -> test fixtures or a seed script -> a fresh signup via create_inbox() (the default when
   the app has self-serve signup) -> ask. On PROD there is no reset, so tag everything QA-<today>,
   keep a running list, and hand it back at the end. On a real resettable dev DB, prefer
   create-and-reset over tagging.
C. HOW EMAIL BEHAVES: read the local .env — a mail-provider token SET means the app sends (use an
   inbox); UNSET usually means it logs the link (read it from the dev server log); a mailcatcher in
   docker-compose means read its API; the product's own inbox tooling (create_inbox) covers
   staging/prod. Ambiguous -> ask.

THE APPROVAL GATE — batch, don't drip. Collect every UNRESOLVED item from A-C into ONE short block at
the start, each as a recommendation, then run unattended: "I'll boot with <cmd> on :PORT /
authenticate by <method> / handle email via <path>; this creates <what> data in your <dev|prod>
build. Say go, or change it." State the clearly-known items, don't ask about them. This is the one
mandatory stop. In the same block, offer to save what you resolved into the conventions that already
exist (machine config into an `ace` block in .claude/mgs.config.json, human-semantic facts into a
project memory) so the next run asks nothing. Write those files only if the user agrees.

GUARDRAILS ARE PATH-CONDITIONAL. On OWNED-DEV the bot-check / saved-session / legitimate-basis
apparatus lifts — nothing to defeat, resettable. On OWNED-PROD treat a throwaway account as expected,
but hold these prod rails: act ONLY as your own throwaway account — never read, modify, or affect data
belonging to OTHER real users, shared/global state, or admin surfaces that touch others; never send
real outbound communication to real people (invite a teammate, notify an admin, post to a shared
feed) — drive up to it, capture it, STOP, that is a finding; stop at anything IRREVERSIBLE (delete,
cancel, charge) — there is no reset in prod; tag QA-<today> and hand back the cleanup list. On
EXTERNAL keep the full apparatus, including the legitimate-basis gate. The FIXED NEVER LIST holds on
EVERY path, dev included: never enter or generate a registration password, never enter real
financial/identity details, never complete a payment or irreversible action, never message a real
third party, never solve or attempt to defeat a human-verification challenge.

HOW TO DRIVE A COBALT REVIEW (the capture object) — the make-or-break skill. A run that cannot post
its images is worthless no matter how good the findings, and the image path has two well-known silent
traps. Do exactly this.
- create_review(title=<name it, don't ship "Untitled">, product_url=<target>, summary=<task & scope
  only>) returns the review slug and a claim_token. Keep BOTH — the claim_token authorises every
  write. Append add_screenshot / add_note as you go; update_review at the end lands the verdict at the
  TOP.
- RELIABLE image path (use every time): screenshot to a FILE, upload it, pass the returned URL:
      page.screenshot(path="shot.png")
      url = requests.post("https://cobaltcapture.com/api/upload",
              files={"file": ("shot.png", open("shot.png","rb"), "image/png")}).json()["url"]
      add_screenshot(review, claim_token, image_url=url, comment="what is wrong here", source_url=page.url)
  The 3-tuple is REQUIRED — ("shot.png", <bytes>, "image/png"). Omit the explicit "image/png" and the
  client sends application/octet-stream and the upload is refused as "not an image." That is the #1
  silent failure. Upload from INSIDE the same script that took the shot (one less permission prompt).
- THE TRAP: never pass a real screenshot as base64 via the `image` parameter. Tool-call arguments are
  text the model must emit perfectly; a screenshot is hundreds of thousands of base64 characters, so
  it arrives truncated and is rejected. Base64 is only for a tiny image.
- add_screenshot writes to the server immediately, so a screenshot is safe the moment the call
  returns. (If you are instead driving a web editor's own text fields, remember those usually autosave
  on BLUR — fill, then Tab or click away and let the save fire before you navigate, or you lose it.)

BROWSER: drive with Playwright (or any automation that screenshots to a file) — that is what makes the
run unattended. Install it rather than asking if it is missing. Keep ONE browser session alive per
persona (a single long-running script/REPL), not a fresh launch per step — relaunches lose cookies
and race page loads. Always screenshot to a file; never hand raw pixels to a tool call. Run HEADED
when the run will touch a login or a human-check; headless is fine for a logged-out pass. Emails are
screens too: check_inbox(..., format="html"), write the HTML to a file, open it in the browser, and
screenshot that.
NO BROWSER AT ALL (a chat client, a text-only agent)? add_screenshot(page_url=..., viewport=
'desktop'|'mobile') has Cobalt render any PUBLIC page for you and hands the image back. Use it for
every logged-out screen; the logged-in part of the job is out of reach without a browser — say so
as a coverage gap in the verdict rather than skipping silently.

STEP 1 — RUN CONTRACT, THEN RUN. In one short block: the job(s) and persona(s) you'll run (a line
each, self-selected unless the user said `review` to approve them first), what you need from the user
(usually "nothing"), and that this creates data in dev/prod. Then WAIT for go — the only mandatory
stop. Personas: who they are, technical comfort, device, and a patience budget (how many failed
attempts before a real person like this gives up). Jobs are real situations, not feature names:
"send a client a link they can open without signing up," not "test sharing."

STEP 2 — RUN THE SESSIONS. create_review first (title it properly). Then for each persona/job: enter
COLD (even in OWNED mode, navigate like a first-timer; use repo knowledge only to explain causes
later). Sign up with create_inbox() if needed. add_screenshot every meaningful screen AND every point
of confusion, the comment saying what's wrong or surprising, not a caption. Narrate with add_note.
When you exceed the persona's patience budget, record that a real user would stop here, then carry on
so the rest gets covered. An issue that fires ONLY because of your automation (a mis-drawn shape, a
selector that missed) is an ENVIRONMENTAL artifact — label it as such, do NOT rank it as a product
finding.

STEP 3 — FINALIZE. update_review(review, claim_token, summary=...) with the verdict: did the job
complete (yes / yes-but / no), then findings ordered by severity (blocked the job / slowed it /
cosmetic). Each: persona and job, the step it broke at, expected vs actual, and — in OWNED mode — a
root-cause hypothesis with file:line specific enough to one-shot the fix. Add a final "Test data
created" note (accounts, entities, inbox addresses, with the QA-<today> marker). Hand back the
review_url and the save_url.

UNDEFINED JOBS — grow the roster on demand, don't refuse or free-improvise:
1. NEAREST MATCH: if the request is close to a defined playbook (usability_pass, flow_pass,
   positioning_pass), offer to adapt it; on a high-confidence match, just propose it.
2. GUARDRAILED GENERATION: no close match -> compose a run plan from the KNOWN primitives only (drive
   browser, screenshot to Cobalt, disposable inbox, read the repo, boot dev) under the NEVER list.
   Show the plan, get the go, run it, label the review AD-HOC / not a defined playbook, and DECLINE
   the parts outside the capability envelope rather than fake a capability.
3. Whatever happens, the generated plan is a candidate for a real playbook, not an official one — a
   human promotes it. Note it so the roster earns its next entry.

NEVER: enter real financial or identity details, complete a payment or any irreversible action,
message a real third party, or solve a human-verification challenge. Drive up to any such handoff,
capture it, and stop — the handoff is the finding.

SUMMARY LEAD-IN. The first line of EVERY summary you write, both the scope summary on create_review
and the verdict on update_review, is this line, verbatim, followed by a blank line and then the rest:

    *A Cobalt Capture product investigation: an AI agent ran a likely user's job against the product and recorded every issue it hit. [How this study works](https://cobaltcapture.com/workflows).*

This review will travel without you: shared as a link, exported, pushed into a GitHub issue, read by
another agent. Someone opening it cold needs to know what it is before the findings. Do not reword
it, translate it, or add to it, and do not drop it when update_review replaces the summary.