agentleFS
pgplexpgplex/pgconsole/.claude/skills/take-doc-screenshots/SKILL.md

take-doc-screenshots

Skill157 starsChanged 5 months agoApache-2.0View on GitHub

Take screenshots of the running pgconsole app for documentation. Use when updating docs with screenshots or adding images to .mdx files.

  • Installs packages

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Read pgconsole.toml to find the email and password from the first [[users]] entry

    line 22
  2. Distinctive:

    Call the login API to get a session token:

    line 23
  3. Distinctive:

    Create a Playwright auth state JSON file:

    line 30
  4. Very specific:

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

    line 48
  5. Very specific:

    Use page.keyboard.type('SQL here', { delay: 5 }) to type

    line 60
  6. Very specific:

    Use page.keyboard.press('Control+Space') for autocomplete

    line 61
  7. Very specific:

    Use page.keyboard.press('Meta+a') to select all before replacing content

    line 62
  8. Very specific:

    Do NOT try to access cmView from the DOM — it's not exposed

    line 63
  9. Distinctive:

    After capturing dropdown/modal screenshots, always dismiss with:

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

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

Dismissing Overlays

After capturing dropdown/modal screenshots, always dismiss with:

await page.keyboard.press('Escape');
await page.waitForTimeout(500);

An open overlay blocks clicks on other elements.

Image Processing

  1. Convert PNGs to WebP: cwebp -q 90 input.png -o output.webp
  2. Store in docs/images/features/<feature-name>/ (matching docs/features/<feature-name>.mdx)
  3. Reference in MDX as ![Alt text](/images/features/<feature-name>/<image>.webp)
  4. Clean up temporary PNG files after conversion

Image Convention

  • Format: WebP (.webp), quality 90
  • Dimensions: 1440x900 (1x resolution)
  • Location: docs/images/ mirroring the docs/ structure
  • Naming: <feature>-<description>.webp (e.g., sql-editor-autocomplete.webp)
  • Alt text: brief description of what the screenshot shows

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.