take-doc-screenshots

A procedure for capturing screenshots of the running pgconsole application for documentation. pgconsole is the application being documented, and MDX is a format that combines Markdown with embedded components.

In plain words
What is it for?
Use it when updating documentation that needs images or screenshots of pgconsole screens.
Why use it?
It provides a repeatable way to log in, open the application, and save screenshots in the required format instead of capturing them manually.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pgplex/pgconsole/take-doc-screenshots
Any agent
npx skills add pgplex/pgconsole --skill take-doc-screenshots
Clone the repo
git clone --depth 1 https://github.com/pgplex/pgconsole

Made for: Claude Code, Codex.

Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.00881
Opus 5 $0.00016 $0.00441
Sonnet 5 $0.00006 $0.00176
Haiku 4.5 $0.00003 $0.00088

Measured 2d ago against content hash d53196f06297, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

take-doc-screenshots scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -c cookies.txt -X POST http://localhost:5173/api/auth/login \
.claude/skills/take-doc-screenshots/SKILL.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Take Documentation Screenshots

Capture screenshots of the running pgconsole app at http://localhost:5173 for use in documentation.

Prerequisites

  • The dev server must be running (pnpm dev)
  • shot-scraper must be installed (pipx install shot-scraper && shot-scraper install)
  • cwebp must be installed (brew install webp)

Authentication

Login credentials are in pgconsole.toml under [[users]]. Use the first user entry.

  1. Read pgconsole.toml to find the email and password from the first [[users]] entry
  2. Call the login API to get a session token:
    curl -s -c cookies.txt -X POST http://localhost:5173/api/auth/login \
      -H 'Content-Type: application/json' \
      -d '{"email":"<email>","password":"<password>"}'
    
  3. Extract the pgconsole_token cookie value from cookies.txt
  4. Create a Playwright auth state JSON file:
    {
      "cookies": [{
        "name": "pgconsole_token",
        "value": "<token>",
        "domain": "localhost",
        "path": "/",
        "httpOnly": true,
        "secure": false,
        "sameSite": "Lax"
      }],
      "origins": []
    }
    

Taking Screenshots

Write a Playwright script (.mjs file in the scratchpad directory) that:

  1. Launches Chromium with viewport: { width: 1440, height: 900 } (no deviceScaleFactor — use 1x)
  2. Sets the auth cookie via context.addCookies()
  3. Navigates to http://localhost:5173
  4. Uses Playwright actions (click, type, keyboard) to navigate to the desired state
  5. Saves screenshots as PNG

CodeMirror Interaction

The SQL editor uses CodeMirror 6. To type into it:

  • Click .cm-content to focus
  • Use page.keyboard.type('SQL here', { delay: 5 }) to type
  • Use page.keyboard.press('Control+Space') for autocomplete
  • Use page.keyboard.press('Meta+a') to select all before replacing content
  • Do NOT try to access cmView from the DOM — it's not exposed

UI Navigation

Key buttons to interact with:

  • button with text SQL — opens a new query tab
  • button with text Run — executes the query
  • button with text Format — opens format dropdown
  • button with text Quick SQL — opens quick SQL dropdown
  • button with text Processes — opens processes modal
  • Right-click on .cm-content for context menu

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 98 lines · 32 tokens per session scan A d53196f06297

Subscribe to this mod's changes

take-doc-screenshots is a skill published in the GitHub repository pgplex/pgconsole (148 stars, last pushed 19d ago), licensed Apache-2.0. It adds 32 tokens to every session and 881 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.