Reader Mode Bridge
Use this skill when the user needs a real local cleanup pass before a web article, PDF excerpt, or copied reading fragment moves into notes, chat, or another document.
Reader Mode Bridge fits best when the task is about:
- turning copied reading input into one stable handoff without another cleanup pass
- preserving title, source, and readable body text when the original input is noisy
- attaching front-browser-tab metadata to clipboard text so the handoff keeps its source
- exporting a clean reading payload as markdown, prompt text, plain text, or JSON
Quick Start
From the skill folder:
python3 scripts/reader_mode_bridge.py doctor
python3 scripts/reader_mode_bridge.py clean --clipboard --front-tab --format markdown
python3 scripts/reader_mode_bridge.py clean --file ~/Downloads/article.html --format prompt
python3 scripts/reader_mode_bridge.py clean --file ~/Downloads/paper.pdf --title "Paper excerpt" --format markdown
pbpaste | python3 scripts/reader_mode_bridge.py clean --stdin --source-url https://example.com/article --format prompt
python3 scripts/reader_mode_bridge.py copy --text "<h1>Sample</h1><p>Reader handoff body.</p>" --format markdown
What the helper does
- reads saved HTML, markdown, text, clipboard content, stdin, or local PDFs when
pdftotext is available
- removes common boilerplate such as share prompts, cookie lines, duplicate lines, and other short navigation debris
- keeps one clean title, one source label, and one readable body so the handoff lands in notes or chat without manual repair
- can attach the current Safari or Chrome-family front-tab title and URL when the article text came from the clipboard
- renders plain text, markdown, prompt-friendly text, or JSON output and can copy the result to the macOS clipboard
Workflow
- Run
doctor once if you need to confirm pbcopy, pbpaste, pdftotext, or AppleScript support.
- Use
clean with --clipboard, --stdin, --text, or --file to create the reading handoff.
- Add
--front-tab when the source text came from a browser and you want the current tab metadata attached automatically.
- Use
copy when the next move is pasting the cleaned handoff directly into Codex, Notes, a ticket, or a chat thread.
Guardrails
- Do not invent source metadata that is not present in the input, the supplied flags, or the active front tab.
- Keep the tool local and deterministic; it should not depend on network access or remote reader services.
- Treat PDF extraction as best-effort and fail clearly when
pdftotext is unavailable instead of pretending the PDF was read.
- Reader Mode Bridge cleans and formats content; it should not summarize, rewrite, or mutate the source beyond cleanup and truncation.
Prototype
prototype/ sketches a menu-bar shell with source metadata, cleanup notes, reading metrics, and export actions.
- Keep the SwiftUI surface menu-bar first and compact enough to support the quick "clean this and move it on" moment.
Resources
scripts/reader_mode_bridge.py: deterministic local helper for reading cleanup and export
references/cleanup-contract.md: supported inputs, outputs, and cleanup heuristics
prototype/: SwiftUI starter files for a compact macOS reader handoff surface
1---2name: reader-mode-bridge3description: Turn saved HTML, copied article text, or PDF excerpts into a deterministic local reading handoff with clean metadata and export-ready output.4---56# Reader Mode Bridge78Use this skill when the user needs a real local cleanup pass before a web article, PDF excerpt, or copied reading fragment moves into notes, chat, or another document.910Reader Mode Bridge fits best when the task is about:1112- turning copied reading input into one stable handoff without another cleanup pass13- preserving title, source, and readable body text when the original input is noisy14- attaching front-browser-tab metadata to clipboard text so the handoff keeps its source15- exporting a clean reading payload as markdown, prompt text, plain text, or JSON1617## Quick Start1819From the skill folder:2021```bash22python3 scripts/reader_mode_bridge.py doctor23python3 scripts/reader_mode_bridge.py clean --clipboard --front-tab --format markdown24python3 scripts/reader_mode_bridge.py clean --file ~/Downloads/article.html --format prompt25python3 scripts/reader_mode_bridge.py clean --file ~/Downloads/paper.pdf --title "Paper excerpt" --format markdown26pbpaste | python3 scripts/reader_mode_bridge.py clean --stdin --source-url https://example.com/article --format prompt27python3 scripts/reader_mode_bridge.py copy --text "<h1>Sample</h1><p>Reader handoff body.</p>" --format markdown28```2930## What the helper does3132- reads saved HTML, markdown, text, clipboard content, stdin, or local PDFs when `pdftotext` is available33- removes common boilerplate such as share prompts, cookie lines, duplicate lines, and other short navigation debris34- keeps one clean title, one source label, and one readable body so the handoff lands in notes or chat without manual repair35- can attach the current Safari or Chrome-family front-tab title and URL when the article text came from the clipboard36- renders plain text, markdown, prompt-friendly text, or JSON output and can copy the result to the macOS clipboard3738## Workflow39401. Run `doctor` once if you need to confirm `pbcopy`, `pbpaste`, `pdftotext`, or AppleScript support.412. Use `clean` with `--clipboard`, `--stdin`, `--text`, or `--file` to create the reading handoff.423. Add `--front-tab` when the source text came from a browser and you want the current tab metadata attached automatically.434. Use `copy` when the next move is pasting the cleaned handoff directly into Codex, Notes, a ticket, or a chat thread.4445## Guardrails4647- Do not invent source metadata that is not present in the input, the supplied flags, or the active front tab.48- Keep the tool local and deterministic; it should not depend on network access or remote reader services.49- Treat PDF extraction as best-effort and fail clearly when `pdftotext` is unavailable instead of pretending the PDF was read.50- Reader Mode Bridge cleans and formats content; it should not summarize, rewrite, or mutate the source beyond cleanup and truncation.5152## Prototype5354- `prototype/` sketches a menu-bar shell with source metadata, cleanup notes, reading metrics, and export actions.55- Keep the SwiftUI surface menu-bar first and compact enough to support the quick "clean this and move it on" moment.5657## Resources5859- `scripts/reader_mode_bridge.py`: deterministic local helper for reading cleanup and export60- `references/cleanup-contract.md`: supported inputs, outputs, and cleanup heuristics61- `prototype/`: SwiftUI starter files for a compact macOS reader handoff surface