flonat-research 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/.claude/agents/domain-reviewer.md +336 -0
  2. package/.claude/agents/fixer.md +226 -0
  3. package/.claude/agents/paper-critic.md +370 -0
  4. package/.claude/agents/peer-reviewer.md +289 -0
  5. package/.claude/agents/proposal-reviewer.md +215 -0
  6. package/.claude/agents/referee2-reviewer.md +367 -0
  7. package/.claude/agents/references/journal-referee-profiles.md +354 -0
  8. package/.claude/agents/references/paper-critic/council-personas.md +77 -0
  9. package/.claude/agents/references/paper-critic/council-prompts.md +198 -0
  10. package/.claude/agents/references/peer-reviewer/report-template.md +199 -0
  11. package/.claude/agents/references/peer-reviewer/sa-prompts.md +260 -0
  12. package/.claude/agents/references/peer-reviewer/security-scan.md +188 -0
  13. package/.claude/agents/references/proposal-reviewer/report-template.md +144 -0
  14. package/.claude/agents/references/proposal-reviewer/sa-prompts.md +149 -0
  15. package/.claude/agents/references/referee-config.md +114 -0
  16. package/.claude/agents/references/referee2-reviewer/audit-checklists.md +287 -0
  17. package/.claude/agents/references/referee2-reviewer/report-template.md +334 -0
  18. package/.claude/rules/design-before-results.md +52 -0
  19. package/.claude/rules/ignore-agents-md.md +17 -0
  20. package/.claude/rules/ignore-gemini-md.md +17 -0
  21. package/.claude/rules/lean-claude-md.md +45 -0
  22. package/.claude/rules/learn-tags.md +99 -0
  23. package/.claude/rules/overleaf-separation.md +67 -0
  24. package/.claude/rules/plan-first.md +175 -0
  25. package/.claude/rules/read-docs-first.md +50 -0
  26. package/.claude/rules/scope-discipline.md +28 -0
  27. package/.claude/settings.json +125 -0
  28. package/.context/current-focus.md +33 -0
  29. package/.context/preferences/priorities.md +36 -0
  30. package/.context/preferences/task-naming.md +28 -0
  31. package/.context/profile.md +29 -0
  32. package/.context/projects/_index.md +41 -0
  33. package/.context/projects/papers/nudge-exp.md +22 -0
  34. package/.context/projects/papers/uncertainty.md +31 -0
  35. package/.context/resources/claude-scientific-writer-review.md +48 -0
  36. package/.context/resources/cunningham-multi-analyst-agents.md +104 -0
  37. package/.context/resources/cunningham-multilang-code-audit.md +62 -0
  38. package/.context/resources/google-ai-co-scientist-review.md +72 -0
  39. package/.context/resources/karpathy-llm-council-review.md +58 -0
  40. package/.context/resources/multi-coder-reliability-protocol.md +175 -0
  41. package/.context/resources/pedro-santanna-takeaways.md +96 -0
  42. package/.context/resources/venue-rankings/abs_ajg_2024.csv +1823 -0
  43. package/.context/resources/venue-rankings/abs_ajg_2024_econ.csv +356 -0
  44. package/.context/resources/venue-rankings/cabs_4_4star_theory.csv +40 -0
  45. package/.context/resources/venue-rankings/core_2026.csv +801 -0
  46. package/.context/resources/venue-rankings.md +147 -0
  47. package/.context/workflows/README.md +69 -0
  48. package/.context/workflows/daily-review.md +91 -0
  49. package/.context/workflows/meeting-actions.md +108 -0
  50. package/.context/workflows/replication-protocol.md +155 -0
  51. package/.context/workflows/weekly-review.md +113 -0
  52. package/.mcp-server-biblio/formatters.py +158 -0
  53. package/.mcp-server-biblio/pyproject.toml +11 -0
  54. package/.mcp-server-biblio/server.py +678 -0
  55. package/.mcp-server-biblio/sources/__init__.py +14 -0
  56. package/.mcp-server-biblio/sources/base.py +73 -0
  57. package/.mcp-server-biblio/sources/formatters.py +83 -0
  58. package/.mcp-server-biblio/sources/models.py +22 -0
  59. package/.mcp-server-biblio/sources/multi_source.py +243 -0
  60. package/.mcp-server-biblio/sources/openalex_source.py +183 -0
  61. package/.mcp-server-biblio/sources/scopus_source.py +309 -0
  62. package/.mcp-server-biblio/sources/wos_source.py +508 -0
  63. package/.mcp-server-biblio/uv.lock +896 -0
  64. package/.scripts/README.md +161 -0
  65. package/.scripts/ai_pattern_density.py +446 -0
  66. package/.scripts/conf +445 -0
  67. package/.scripts/config.py +122 -0
  68. package/.scripts/count_inventory.py +275 -0
  69. package/.scripts/daily_digest.py +288 -0
  70. package/.scripts/done +177 -0
  71. package/.scripts/extract_meeting_actions.py +223 -0
  72. package/.scripts/focus +176 -0
  73. package/.scripts/generate-codex-agents-md.py +217 -0
  74. package/.scripts/inbox +194 -0
  75. package/.scripts/notion_helpers.py +325 -0
  76. package/.scripts/openalex/query_helpers.py +306 -0
  77. package/.scripts/papers +227 -0
  78. package/.scripts/query +223 -0
  79. package/.scripts/session-history.py +201 -0
  80. package/.scripts/skill-health.py +516 -0
  81. package/.scripts/skill-log-miner.py +273 -0
  82. package/.scripts/sync-to-codex.sh +252 -0
  83. package/.scripts/task +213 -0
  84. package/.scripts/tasks +190 -0
  85. package/.scripts/week +206 -0
  86. package/CLAUDE.md +197 -0
  87. package/LICENSE +21 -0
  88. package/MEMORY.md +38 -0
  89. package/README.md +269 -0
  90. package/docs/agents.md +44 -0
  91. package/docs/bibliography-setup.md +55 -0
  92. package/docs/council-mode.md +36 -0
  93. package/docs/getting-started.md +245 -0
  94. package/docs/hooks.md +38 -0
  95. package/docs/mcp-servers.md +82 -0
  96. package/docs/notion-setup.md +109 -0
  97. package/docs/rules.md +33 -0
  98. package/docs/scripts.md +303 -0
  99. package/docs/setup-overview/setup-overview.pdf +0 -0
  100. package/docs/skills.md +70 -0
  101. package/docs/system.md +159 -0
  102. package/hooks/block-destructive-git.sh +66 -0
  103. package/hooks/context-monitor.py +114 -0
  104. package/hooks/postcompact-restore.py +157 -0
  105. package/hooks/precompact-autosave.py +181 -0
  106. package/hooks/promise-checker.sh +124 -0
  107. package/hooks/protect-source-files.sh +81 -0
  108. package/hooks/resume-context-loader.sh +53 -0
  109. package/hooks/startup-context-loader.sh +102 -0
  110. package/package.json +51 -0
  111. package/packages/cli-council/.github/workflows/claude-code-review.yml +44 -0
  112. package/packages/cli-council/.github/workflows/claude.yml +50 -0
  113. package/packages/cli-council/README.md +100 -0
  114. package/packages/cli-council/pyproject.toml +43 -0
  115. package/packages/cli-council/src/cli_council/__init__.py +19 -0
  116. package/packages/cli-council/src/cli_council/__main__.py +185 -0
  117. package/packages/cli-council/src/cli_council/backends/__init__.py +8 -0
  118. package/packages/cli-council/src/cli_council/backends/base.py +81 -0
  119. package/packages/cli-council/src/cli_council/backends/claude.py +25 -0
  120. package/packages/cli-council/src/cli_council/backends/codex.py +27 -0
  121. package/packages/cli-council/src/cli_council/backends/gemini.py +26 -0
  122. package/packages/cli-council/src/cli_council/checkpoint.py +212 -0
  123. package/packages/cli-council/src/cli_council/config.py +51 -0
  124. package/packages/cli-council/src/cli_council/council.py +391 -0
  125. package/packages/cli-council/src/cli_council/models.py +46 -0
  126. package/packages/llm-council/.github/workflows/claude-code-review.yml +44 -0
  127. package/packages/llm-council/.github/workflows/claude.yml +50 -0
  128. package/packages/llm-council/README.md +453 -0
  129. package/packages/llm-council/pyproject.toml +42 -0
  130. package/packages/llm-council/src/llm_council/__init__.py +23 -0
  131. package/packages/llm-council/src/llm_council/__main__.py +259 -0
  132. package/packages/llm-council/src/llm_council/checkpoint.py +193 -0
  133. package/packages/llm-council/src/llm_council/client.py +253 -0
  134. package/packages/llm-council/src/llm_council/config.py +232 -0
  135. package/packages/llm-council/src/llm_council/council.py +482 -0
  136. package/packages/llm-council/src/llm_council/models.py +46 -0
  137. package/packages/mcp-bibliography/MEMORY.md +31 -0
  138. package/packages/mcp-bibliography/_app.py +226 -0
  139. package/packages/mcp-bibliography/formatters.py +158 -0
  140. package/packages/mcp-bibliography/log/2026-03-13-2100.md +35 -0
  141. package/packages/mcp-bibliography/pyproject.toml +15 -0
  142. package/packages/mcp-bibliography/run.sh +20 -0
  143. package/packages/mcp-bibliography/scholarly_formatters.py +83 -0
  144. package/packages/mcp-bibliography/server.py +1857 -0
  145. package/packages/mcp-bibliography/tools/__init__.py +28 -0
  146. package/packages/mcp-bibliography/tools/_registry.py +19 -0
  147. package/packages/mcp-bibliography/tools/altmetric.py +107 -0
  148. package/packages/mcp-bibliography/tools/core.py +92 -0
  149. package/packages/mcp-bibliography/tools/dblp.py +52 -0
  150. package/packages/mcp-bibliography/tools/openalex.py +296 -0
  151. package/packages/mcp-bibliography/tools/opencitations.py +102 -0
  152. package/packages/mcp-bibliography/tools/openreview.py +179 -0
  153. package/packages/mcp-bibliography/tools/orcid.py +131 -0
  154. package/packages/mcp-bibliography/tools/scholarly.py +575 -0
  155. package/packages/mcp-bibliography/tools/unpaywall.py +63 -0
  156. package/packages/mcp-bibliography/tools/zenodo.py +123 -0
  157. package/packages/mcp-bibliography/uv.lock +711 -0
  158. package/scripts/setup.sh +143 -0
  159. package/skills/beamer-deck/SKILL.md +199 -0
  160. package/skills/beamer-deck/references/quality-rubric.md +54 -0
  161. package/skills/beamer-deck/references/review-prompts.md +106 -0
  162. package/skills/bib-validate/SKILL.md +261 -0
  163. package/skills/bib-validate/references/council-mode.md +34 -0
  164. package/skills/bib-validate/references/deep-verify.md +79 -0
  165. package/skills/bib-validate/references/fix-mode.md +36 -0
  166. package/skills/bib-validate/references/openalex-verification.md +45 -0
  167. package/skills/bib-validate/references/preprint-check.md +31 -0
  168. package/skills/bib-validate/references/ref-manager-crossref.md +41 -0
  169. package/skills/bib-validate/references/report-template.md +82 -0
  170. package/skills/code-archaeology/SKILL.md +141 -0
  171. package/skills/code-review/SKILL.md +265 -0
  172. package/skills/code-review/references/quality-rubric.md +67 -0
  173. package/skills/consolidate-memory/SKILL.md +208 -0
  174. package/skills/context-status/SKILL.md +126 -0
  175. package/skills/creation-guard/SKILL.md +230 -0
  176. package/skills/devils-advocate/SKILL.md +130 -0
  177. package/skills/devils-advocate/references/competing-hypotheses.md +83 -0
  178. package/skills/init-project/SKILL.md +115 -0
  179. package/skills/init-project-course/references/memory-and-settings.md +92 -0
  180. package/skills/init-project-course/references/organise-templates.md +94 -0
  181. package/skills/init-project-course/skill.md +147 -0
  182. package/skills/init-project-light/skill.md +139 -0
  183. package/skills/init-project-research/SKILL.md +368 -0
  184. package/skills/init-project-research/references/atlas-pipeline-sync.md +70 -0
  185. package/skills/init-project-research/references/atlas-schema.md +81 -0
  186. package/skills/init-project-research/references/confirmation-report.md +39 -0
  187. package/skills/init-project-research/references/domain-profile-template.md +104 -0
  188. package/skills/init-project-research/references/interview-round3.md +34 -0
  189. package/skills/init-project-research/references/literature-discovery.md +43 -0
  190. package/skills/init-project-research/references/scaffold-details.md +197 -0
  191. package/skills/init-project-research/templates/field-calibration.md +60 -0
  192. package/skills/init-project-research/templates/pipeline-manifest.md +63 -0
  193. package/skills/init-project-research/templates/run-all.sh +116 -0
  194. package/skills/init-project-research/templates/seed-files.md +337 -0
  195. package/skills/insights-deck/SKILL.md +151 -0
  196. package/skills/interview-me/SKILL.md +157 -0
  197. package/skills/latex/SKILL.md +141 -0
  198. package/skills/latex/references/latex-configs.md +183 -0
  199. package/skills/latex-autofix/SKILL.md +230 -0
  200. package/skills/latex-autofix/references/known-errors.md +183 -0
  201. package/skills/latex-autofix/references/quality-rubric.md +50 -0
  202. package/skills/latex-health-check/SKILL.md +161 -0
  203. package/skills/learn/SKILL.md +220 -0
  204. package/skills/learn/scripts/validate_skill.py +265 -0
  205. package/skills/lessons-learned/SKILL.md +201 -0
  206. package/skills/literature/SKILL.md +335 -0
  207. package/skills/literature/references/agent-templates.md +393 -0
  208. package/skills/literature/references/bibliometric-apis.md +44 -0
  209. package/skills/literature/references/cli-council-search.md +79 -0
  210. package/skills/literature/references/openalex-api-guide.md +371 -0
  211. package/skills/literature/references/openalex-common-queries.md +381 -0
  212. package/skills/literature/references/openalex-workflows.md +248 -0
  213. package/skills/literature/references/reference-manager-sync.md +36 -0
  214. package/skills/literature/references/scopus-api-guide.md +208 -0
  215. package/skills/literature/references/wos-api-guide.md +308 -0
  216. package/skills/multi-perspective/SKILL.md +311 -0
  217. package/skills/multi-perspective/references/computational-many-analysts.md +77 -0
  218. package/skills/pipeline-manifest/SKILL.md +226 -0
  219. package/skills/pre-submission-report/SKILL.md +153 -0
  220. package/skills/process-reviews/SKILL.md +244 -0
  221. package/skills/process-reviews/references/rr-routing.md +101 -0
  222. package/skills/project-deck/SKILL.md +87 -0
  223. package/skills/project-safety/SKILL.md +135 -0
  224. package/skills/proofread/SKILL.md +254 -0
  225. package/skills/proofread/references/quality-rubric.md +104 -0
  226. package/skills/python-env/SKILL.md +57 -0
  227. package/skills/quarto-deck/SKILL.md +226 -0
  228. package/skills/quarto-deck/references/markdown-format.md +143 -0
  229. package/skills/quarto-deck/references/quality-rubric.md +54 -0
  230. package/skills/save-context/SKILL.md +174 -0
  231. package/skills/session-log/SKILL.md +98 -0
  232. package/skills/shared/concept-validation-gate.md +161 -0
  233. package/skills/shared/council-protocol.md +265 -0
  234. package/skills/shared/distribution-diagnostics.md +164 -0
  235. package/skills/shared/engagement-stratified-sampling.md +218 -0
  236. package/skills/shared/escalation-protocol.md +74 -0
  237. package/skills/shared/external-audit-protocol.md +205 -0
  238. package/skills/shared/intercoder-reliability.md +256 -0
  239. package/skills/shared/mcp-degradation.md +81 -0
  240. package/skills/shared/method-probing-questions.md +163 -0
  241. package/skills/shared/multi-language-conventions.md +143 -0
  242. package/skills/shared/paid-api-safety.md +174 -0
  243. package/skills/shared/palettes.md +90 -0
  244. package/skills/shared/progressive-disclosure.md +92 -0
  245. package/skills/shared/project-documentation-content.md +443 -0
  246. package/skills/shared/project-documentation-format.md +281 -0
  247. package/skills/shared/project-documentation.md +100 -0
  248. package/skills/shared/publication-output.md +138 -0
  249. package/skills/shared/quality-scoring.md +70 -0
  250. package/skills/shared/reference-resolution.md +77 -0
  251. package/skills/shared/research-quality-rubric.md +165 -0
  252. package/skills/shared/rhetoric-principles.md +54 -0
  253. package/skills/shared/skill-design-patterns.md +272 -0
  254. package/skills/shared/skill-index.md +240 -0
  255. package/skills/shared/system-documentation.md +334 -0
  256. package/skills/shared/tikz-rules.md +402 -0
  257. package/skills/shared/validation-tiers.md +121 -0
  258. package/skills/shared/venue-guides/README.md +46 -0
  259. package/skills/shared/venue-guides/cell_press_style.md +483 -0
  260. package/skills/shared/venue-guides/conferences_formatting.md +564 -0
  261. package/skills/shared/venue-guides/cs_conference_style.md +463 -0
  262. package/skills/shared/venue-guides/examples/cell_summary_example.md +247 -0
  263. package/skills/shared/venue-guides/examples/medical_structured_abstract.md +313 -0
  264. package/skills/shared/venue-guides/examples/nature_abstract_examples.md +213 -0
  265. package/skills/shared/venue-guides/examples/neurips_introduction_example.md +245 -0
  266. package/skills/shared/venue-guides/journals_formatting.md +486 -0
  267. package/skills/shared/venue-guides/medical_journal_styles.md +535 -0
  268. package/skills/shared/venue-guides/ml_conference_style.md +556 -0
  269. package/skills/shared/venue-guides/nature_science_style.md +405 -0
  270. package/skills/shared/venue-guides/reviewer_expectations.md +417 -0
  271. package/skills/shared/venue-guides/venue_writing_styles.md +321 -0
  272. package/skills/split-pdf/SKILL.md +172 -0
  273. package/skills/split-pdf/methodology.md +48 -0
  274. package/skills/sync-notion/SKILL.md +93 -0
  275. package/skills/system-audit/SKILL.md +157 -0
  276. package/skills/system-audit/references/sub-agent-prompts.md +294 -0
  277. package/skills/task-management/SKILL.md +131 -0
  278. package/skills/update-focus/SKILL.md +204 -0
  279. package/skills/update-project-doc/SKILL.md +194 -0
  280. package/skills/validate-bib/SKILL.md +242 -0
  281. package/skills/validate-bib/references/council-mode.md +34 -0
  282. package/skills/validate-bib/references/deep-verify.md +71 -0
  283. package/skills/validate-bib/references/openalex-verification.md +45 -0
  284. package/skills/validate-bib/references/preprint-check.md +31 -0
  285. package/skills/validate-bib/references/report-template.md +62 -0
