tristanh/wikiwise/fetch-readwise-document
Claude Code and agent skill by tristanh/wikiwise
- community
Checking that the SKILL.md file is still in the repository.
Fetch one or more Readwise Reader documents into raw/ without loading bodies into context. Streams content to disk via jq pipe, then chains into ingest.
Install
npx vskill@latest install tristanh/wikiwise/fetch-readwise-documentSKILL.md
Fetch Readwise Document
Goal: grab a Reader document (or several) and drop it into raw/ without ever loading the full body into context. Only small metadata (title, author, url, date, category, doc_id) is allowed in context. The body gets streamed from CLI to file via a pipe.
Preconditions
readwiseCLI installed and authenticated.jqinstalled (brew install jqif missing).- A
raw/directory exists.
Core pattern (single doc)
Given a Readwise URL (https://read.readwise.io/read/<id>), a bare doc_id, or a search query:
Step 1 — Resolve doc_id
If the user gave a URL: the id is the last path segment. No CLI call needed.
If the user gave a specific title, use --title-search (note: --query is also required even when filtering by title):
For a topical search (no exact title), use --query alone. Add --author-search when you know the author. Show candidates to the user if ambiguous.
Step 2 — Fetch metadata (mandatory)
reader-get-document-details does not return image_url, source_url, published_date, word_count, or site_name. Pull those from reader-list-documents:
image_url— cover/header image. Embed asin the raw header.source_url— the original URL (not theread.readwise.ioshell). Use as the canonical**Source:**.
If image_url is null, skip the markdown image embed. Don't fail the fetch.
Pick a filename slug: <author-last-or-source>_<short-title-slug>.md, lowercase, hyphen-separated, no punctuation, max 60 chars.
Step 3 — Stream the body to disk
This is the critical command. Never run reader-get-document-details without piping into jq and redirecting to a file.
Drop the \n\n line if image_url is null.
Step 4 — Verify without reading the body
head -n 10 only shows the header you wrote. If line count is 0, something went wrong.
Step 5 — Report, then chain into ingest
Tell the user: filename, word count (from metadata), and that the body is on disk. Do not summarize the content — you haven't read it. Then invoke the ingest skill on the raw file.
Multi-doc pattern
Resolve all doc_ids first (Step 1), fetch metadata for all (Step 2), then loop:
Hold off on ingest until all fetches are done, then ingest the batch using parallel subagents (see import-readwise skill Step 4).
JSON shapes (don't re-probe these)
reader-search-documents --json→ top-level array. Each item:document_id,title,author,category,url,matches[].reader-list-documents --json→ `{count, nextPageCursor, results: [...]}`. Access withjq -r '.results[0] | ...'.reader-get-document-details --json→ flat object with keysid, title, author, category, tags, notes, content. The body is at.content. Noimage_url,source_url,published_date.
Tweet caveat
When a user saves a tweet that is a reply, Reader stores the parent thread as the document. The source_url (from list-documents) points at the actually-saved tweet. The image_url is the parent author's avatar. Surface this to the user when fetching tweet replies.
CLI flag reference (don't guess these)
The Readwise CLI uses --document-id, NOT --id. Here are the exact flags:
Common mistakes to avoid:
reader-get-document-details --id→ WRONG, use--document-idreader-list-documents --document-id→ WRONG, use--id
Rules
- Never run
reader-get-document-detailswithout| jq -r '.content' > <file>. No exceptions. - Never
Readorcataraw/file you just wrote unless the user explicitly asks. - Never probe JSON shapes with
jq 'keys'. - Prefer the flag reference above over
--help— but--helpis fine as a fallback. - Prefer `--title-search` over
--querywhen the user names a specific title. - If metadata is missing fields, use
nullorunknown— do not fetch the body to find them. - Confirm with the user before overwriting an existing
raw/file.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSources/Wikiwise/Resources/scaffold/skills/fetch-readwise-document/SKILL.md
Popularity
- Repository stars
- 232
- Repository forks
- 20
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tristanh/wikiwise/fetch-readwise-document)