agentleFS
cogine-aicogine-ai/cogine-dev-skillset/skills/get-cookies/SKILL.md

get-cookies

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Use when a site under review requires authentication and you need to import cookies from a real browser session into your local browser automation helper. Trigger on "get-cookies", cookie import, browser session reuse, authenticated QA, or protected pages behind login.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When this skill says AskUserQuestion, use the platform's question or confirmation tool if available.

    line 12
  2. Distinctive:

    Import logged-in sessions from your real Chromium browser into the headless browse session.

    line 37
  3. Distinctive:

    Check whether the current automation session is already attached to a real browser profile

    line 42
  4. Very specific:

    Run cookie-import-browser to detect installed browsers and open the picker UI

    line 43
  5. Very specific:

    If the user provides a path, export it as COGINE_BROWSE_BIN for the current session and continue.

    line 68
  6. Distinctive:

    If the browser automation helper is already connected to a real browser profile through CDP or an equivalent "use my existing browser" …

    line 72
  7. Distinctive:

    If the status output indicates an attached real browser profile, tell the user: "This session already appears to be using your real browser …

    line 78
  8. Very specific:

    If the helper has no status command or the output is inconclusive, continue to cookie import.

    line 80
  9. Very specific:

    If the user specifies a domain directly (e.g., /get-cookies github.com), skip the UI:

    line 99
  10. Distinctive:

    After the user confirms they're done:

    line 109
  11. Distinctive:

    Only domain names and cookie counts are shown in the UI — no cookie values are exposed.

    line 122
  12. Distinctive:

    Do not print cookie values, raw SQLite rows, decrypted secrets, or Keychain/libsecret output.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

get-cookies

Cogine internal skill for importing cookies from a real browser session into local browser automation.

Cross-Platform Notes

  • When this skill says AskUserQuestion, use the platform's question or confirmation tool if available; otherwise ask the user directly and wait.
  • Ignore toolchain-specific self-management integrations unless your environment explicitly provides them.
  • This skill assumes your environment has a browser automation helper that supports cookie import. If it does not, stop and ask the user which local browser tool to use.

Preamble (run first)

_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"

AskUserQuestion Format

ALWAYS follow this structure for every AskUserQuestion call:

  1. Re-ground: State the project, the current branch (use the _BRANCH value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
  2. Simplify: Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
  3. Recommend: RECOMMENDATION: Choose [X] because [one-line reason]
  4. Options: Lettered options: A) ... B) ... C) ...

Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.

Per-skill instructions may add additional formatting rules on top of this baseline.

Setup Browser Cookies

Import logged-in sessions from your real Chromium browser into the headless browse session.

How it works

  1. Find the browse binary
  2. Check whether the current automation session is already attached to a real browser profile
  3. Run cookie-import-browser to detect installed browsers and open the picker UI
  4. User selects which cookie domains to import in their browser
  5. Cookies are decrypted and loaded into the Playwright session

Steps

1. Find the browse binary

SETUP (run this check BEFORE any browse command)

_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
B="${COGINE_BROWSE_BIN:-}"
[ -z "$B" ] && [ -n "$_ROOT" ] && [ -x "$_ROOT/.cogine/tools/browse" ] && B="$_ROOT/.cogine/tools/browse"
[ -z "$B" ] && [ -x "$HOME/.cogine/tools/browse" ] && B="$HOME/.cogine/tools/browse"
[ -z "$B" ] && command -v browse >/dev/null 2>&1 && B="$(command -v browse)"
if [ -n "$B" ] && [ -x "$B" ]; then
  echo "READY: $B"
else
  echo "NEEDS_SETUP"
fi

If NEEDS_SETUP:

  1. Tell the user: "Cogine browser tooling is not configured on this machine. Point me to the browser helper binary or tell me which browser automation stack to use." Then STOP and wait.
  2. If the user provides a path, export it as COGINE_BROWSE_BIN for the current session and continue.

2. Check for real-browser / CDP mode

If the browser automation helper is already connected to a real browser profile through CDP or an equivalent "use my existing browser" mode, cookie import is usually unnecessary. Verify before opening the picker:

"$B" status 2>/dev/null || true

If the status output indicates an attached real browser profile, tell the user: "This session already appears to be using your real browser profile, so cookie import is not needed unless a specific domain still fails authentication." Then continue with the authenticated QA task.

If the helper has no status command or the output is inconclusive, continue to cookie import.

3. Open the cookie picker

$B cookie-import-browser

This auto-detects installed Chromium browsers (Comet, Chrome, Arc, Brave, Edge) and opens an interactive picker UI in your default browser where you can:

  • Switch between installed browsers
  • Search domains
  • Click "+" to import a domain's cookies
  • Click trash to remove imported cookies

Tell the user: "Cookie picker opened — select the domains you want to import in your browser, then tell me when you're done."

4. Direct import (alternative)

If the user specifies a domain directly (e.g., /get-cookies github.com), skip the UI:

$B cookie-import-browser comet --domain github.com

Replace comet with the appropriate browser if specified.

5. Verify

After the user confirms they're done:

$B cookies

Show the user a summary of imported cookies (domain counts).

Notes

  • First import per browser may trigger a macOS Keychain dialog — click "Allow" / "Always Allow".
  • On Linux, Chromium cookie decryption may depend on libsecret/Secret Service and the browser's current cookie storage version. If imports fail on Linux, report only a redacted error summary or error code and ask whether to use an already-authenticated CDP session instead.
  • Cookie picker is served on the same port as the browse server (no extra process)
  • Only domain names and cookie counts are shown in the UI — no cookie values are exposed.
  • Do not print cookie values, raw SQLite rows, decrypted secrets, or Keychain/libsecret output.
  • The importer should read browser cookie stores through a temporary read-only copy and avoid writing plaintext cookies to disk outside the automation session.
  • The browse session persists cookies between commands, so imported cookies work immediately.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.