AGENTS.md, and live state as a JSON file. Any agent that can read and write files works: Claude Code, Cursor, Codex, or anything else.
The five skills
npm create @autono/open-pdf@latest installs five skills into .agents/skills/ and symlinks each into .claude/skills/, so Claude Code picks them up natively while other agents read them from the neutral .agents/ location.
AGENTS.md and CLAUDE.md
The workspace root carriesAGENTS.md and an identical CLAUDE.md. They are deliberately short: the hard rules (docs live at docs/<kebab-id>/index.tsx, do not touch package.json or open-pdf.config.ts, no new dependencies) plus a routing table that points each kind of task at the right skill. Everything deeper lives in the skills, so the always-loaded context stays small.
Keeping skills in sync
Skills are managed by@autono/open-pdf. Do not edit them in place; local edits are overwritten on the next sync. To pull the latest versions:
npm run dev also detects drift on startup and offers to sync. To preview what a sync would change without writing anything:
added, updated, or unchanged. Sync copies changed skills into .agents/skills/ and maintains the .claude/skills/ symlinks, falling back to a plain copy on filesystems that refuse symlinks.
The agent cursor: current.json
The dev server writes a live cursor on every navigation and inspector pick:docIdandpagePathidentify the doc the human has open.pagePathis relative to the project root.selectionisnullunless the human has picked an element in inspect mode. When set,line(1-indexed) andcolumn(0-indexed) point at the JSX opening tag inpagePath,tagNameis the source tag, andtextis a snippet (up to 120 chars) extracted from the PDF under the element as a sanity check.updatedAtis the last navigation or selection change. Use it to judge staleness: trust a fresh read, confirm before acting on one older than a few minutes.
current.json, jumps to pagePath at selection.line, and edits, without asking “which doc?”. The cursor is live state, not conversation history: the current-doc skill instructs agents to re-read it at the start of every deictic turn, because the human navigates between turns.
If the file is missing, the dev server has not been opened on a doc yet. Agents are instructed to ask rather than guess.
The @pdf-comment marker
Inspector comments persist as JSX comment markers insidedocs/<id>/index.tsx:
- Inserted as the first child inside the element the comment refers to, spliced immediately after the opening tag’s
>. textdecodes to JSON:{"note": "...", "hint"?: "..."}. Thenoteis the human’s verbatim comment.- Being a JSX comment, it renders nothing and never affects PDF output.
apply-comments skill carries the authoritative detection regex, the procedure for resolving each marker’s target element, and the edge cases (self-closing elements, stacked markers, unresolvable notes). Agents apply edits in reverse line order so earlier edits do not invalidate later line numbers, then delete each marker they applied. A marker left behind means the edit was skipped, not forgotten.
Working outside Claude Code
Nothing above depends on Claude Code. Cursor, Codex, and other agents get the same surface:AGENTS.mdat the root is the standard entry point most agents already read.- Skills in
.agents/skills/<name>/SKILL.mdare plain markdown. Point your agent at the relevant one, or reference it in your agent’s rules file. current.jsonand@pdf-commentmarkers are plain files the dev server maintains regardless of which agent is attached.