@bohuyeshan/openagent-labforge-core 3.11.1 → 3.11.3

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 (226) hide show
  1. package/README.ja.md +34 -27
  2. package/README.ko.md +34 -27
  3. package/README.md +245 -188
  4. package/README.ru.md +28 -21
  5. package/README.zh-cn.md +245 -188
  6. package/bin/platform.test.ts +21 -20
  7. package/dist/agents/atlas/default.d.ts +1 -1
  8. package/dist/agents/atlas/gemini.d.ts +1 -1
  9. package/dist/agents/atlas/gpt.d.ts +1 -1
  10. package/dist/agents/bio-methodologist.d.ts +1 -1
  11. package/dist/agents/bio-pipeline-operator.d.ts +1 -1
  12. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  13. package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -0
  14. package/dist/agents/env-context.d.ts +1 -1
  15. package/dist/agents/index.d.ts +1 -0
  16. package/dist/agents/metis.d.ts +1 -1
  17. package/dist/agents/prometheus/gemini.d.ts +1 -1
  18. package/dist/agents/prometheus/gpt.d.ts +1 -1
  19. package/dist/agents/prometheus/interview-mode.d.ts +1 -1
  20. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  21. package/dist/agents/prometheus/plan-template.d.ts +1 -1
  22. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  23. package/dist/agents/types.d.ts +1 -1
  24. package/dist/cli/config-manager/bun-install.d.ts +6 -1
  25. package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
  26. package/dist/cli/doctor/constants.d.ts +1 -1
  27. package/dist/cli/index.js +763 -467
  28. package/dist/cli/install-validators.d.ts +1 -0
  29. package/dist/cli/model-fallback-types.d.ts +1 -0
  30. package/dist/cli/openai-only-model-catalog.d.ts +3 -0
  31. package/dist/cli/run/index.d.ts +1 -0
  32. package/dist/cli/run/model-resolver.d.ts +4 -0
  33. package/dist/cli/run/types.d.ts +1 -0
  34. package/dist/cli/types.d.ts +3 -0
  35. package/dist/config/schema/agent-names.d.ts +3 -1
  36. package/dist/config/schema/background-task.d.ts +2 -0
  37. package/dist/config/schema/git-env-prefix.d.ts +5 -0
  38. package/dist/config/schema/git-master.d.ts +1 -0
  39. package/dist/config/schema/hooks.d.ts +2 -0
  40. package/dist/config/schema/oh-my-opencode-config.d.ts +54 -1
  41. package/dist/config/schema.d.ts +1 -0
  42. package/dist/create-hooks.d.ts +13 -0
  43. package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +16 -1
  44. package/dist/features/background-agent/constants.d.ts +1 -1
  45. package/dist/features/background-agent/manager.d.ts +20 -4
  46. package/dist/features/background-agent/process-cleanup.d.ts +1 -1
  47. package/dist/features/background-agent/remove-task-toast-tracking.d.ts +1 -0
  48. package/dist/features/background-agent/subagent-spawn-limits.d.ts +23 -0
  49. package/dist/features/background-agent/task-history.d.ts +1 -0
  50. package/dist/features/background-agent/task-poller.d.ts +1 -0
  51. package/dist/features/background-agent/types.d.ts +4 -0
  52. package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +4 -0
  53. package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
  54. package/dist/features/claude-code-agent-loader/types.d.ts +8 -1
  55. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
  56. package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
  57. package/dist/features/claude-code-plugin-loader/types.d.ts +1 -1
  58. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
  59. package/dist/features/skill-mcp-manager/types.d.ts +4 -0
  60. package/dist/features/tmux-subagent/index.d.ts +1 -0
  61. package/dist/features/tmux-subagent/manager.d.ts +5 -0
  62. package/dist/features/tmux-subagent/pane-state-parser.d.ts +8 -0
  63. package/dist/features/tmux-subagent/tracked-session-state.d.ts +8 -0
  64. package/dist/features/tmux-subagent/types.d.ts +2 -0
  65. package/dist/hooks/atlas/boulder-session-lineage.d.ts +6 -0
  66. package/dist/hooks/atlas/final-wave-approval-gate.d.ts +4 -0
  67. package/dist/hooks/atlas/idle-event.d.ts +8 -0
  68. package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +11 -0
  69. package/dist/hooks/atlas/tool-execute-after.d.ts +2 -0
  70. package/dist/hooks/atlas/types.d.ts +2 -0
  71. package/dist/hooks/atlas/verification-reminders.d.ts +4 -0
  72. package/dist/hooks/auto-slash-command/hook.d.ts +7 -0
  73. package/dist/hooks/auto-slash-command/processed-command-store.d.ts +7 -0
  74. package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +7 -0
  75. package/dist/hooks/auto-update-checker/checker.d.ts +3 -1
  76. package/dist/hooks/auto-update-checker/constants.d.ts +2 -2
  77. package/dist/hooks/comment-checker/downloader.d.ts +1 -1
  78. package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -0
  79. package/dist/hooks/compaction-context-injector/constants.d.ts +5 -0
  80. package/dist/hooks/compaction-context-injector/hook.d.ts +5 -1
  81. package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +6 -0
  82. package/dist/hooks/compaction-context-injector/recovery.d.ts +6 -0
  83. package/dist/hooks/compaction-context-injector/session-id.d.ts +2 -0
  84. package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +16 -0
  85. package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +13 -0
  86. package/dist/hooks/compaction-context-injector/types.d.ts +43 -0
  87. package/dist/hooks/compaction-context-injector/validated-model.d.ts +13 -0
  88. package/dist/hooks/context-window-monitor.d.ts +2 -5
  89. package/dist/hooks/delegate-task-english-directive/hook.d.ts +14 -0
  90. package/dist/hooks/delegate-task-english-directive/index.d.ts +1 -0
  91. package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +23 -0
  92. package/dist/hooks/gpt-permission-continuation/constants.d.ts +4 -0
  93. package/dist/hooks/gpt-permission-continuation/detector.d.ts +1 -0
  94. package/dist/hooks/gpt-permission-continuation/handler.d.ts +12 -0
  95. package/dist/hooks/gpt-permission-continuation/index.d.ts +13 -0
  96. package/dist/hooks/gpt-permission-continuation/session-state.d.ts +15 -0
  97. package/dist/hooks/index.d.ts +2 -0
  98. package/dist/hooks/keyword-detector/hook.d.ts +1 -0
  99. package/dist/hooks/preemptive-compaction.d.ts +2 -5
  100. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +16 -0
  101. package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
  102. package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
  103. package/dist/hooks/runtime-fallback/hook.d.ts +2 -3
  104. package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
  105. package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -2
  106. package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +7 -0
  107. package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
  108. package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
  109. package/dist/hooks/runtime-fallback/types.d.ts +57 -3
  110. package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
  111. package/dist/hooks/session-notification-content.d.ts +30 -0
  112. package/dist/hooks/session-notification-scheduler.d.ts +5 -3
  113. package/dist/hooks/session-notification.d.ts +2 -0
  114. package/dist/hooks/start-work/index.d.ts +1 -1
  115. package/dist/hooks/start-work/worktree-detector.d.ts +7 -0
  116. package/dist/hooks/todo-continuation-enforcer/constants.d.ts +6 -2
  117. package/dist/hooks/todo-continuation-enforcer/handler.d.ts +1 -0
  118. package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +1 -0
  119. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +10 -1
  120. package/dist/hooks/todo-continuation-enforcer/stagnation-detection.d.ts +6 -0
  121. package/dist/hooks/todo-continuation-enforcer/types.d.ts +5 -0
  122. package/dist/hooks/tool-output-truncator.d.ts +1 -0
  123. package/dist/index.d.ts +2 -2
  124. package/dist/index.js +10581 -7245
  125. package/dist/openagent-labforge.schema.json +70 -4
  126. package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
  127. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  128. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
  129. package/dist/plugin/normalize-tool-arg-schemas.d.ts +2 -0
  130. package/dist/plugin/ultrawork-model-override.d.ts +1 -15
  131. package/dist/plugin/ultrawork-variant-availability.d.ts +6 -0
  132. package/dist/plugin-dispose.d.ts +10 -0
  133. package/dist/plugin-handlers/agent-override-protection.d.ts +3 -0
  134. package/dist/plugin-state.d.ts +5 -0
  135. package/dist/shared/compaction-agent-config-checkpoint.d.ts +11 -0
  136. package/dist/shared/context-limit-resolver.d.ts +5 -0
  137. package/dist/shared/data-path.d.ts +2 -2
  138. package/dist/shared/dynamic-truncator.d.ts +4 -7
  139. package/dist/shared/external-plugin-detector.d.ts +1 -1
  140. package/dist/shared/fallback-chain-from-models.d.ts +3 -0
  141. package/dist/shared/index.d.ts +3 -0
  142. package/dist/shared/model-error-classifier.d.ts +2 -1
  143. package/dist/shared/opencode-command-dirs.d.ts +3 -0
  144. package/dist/shared/plugin-identity.d.ts +7 -0
  145. package/dist/shared/question-denied-session-permission.d.ts +6 -0
  146. package/dist/shared/retry-status-utils.d.ts +2 -0
  147. package/dist/shared/system-directive.d.ts +6 -5
  148. package/dist/shared/vision-capable-models-cache.d.ts +4 -0
  149. package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
  150. package/dist/tools/call-omo-agent/constants.d.ts +1 -1
  151. package/dist/tools/call-omo-agent/sync-executor.d.ts +11 -3
  152. package/dist/tools/call-omo-agent/tools.d.ts +2 -1
  153. package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +2 -0
  154. package/dist/tools/delegate-task/model-selection.d.ts +1 -0
  155. package/dist/tools/delegate-task/model-string-parser.d.ts +1 -3
  156. package/dist/tools/look-at/multimodal-fallback-chain.d.ts +4 -0
  157. package/dist/tools/lsp/constants.d.ts +1 -0
  158. package/dist/tools/lsp/directory-diagnostics.d.ts +1 -0
  159. package/dist/tools/lsp/lsp-client-transport.d.ts +4 -2
  160. package/dist/tools/lsp/lsp-client-wrapper.d.ts +2 -1
  161. package/dist/tools/lsp/server-path-bases.d.ts +1 -0
  162. package/generated/skills-bundles/catalog.json +282 -39
  163. package/generated/skills-bundles/full/INDEX.md +38 -10
  164. package/generated/skills-bundles/full/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +63 -0
  165. package/generated/skills-bundles/full/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +112 -0
  166. package/generated/skills-bundles/full/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +279 -0
  167. package/generated/skills-bundles/full/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +47 -0
  168. package/generated/skills-bundles/full/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +281 -0
  169. package/generated/skills-bundles/full/skills/productivity/communication/auto-claude__feishu-notify/SKILL.md +154 -0
  170. package/generated/skills-bundles/full/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +138 -0
  171. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +252 -0
  172. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +254 -0
  173. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +310 -0
  174. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -0
  175. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -0
  176. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -0
  177. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -0
  178. package/generated/skills-bundles/full/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +255 -0
  179. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +133 -0
  180. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +87 -0
  181. package/generated/skills-bundles/full/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +194 -0
  182. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +228 -0
  183. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +186 -0
  184. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +351 -0
  185. package/generated/skills-bundles/full/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +174 -0
  186. package/generated/skills-bundles/full/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +224 -0
  187. package/generated/skills-bundles/paper/INDEX.md +40 -0
  188. package/generated/skills-bundles/paper/skills/data-analysis/experiment-monitoring/auto-claude__monitor-experiment/SKILL.md +63 -0
  189. package/generated/skills-bundles/paper/skills/data-analysis/experiment-ops/auto-claude__run-experiment/SKILL.md +112 -0
  190. package/generated/skills-bundles/paper/skills/data-analysis/optimization/auto-claude__dse-loop/SKILL.md +279 -0
  191. package/generated/skills-bundles/paper/skills/data-analysis/statistics/auto-claude__analyze-results/SKILL.md +47 -0
  192. package/generated/skills-bundles/paper/skills/data-analysis/visualization/auto-claude__paper-figure/SKILL.md +281 -0
  193. package/generated/skills-bundles/paper/skills/productivity/communication/auto-claude__feishu-notify/SKILL.md +154 -0
  194. package/generated/skills-bundles/paper/skills/productivity/visual-design/auto-claude__pixel-art/SKILL.md +138 -0
  195. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-compile/SKILL.md +252 -0
  196. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-plan/SKILL.md +254 -0
  197. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/SKILL.md +310 -0
  198. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/iclr2026.tex +84 -0
  199. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/icml2025.tex +87 -0
  200. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/math_commands.tex +48 -0
  201. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-write/templates/neurips2025.tex +80 -0
  202. package/generated/skills-bundles/paper/skills/research/document-authoring/auto-claude__paper-writing/SKILL.md +255 -0
  203. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__arxiv/SKILL.md +133 -0
  204. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__novelty-check/SKILL.md +87 -0
  205. package/generated/skills-bundles/paper/skills/research/literature-and-web-search/auto-claude__research-lit/SKILL.md +194 -0
  206. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-creator/SKILL.md +228 -0
  207. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery/SKILL.md +186 -0
  208. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__idea-discovery-robot/SKILL.md +351 -0
  209. package/generated/skills-bundles/paper/skills/research/research-ideation/auto-claude__research-pipeline/SKILL.md +174 -0
  210. package/generated/skills-bundles/paper/skills/research/theory-writing/auto-claude__proof-writer/SKILL.md +224 -0
  211. package/package.json +21 -21
  212. package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/LICENSE.txt +0 -21
  213. package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/SKILL.md +0 -615
  214. package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/_meta.json +0 -11
  215. package/generated/skills-bundles/full/skills/engineering/virtualization/skills-main__virtualbox/scripts/virtualbox-utils.ts +0 -586
  216. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/.clawhubsafe +0 -0
  217. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/LICENSE +0 -21
  218. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/README.md +0 -127
  219. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/SECURITY.md +0 -68
  220. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/SKILL.md +0 -141
  221. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/_meta.json +0 -11
  222. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/scripts/speak.sh +0 -52
  223. package/generated/skills-bundles/full/skills/productivity/voice-and-accessibility/skills-main__voiceclaw/scripts/transcribe.sh +0 -50
  224. package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/LICENSE.txt +0 -21
  225. package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/SKILL.md +0 -416
  226. package/generated/skills-bundles/full/skills/research/media-search/skills-main__youtube-search/_meta.json +0 -11
