Generate comprehensive literature review from research proposal...
Generate a comprehensive literature review on any research topic. This skill walks you through the process step by step. While it includes LessWrong and Alignment Forum as sources (useful for AI safety research), it works equally well for any field — the academic search engines (arXiv, Semantic Scholar, Google Scholar) cover all disciplines.
Explain to the user what this skill does:
"I'll help you conduct a comprehensive literature review. Here's what will happen:
- Setup - We'll create a folder for your lit review outputs
- Research focus - You'll tell me about your research topic (or I can help you develop one)
- Automated search - I'll search academic databases, arXiv, and relevant forums
- Processing - I'll download papers, remove duplicates, and summarize each one
- Report - You'll get a catalog of papers and a curated top-10 report
The whole process runs mostly automatically, but I'll check in at key points. Ready to get started?"
Wait for confirmation before proceeding.
Ask the user where they'd like to save the literature review outputs:
"Where would you like me to save the literature review? I'll create a folder for all the papers, summaries, and reports.
You can give me a path like
./my_project_lit_reviewor just a name likeinterpretability_reviewand I'll create it in your current directory."
Once they provide a location:
.gitignore (the folder can get large with PDFs)The literature review needs a research focus to guide the search. Ask the user:
"Do you have a research proposal or project description I should use to guide the search?
- If yes: Give me the file path and I'll read it
- If no: I can help you articulate your research focus through a few questions
(If you have something in Google Docs or another cloud tool, you can copy-paste it into a local text file—something like
proposal.mdorproposal.txtin your project folder—and give me that path.)"
Read the file and confirm you understand the research focus.
Conduct a brief interview:
Based on their answers, synthesize a brief research focus document (~1 page). Show it to them and ask if it captures their intent. Save it to their output folder as research_proposal.md.
Before starting the automated process, explain what permissions will be needed:
"For the literature review, I'll need to:
- Run Python scripts - These search databases, download papers, and process results
- Read and write files - To save papers, summaries, and reports to your folder
- Make web requests - To search Semantic Scholar, arXiv, LessWrong, and optionally Google Scholar
The scripts are part of this plugin and run locally on your machine. No data is sent anywhere except the search queries to the academic databases.
You may see permission prompts as I work—these are normal. Let me know if you have any questions before we begin."
Wait for the user to confirm they're comfortable proceeding.
Optional enhancement - Exa Search API:
"By the way, if you want higher-quality search results, you can optionally set up an Exa API key. Exa is a semantic search engine designed for AI—it finds more relevant results than keyword search.
It's free to sign up at https://exa.ai and you get generous free credits. If you have a key, set it as
EXA_API_KEYin your environment and I'll use it automatically.This is totally optional—the literature review works fine without it."
Check if uv is installed:
!which uv || echo "UV_NOT_FOUND"
If the output shows "UV_NOT_FOUND", tell the user:
"I need a tool called
uvto run the search scripts, but it's not installed on your system. It's a fast Python package manager.Would you like me to install it? I'll run:
curl -LsSf https://astral.sh/uv/install.sh | shThis is safe and widely used in the Python community."
If they agree, run the installation command and verify it worked. If they decline, explain the skill cannot proceed without it.
Once setup is complete, execute the phases below. This process is largely autonomous, but you can adapt based on results—for example, adding additional search stages if gaps remain.
Analyze the proposal and generate 8-12 diverse search queries. Consider:
Save queries to <output_dir>/search_terms.json as a JSON array of strings.
Example format:
[
"main research question keywords",
"specific method or technique name",
"related concept from adjacent field"
]
Stage 1 is intentionally small - the goal is to quickly understand the terminology and landscape, not to be comprehensive. Limit to ~10 results per source. The refined Stage 2 search will be the thorough one.
Create the raw_results directory:
mkdir -p <output_dir>/raw_results
Academic sources (Semantic Scholar, arXiv, Google Scholar):
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/run_searches.py \
--queries <output_dir>/search_terms.json \
--output-dir <output_dir>/raw_results \
--scripts-dir ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review \
--arxiv-limit 10 \
--semantic-scholar-limit 10 \
--google-scholar-limit 10
Note: Google Scholar may fail due to rate limiting—this is expected.
LessWrong and Alignment Forum:
Search for LW/AF posts using the WebSearch tool. Keep it brief for Stage 1—just 1-2 searches per platform:
site:lesswrong.com [main query]
site:alignmentforum.org [main query]
Important notes on LW/AF cross-posting:
Collect the URLs (aim for ~5-10 posts) and save them to <output_dir>/raw_results/lesswrong_urls.json as a JSON array:
[
{"url": "https://www.lesswrong.com/posts/...", "title": "Post Title"},
{"url": "https://www.alignmentforum.org/posts/...", "title": "Another Post"}
]
Then fetch full content (posts + comments) using the scraper via the LW GraphQL API:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/fetch_lesswrong.py \
--urls <output_dir>/raw_results/lesswrong_urls.json \
--output <output_dir>/raw_results/lesswrong.json
The scraper:
Run the deduplication script to merge results from all sources:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/dedup_papers.py \
--input-dir <output_dir>/raw_results/ \
--output <output_dir>/deduplicated.json \
--threshold 0.85
These three stages run as a pipeline for maximum throughput. Papers flow through download → markdown conversion → summarization incrementally, rather than waiting for all papers to finish one stage before starting the next.
Create directories and start the pipeline script. It downloads PDFs, converts them to markdown, and processes LW/AF posts—all incrementally. Each completed markdown file path is printed to stdout as it becomes ready.
mkdir -p <output_dir>/papers <output_dir>/summaries
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/process_papers_pipeline.py \
--input <output_dir>/deduplicated.json \
--output-dir <output_dir>/papers/
Run this command in the background using the Bash tool's run_in_background parameter.
While the pipeline runs, repeatedly check for new markdown files that need summarization. Loop until the pipeline finishes and all papers are summarized:
<output_dir>/papers/ that do NOT yet have a corresponding summary in <output_dir>/summaries/Each summarizer agent should receive:
Example Task prompt for each agent:
Summarize the paper at: <output_dir>/papers/<paper_id>.md
Research proposal context:
<proposal content>
Write the summary to: <output_dir>/summaries/<paper_id>.md
Follow the summarizer agent instructions for output format.
This pipelined approach means summarization starts within seconds of the first paper being ready, rather than waiting for all downloads and conversions to finish.
Run the catalog generator:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/generate_catalog.py \
--summaries <output_dir>/summaries/ \
--papers <output_dir>/deduplicated.json \
--output <output_dir>/catalog.md
Read the catalog and summaries. Create <output_dir>/stage1_report.md with:
This is the main search. Now that you understand the terminology and landscape from Stage 1, run a comprehensive search with the refined queries. Use full limits (100 per source).
Analyze the Stage 1 results to create refined search queries. Consider:
-particle -collider if "accelerator" matched physics papers)Generate 8-12 refined queries and save to <output_dir>/search_terms_stage2.json.
Run comprehensive searches with refined terms (full limits):
mkdir -p <output_dir>/raw_results_stage2
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/run_searches.py \
--queries <output_dir>/search_terms_stage2.json \
--output-dir <output_dir>/raw_results_stage2 \
--scripts-dir ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review \
--arxiv-limit 100 \
--semantic-scholar-limit 100 \
--google-scholar-limit 50
LessWrong and Alignment Forum (comprehensive):
Now do thorough LW/AF searches with all refined queries. Search both platforms since comments differ:
site:lesswrong.com [refined query 1]
site:lesswrong.com [refined query 2]
site:alignmentforum.org [refined query 1]
site:alignmentforum.org [refined query 2]
...
Collect all URLs into <output_dir>/raw_results_stage2/lesswrong_urls.json and fetch via fetch_lesswrong.py as in Stage 1. The scraper deduplicates by post ID, so cross-posted URLs won't be fetched twice.
Combine Stage 1 and Stage 2 results:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/dedup_papers.py \
--input-dir <output_dir>/raw_results/ \
--input-dir <output_dir>/raw_results_stage2/ \
--output <output_dir>/deduplicated_merged.json \
--threshold 0.85
deduplicated_merged.json to original deduplicated.json to identify NEW papers<output_dir>/new_papers_stage2.json)process_papers_pipeline.py in the background with --input <output_dir>/new_papers_stage2.jsonAfter processing Stage 2 results, assess the current state:
Based on this assessment, choose the appropriate next action:
Run another search stage if major gaps remain or new promising search directions emerged. Repeat Phases 10-13 with further refined terms (save to search_terms_stage3.json, raw_results_stage3/, etc.).
Proceed to final reporting if coverage is sufficient. Continue to the Final Output section below.
Explore a specific tangent if the findings suggest a related but distinct area worth investigating separately.
Use your judgment based on the research proposal's goals and the quality of results so far.
When ready to conclude, generate the final deliverables:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/lit-review/generate_catalog.py \
--summaries <output_dir>/summaries/ \
--papers <output_dir>/deduplicated_merged.json \
--output <output_dir>/catalog.md
Create <output_dir>/top_10_report.md with:
Save final state to <output_dir>/progress.json with completion timestamp and statistics for each stage completed.
Summarize:
catalog.md and top_10_report.mdpython -c "..." for ad-hoc processing. This produces long, hard-to-read commands that make users nervous. If you need to do data manipulation beyond what the provided scripts handle, write a small temporary script file, run it, then delete it.progress.json after each major phaseIf <output_dir>/progress.json exists, check which phases completed and resume from where left off. Skip phases that already have output files.