invisible-threads
Skill9 starsChanged 10 months agoMITArchived repositoryView on GitHub
Discovers non-obvious thematic connections ("invisible threads") across a corpus of essays, articles, or transcripts. Adapted from invisible-threads. The key file to modify is the extraction prompt in extract_insights.py. See references/prompt-templates.md for examples.
In this repository35 other files it gives its agents.
- docs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- nano-banana-image-generatorSkill
- find-your-marginSkill
- vellum-prepSkill
- open-education-hub-deep-divesSkill
- seo-content-writerSkill
- seo-researchSkill
- meta-ads-creativeSkill
- social-content-creationSkill
- text-contentSkill
- x-article-converterSkill
- x-postingSkill
- day-in-the-lifeSkill
- podcast-blog-post-creatorSkill
- podcast-productionSkill
- short-form-videoSkill
- video-caption-creationSkill
- youtube-clip-extractorSkill
- youtube-downloaderSkill
- youtube-title-creatorSkill
- ai-tellsSkill
- anti-ai-writingSkill
- cold-open-creatorSkill
- dude-with-sign-writerSkill
- email-writingSkill
- ghostwriterSkill
- hook-and-headline-writingSkill
- how-newslettersSkill
- human-writingSkill
- memoSkill
- transcript-polisherSkill
- verified-reviewSkill
- voice-pirate-wiresSkill
- writing-styleSkill
The file
Files
Invisible Threads Skill
Discovers non-obvious thematic connections ("invisible threads") across a corpus of essays, articles, or transcripts.
Adapted from invisible-threads.
When to Use
- Editing an anthology and want to find thematic connections
- Analyzing a body of work for recurring ideas
- Finding quotes that support a theme across multiple sources
- Writing editorial commentary that weaves sources together
Quick Start
# 1. Prepare your corpus as markdown files in a source directory
# 2. Chunk the corpus into a database
python chunk_corpus.py --source /path/to/markdown/files --output corpus.db
# 3. Extract insights using Gemini
python extract_insights.py --db corpus.db --backend gemini
# 4. Find threads
python find_threads.py --input data/insights_*.json
# 5. Review threads_*.json for editorial useAdapting for Your Project
The key file to modify is the extraction prompt in extract_insights.py.
Default Prompt Categories
The default is set up for Catholic agrarian content (Cross & Plough):
- industrialism, land, family, property, craft, liturgy
- organic-farming, distributism, eugenics, totalitarianism
- natural-law, peasantry, economics, spirituality
For Other Projects
Change the EXTRACTION_PROMPT in extract_insights.py:
- Context section: Describe what the corpus is
- Examples section: Give 3 examples of genuine insights from this domain
- Categories: List 10-15 thematic categories relevant to your content
See references/prompt-templates.md for examples.
Output
insights_*.json
Each insight includes:
insight_text: The extracted quote/ideacategory: Thematic categorynovelty_score: 1-10 how surprisingspecificity_score: 1-10 how quotablesource: Which document it came fromraw_chunk: Original context
threads_*.json
Each thread includes:
thread_id: Identifiercategory: Dominant themesize: Number of connected insightsnum_sources: How many different documentsyears_spanned: Timeline (if applicable)insights: All insights in this thread
Editorial Applications
- Reorganize structure around discovered threads
- Write headnotes referencing how themes recur
- Add footnotes pointing to related pieces
- Find unused quotes that connect to themes
- Write bridge paragraphs between sections
Scripts
| Script | Purpose |
chunk_corpus.py | Split markdown files into database |
extract_insights.py | Extract insights using LLM (Gemini/Claude/Ollama) |
find_threads.py | Cluster insights into thematic threads |
Requirements
google-generativeai>=0.3.0 # For Gemini
sentence-transformers>=2.2.0
networkx>=3.0
python-louvain>=0.16
scikit-learn>=1.0Cost
| Backend | ~1000 chunks | Speed |
| Gemini Flash | Free tier | Fast |
| Gemini Pro | ~$1-2 | Fast |
| Claude Haiku | ~$0.50 | Fast |
| Ollama | Free | Slow |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

