# Agent skill

One install teaches Claude Code, Codex, Cursor and the rest when to use Page Scanner and how, and what to say to them.

The MCP server gives an agent four tools. The skill tells it when to reach for them and how: check
the pairing first, capture the tab you are looking at rather than reopen a page you are logged
into, which options print well, what `truncated` means, and what Chrome's debugger bar is. It is a
`SKILL.md` in the [Agent Skills](https://agentskills.io) format, so the same file works in every
agent that reads the standard, and it lives in a public repository,
[sbd530/page-scanner-skills](https://github.com/sbd530/page-scanner-skills).

## Install it

### Claude Code: the plugin

The plugin carries the skill and registers the MCP server, so these two lines are the whole setup
on the agent's side and replace the `claude mcp add` line on the [install page](https://docs.pagescanner.app/mcp/install):

```bash
claude plugin marketplace add sbd530/page-scanner-skills
claude plugin install page-scanner@page-scanner-skills
```

### Any agent: the skill on its own

```bash
npx skills add sbd530/page-scanner-skills
```

That installs it for the agents it finds in the current project: Claude Code, Codex, Cursor,
GitHub Copilot, Gemini CLI and the rest; `-g` installs it for your user instead. An agent that
speaks MCP still needs the server registered, one line per client on the
[install page](https://docs.pagescanner.app/mcp/install). An agent with only a shell needs nothing more: the skill falls back
to the `page-scanner` command, run through `npx`. `npx skills update` picks up a newer skill later.

Either way, then [pair Chrome](https://docs.pagescanner.app/mcp/pairing), once per profile. The extension ships with local
agents off, and turning them on means pasting a token into its settings page; the skill knows to
ask you to do that rather than fetch the token itself.

## What to say to the agent

Plain requests work. The skill maps them onto the tools:

| You say                                                                               | The agent does                                                     |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| "Save this tab as a PDF on my Desktop"                                                | `list_tabs`, then `scan_page` with that `tabId` and the folder     |
| "Capture [https://example.com/report](https://example.com/report) so it prints on A4" | `scan_page` with the `url`, `captureWidth: "a4"`, `pageSize: "a4"` |
| "I need a full-page screenshot of the pricing page, PNG"                              | `format: "png"`                                                    |
| "Grab the dark version of the docs page"                                              | `colorScheme: "dark"`                                              |
| "Capture it and open it so I can crop it"                                             | `openEditor: true`; an agent cannot crop, the editor can           |
| "Which of my open tabs are on the wiki?"                                              | `list_tabs`, no capture                                            |

Name a tab when the page's state matters: what you have scrolled, filtered or logged into is only
in the tab you are looking at. Give a URL when it does not; the agent opens it in a background tab
of your Chrome, captures it, and closes it again.

The agent reports the path it wrote, and two things about the file: `selectableText`, which is the
only basis for saying the PDF's text is real, and `truncated`, which is set when the page was
longer than the [60,000 pixel ceiling](https://docs.pagescanner.app/mcp/limits) and the file is missing the rest. A skill that
follows the file will say so rather than hand you an incomplete document as a whole one.

## What the agent runs on its own

Nothing you have to hand it. With the MCP server it calls `list_browsers`, `list_tabs` and
`scan_page`, [documented here](https://docs.pagescanner.app/mcp/tools). With a shell only, it runs the command line:

```bash
npx @page-scanner/cli browsers --json
npx @page-scanner/cli tabs --json
npx @page-scanner/cli scan --tab <id> --out ~/Desktop/ --json
npx @page-scanner/cli scan --url https://example.com/doc --page-width a4 --out ./doc.pdf --json
```

`--json` puts one document on stdout for success and failure alike, which is what an agent wants
to read; the [commands page](https://docs.pagescanner.app/cli/commands) has the whole surface and the exit codes.

Two things the skill tells the agent not to do: rotate the pairing token on its own, because that
disconnects every browser you paired, and call the `pair` tool when you have not asked it to,
because the token would land in the transcript.

## Where it lives

[sbd530/page-scanner-skills](https://github.com/sbd530/page-scanner-skills) holds the skill, its
argument reference and the Claude Code marketplace file, under Apache-2.0. It is published from
the product repository, so a change to the tools and a change to the skill ship together; issues
are welcome on either.
