Topic: The search query (e.g., "networks", "behavioral economics")
Journals: Which journals to search (default: Top 5 Economics)
Year range: Publication year(s) (default: current year)
Output format: LaTeX (default), Markdown, or both
Create working directory:
agent_tasks/{topic_slug}_{YYYYMMDDHH}/
Write plan.md to the working directory documenting the execution plan.
Set up task tracking with TaskCreate for the 4 phases.
Step 1: Phase 1 — Parallel Journal Search
Launch one subagent per journal (up to 10 in parallel). Each agent:
Queries OpenAlex API with the journal's source ID and topic keyword
Queries CrossRef API with the journal's ISSN and topic keyword
Deduplicates results by DOI
Saves to search_{journal_abbrev}.json
Agent prompt template:
Search for papers about "{TOPIC}" published in {JOURNAL_NAME} in {YEAR}.
1. OpenAlex API (source ID: {OPENALEX_ID}):
curl -s "https://api.openalex.org/works?filter=primary_location.source.id:{OPENALEX_ID},default.search:{TOPIC},publication_year:{YEAR}&per_page=50&[email protected]"
2. CrossRef API (ISSN: {ISSN}):
curl -s "https://api.crossref.org/journals/{ISSN}/works?query={TOPIC}&filter=from-pub-date:{YEAR}-01-01&rows=50&[email protected]"
Extract: title, authors, doi, year, cited_by, pdf_urls, abstract (from inverted index), openalex_id.
Deduplicate by DOI. Save to: {WORKDIR}/search_{ABBREV}.json
Key journal identifiers (verify OpenAlex IDs via API before use):
Journal
ISSN
OpenAlex ID
American Economic Review
0002-8282
S23254222
Econometrica
0012-9682
S95464858
Journal of Political Economy
0022-3808
(verify via API)
Quarterly Journal of Economics
0033-5533
S203860005
Review of Economic Studies
0034-6527
(verify via API)
For non-Top-5 journals, first look up the OpenAlex source ID:
Wait for all search agents to complete before proceeding.
After all agents complete, do a quick tally: read each search_*.json and count papers. If total < 3, consider broadening the search terms or year range. If total > 30, the topic may need narrowing — flag this to the user.
File handoff, not context handoff: Every agent saves its output to a file.
Never pass large content back to the main agent. Agents return only a status
summary (paper count, success/failure, file paths).
Parallel where possible, sequential where required: Phases 1 and 2 are
parallel internally. Phase 3 depends on Phase 2 outputs. Phase 4 is sequential
(review before revision).
All agents get mode: auto: Subagents need Bash, Read, Write, Edit access
to do their work without permission prompts.
Verify before proceeding: Always compile LaTeX and check for errors between
phases. Don't hand broken output to the next phase.
Be transparent about relevance: Not every paper returned by keyword search
is centrally about the topic. The survey should acknowledge varying degrees of
relevance rather than force-fitting papers into the narrative.
Respect API rate limits: OpenAlex (add mailto), CrossRef (add mailto),
Semantic Scholar (3s between calls), arXiv (3s between calls).
Customization Points
Different journals: Change the journal table. For any journal, look up its
OpenAlex source ID first.
Different output format: Swap LaTeX template for Markdown if user prefers.
Broader search: Add NBER, SSRN, arXiv searches in Phase 1 using the
academic-paper-search skill's API patterns.
Deeper review: Add a second review-revise cycle if the first review score < 7.
Zotero import: After Phase 2, optionally import all papers via zotero_add_by_doi.