highlight-graph
Visualize your highlights and their connections in an interactive 2D graph
What this skill does
You are building an interactive 2D force-graph visualization of the user's Readwise highlights, showing how ideas connect across books, articles, and other sources. Think Obsidian's graph view, but for highlights.
## Readwise Access
Check if Readwise MCP tools are available (e.g. `mcp__readwise__readwise_list_highlights`). If they are, use them throughout. If not, use the equivalent `readwise` CLI commands instead.
## Process
### Step 1: Fetch Highlights
Open with:
> **Highlight Graph** · Readwise
>
> I'll pull your recent highlights, find connections between them, and build a graph you can explore. Give me a moment.
Fetch the user's most recent highlights using `readwise_list_highlights` with `page_size=100`. Fetch 2 pages (200 highlights) for a good starting graph. Each page returns highlights from most recent to least recent — use `page=1`, then `page=2`.
### Step 2: Prepare Highlight Data
Parse the API responses and build a JSON array of highlights. Each highlight needs:
```json
{
"id": "12345",
"text": "The actual highlight text...",
"note": "User's note if any",
"book_id": 58741401,
"source_title": "The Goal",
"source_author": "Eliyahu Goldratt",
"url": "https://..."
}
```
**Important:** The Readwise API returns `book_id` but does NOT return the book/article title or author with each highlight. You must identify the source title and author yourself by reading the highlight texts and any available metadata (URLs, content patterns). Group highlights by `book_id` and infer the source from context. It's fine to use "Unknown" for author when unsure, but try to identify the title.
Write this array to a temp file: `/tmp/highlights.json`
### Step 3: Initial Render (No Connections)
Write an empty connections file and run the build script to give the user something to look at immediately:
```bash
echo '[]' > /tmp/connections.json
python3 SKILL_DIR/build_graph.py --highlights /tmp/highlights.json --connections /tmp/connections.json --output highlight-graph.html
open highlight-graph.html
```
Tell the user:
> Graph is open with **{N} highlights** across **{N} sources**. Finding connections between ideas now...
### Step 4: Find Cross-Source Connections
Launch **parallel subagents** (3-5 agents) to find semantic connections between highlights from *different* sources. Each agent should analyze a batch of highlights and return connections.
**Batching strategy:**
1. Group highlights by source (book_id).
2. Split sources into batches of ~8 sources each.
3. For each batch pair (including within-batch), launch an agent with the highlight texts from those sources.
4. Each agent should find 5-10 genuine conceptual connections — shared themes, ideas, or language across different sources.
Each agent should return a JSON array of connections:
```json
[
{
"a_id": "12345",
"b_id": "67890",
"label": "Feedback loops",
"why": "Both highlights discuss how tight feedback loops improve quality"
}
]
```
**Quality over quantity.** Only create connections when the link is real and would be interesting. 15-30 total cross-source connections for 200 highlights is ideal.
### Step 5: Rebuild with Connections
Merge all agent results into a single connections JSON array, write to `/tmp/connections.json`, and re-run the build script:
```bash
python3 SKILL_DIR/build_graph.py --highlights /tmp/highlights.json --connections /tmp/connections.json --output highlight-graph.html
open highlight-graph.html
```
Present a summary:
> Built a graph of **{N} highlights** across **{N} sources**, with **{N} connections** between ideas.
>
> A few interesting connections I found:
> - "{highlight A snippet}" ↔ "{highlight B snippet}" — *{connection label}*
> - ...
>
> The graph is open in your browser. Want to add more highlights?
### Step 6: Iterate
- **More highlights:** Fetch additional pages (`page=3`, `page=4`, etc.), re-run source identification, find new connections, rebuild.
- **Filter by topic:** Use `readwise_search_highlights` to pull highlights on a specific topic or from a specific book, rebuild with just those.
## The Build Script
`build_graph.py` (in this skill's directory) handles all the visualization logic. It takes two JSON files and outputs a self-contained HTML file:
```
python3 build_graph.py --highlights highlights.json --connections connections.json --output output.html
```
**highlights.json:** Array of `{id, text, note, book_id, source_title, source_author, url}`
**connections.json:** Array of `{a_id, b_id, label, why}`
The script handles:
- Deduplication and filtering of highlights
- Color assignment per source (rose-pine palette)
- Same-source full pairwise connectivity (all highlights from same book linked)
- Cross-source semantic connections (dashed purple edges with particles)
- Interactive sidebar panel with connected ideas and same-book highlights
- Label overlap prevention
- Screen-relative text scaling (consistent size at any zoom level)
- Source legend with click-to-filter
- Hover isolation and selection persistence
The output is a single HTML file using [force-graph](https://github.com/vasturiano/force-graph) from CDN. No server needed — just open in a browser.
## SKILL_DIR
Replace `SKILL_DIR` in commands above with the actual path to this skill's directory (where `build_graph.py` lives).
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.