@@ -0,0 +1,335 @@
1
+ ---
2
+ name: literature
3
+ description: "Use when you need academic literature discovery, synthesis, or bibliography management."
4
+ allowed-tools: Bash(curl*), Bash(wget*), Bash(mkdir*), Bash(ls*), Bash(uv*), Bash(cd*), Read, Write, Edit, WebSearch, WebFetch, Task, mcp__paperpile__search_library, mcp__paperpile__get_items_by_label, mcp__refpile__search_library, mcp__refpile__get_collections, mcp__refpile__add_item, mcp__refpile__add_to_collection, mcp__refpile__parse_pdf_metadata, mcp__refpile__parse_pdf_references
5
+ argument-hint: [topic-or-paper-query]
6
+ ---
7
+
8
+ # Literature Skill
9
+
10
+ **CRITICAL RULE: Every citation must be verified to exist before inclusion.** Never include a paper you cannot find via web search. Hallucinated citations are worse than no citations.
11
+
12
+ **DOI INTEGRITY RULE: Every DOI must be programmatically verified before entering any `.bib` file.** Sub-agents hallucinate plausible-looking DOIs that resolve to wrong papers (e.g., correct journal prefix, wrong suffix). The ONLY reliable verification is `scholarly_verify_dois` with title-matching (see Phase 4). A DOI that resolves to a different title than expected is WRONG — treat it the same as a missing DOI.
13
+
14
+ **CITATION KEY RULE: ALWAYS use Better BibTeX-format keys (e.g., `Author2016-xx`).** When merging into an existing `.bib`, match existing keys. Never generate custom keys (`AuthorYear`, `AuthorKamenica2017`, etc.) or retain non-standard keys unless the user explicitly says otherwise.
15
+
16
+ **Python:** Always use `uv run python`. Never bare `python`, `python3`, `pip`, or `pip3`.
17
+
18
+ **LIBRARY-FIRST RULE: ALWAYS check both Zotero (refpile MCP) and Paperpile (paperpile MCP) BEFORE any external search.** Call `mcp__refpile__search_library` and `mcp__paperpile__search_library` for the topic in Phase 1. Do not skip this even if no `.bib` file exists yet. Papers already in either library should be reused, not re-discovered.
19
+
20
+ **PREPRINT RULE: Always prefer the published version.** If a paper is found on arXiv, SSRN, NBER, or any working paper series, search for a published journal/conference version using `scholarly_search`. Only cite a preprint if no published version can be found. This applies at every phase: Phase 2 (discovery), Phase 4 (verification), and Phase 6b (bib-validate runs the full preprint staleness check from `bib-validate/references/preprint-check.md`).
21
+
22
+ > Comprehensive academic literature workflow: discover, verify, organize, synthesize.
23
+ > Uses parallel sub-agents to search multiple sources, verify citations, and fetch PDFs concurrently.
24
+
25
+ ## Shared References
26
+
27
+ - Concept validation gate: `shared/concept-validation-gate.md` — validate concept before synthesis
28
+ - Escalation protocol: `shared/escalation-protocol.md` — escalate when research question is vague
29
+
30
+ ## When to Use
31
+
32
+ - Starting a new research project
33
+ - Writing a literature review section
34
+ - Building a reading list on a topic
35
+ - Finding specific citations
36
+ - Creating annotated bibliographies
37
+
38
+ ---
39
+
40
+ ## Architecture: Orchestrator + Sub-Agents
41
+
42
+ ```
43
+ You (orchestrator)
44
+ ├── Phase 0: Session log & compact (mandatory — /session-log)
45
+ ├── Phase 1: Pre-search check (direct — no sub-agent)
46
+ ├── Phase 2: Parallel search (2-3 Explore agents)
47
+ ├── Phase 2b: CLI Council search (optional — multi-model recall via cli-council)
48
+ ├── Phase 3: Deduplicate + rank (direct — no sub-agent)
49
+ ├── Phase 4: Parallel verification (general-purpose agents, batches of 5)
50
+ ├── Phase 5: Parallel PDF download (Bash agents)
51
+ ├── Phase 6: Assemble .bib (direct — no sub-agent)
52
+ ├── Phase 6c: Sync to reference managers (Paperpile + Zotero via MCP)
53
+ └── Phase 7: Synthesize narrative (direct, or cli-council for multi-model synthesis)
54
+ ```
55
+
56
+ **Key principle:** Sub-agents handle independent, parallelizable work. Merging, deduplication, and synthesis stay with you because they need the full picture.
57
+
58
+ **Full agent prompt templates for all phases:** [references/agent-templates.md](references/agent-templates.md)
59
+
60
+ ---
61
+
62
+ ## Phase 0: Session Log & Compact (Mandatory)
63
+
64
+ Literature searches are context-heavy. **Always** run `/session-log` before starting to create a recovery checkpoint.
65
+
66
+ ---
67
+
68
+ ## Phase 1: Pre-Search Check (Direct)
69
+
70
+ Check for existing `.bib` files in project root, `/references`, `/bib`, `/bibliography`:
71
+
72
+ 1. Parse existing entries to avoid duplicates and understand context
73
+ 2. Identify gaps — note if bibliography skews toward certain years/methods
74
+ 3. Compile list of existing citation keys to pass to sub-agents
75
+ 4. **MANDATORY: Check Zotero library** (active write target) — call `mcp__refpile__search_library` for the search topic. This finds papers the user already has, preventing re-discovery of known work. Mark these as **ALREADY IN ZOTERO** and reuse their citation keys. If refpile MCP is unavailable, log a warning and continue — but always attempt the call.
76
+ 5. **MANDATORY: Check Paperpile library** (read-only cross-reference) — call `mcp__paperpile__search_library` for the search topic. Also call `mcp__paperpile__get_items_by_label` if a relevant folder exists. Mark matches as **ALREADY IN PAPERPILE**. Items in Paperpile but not Zotero are flagged as `MIGRATE_TO_ZOTERO` candidates. If Paperpile MCP is unavailable, log a warning and continue — but always attempt the call.
77
+ 6. **Resolve topic collection** — read `zotero-collections.md` to find the collection key for the current topic (see `shared/reference-resolution.md` for resolution logic). This key is used in Phase 6c for filing.
78
+ 7. **Check source availability** — call `scholarly_source_status` (bibliography MCP) to see which sources are active (OpenAlex always; Scopus and WoS if API keys are set). Report this so search agents know what coverage to expect.
79
+
80
+ **Steps 4 and 5 are NOT optional.** Every literature search must check both reference managers before external discovery. This prevents re-discovering papers already in the library and identifies migration candidates early.
81
+
82
+ ---
83
+
84
+ ## Phase 2: Parallel Search (Sub-Agents)
85
+
86
+ **MCP pre-fetch (main context, before spawning agents):** Call these bibliography MCP tools from the main context before spawning agents. MCP tools are not available inside sub-agents — they are permission-scoped to the main conversation context only. Write results to `/tmp/lit-search/`.
87
+
88
+ 1. **`scholarly_search`** — cross-source keyword search (OpenAlex + S2 + Scopus + WoS). Write to `/tmp/lit-search/bibliography-results.json`.
89
+ 2. **`scholarly_similar_works`** — ML-based recommendations (powered by S2 Recommendations API). Pass the topic description as text to find semantically related papers beyond keyword matches. Write to `/tmp/lit-search/similar-results.json`.
90
+ 3. **`scholarly_author_papers`** — if key authors are known, fetch their publication lists. Write to `/tmp/lit-search/author-results.json`.
91
+
92
+ Spawn **2-3 Explore agents in parallel** in a single message, one per source. Read the full prompt templates from [references/agent-templates.md](references/agent-templates.md#phase-2-search-agent-templates).
93
+
94
+ Available search agents:
95
+ 1. **Google Scholar** — broad academic search via web (no MCP needed)
96
+ 2. **Cross-Source via pre-fetched biblio data** (recommended) — reads `/tmp/lit-search/bibliography-results.json` and `/tmp/lit-search/similar-results.json` (pre-fetched by the orchestrator) and supplements with WebSearch
97
+ 3. **Semantic Scholar / arXiv** (optional) — CS/ML focused, useful when topic has strong CS overlap (no MCP needed)
98
+ 4. **Domain-specific** (optional) — SSRN, NBER, specific journals (no MCP needed)
99
+
100
+ **The MCP calls happen in the main context (Phase 2 pre-fetch), not inside sub-agents.** Sub-agents read the pre-fetched results and supplement with web search.
101
+
102
+ ---
103
+
104
+ ## Phase 2b: CLI Council Search (Optional)
105
+
106
+ Multi-model literature search via `cli-council` — runs the same query through Gemini, Codex, and Claude for maximum recall. Use for broad reviews (20+ papers) or interdisciplinary topics.
107
+
108
+ **Full invocation, prompt template, and post-processing:** [references/cli-council-search.md](references/cli-council-search.md#phase-2b-cli-council-search-optional)
109
+
110
+ ---
111
+
112
+ ## Phase 2.5: Snowball Search (Optional — Main Context)
113
+
114
+ After Phase 2 results are merged, use S2's citation graph to expand the candidate pool via snowballing. This finds seminal papers (backward) and recent follow-ups (forward) that keyword search misses.
115
+
116
+ 1. **Identify seed papers** — pick the 3-5 most relevant papers from Phase 2 results (highest citation count + relevance)
117
+ 2. **Forward snowball** — call `scholarly_citations` for each seed to find papers that cite it. Useful for finding recent work building on foundational papers.
118
+ 3. **Backward snowball** — call `scholarly_references` for each seed to find papers it cites. Useful for finding seminal/foundational works.
119
+ 4. **Filter** — deduplicate against Phase 2 results, keep only papers with ≥5 citations (avoid noise)
120
+ 5. **Add to candidate pool** — merge into the main list before Phase 3 ranking
121
+
122
+ **When to use:** Literature reviews, broad topic surveys, or when Phase 2 returned <15 unique papers. Skip for narrow/targeted searches where the initial results are sufficient.
123
+
124
+ **Paper detail enrichment:** For top candidates, call `scholarly_paper_detail` to get TLDR summaries (one-line AI-generated descriptions) — useful for rapid screening without reading abstracts.
125
+
126
+ ---
127
+
128
+ ## Phase 3: Deduplicate and Rank (Direct)
129
+
130
+ 1. **Merge** results from all search agents (Phase 2 + Phase 2b if used)
131
+ 2. **Remove duplicates** — match on title similarity and DOI
132
+ 3. **Rank** by relevance, citation count, and recency
133
+ 4. **Select top N** to verify (typically 25-30 candidates for 20-25 verified)
134
+ 5. **Assign batches** of ~5 for verification
135
+
136
+ ---
137
+
138
+ ## Phase 4: Parallel Verification (Sub-Agents)
139
+
140
+ **Step 1 — Batch DOI pre-verification via MCP:** Collect all DOIs from Phase 3 candidates and call `scholarly_verify_dois` (bibliography MCP). This checks each DOI against all enabled sources (OpenAlex, Scopus, WoS). For each result:
141
+ - **VERIFIED (2+ sources):** Check that the **returned title matches** the expected paper. If the title doesn't match, the DOI is wrong — flag as DOI MISMATCH and find the correct DOI in Step 2.
142
+ - **SINGLE_SOURCE:** Needs manual verification — the DOI may be real but unconfirmed.
143
+ - **NOT_FOUND:** DOI is likely hallucinated. Find the correct DOI in Step 2.
144
+
145
+ **Title-matching is mandatory.** `scholarly_verify_dois` returns the title each DOI actually resolves to. Compare this against the title you expect. DOIs that are off by one character in the suffix (e.g., `02387` vs `02366`, `2014.01.014` vs `2014.03.013`) are the most common hallucination pattern — they resolve to real papers in the same journal but with different content.
146
+
147
+ **Step 2 — Find correct DOIs for flagged papers:** For any paper where the DOI was wrong, missing, or single-source, use these methods **in order of reliability**:
148
+ 1. **Crossref API** (most reliable): `curl -sL "https://api.crossref.org/works?query.bibliographic=[URL-encoded title+author]&rows=3"` — returns the actual DOI from publisher metadata.
149
+ 2. **`scholarly_search`** with exact title — searches OpenAlex/Scopus/WoS for the paper.
150
+ 3. **Web search as last resort** — but DOIs from web search must still be verified via `scholarly_verify_dois` before use.
151
+
152
+ **Step 3 — Manual verification for remaining papers:** Spawn **multiple general-purpose agents in parallel**, each verifying ~5 papers. Read the full verification template from [references/agent-templates.md](references/agent-templates.md#phase-4-verification-agent-template). **Include the Crossref instruction** in the agent prompt — agents must use Crossref API (`curl`) for DOI lookup, not reconstruct DOIs from memory. **Do NOT instruct sub-agents to call MCP tools** (`scholarly_search`, `scholarly_verify_dois`) — MCP tools are not available in sub-agents. Sub-agents should use Crossref API and WebSearch/WebFetch only.
153
+
154
+ Key rules enforced by the template:
155
+ - DOI verification is mandatory (resolve and confirm)
156
+ - ALL authors must be listed (never "et al." in metadata)
157
+ - Preprint check: always search for published version; use `scholarly_search` MCP tool to find published versions of preprints
158
+ - Results: VERIFIED / NOT FOUND / METADATA MISMATCH
159
+
160
+ **Step 4 — Final DOI gate:** Before proceeding to Phase 5/6, run `scholarly_verify_dois` one final time on ALL DOIs that will enter the `.bib`. This is the hard gate — no DOI enters a bibliography without passing this check with a matching title. Papers without DOIs (working papers, book chapters, old pre-DOI articles) are acceptable but must be explicitly flagged as `% NO DOI` in the `.bib`.
161
+
162
+ After all return: collect VERIFIED, drop NOT FOUND, check for remaining duplicates.
163
+
164
+ ---
165
+
166
+ ## Phase 5: Parallel PDF Download (Sub-Agents)
167
+
168
+ Spawn Bash agents in parallel, 3-5 papers each. Read template from [references/agent-templates.md](references/agent-templates.md#phase-5-pdf-download-agent-template). Best-effort — many papers are behind paywalls.
169
+
170
+ ---
171
+
172
+ ## Phase 6: Assemble Bibliography (Direct)
173
+
174
+ **Two outputs required:**
175
+
176
+ 1. **`docs/literature-review/literature_summary.bib`** — always created, standalone, self-contained
177
+ 2. **Project canonical bib** (e.g. `paper/references.bib`) — merge into it if it exists
178
+
179
+ ### BibTeX Format
180
+
181
+ ```bibtex
182
+ @article{AuthorYear,
183
+ author = {Last, First and Last, First},
184
+ title = {Full Title},
185
+ journal = {Journal Name},
186
+ year = {2024},
187
+ volume = {XX},
188
+ pages = {1--20},
189
+ doi = {10.1000/example},
190
+ abstract = {Abstract text here.}
191
+ }
192
+ ```
193
+
194
+ Rules:
195
+ - Citation keys: use **Better BibTeX-format keys** (e.g., `Author2016-xx`). If merging into an existing `.bib`, match the key format already in use. Never generate `AuthorYear` keys.
196
+ - **Reuse existing Zotero citation keys** — for entries marked **ALREADY IN ZOTERO** in Phase 1, use the Zotero `citationKey` directly. Do not generate a new key.
197
+ - Only VERIFIED papers — no METADATA MISMATCH entries
198
+ - **List ALL authors explicitly** — never "et al." in BibTeX
199
+ - Include abstracts when available
200
+ - **S2 BibTeX seed:** Call `scholarly_paper_detail` for each verified paper to get pre-formatted BibTeX via the `citationStyles` field. Use as a starting template, then enrich with missing fields (abstract, pages, volume) and correct the citation key to BBT format. This reduces manual entry errors.
201
+
202
+ ---
203
+
204
+ ## Phase 6b: Validate Bibliography (Mandatory)
205
+
206
+ **After assembling the `.bib`, always run `/bib-validate`.** The Phase 4 verification checks that papers exist, but `/bib-validate` catches a different class of issues:
207
+
208
+ - Missing required BibTeX fields (journal, volume, pages)
209
+ - Preprint staleness (arXiv paper now published in a journal)
210
+ - Missing or incorrect DOIs
211
+ - Author formatting problems ("et al." in author field, corporate names needing braces)
212
+ - Unused entries and possible typos
213
+
214
+ This is **not optional** — every time new entries are added to a `.bib` file, run the validation before considering the bibliography complete.
215
+
216
+ ---
217
+
218
+ ## Phase 6c: Sync to Reference Managers
219
+
220
+ After assembling and validating the `.bib`, sync new references to Zotero (active write target) and cross-reference with Paperpile (read-only). Handles migration candidates and post-run maintenance.
221
+
222
+ Full steps: [`references/reference-manager-sync.md`](references/reference-manager-sync.md)
223
+
224
+ ---
225
+
226
+ ## Phase 7: Synthesize Narrative (Direct or CLI Council)
227
+
228
+ 1. **Identify themes** — group papers by approach, finding, or debate
229
+ 2. **Map intellectual lineage** — how did thinking evolve?
230
+ 3. **Note current debates** — where do researchers disagree?
231
+ 4. **Find gaps** — what's missing?
232
+
233
+ Output types: narrative summary (LaTeX), literature deck, annotated bibliography, concise field synthesis.
234
+
235
+ ### Concise Field Synthesis (~400 words)
236
+
237
+ When the user asks for a "quick synthesis", "field overview", or "what does the literature say", produce a tight ~400-word synthesis instead of a full narrative. No paper-by-paper summaries — write about the field, not individual papers.
238
+
239
+ Structure:
240
+ 1. **What the field collectively believes** — established consensus (2-3 sentences)
241
+ 2. **Where researchers disagree** — active debates with camps identified (2-3 sentences)
242
+ 3. **What has been proven** — findings with strong, replicated evidence (2-3 sentences)
243
+ 4. **The single most important unanswered question** — one question, why it matters, why it's hard (2-3 sentences)
244
+
245
+ Cite papers parenthetically (Author, Year) but never summarise individual papers. The goal is a helicopter view that a newcomer could read in 2 minutes and understand where the field stands.
246
+
247
+ ### [VERIFY] Citation Tags
248
+
249
+ When synthesising, mark uncertain attributions with `[VERIFY]` tags for later resolution:
250
+
251
+ ```markdown
252
+ Meraz and Papacharissi (2013) argue that gatekeeping power shifted
253
+ from institutional positions to network centrality [VERIFY: exact claim on p. 12?].
254
+ ```
255
+
256
+ - **Drafting tier:** [VERIFY] tags are acceptable — resolve before finalising
257
+ - **Publication tier:** All [VERIFY] tags must be resolved (read the actual source)
258
+ - Run `/bib-validate` to catch any remaining [VERIFY] tags before submission
259
+
260
+ ### Multi-Model Synthesis (Optional)
261
+
262
+ For comprehensive literature reviews, run the synthesis through `cli-council` to get three independent interpretations of the literature landscape. Different models identify different themes, debates, and gaps.
263
+
264
+ ```bash
265
+ cd "packages/cli-council"
266
+ uv run python -m cli_council \
267
+ --prompt-file /tmp/lit-synthesis-prompt.txt \
268
+ --context-file /tmp/lit-papers.txt \
269
+ --output-md /tmp/lit-synthesis-report.md \
270
+ --chairman claude \
271
+ --timeout 180
272
+ ```
273
+
274
+ Where `--context-file` contains the verified paper list with titles, abstracts, and metadata, and the prompt asks for thematic grouping, intellectual lineage, and gap identification. The chairman synthesises three independent narratives into one.
275
+
276
+ ---
277
+
278
+ ## Output Structure
279
+
280
+ ```
281
+ project/
282
+ ├── docs/
283
+ │ ├── literature-review/
284
+ │ │ ├── literature_summary.md # Thematic narrative (always)
285
+ │ │ └── literature_summary.bib # Standalone .bib (always)
286
+ │ └── readings/
287
+ │ ├── Smith2024.pdf # Downloaded PDFs
288
+ │ └── ...
289
+ └── paper/
290
+ └── references.bib # Canonical bib (merge if exists)
291
+ ```
292
+
293
+ ---
294
+
295
+ ## Sub-Agent Guidelines
296
+
297
+ 0. **Python: ALWAYS use `uv run python`.** Include this in every sub-agent prompt.
298
+ 1. **Launch independent agents in a single message** for parallelism
299
+ 2. **Be explicit in prompts** — sub-agents have no context
300
+ 3. **Include skip lists** of existing citation keys
301
+ 4. **Batch sizes:** 5 papers per verification agent, 3-5 per PDF agent
302
+ 5. **Maximum 3 parallel agents at a time** — spawn in waves, write results to disk between waves. Each agent should write to a temp file (e.g., `/tmp/lit-search/agent-N.json`) rather than returning large payloads in-context. Summarise from files to avoid context overflow.
303
+ 6. **Right agent type:** `Explore` for search, `general-purpose` for verification, `Bash` for downloads
304
+ 7. **Tolerate partial failures** — continue with what you have
305
+
306
+ ---
307
+
308
+ ## Bibliometric API Structured Queries
309
+
310
+ Four bibliometric sources available via the bibliography MCP server and direct APIs. Includes MCP tool table, OpenAlex workflows, Scopus query syntax, and WoS API tiers.
311
+
312
+ Full reference: [`references/bibliometric-apis.md`](references/bibliometric-apis.md) | API guides: [OpenAlex](references/openalex-api-guide.md), [Scopus](references/scopus-api-guide.md), [WoS](references/wos-api-guide.md)
313
+
314
+ ---
315
+
316
+ ## Reading Full Paper Text from arXiv
317
+
318
+ Download arXiv LaTeX source for full-text reading (equations, methodology, exact phrasing). Only works for arXiv papers with source available — for journal-only papers, use `/split-pdf`.
319
+
320
+ **Full instructions:** [references/cli-council-search.md](references/cli-council-search.md#reading-full-paper-text-from-arxiv)
321
+
322
+ ---
323
+
324
+ ## Cross-References
325
+
326
+ | Skill / Package | When to use instead/alongside |
327
+ |-------|-------------------------------|
328
+ | `/scout generate` | Generate research questions first |
329
+ | `/interview-me` | Develop a specific idea before searching |
330
+ | `/bib-validate` | **Mandatory** after assembling `.bib` (Phase 6b) — metadata quality, preprint staleness, DOI checks |
331
+ | `/bib-coverage` | Compare project `.bib` vs Zotero topic collection — find uncited papers and unfiled references |
332
+ | `/split-pdf` | Deep-read a paper found during search |
333
+ | `cli-council` | Multi-model search (Phase 2b) and synthesis (Phase 7) — `packages/cli-council/` |
334
+ | `refpile` MCP | Search personal Zotero library, extract PDF text/annotations, export BibTeX. Use in Phase 1 to check what's already in the library before searching externally. GROBID tools (`parse_pdf_metadata`, `parse_pdf_references`) extract structured metadata and bibliographies from PDFs — use after downloading to auto-extract refs without manual reading |
335
+ | `shared/reference-resolution.md` | Canonical lookup + filing sequence used by Phase 1 and Phase 6c |