@@ -0,0 +1,255 @@
1
+ ---
2
+ name: "auto-claude/paper-writing"
3
+ description: "Workflow 3: Full paper writing pipeline. Orchestrates paper-plan → paper-figure → paper-write → paper-compile → ULTRAWORK QA to go from a narrative report to a polished, submission-ready PDF. Use when user says \"写论文全流程\", \"write paper pipeline\", \"从报告到PDF\", \"paper writing\", or wants the complete paper generation workflow."
4
+ argument-hint: ["narrative-report-path-or-topic"]
5
+ allowed-tools: "Bash(*), Read, Write, Edit, Grep, Glob, Agent, Skill, mcp__codex__codex, mcp__codex__codex-reply"
6
+ metadata:
7
+ category: "research/document-authoring"
8
+ ---
9
+
10
+ # Workflow 3: Paper Writing Pipeline
11
+
12
+ Orchestrate a complete paper writing workflow for: **$ARGUMENTS**
13
+
14
+ ## Overview
15
+
16
+ This skill chains five sub-skills into a single automated pipeline:
17
+
18
+ ```
19
+ /paper-plan → /paper-figure → /paper-write → /paper-compile → /ulw-loop
20
+ (outline) (plots) (LaTeX) (build PDF) (final QA + Oracle verify)
21
+ ```
22
+
23
+ Each phase builds on the previous one's output. The final deliverable is a polished, reviewed `paper/` directory with LaTeX source and compiled PDF.
24
+
25
+ ## Constants
26
+
27
+ - **VENUE = `ICLR`** — Target venue. Options: `ICLR`, `NeurIPS`, `ICML`. Affects style file, page limit, citation format.
28
+ - **REVIEWER_MODEL = `gpt-5.4`** — Model used via Codex MCP for plan review, figure review, and writing review.
29
+ - **AUTO_PROCEED = true** — Auto-continue between phases. Set `false` to pause and wait for user approval after each phase.
30
+
31
+ > Override inline: `/paper-writing "NARRATIVE_REPORT.md" — venue: NeurIPS`
32
+
33
+ ## Inputs
34
+
35
+ This pipeline accepts one of:
36
+
37
+ 1. **`NARRATIVE_REPORT.md`** (best) — structured research narrative with claims, experiments, results, figures
38
+ 2. **Research direction + experiment results** — the skill will help draft the narrative first
39
+ 3. **Existing `PAPER_PLAN.md`** — skip Phase 1, start from Phase 2
40
+
41
+ The more detailed the input (especially figure descriptions and quantitative results), the better the output.
42
+
43
+ ## Pipeline
44
+
45
+ ### Phase 1: Paper Plan
46
+
47
+ Invoke `/paper-plan` to create the structural outline:
48
+
49
+ ```
50
+ /paper-plan "$ARGUMENTS"
51
+ ```
52
+
53
+ **What this does:**
54
+ - Parse NARRATIVE_REPORT.md for claims, evidence, and figure descriptions
55
+ - Build a **Claims-Evidence Matrix** — every claim maps to evidence, every experiment supports a claim
56
+ - Design section structure (5-8 sections depending on paper type)
57
+ - Plan figure/table placement with data sources
58
+ - Scaffold citation structure
59
+ - GPT-5.4 reviews the plan for completeness
60
+
61
+ **Output:** `PAPER_PLAN.md` with section plan, figure plan, citation scaffolding.
62
+
63
+ **Checkpoint:** Present the plan summary to the user.
64
+
65
+ ```
66
+ 📐 Paper plan complete:
67
+ - Title: [proposed title]
68
+ - Sections: [N] ([list])
69
+ - Figures: [N] auto-generated + [M] manual
70
+ - Target: [VENUE], [PAGE_LIMIT] pages
71
+
72
+ Shall I proceed with figure generation?
73
+ ```
74
+
75
+ - **User approves** (or AUTO_PROCEED=true) → proceed to Phase 2.
76
+ - **User requests changes** → adjust plan and re-present.
77
+
78
+ ### Phase 2: Figure Generation
79
+
80
+ Invoke `/paper-figure` to generate data-driven plots and tables:
81
+
82
+ ```
83
+ /paper-figure "PAPER_PLAN.md"
84
+ ```
85
+
86
+ **What this does:**
87
+ - Read figure plan from PAPER_PLAN.md
88
+ - Generate matplotlib/seaborn plots from JSON/CSV data
89
+ - Generate LaTeX comparison tables
90
+ - Create `figures/latex_includes.tex` for easy insertion
91
+ - GPT-5.4 reviews figure quality and captions
92
+
93
+ **Output:** `figures/` directory with PDFs, generation scripts, and LaTeX snippets.
94
+
95
+ > **Scope:** Auto-generates ~60% of figures (data plots, comparison tables). Architecture diagrams, pipeline figures, and qualitative result grids must be created manually and placed in `figures/` before proceeding. See `/paper-figure` SKILL.md for details.
96
+
97
+ **Checkpoint:** List generated vs manual figures.
98
+
99
+ ```
100
+ 📊 Figures complete:
101
+ - Auto-generated: [list]
102
+ - Manual (need your input): [list]
103
+ - LaTeX snippets: figures/latex_includes.tex
104
+
105
+ [If manual figures needed]: Please add them to figures/ before I proceed.
106
+ [If all auto]: Shall I proceed with LaTeX writing?
107
+ ```
108
+
109
+ ### Phase 3: LaTeX Writing
110
+
111
+ Invoke `/paper-write` to generate section-by-section LaTeX:
112
+
113
+ ```
114
+ /paper-write "PAPER_PLAN.md"
115
+ ```
116
+
117
+ **What this does:**
118
+ - Write each section following the plan, with proper LaTeX formatting
119
+ - Insert figure/table references from `figures/latex_includes.tex`
120
+ - Build `references.bib` from citation scaffolding
121
+ - Clean stale files from previous section structures
122
+ - Automated bib cleaning (remove uncited entries)
123
+ - De-AI polish (remove "delve", "pivotal", "landscape"...)
124
+ - GPT-5.4 reviews each section for quality
125
+
126
+ **Output:** `paper/` directory with `main.tex`, `sections/*.tex`, `references.bib`, `math_commands.tex`.
127
+
128
+ **Checkpoint:** Report section completion.
129
+
130
+ ```
131
+ ✍️ LaTeX writing complete:
132
+ - Sections: [N] written ([list])
133
+ - Citations: [N] unique keys in references.bib
134
+ - Stale files cleaned: [list, if any]
135
+
136
+ Shall I proceed with compilation?
137
+ ```
138
+
139
+ ### Phase 4: Compilation
140
+
141
+ Invoke `/paper-compile` to build the PDF:
142
+
143
+ ```
144
+ /paper-compile "paper/"
145
+ ```
146
+
147
+ **What this does:**
148
+ - `latexmk -pdf` with automatic multi-pass compilation
149
+ - Auto-fix common errors (missing packages, undefined refs, BibTeX syntax)
150
+ - Up to 3 compilation attempts
151
+ - Post-compilation checks: undefined refs, page count, font embedding
152
+ - Precise page verification via `pdftotext`
153
+ - Stale file detection
154
+
155
+ **Output:** `paper/main.pdf`
156
+
157
+ **Checkpoint:** Report compilation results.
158
+
159
+ ```
160
+ 🔨 Compilation complete:
161
+ - Status: SUCCESS
162
+ - Pages: [X] (main body) + [Y] (references) + [Z] (appendix)
163
+ - Within page limit: YES/NO
164
+ - Undefined references: 0
165
+ - Undefined citations: 0
166
+
167
+ Shall I proceed with the ULTRAWORK final QA?
168
+ ```
169
+
170
+ ### Phase 5: ULTRAWORK Final QA
171
+
172
+ Invoke `/ulw-loop` to do a final evidence-based QA pass:
173
+
174
+ ```
175
+ /ulw-loop "Final QA for paper/: verify claims vs figures, references, and compile output" --max-iterations=2
176
+ ```
177
+
178
+ **What this does (recommend 1-2 rounds):**
179
+
180
+ - Verify claims vs figures and tables
181
+ - Check references, citations, and build artifacts
182
+ - Fix inconsistencies, missing evidence, and presentation gaps
183
+ - Oracle verifies completion; if not verified, iterate
184
+
185
+ **Output:** `paper/main.pdf` plus a `ULTRAWORK_LOG.md` describing evidence and fixes.
186
+
187
+ **Format check** (included in improvement loop Step 8): After final recompilation, auto-detect and fix overfull hboxes (content exceeding margins), verify page count vs venue limit, and ensure compact formatting. Any overfull > 10pt is fixed before generating the final PDF.
188
+
189
+ ### Phase 6: Final Report
190
+
191
+ ```markdown
192
+ # Paper Writing Pipeline Report
193
+
194
+ **Input**: [NARRATIVE_REPORT.md or topic]
195
+ **Venue**: [ICLR/NeurIPS/ICML]
196
+ **Date**: [today]
197
+
198
+ ## Pipeline Summary
199
+
200
+ | Phase | Status | Output |
201
+ |-------|--------|--------|
202
+ | 1. Paper Plan | ✅ | PAPER_PLAN.md |
203
+ | 2. Figures | ✅ | figures/ ([N] auto + [M] manual) |
204
+ | 3. LaTeX Writing | ✅ | paper/sections/*.tex ([N] sections, [M] citations) |
205
+ | 4. Compilation | ✅ | paper/main.pdf ([X] pages) |
206
+ | 5. ULTRAWORK QA | ✅ | ULTRAWORK_LOG.md |
207
+
208
+ ## Deliverables
209
+ - paper/main.pdf — Final polished paper
210
+ - paper/ULTRAWORK_LOG.md — QA log with evidence and fixes
211
+
212
+ ## Remaining Issues (if any)
213
+ - [items from final review that weren't addressed]
214
+
215
+ ## Next Steps
216
+ - [ ] Visual inspection of PDF
217
+ - [ ] Add any missing manual figures
218
+ - [ ] Submit to [venue] via OpenReview / CMT / HotCRP
219
+ ```
220
+
221
+ ## Key Rules
222
+
223
+ - **Don't skip phases.** Each phase builds on the previous one — skipping leads to errors.
224
+ - **Checkpoint between phases** when AUTO_PROCEED=false. Present results and wait for approval.
225
+ - **Manual figures first.** If the paper needs architecture diagrams or qualitative results, the user must provide them before Phase 3.
226
+ - **Compilation must succeed** before entering the improvement loop. Fix all errors first.
227
+ - **Preserve all PDFs.** The user needs round0/round1/round2 for comparison.
228
+ - **Document everything.** The pipeline report should be self-contained.
229
+ - **Respect page limits.** If the paper exceeds the venue limit, suggest specific cuts before the improvement loop.
230
+
231
+ ## Composing with Other Workflows
232
+
233
+ ```
234
+ /idea-discovery "direction" ← Workflow 1: find ideas
235
+ implement ← write code
236
+ /run-experiment ← deploy experiments
237
+ /ulw-loop "paper topic" ← Workflow 2: iterate research
238
+ /paper-writing "NARRATIVE_REPORT.md" ← Workflow 3: you are here
239
+ submit! 🎉
240
+
241
+ Or use /research-pipeline for the Workflow 1+2 end-to-end flow,
242
+ then /paper-writing for the final writing step.
243
+ ```
244
+
245
+ ## Typical Timeline
246
+
247
+ | Phase | Duration | Can sleep? |
248
+ |-------|----------|------------|
249
+ | 1. Paper Plan | 5-10 min | No |
250
+ | 2. Figures | 5-15 min | No |
251
+ | 3. LaTeX Writing | 15-30 min | Yes ✅ |
252
+ | 4. Compilation | 2-5 min | No |
253
+ | 5. Improvement | 15-30 min | Yes ✅ |
254
+
255
+ **Total: ~45-90 min** for a full paper from narrative report to polished PDF.
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: "auto-claude/arxiv"
3
+ description: "Search, download, and summarize academic papers from arXiv using MCP tools. Use when user says \"search arxiv\", \"download paper\", \"fetch arxiv\", \"arxiv search\", \"get paper pdf\", or wants to find and save papers from arXiv to the local paper library."
4
+ argument-hint: ["query-or-arxiv-id"]
5
+ allowed-tools: "Read, Write"
6
+ metadata:
7
+ category: "research/literature-and-web-search"
8
+ ---
9
+ # arXiv Paper Search & Download
10
+
11
+ Search topic or arXiv paper ID: $ARGUMENTS
12
+
13
+ ## Constants
14
+
15
+ - **PAPER_DIR** - Local directory to save downloaded PDFs. Default: `papers/` in the current project directory.
16
+ - **MAX_RESULTS = 10** - Default number of search results.
17
+
18
+ > Overrides (append to arguments):
19
+ > - `/arxiv "attention mechanism" - max: 20` - return up to 20 results
20
+ > - `/arxiv "2301.07041" - download` - download a specific paper by ID
21
+ > - `/arxiv "query" - dir: literature/` - save PDFs to a custom directory
22
+ > - `/arxiv "query" - download: all` - download all result PDFs
23
+
24
+ ## MCP Requirement (No Script Fallback)
25
+
26
+ This skill uses MCP only. Ensure at least one of these is enabled:
27
+
28
+ - `paper_search_mcp` (preferred, multi-source)
29
+ - `arxiv_mcp` (arXiv-only)
30
+
31
+ If MCP tools are missing, enable them in config:
32
+
33
+ ```json
34
+ {
35
+ "mcp_policy": {
36
+ "enable": ["paper_search_mcp", "arxiv_mcp"]
37
+ }
38
+ }
39
+ ```
40
+
41
+ ## Workflow
42
+
43
+ ### Step 1: Parse Arguments
44
+
45
+ Parse `$ARGUMENTS` for directives:
46
+
47
+ - **Query or ID**: main search term or a bare arXiv ID such as `2301.07041` or `cs/0601001`
48
+ - **`- max: N`**: override MAX_RESULTS (e.g., `- max: 20`)
49
+ - **`- dir: PATH`**: override PAPER_DIR (e.g., `- dir: literature/`)
50
+ - **`- download`**: download the first result's PDF after listing
51
+ - **`- download: all`**: download PDFs for all results
52
+
53
+ If the argument matches an arXiv ID pattern (`YYMM.NNNNN` or `category/NNNNNNN`), skip the search and go directly to Step 3.
54
+
55
+ ### Step 2: Search arXiv (MCP)
56
+
57
+ Use MCP tools to search:
58
+
59
+ - Prefer `paper_search_mcp` if available (multi-source).
60
+ - Otherwise use `arxiv_mcp` (arXiv-only).
61
+
62
+ Call the search tool exposed by the MCP server (the exact tool name appears in your MCP tool list). Pass the query and `MAX_RESULTS`.
63
+
64
+ Present results as a table:
65
+
66
+ ```text
67
+ | # | arXiv ID | Title | Authors | Date | Category |
68
+ |---|------------|---------------------|----------------|------------|----------|
69
+ | 1 | 2301.07041 | Attention Is All... | Vaswani et al. | 2017-06-12 | cs.LG |
70
+ ```
71
+
72
+ ### Step 3: Fetch Details for a Specific ID (MCP)
73
+
74
+ Use the MCP server's fetch/details tool (if provided) to retrieve metadata for a specific arXiv ID.
75
+
76
+ Display: title, all authors, categories, full abstract, published date, PDF URL, abstract URL.
77
+
78
+ ### Step 4: Download PDFs (MCP)
79
+
80
+ When download is requested:
81
+
82
+ - Use MCP download/fetch tool if available.
83
+ - If the MCP server only returns URLs, create the directory and save the URL list so the user can fetch later.
84
+
85
+ If a local file path is returned:
86
+
87
+ - Confirm file size > 10 KB (reject smaller files - likely an error HTML page)
88
+ - Add a 1-second delay between consecutive downloads to avoid rate limiting
89
+ - Report: `Downloaded: papers/2301.07041.pdf (842 KB)`
90
+
91
+ ### Step 5: Summarize
92
+
93
+ For each paper (downloaded or fetched by API):
94
+
95
+ ```markdown
96
+ ## [Title]
97
+
98
+ - **arXiv**: [ID] - [abs_url]
99
+ - **Authors**: [full author list]
100
+ - **Date**: [published]
101
+ - **Categories**: [cs.LG, cs.AI, ...]
102
+ - **Abstract**: [full abstract]
103
+ - **Key contributions** (extracted from abstract):
104
+ - [contribution 1]
105
+ - [contribution 2]
106
+ - [contribution 3]
107
+ - **Local PDF**: papers/[ID].pdf (if downloaded)
108
+ ```
109
+
110
+ ### Step 6: Final Output
111
+
112
+ Summarize what was done:
113
+
114
+ - `Found N papers for "query"`
115
+ - `Downloaded: papers/2301.07041.pdf (842 KB)` (for each download)
116
+ - Any warnings (rate limit hit, file too small, already exists)
117
+
118
+ Suggest follow-up skills:
119
+
120
+ ```text
121
+ /research-lit "topic" - multi-source review: Zotero + Obsidian + local PDFs + web
122
+ /novelty-check "idea" - verify your idea is novel against these papers
123
+ ```
124
+
125
+ ## Key Rules
126
+
127
+ - Always show the arXiv ID prominently - users need it for citations and reproducibility
128
+ - Verify downloaded PDFs: file must be > 10 KB; warn and delete if smaller
129
+ - Rate limit: wait 1 second between consecutive PDF downloads; retry once after 5 seconds on HTTP 429
130
+ - Never overwrite an existing PDF at the same path - skip it and report "already exists"
131
+ - Handle both arXiv ID formats: new (`2301.07041`) and old (`cs/0601001`)
132
+ - PAPER_DIR is created automatically if it does not exist
133
+ - If the arXiv API is unreachable, report the error clearly and suggest using `/research-lit` with `- sources: web` as a fallback
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: "auto-claude/novelty-check"
3
+ description: "Verify research idea novelty against recent literature. Use when user says \"查新\", \"novelty check\", \"有没有人做过\", \"check novelty\", or wants to verify a research idea is novel before implementing."
4
+ argument-hint: ["method-or-idea-description"]
5
+ allowed-tools: "WebSearch, WebFetch, Grep, Read, Glob, mcp__codex__codex"
6
+ metadata:
7
+ category: "research/literature-and-web-search"
8
+ ---
9
+ # Novelty Check Skill
10
+
11
+ Check whether a proposed method/idea has already been done in the literature: **$ARGUMENTS**
12
+
13
+ ## Constants
14
+
15
+ - REVIEWER_MODEL = `gpt-5.4` — Model used via Codex MCP. Must be an OpenAI model (e.g., `gpt-5.4`, `o3`, `gpt-4o`)
16
+
17
+ ## Instructions
18
+
19
+ Given a method description, systematically verify its novelty:
20
+
21
+ ### Phase A: Extract Key Claims
22
+ 1. Read the user's method description
23
+ 2. Identify 3-5 core technical claims that would need to be novel:
24
+ - What is the method?
25
+ - What problem does it solve?
26
+ - What is the mechanism?
27
+ - What makes it different from obvious baselines?
28
+
29
+ ### Phase B: Multi-Source Literature Search
30
+ For EACH core claim, search using ALL available sources:
31
+
32
+ 1. **Web Search** (via `WebSearch`):
33
+ - Search arXiv, Google Scholar, Semantic Scholar
34
+ - Use specific technical terms from the claim
35
+ - Try at least 3 different query formulations per claim
36
+ - Include year filters for 2024-2026
37
+
38
+ 2. **Known paper databases**: Check against:
39
+ - ICLR 2025/2026, NeurIPS 2025, ICML 2025/2026
40
+ - Recent arXiv preprints (2025-2026)
41
+
42
+ 3. **Read abstracts**: For each potentially overlapping paper, WebFetch its abstract and related work section
43
+
44
+ ### Phase C: Cross-Model Verification
45
+ Call REVIEWER_MODEL via Codex MCP (`mcp__codex__codex`) with xhigh reasoning:
46
+ ```
47
+ config: {"model_reasoning_effort": "xhigh"}
48
+ ```
49
+ Prompt should include:
50
+ - The proposed method description
51
+ - All papers found in Phase B
52
+ - Ask: "Is this method novel? What is the closest prior work? What is the delta?"
53
+
54
+ ### Phase D: Novelty Report
55
+ Output a structured report:
56
+
57
+ ```markdown
58
+ ## Novelty Check Report
59
+
60
+ ### Proposed Method
61
+ [1-2 sentence description]
62
+
63
+ ### Core Claims
64
+ 1. [Claim 1] — Novelty: HIGH/MEDIUM/LOW — Closest: [paper]
65
+ 2. [Claim 2] — Novelty: HIGH/MEDIUM/LOW — Closest: [paper]
66
+ ...
67
+
68
+ ### Closest Prior Work
69
+ | Paper | Year | Venue | Overlap | Key Difference |
70
+ |-------|------|-------|---------|----------------|
71
+
72
+ ### Overall Novelty Assessment
73
+ - Score: X/10
74
+ - Recommendation: PROCEED / PROCEED WITH CAUTION / ABANDON
75
+ - Key differentiator: [what makes this unique, if anything]
76
+ - Risk: [what a reviewer would cite as prior work]
77
+
78
+ ### Suggested Positioning
79
+ [How to frame the contribution to maximize novelty perception]
80
+ ```
81
+
82
+ ### Important Rules
83
+ - Be BRUTALLY honest — false novelty claims waste months of research time
84
+ - "Applying X to Y" is NOT novel unless the application reveals surprising insights
85
+ - Check both the method AND the experimental setting for novelty
86
+ - If the method is not novel but the FINDING would be, say so explicitly
87
+ - Always check the most recent 6 months of arXiv — the field moves fast
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: "auto-claude/research-lit"
3
+ description: "Search and analyze research papers, find related work, summarize key ideas. Use when user says \"find papers\", \"related work\", \"literature review\", \"what does this paper say\", or needs to understand academic papers."
4
+ argument-hint: ["paper-topic-or-url"]
5
+ allowed-tools: "Bash(*), Read, Glob, Grep, WebSearch, WebFetch, Write, Agent, mcp__zotero__*, mcp__obsidian-vault__*"
6
+ metadata:
7
+ category: "research/literature-and-web-search"
8
+ ---
9
+ # Research Literature Review
10
+
11
+ Research topic: $ARGUMENTS
12
+
13
+ ## Constants
14
+
15
+ - **PAPER_LIBRARY** — Local directory containing user's paper collection (PDFs). Check these paths in order:
16
+ 1. `papers/` in the current project directory
17
+ 2. `literature/` in the current project directory
18
+ 3. Custom path specified by user in `CLAUDE.md` under `## Paper Library`
19
+ - **MAX_LOCAL_PAPERS = 20** — Maximum number of local PDFs to scan (read first 3 pages each). If more are found, prioritize by filename relevance to the topic.
20
+ - **ARXIV_DOWNLOAD = false** — When `true`, download top 3-5 most relevant arXiv PDFs to PAPER_LIBRARY after search. When `false` (default), only fetch metadata (title, abstract, authors) via arXiv API — no files are downloaded.
21
+ - **ARXIV_MAX_DOWNLOAD = 5** — Maximum number of PDFs to download when `ARXIV_DOWNLOAD = true`.
22
+
23
+ > 💡 Overrides:
24
+ > - `/research-lit "topic" — paper library: ~/my_papers/` — custom local PDF path
25
+ > - `/research-lit "topic" — sources: zotero, local` — only search Zotero + local PDFs
26
+ > - `/research-lit "topic" — sources: zotero` — only search Zotero
27
+ > - `/research-lit "topic" — sources: web` — only search the web (skip all local)
28
+ > - `/research-lit "topic" — arxiv download: true` — download top relevant arXiv PDFs
29
+ > - `/research-lit "topic" — arxiv download: true, max download: 10` — download up to 10 PDFs
30
+
31
+ ## Data Sources
32
+
33
+ This skill checks multiple sources **in priority order**. All are optional — if a source is not configured or not requested, skip it silently.
34
+
35
+ ### Source Selection
36
+
37
+ Parse `$ARGUMENTS` for a `— sources:` directive:
38
+ - **If `— sources:` is specified**: Only search the listed sources (comma-separated). Valid values: `zotero`, `obsidian`, `local`, `web`, `all`.
39
+ - **If not specified**: Default to `all` — search every available source in priority order.
40
+
41
+ Examples:
42
+ ```
43
+ /research-lit "diffusion models" → all (default)
44
+ /research-lit "diffusion models" — sources: all → all
45
+ /research-lit "diffusion models" — sources: zotero → Zotero only
46
+ /research-lit "diffusion models" — sources: zotero, web → Zotero + web
47
+ /research-lit "diffusion models" — sources: local → local PDFs only
48
+ /research-lit "topic" — sources: obsidian, local, web → skip Zotero
49
+ ```
50
+
51
+ ### Source Table
52
+
53
+ | Priority | Source | ID | How to detect | What it provides |
54
+ |----------|--------|----|---------------|-----------------|
55
+ | 1 | **Zotero** (via MCP) | `zotero` | Try calling any `mcp__zotero__*` tool — if unavailable, skip | Collections, tags, annotations, PDF highlights, BibTeX, semantic search |
56
+ | 2 | **Obsidian** (via MCP) | `obsidian` | Try calling any `mcp__obsidian-vault__*` tool — if unavailable, skip | Research notes, paper summaries, tagged references, wikilinks |
57
+ | 3 | **Local PDFs** | `local` | `Glob: papers/**/*.pdf, literature/**/*.pdf` | Raw PDF content (first 3 pages) |
58
+ | 4 | **Web search** | `web` | Always available (WebSearch) | arXiv, Semantic Scholar, Google Scholar |
59
+
60
+ > **Graceful degradation**: If no MCP servers are configured, the skill works exactly as before (local PDFs + web search). Zotero and Obsidian are pure additions.
61
+
62
+ ## Workflow
63
+
64
+ ### Step 0a: Search Zotero Library (if available)
65
+
66
+ **Skip this step entirely if Zotero MCP is not configured.**
67
+
68
+ Try calling a Zotero MCP tool (e.g., search). If it succeeds:
69
+
70
+ 1. **Search by topic**: Use the Zotero search tool to find papers matching the research topic
71
+ 2. **Read collections**: Check if the user has a relevant collection/folder for this topic
72
+ 3. **Extract annotations**: For highly relevant papers, pull PDF highlights and notes — these represent what the user found important
73
+ 4. **Export BibTeX**: Get citation data for relevant papers (useful for `/paper-write` later)
74
+ 5. **Compile results**: For each relevant Zotero entry, extract:
75
+ - Title, authors, year, venue
76
+ - User's annotations/highlights (if any)
77
+ - Tags the user assigned
78
+ - Which collection it belongs to
79
+
80
+ > 📚 Zotero annotations are gold — they show what the user personally highlighted as important, which is far more valuable than generic summaries.
81
+
82
+ ### Step 0b: Search Obsidian Vault (if available)
83
+
84
+ **Skip this step entirely if Obsidian MCP is not configured.**
85
+
86
+ Try calling an Obsidian MCP tool (e.g., search). If it succeeds:
87
+
88
+ 1. **Search vault**: Search for notes related to the research topic
89
+ 2. **Check tags**: Look for notes tagged with relevant topics (e.g., `#diffusion-models`, `#paper-review`)
90
+ 3. **Read research notes**: For relevant notes, extract the user's own summaries and insights
91
+ 4. **Follow links**: If notes link to other relevant notes (wikilinks), follow them for additional context
92
+ 5. **Compile results**: For each relevant note:
93
+ - Note title and path
94
+ - User's summary/insights
95
+ - Links to other notes (research graph)
96
+ - Any frontmatter metadata (paper URL, status, rating)
97
+
98
+ > 📝 Obsidian notes represent the user's **processed understanding** — more valuable than raw paper content for understanding their perspective.
99
+
100
+ ### Step 0c: Scan Local Paper Library
101
+
102
+ Before searching online, check if the user already has relevant papers locally:
103
+
104
+ 1. **Locate library**: Check PAPER_LIBRARY paths for PDF files
105
+ ```
106
+ Glob: papers/**/*.pdf, literature/**/*.pdf
107
+ ```
108
+
109
+ 2. **De-duplicate against Zotero**: If Step 0a found papers, skip any local PDFs already covered by Zotero results (match by filename or title).
110
+
111
+ 3. **Filter by relevance**: Match filenames and first-page content against the research topic. Skip clearly unrelated papers.
112
+
113
+ 4. **Summarize relevant papers**: For each relevant local PDF (up to MAX_LOCAL_PAPERS):
114
+ - Read first 3 pages (title, abstract, intro)
115
+ - Extract: title, authors, year, core contribution, relevance to topic
116
+ - Flag papers that are directly related vs tangentially related
117
+
118
+ 5. **Build local knowledge base**: Compile summaries into a "papers you already have" section. This becomes the starting point — external search fills the gaps.
119
+
120
+ > 📚 If no local papers are found, skip to Step 1. If the user has a comprehensive local collection, the external search can be more targeted (focus on what's missing).
121
+
122
+ ### Step 1: Search (external)
123
+ - Use WebSearch to find recent papers on the topic
124
+ - Check arXiv, Semantic Scholar, Google Scholar
125
+ - Focus on papers from last 2 years unless studying foundational work
126
+ - **De-duplicate**: Skip papers already found in Zotero, Obsidian, or local library
127
+
128
+ **arXiv API search** (always runs, no download by default):
129
+
130
+ Locate the fetch script and search arXiv directly:
131
+ ```bash
132
+ # Try to find arxiv_fetch.py
133
+ SCRIPT=$(find tools/ -name "arxiv_fetch.py" 2>/dev/null | head -1)
134
+ # If not found, check ARIS install
135
+ [ -z "$SCRIPT" ] && SCRIPT=$(find ~/.claude/skills/arxiv/ -name "arxiv_fetch.py" 2>/dev/null | head -1)
136
+
137
+ # Search arXiv API for structured results (title, abstract, authors, categories)
138
+ python3 "$SCRIPT" search "QUERY" --max 10
139
+ ```
140
+
141
+ If `arxiv_fetch.py` is not found, fall back to WebSearch for arXiv (same as before).
142
+
143
+ The arXiv API returns structured metadata (title, abstract, full author list, categories, dates) — richer than WebSearch snippets. Merge these results with WebSearch findings and de-duplicate.
144
+
145
+ **Optional PDF download** (only when `ARXIV_DOWNLOAD = true`):
146
+
147
+ After all sources are searched and papers are ranked by relevance:
148
+ ```bash
149
+ # Download top N most relevant arXiv papers
150
+ python3 "$SCRIPT" download ARXIV_ID --dir papers/
151
+ ```
152
+ - Only download papers ranked in the top ARXIV_MAX_DOWNLOAD by relevance
153
+ - Skip papers already in the local library
154
+ - 1-second delay between downloads (rate limiting)
155
+ - Verify each PDF > 10 KB
156
+
157
+ ### Step 2: Analyze Each Paper
158
+ For each relevant paper (from all sources), extract:
159
+ - **Problem**: What gap does it address?
160
+ - **Method**: Core technical contribution (1-2 sentences)
161
+ - **Results**: Key numbers/claims
162
+ - **Relevance**: How does it relate to our work?
163
+ - **Source**: Where we found it (Zotero/Obsidian/local/web) — helps user know what they already have vs what's new
164
+
165
+ ### Step 3: Synthesize
166
+ - Group papers by approach/theme
167
+ - Identify consensus vs disagreements in the field
168
+ - Find gaps that our work could fill
169
+ - If Obsidian notes exist, incorporate the user's own insights into the synthesis
170
+
171
+ ### Step 4: Output
172
+ Present as a structured literature table:
173
+
174
+ ```
175
+ | Paper | Venue | Method | Key Result | Relevance to Us | Source |
176
+ |-------|-------|--------|------------|-----------------|--------|
177
+ ```
178
+
179
+ Plus a narrative summary of the landscape (3-5 paragraphs).
180
+
181
+ If Zotero BibTeX was exported, include a `references.bib` snippet for direct use in paper writing.
182
+
183
+ ### Step 5: Save (if requested)
184
+ - Save paper PDFs to `literature/` or `papers/`
185
+ - Update related work notes in project memory
186
+ - If Obsidian is available, optionally create a literature review note in the vault
187
+
188
+ ## Key Rules
189
+ - Always include paper citations (authors, year, venue)
190
+ - Distinguish between peer-reviewed and preprints
191
+ - Be honest about limitations of each paper
192
+ - Note if a paper directly competes with or supports our approach
193
+ - **Never fail because a MCP server is not configured** — always fall back gracefully to the next data source
194
+ - Zotero/Obsidian tools may have different names depending on how the user configured the MCP server (e.g., `mcp__zotero__search` or `mcp__zotero-mcp__search_items`). Try the most common patterns and adapt.