pdf-viewer
View and discuss PDF files with the user in the PDF side panel. Use when the user wants to open, read, review or ask about a PDF in the workspace, refers to something they selected or referenced in the PDF viewer, or should check a PDF you just produced.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 253
- Forks
- 20
01 前言 Front Matter
- name
- pdf-viewer
- description
- View and discuss PDF files with the user in the PDF side panel. Use when the user wants to open, read, review or ask about a PDF in the workspace, refers to something they selected or referenced in the PDF viewer, or should check a PDF you just produced.
03 SKILL.md 正文
PDF viewer
The PDF panel renders a workspace PDF for the user. You read the same file through tools and point the user at places in it. The viewer is read-only: never claim to have edited a file through it. To produce or change PDFs, use the pdf skill.
Anchors
Every location is an anchor <workspace-relative path>#<location>: page:N or page:N-M, for example paper.pdf#page:5. Omit #<location> for the whole document. Pages start at 1. Use only anchors that a tool returned or that follow this grammar; tool output prefixes every page with its location.
Workflow
open_document(path, at?)opens the file in the panel and returns its outline. Open the document before discussing it so the user sees what you see.read_document(anchor, cursor?)returns the text of a page or range. Read the relevant part before answering; follow thecursorhint for long content instead of guessing.search_document(path, query)finds text and returns page anchors.show_in_viewer(targets, note?)scrolls the panel to the targets and highlights them. Use it whenever your answer is about specific places. Addquote(exact text on the page) to highlight a phrase rather than the whole page. Keepnoteto one short sentence.get_view()tells you what the user is looking at and what they selected. Call it when the user says "this", "here", "the selected …" or similar without an anchor.capture_view(anchor?)(a panel tool, available while the panel is open) returns an image of the rendered page. Use it when layout, figures or formatting matter, or when text extraction comes back empty (for example scanned PDFs). The document must already be open in the panel.
After you produce a PDF with the pdf skill, open it with open_document so the user can look at the result with you.
References from the user
When the user selects text or clicks a page and chooses Add to chat, the next message carries context like - paper.pdf#page:4: "Latency fell by 40 percent…". Treat those anchors as precise pointers: read them with read_document if you need more than the quoted text, and answer about exactly those places. Ask sends a question that already includes the anchor and the quoted text.
show_in_viewer marks every target and shows your note beside the first one; the user can step through the targets in order, so list them in the order you discuss them.
Notes
- Paths are relative to the workspace; files outside it cannot be opened. Encrypted PDFs cannot be opened.
- Do not paste whole documents into the chat; quote briefly and point with
show_in_viewer. - The panel only works in ZCode Desktop local workspaces. Elsewhere, the read and search tools still work; tell the user the visual viewer is unavailable.
04 同仓库更多 Skills
plugin-mcp-ping
E2E workspace Plugin skill marker
zcode-configuration-guide
Use when configuring ZCode's extension resources (MCP servers, slash commands, skills, hooks, and plugins) or instruction files such as AGENTS.md in the ZCode client. Explains where each resource is configured at the user and workspace scope, the discovery order, precedence, and merge rules, plus guidance on which location to choose. Use when someone asks how to add an MCP server, command, skill, hook, plugin, or AGENTS.md instructions, where a configuration file lives, why a configuration is not taking effect, or needs routing to a specific diagnostic skill.
diagnosing-skills
Use to diagnose and fix ZCode skill configuration problems in the ZCode client. Applies when a skill is not discovered, is installed but does not trigger automatically, is shadowed by a higher-precedence skill of the same name, is disabled by configuration, has a SKILL.md frontmatter error, fails to load because its description is too long, or disappears because the plugin providing it is disabled. Provides the discovery order, how to inspect skills in the client, common pitfalls, and a step-by-step localization and repair workflow.
diagnosing-plugins
Use to diagnose and fix ZCode plugin and marketplace problems in the ZCode client. Applies when a plugin is not listed, adding a marketplace or installing a plugin fails, a plugin is enabled but its skills or commands are missing, a built-in plugin still appears after being disabled, a plugin is not enabled as expected, a plugin.json manifest has a parse error, a plugin name is invalid, a dependency is unresolved or blocked across marketplaces, or a sensitive configuration value cannot be entered in the interface. Provides the plugin lifecycle, manifest schema, how to manage plugins in the client, and a step-by-step localization and repair workflow.
diagnosing-mcp
Use to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client. Applies when an MCP server will not connect, its tools (mcp__server__tool) do not appear, it shows as disabled or failed, connections time out, a command cannot be found, template variables are not expanded, or a server defined in a configuration file has no effect. Provides configuration locations, how to inspect status in Settings, common pitfalls, and a step-by-step localization and repair workflow.
diagnosing-hooks
Use to diagnose and fix ZCode hook configuration problems in the ZCode client. Applies when a hook does not trigger, an event name is wrong, a matcher does not match a tool name, a script is not executable, template variables are not expanded, a timeout unit is mistaken (seconds versus milliseconds), the command and process field styles are mixed, a hook's JSON output fails validation, a hook blocks the session unexpectedly, or configuration-file hooks are not enabled. Provides configuration sources, the hooks.json schema, how to inspect hooks in the client, and a step-by-step localization and repair workflow.