wtf-p 0.2.0 → 0.4.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 (122) hide show
  1. package/README.md +24 -2
  2. package/bin/commands/doctor.js +100 -0
  3. package/bin/commands/install-logic.js +231 -0
  4. package/bin/commands/list.js +88 -0
  5. package/bin/commands/status.js +85 -0
  6. package/bin/commands/update.js +50 -0
  7. package/bin/install.js +78 -629
  8. package/bin/lib/analyze-impact.js +105 -0
  9. package/bin/lib/bib-format.js +161 -0
  10. package/bin/lib/bib-index.js +104 -0
  11. package/bin/lib/citation-fetcher.js +299 -0
  12. package/bin/lib/citation-ranker.js +133 -0
  13. package/bin/lib/manifest.js +59 -0
  14. package/bin/lib/scholar-lookup.js +188 -0
  15. package/bin/lib/semantic-scholar.js +184 -0
  16. package/bin/lib/utils.js +37 -17
  17. package/bin/lib/wcn-compiler.js +226 -0
  18. package/bin/uninstall.js +51 -17
  19. package/core/write-the-f-paper/templates/posters/basic.md +34 -0
  20. package/core/write-the-f-paper/templates/slides/basic.md +31 -0
  21. package/package.json +12 -4
  22. package/vendors/claude/.claude-plugin/plugin.json +12 -0
  23. package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
  24. package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
  25. package/vendors/claude/agents/wtfp/citation-retriever.md +31 -0
  26. package/{commands → vendors/claude/commands}/wtfp/analyze-bib.md +41 -52
  27. package/{commands → vendors/claude/commands}/wtfp/check-refs.md +11 -9
  28. package/vendors/claude/commands/wtfp/create-poster.md +42 -0
  29. package/vendors/claude/commands/wtfp/create-slides.md +41 -0
  30. package/{commands → vendors/claude/commands}/wtfp/help.md +3 -0
  31. package/{commands → vendors/claude/commands}/wtfp/new-paper.md +42 -81
  32. package/{commands → vendors/claude/commands}/wtfp/research-gap.md +3 -4
  33. package/vendors/claude/mcp/research-server/package.json +13 -0
  34. package/vendors/claude/mcp/research-server/src/index.js +133 -0
  35. package/vendors/claude/skills/wtfp/echarts/SKILL.md +47 -0
  36. package/vendors/claude/skills/wtfp/marp/SKILL.md +49 -0
  37. /package/{write-the-f-paper → core/write-the-f-paper}/references/checkpoints.md +0 -0
  38. /package/{write-the-f-paper → core/write-the-f-paper}/references/continuation-format.md +0 -0
  39. /package/{write-the-f-paper → core/write-the-f-paper}/references/git-integration.md +0 -0
  40. /package/{write-the-f-paper → core/write-the-f-paper}/references/github-contrib.md +0 -0
  41. /package/{write-the-f-paper → core/write-the-f-paper}/references/imrad-structure.md +0 -0
  42. /package/{write-the-f-paper → core/write-the-f-paper}/references/length-estimation.md +0 -0
  43. /package/{write-the-f-paper → core/write-the-f-paper}/references/plan-format.md +0 -0
  44. /package/{write-the-f-paper → core/write-the-f-paper}/references/principles.md +0 -0
  45. /package/{write-the-f-paper → core/write-the-f-paper}/references/questioning.md +0 -0
  46. /package/{write-the-f-paper → core/write-the-f-paper}/references/research-pitfalls.md +0 -0
  47. /package/{write-the-f-paper → core/write-the-f-paper}/templates/config.json +0 -0
  48. /package/{write-the-f-paper → core/write-the-f-paper}/templates/context.md +0 -0
  49. /package/{write-the-f-paper → core/write-the-f-paper}/templates/continue-here.md +0 -0
  50. /package/{write-the-f-paper → core/write-the-f-paper}/templates/data-inventory.md +0 -0
  51. /package/{write-the-f-paper → core/write-the-f-paper}/templates/discovery.md +0 -0
  52. /package/{write-the-f-paper → core/write-the-f-paper}/templates/issues.md +0 -0
  53. /package/{write-the-f-paper → core/write-the-f-paper}/templates/manuscript.md +0 -0
  54. /package/{write-the-f-paper → core/write-the-f-paper}/templates/narrative-arc.md +0 -0
  55. /package/{write-the-f-paper → core/write-the-f-paper}/templates/outline.md +0 -0
  56. /package/{write-the-f-paper → core/write-the-f-paper}/templates/phase-prompt.md +0 -0
  57. /package/{write-the-f-paper → core/write-the-f-paper}/templates/prior-drafts.md +0 -0
  58. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/argument-structure.md +0 -0
  59. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/bibliography.md +0 -0
  60. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/gaps.md +0 -0
  61. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/imrad.md +0 -0
  62. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/peer-review.md +0 -0
  63. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/style-guide.md +0 -0
  64. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/tools.md +0 -0
  65. /package/{write-the-f-paper → core/write-the-f-paper}/templates/project.md +0 -0
  66. /package/{write-the-f-paper → core/write-the-f-paper}/templates/research.md +0 -0
  67. /package/{write-the-f-paper → core/write-the-f-paper}/templates/review-comments.md +0 -0
  68. /package/{write-the-f-paper → core/write-the-f-paper}/templates/revision-issues.md +0 -0
  69. /package/{write-the-f-paper → core/write-the-f-paper}/templates/roadmap.md +0 -0
  70. /package/{write-the-f-paper → core/write-the-f-paper}/templates/section-archive.md +0 -0
  71. /package/{write-the-f-paper → core/write-the-f-paper}/templates/section-context.md +0 -0
  72. /package/{write-the-f-paper → core/write-the-f-paper}/templates/section.md +0 -0
  73. /package/{write-the-f-paper → core/write-the-f-paper}/templates/state.md +0 -0
  74. /package/{write-the-f-paper → core/write-the-f-paper}/templates/summary.md +0 -0
  75. /package/{write-the-f-paper → core/write-the-f-paper}/venues/acm-cs.yaml +0 -0
  76. /package/{write-the-f-paper → core/write-the-f-paper}/venues/arxiv-ml.yaml +0 -0
  77. /package/{write-the-f-paper → core/write-the-f-paper}/venues/ieee-cs.yaml +0 -0
  78. /package/{write-the-f-paper → core/write-the-f-paper}/venues/nature.yaml +0 -0
  79. /package/{write-the-f-paper → core/write-the-f-paper}/venues/thesis-chapter.yaml +0 -0
  80. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/create-outline.md +0 -0
  81. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/create-outline.wcn.md +0 -0
  82. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/discuss-section.md +0 -0
  83. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/discuss-section.wcn.md +0 -0
  84. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/execute-section.md +0 -0
  85. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/execute-section.wcn.md +0 -0
  86. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/list-assumptions.md +0 -0
  87. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/list-assumptions.wcn.md +0 -0
  88. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/lit-review-phase.md +0 -0
  89. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/lit-review-phase.wcn.md +0 -0
  90. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/map-project.md +0 -0
  91. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/map-project.wcn.md +0 -0
  92. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/plan-section.md +0 -0
  93. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/plan-section.wcn.md +0 -0
  94. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/research-gap.md +0 -0
  95. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/research-gap.wcn.md +0 -0
  96. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/resume-paper.md +0 -0
  97. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/resume-paper.wcn.md +0 -0
  98. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/review-section.md +0 -0
  99. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/review-section.wcn.md +0 -0
  100. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/submit-draft.md +0 -0
  101. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/submit-draft.wcn.md +0 -0
  102. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/transition.md +0 -0
  103. /package/{write-the-f-paper → core/write-the-f-paper}/workflows/transition.wcn.md +0 -0
  104. /package/{commands → vendors/claude/commands}/wtfp/contribute.md +0 -0
  105. /package/{commands → vendors/claude/commands}/wtfp/create-outline.md +0 -0
  106. /package/{commands → vendors/claude/commands}/wtfp/discuss-section.md +0 -0
  107. /package/{commands → vendors/claude/commands}/wtfp/export-latex.md +0 -0
  108. /package/{commands → vendors/claude/commands}/wtfp/insert-section.md +0 -0
  109. /package/{commands → vendors/claude/commands}/wtfp/list-assumptions.md +0 -0
  110. /package/{commands → vendors/claude/commands}/wtfp/map-project.md +0 -0
  111. /package/{commands → vendors/claude/commands}/wtfp/pause-writing.md +0 -0
  112. /package/{commands → vendors/claude/commands}/wtfp/plan-revision.md +0 -0
  113. /package/{commands → vendors/claude/commands}/wtfp/plan-section.md +0 -0
  114. /package/{commands → vendors/claude/commands}/wtfp/polish-prose.md +0 -0
  115. /package/{commands → vendors/claude/commands}/wtfp/progress.md +0 -0
  116. /package/{commands → vendors/claude/commands}/wtfp/remove-section.md +0 -0
  117. /package/{commands → vendors/claude/commands}/wtfp/report-bug.md +0 -0
  118. /package/{commands → vendors/claude/commands}/wtfp/request-feature.md +0 -0
  119. /package/{commands → vendors/claude/commands}/wtfp/resume-writing.md +0 -0
  120. /package/{commands → vendors/claude/commands}/wtfp/review-section.md +0 -0
  121. /package/{commands → vendors/claude/commands}/wtfp/submit-milestone.md +0 -0
  122. /package/{commands → vendors/claude/commands}/wtfp/write-section.md +0 -0
@@ -43,60 +43,51 @@ BibTeX file: $ARGUMENTS (optional - auto-detects .bib files if not provided)
43
43
  find . -name "*.bib" -type f 2>/dev/null | grep -v node_modules | grep -v .git | head -10
44
44
  ```
45
45
 
46
- If multiple found, use AskUserQuestion:
47
- - header: "BibTeX"
48
- - question: "Which bibliography file should I analyze?"
49
- - options: [list found files] + "Analyze all"
46
+ If multiple found, use AskUserQuestion.
47
+ If none found, exit with error.
48
+ </step>
50
49
 
51
- If none found:
52
- ```
53
- No .bib file found.
50
+ <step name="parse_entries">
51
+ **Parse BibTeX Index:**
52
+
53
+ Use the specialized indexer tool to get a structured JSON summary of the bibliography. This handles large files efficiently.
54
54
 
55
- Either:
56
- 1. Add your .bib file to the project
57
- 2. Specify path: /wtfp:analyze-bib path/to/refs.bib
55
+ ```bash
56
+ # Index the bibliography (returns JSON)
57
+ node ~/.claude/bin/bib-index.js index "$ARGUMENTS"
58
58
  ```
59
- Exit command.
59
+ *(If $ARGUMENTS is empty, use the file found in previous step)*
60
60
 
61
61
  </step>
62
62
 
63
- <step name="parse_entries">
64
- **Parse all BibTeX entries:**
63
+ <step name="impact_analysis">
64
+ **Impact Analysis:**
65
65
 
66
- Extract from each entry:
67
- - Citation key
68
- - Type (@article, @inproceedings, @book, etc.)
69
- - Authors
70
- - Title
71
- - Year
72
- - Venue (journal/booktitle)
73
- - Abstract (if present)
74
- - Keywords (if present)
66
+ Analyze citation metrics (citations, velocity, age) to identify seminal and rising papers.
75
67
 
76
- Build structured inventory of all references.
68
+ ```bash
69
+ node ~/.claude/bin/analyze-impact.js "$ARGUMENTS"
70
+ ```
71
+
72
+ Output sections:
73
+ 1. **Seminal Works** (>1000 citations)
74
+ 2. **Rising Stars** (High citation velocity)
75
+ 3. **Review Suggested** (Old, low impact)
77
76
 
78
77
  </step>
79
78
 
80
79
  <step name="temporal_analysis">
81
80
  **Temporal Analysis:**
82
81
 
83
- Categorize by publication year:
84
- - **Foundational** (10+ years old): Seminal works, established theory
85
- - **Established** (5-10 years): Mature approaches, proven methods
86
- - **Recent** (2-5 years): Current state of the art
87
- - **Cutting edge** (<2 years): Latest developments, concurrent work
82
+ Analyze the JSON output from the parse_entries step.
88
83
 
89
- ```markdown
90
- ## Temporal Distribution
91
-
92
- | Era | Count | Examples |
93
- |-----|-------|----------|
94
- | Foundational (pre-2015) | [N] | [key1], [key2] |
95
- | Established (2015-2019) | [N] | [key3], [key4] |
96
- | Recent (2020-2023) | [N] | [key5], [key6] |
97
- | Cutting edge (2024+) | [N] | [key7], [key8] |
98
- ```
84
+ Categorize entries by the `year` field in the JSON:
85
+ - **Foundational** (10+ years old)
86
+ - **Established** (5-10 years)
87
+ - **Recent** (2-5 years)
88
+ - **Cutting edge** (<2 years)
99
89
 
90
+ Produce the "Temporal Distribution" table based on these counts.
100
91
  </step>
101
92
 
102
93
  <step name="cluster_topics">
@@ -125,21 +116,16 @@ Analyze titles, abstracts, and keywords to cluster papers by theme:
125
116
  </step>
126
117
 
127
118
  <step name="identify_seminal">
128
- **Identify Seminal Works:**
119
+ **Verify Seminal Works:**
129
120
 
130
- Flag likely seminal papers based on:
131
- - High citation count (if DOI available, could fetch)
132
- - Foundational publication year
133
- - Appears in prestigious venue
134
- - Authors are field leaders
135
- - Title suggests foundational contribution
121
+ Review the "Seminal Works" list from the Impact Analysis step.
136
122
 
137
123
  ```markdown
138
- ## Seminal Works (Must Cite)
124
+ ## Seminal Works (Verified High Impact)
139
125
 
140
- | Key | Title | Why Seminal |
141
- |-----|-------|-------------|
142
- | [key] | [title] | [reason: foundational method, influential framework, etc.] |
126
+ | Key | Title | Citations | Why Seminal |
127
+ |-----|-------|-----------|-------------|
128
+ | [key] | [title] | [N] | [reason] |
143
129
  ```
144
130
 
145
131
  Use AskUserQuestion:
@@ -233,15 +219,18 @@ Write to `.planning/sources/REFS.md`:
233
219
  **Total entries:** [N]
234
220
  **Analysis date:** [date]
235
221
 
222
+ ## Impact Analysis
223
+ [From impact_analysis step]
224
+ - Seminal Works (>1000 citations)
225
+ - Rising Stars (High Velocity)
226
+ - Review Suggested (Low Impact/Old)
227
+
236
228
  ## Temporal Distribution
237
229
  [From temporal_analysis step]
238
230
 
239
231
  ## Topic Clusters
240
232
  [From cluster_topics step]
241
233
 
242
- ## Seminal Works
243
- [From identify_seminal step]
244
-
245
234
  ## Citation Map by Section
246
235
  [From map_to_sections step]
247
236
 
@@ -55,16 +55,18 @@ Create one or specify path: /wtfp:check-refs path/to/refs.bib
55
55
  </step>
56
56
 
57
57
  <step name="parse_bib">
58
- **Extract all BibTeX keys:**
58
+ **Extract BibTeX Keys:**
59
+
60
+ Use the deterministic indexer to get an accurate list of keys from the .bib file.
59
61
 
60
62
  ```bash
61
- grep -E "^@[a-zA-Z]+\{" *.bib | sed 's/.*{\([^,]*\),.*/\1/'
63
+ node ~/.claude/bin/bib-index.js index "$ARGUMENTS"
62
64
  ```
65
+ *(Use the file found/selected in step 1)*
63
66
 
64
- Build inventory:
67
+ Build inventory from the JSON output:
65
68
  - Entry key
66
- - Entry type (@article, @inproceedings, etc.)
67
- - Required fields present/missing
69
+ - Title
68
70
  - Year
69
71
  </step>
70
72
 
@@ -133,10 +135,10 @@ Use AskUserQuestion:
133
135
  - "Keep all" — Leave .bib unchanged
134
136
  - "Comment out" — Keep but mark as unused
135
137
 
136
- For missing entries, offer to:
137
- - Search for DOI/metadata (if WebFetch available)
138
- - Create skeleton entry for user to complete
139
- - Flag for manual resolution
138
+ For missing entries, offer to find them:
139
+ 1. **Search:** Run `node ~/.claude/bin/citation-fetcher.js "title or author"` (uses Semantic Scholar + CrossRef) to find the correct BibTeX.
140
+ 2. **Create:** If found, append the new entry to the .bib file.
141
+ 3. **Flag:** If not found, flag for manual resolution.
140
142
  </step>
141
143
 
142
144
  <step name="apply_fixes">
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: wtfp:create-poster
3
+ description: Full workflow for creating an academic poster from project content
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+
11
+ <objective>
12
+ Generate an academic poster based on the current project's PROJECT.md and findings.
13
+ Uses the wtfp-marp skill to compile to HTML.
14
+ </objective>
15
+
16
+ <context>
17
+ @~/.claude/write-the-f-paper/references/principles.md
18
+ @~/.claude/write-the-f-paper/templates/posters/basic.md
19
+ </context>
20
+
21
+ <process>
22
+ ## Step 1: Content Synthesis
23
+ - Read `.planning/PROJECT.md` and any drafted sections.
24
+ - Identify key findings, methodology, and conclusion.
25
+
26
+ ## Step 2: User Interview
27
+ AskUserQuestion to determine:
28
+ - Poster title (default to project title)
29
+ - Authors
30
+ - Key visuals/charts needed
31
+ - Target audience
32
+
33
+ ## Step 3: Markdown Generation
34
+ - Create `poster.md` using Marp format.
35
+ - Integrate synthesized content.
36
+
37
+ ## Step 4: Compilation
38
+ - Use `wtfp-marp` skill: `npx @marp-team/marp-cli poster.md -o poster.html`
39
+
40
+ ## Step 5: Review
41
+ - Present the generated poster.html path to the user.
42
+ </process>
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: wtfp:create-slides
3
+ description: Full workflow for creating presentation slides from project content
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - AskUserQuestion
9
+ ---
10
+
11
+ <objective>
12
+ Generate presentation slides based on the current project's PROJECT.md and findings.
13
+ Uses the wtfp-marp skill to compile to PDF.
14
+ </objective>
15
+
16
+ <context>
17
+ @~/.claude/write-the-f-paper/references/principles.md
18
+ @~/.claude/write-the-f-paper/templates/slides/
19
+ </context>
20
+
21
+ <process>
22
+ ## Step 1: Content Synthesis
23
+ - Read `.planning/PROJECT.md` and any drafted sections.
24
+ - Identify the core narrative and supporting claims.
25
+
26
+ ## Step 2: User Interview
27
+ AskUserQuestion to determine:
28
+ - Presentation duration/target number of slides
29
+ - Specific focus areas
30
+ - Audience background
31
+
32
+ ## Step 3: Markdown Generation
33
+ - Create `slides.md` using Marp format.
34
+ - Separate slides with `---`.
35
+
36
+ ## Step 4: Compilation
37
+ - Use `wtfp-marp` skill: `npx @marp-team/marp-cli slides.md -o slides.pdf`
38
+
39
+ ## Step 5: Review
40
+ - Present the generated slides.pdf path to the user.
41
+ </process>
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: wtfp:help
3
3
  description: Show available WTF-P commands and usage guide
4
+ allowed-tools: []
4
5
  ---
5
6
 
6
7
  <objective>
@@ -14,6 +15,7 @@ Output ONLY the reference content below. Do NOT add:
14
15
  - Any commentary beyond the reference
15
16
  </objective>
16
17
 
18
+ <process>
17
19
  <reference>
18
20
  # WTF-P Command Reference
19
21
 
@@ -365,3 +367,4 @@ Guide through contributing code via Pull Request.
365
367
  - Request features: `/wtfp:request-feature`
366
368
  - GitHub: https://github.com/akougkas/wtf-p
367
369
  </reference>
370
+ </process>
@@ -88,116 +88,77 @@ Exit command.
88
88
 
89
89
  </step>
90
90
 
91
- <step name="type">
91
+ <step name="initial_batch">
92
92
 
93
- **Ask paper type:**
93
+ **Gather Core Context (Batched):**
94
94
 
95
- Use AskUserQuestion:
96
- - header: "Paper Type"
97
- - question: "What type of document are you writing?"
95
+ Use AskUserQuestion to collect the foundational pillars in one turn.
96
+
97
+ - header: "Paper Foundations"
98
+ - question: "To initialize the project, I need to understand 4 things. Answer what you can, and I'll infer or ask about the rest:\n\n1. **Type:** (Research paper, Grant, Thesis, etc.)\n2. **Venue:** (Target conference/journal, e.g., NeurIPS, CHI, Nature)\n3. **Core Argument:** (The one main thing you are proving/proposing)\n4. **Audience:** (Who is this for?)"
98
99
  - options:
99
- - "Research paper" — Journal article or conference paper
100
- - "Grant proposal" — Funding application (NSF, NIH, etc.)
101
- - "Thesis chapter" — Dissertation or thesis section
102
- - "Other" — Essay, report, or something else
100
+ - "I provided the details" — Continue with what I said
101
+ - "Guide me step-by-step" — I prefer individual questions
102
+
103
+ **If "Guide me step-by-step":**
104
+ Fall back to the sequential interview mode (ask Type, then Venue, then Argument).
103
105
 
104
- Store the document type for later structure decisions.
106
+ **If "I provided the details":**
107
+ Parse the response to extract: `document_type`, `target_venue`, `core_argument`, `target_audience`.
105
108
 
106
109
  </step>
107
110
 
108
111
  <step name="venue_template">
109
112
 
110
- **Select venue template (for research papers):**
113
+ **Select venue template (if not inferred):**
111
114
 
112
- If document type is "Research paper", ask for venue template:
115
+ If `document_type` or `target_venue` is ambiguous, ask specifically for the template:
113
116
 
114
117
  Use AskUserQuestion:
115
- - header: "Venue"
116
- - question: "What's your target venue or field?"
118
+ - header: "Venue Structure"
119
+ - question: "Based on your input, which structure fits best?"
117
120
  - options:
118
- - "ACM CS" — Systems, databases, architecture (SIGMOD, OSDI, SOSP)
119
- - "IEEE CS" — HPC, parallel systems, storage (SC, IPDPS, TPDS)
121
+ - "ACM CS" — Systems/Databases (SIGMOD, SOSP)
122
+ - "IEEE CS" — HPC/Systems (SC, IPDPS)
120
123
  - "ML/AI" — NeurIPS, ICML, ICLR style
121
- - "Nature/Science" — Classic IMRaD for life sciences
122
- - "Other" — Custom structure
124
+ - "Nature/Science" — Life Sciences IMRaD
125
+ - "Grant" — Funding Proposal
126
+ - "Thesis" — Dissertation Chapter
127
+ - "Other" — Custom
123
128
 
124
129
  **Load venue template:**
125
-
126
- Based on selection, read the corresponding venue template:
127
- - ACM CS → `~/.claude/write-the-f-paper/venues/acm-cs.yaml`
128
- - IEEE CS → `~/.claude/write-the-f-paper/venues/ieee-cs.yaml`
129
- - ML/AI → `~/.claude/write-the-f-paper/venues/arxiv-ml.yaml`
130
- - Nature/Science → `~/.claude/write-the-f-paper/venues/nature.yaml`
131
- - Other → Ask user to describe structure
132
-
133
- If document type is "Thesis chapter":
134
- - Load `~/.claude/write-the-f-paper/venues/thesis-chapter.yaml`
135
-
136
- Store the selected venue template for use in structure step.
130
+ (Load corresponding YAML from `~/.claude/write-the-f-paper/venues/`)
137
131
 
138
132
  </step>
139
133
 
140
- <step name="question">
141
-
142
- **1. Open (FREEFORM — do NOT use AskUserQuestion):**
143
-
144
- Ask inline: "What is the core argument or contribution of your paper?"
145
-
146
- Wait for their freeform response. This gives you the context needed to ask intelligent follow-up questions.
147
-
148
- **2. Follow the thread (NOW use AskUserQuestion):**
134
+ <step name="refine_argument">
149
135
 
150
- Based on their response, use AskUserQuestion with options that probe what they mentioned:
151
- - header: "[Topic they mentioned]"
152
- - question: "You mentioned [X] — how would you describe the key insight?"
153
- - options: 2-3 interpretations + "Something else"
136
+ **Sharpen the Core:**
154
137
 
155
- **3. Target venue:**
138
+ If `core_argument` was weak or missing in the batch, drill down now.
156
139
 
157
140
  Use AskUserQuestion:
158
- - header: "Venue"
159
- - question: "What's the target venue or format?"
160
- - options: Common venues for their field + "Undecided" + "Let me specify"
141
+ - header: "Refine Core"
142
+ - question: "Let's sharpen the core argument. If reviewers remember ONE thing, what is it?"
143
+ - options:
144
+ - "The Method" — A new way of doing X
145
+ - "The Findings" — We discovered Y
146
+ - "The Theory" — A new perspective on Z
147
+ - "The System" — We built system Q
148
+ - "Write my own" — (User types input)
161
149
 
162
- **4. Sharpen the core:**
150
+ </step>
163
151
 
164
- Use AskUserQuestion:
165
- - header: "Core"
166
- - question: "If reviewers remember one thing, what should it be?"
167
- - options: Key aspects they've mentioned + "The methodology" + "The findings" + "Something else"
152
+ <step name="constraints_batch">
168
153
 
169
- **5. Find boundaries:**
154
+ **Gather Constraints & Boundaries (Batched):**
170
155
 
171
156
  Use AskUserQuestion:
172
- - header: "Scope"
173
- - question: "What's explicitly NOT in this paper?"
174
- - options: Tempting tangents + "Nothing specific" + "Let me list them"
175
-
176
- **6. Constraints:**
177
-
178
- Use AskUserQuestion:
179
- - header: "Constraints"
180
- - question: "Any hard constraints?"
157
+ - header: "Scope & Limits"
158
+ - question: "Finally, define the box we are playing in:\n\n1. **Out of Scope:** What are we explicitly NOT doing?\n2. **Hard Constraints:** Page limits, deadlines, data restrictions?"
181
159
  - options:
182
- - "Page/word limit" — Strict length requirements
183
- - "Deadline" — Submission deadline pressure
184
- - "Data limitations" — Working with specific dataset
185
- - "None" — Flexible constraints
186
- - "Multiple constraints" — Let me explain
187
-
188
- **7. Decision gate:**
189
-
190
- Use AskUserQuestion:
191
- - header: "Ready?"
192
- - question: "Ready to create PROJECT.md, or explore more?"
193
- - options (ALL THREE REQUIRED):
194
- - "Create PROJECT.md" — Finalize and continue
195
- - "Ask more questions" — I'll dig deeper
196
- - "Let me add context" — You have more to share
197
-
198
- If "Ask more questions" → return to step 2.
199
- If "Let me add context" → receive input via their response → return to step 2.
200
- Loop until "Create PROJECT.md" selected.
160
+ - "Provided details" — Save and continue
161
+ - "No constraints" — Standard length, no specific exclusions
201
162
 
202
163
  </step>
203
164
 
@@ -73,10 +73,9 @@ Use AskUserQuestion:
73
73
  Based on scope, investigate:
74
74
 
75
75
  **Key Citations:**
76
- - Identify foundational papers
77
- - Find recent high-impact work
78
- - Note methodological papers
79
- - Track disagreements/debates
76
+ - **Foundational:** Use `node ~/.claude/bin/citation-fetcher.js "[topic]" --intent=seminal` to find high-impact papers.
77
+ - **Recent:** Use `node ~/.claude/bin/citation-fetcher.js "[topic]" --intent=recent --year=2023-2026` to find state-of-the-art.
78
+ - **Validation:** Use `node ~/.claude/bin/citation-fetcher.js "query"` to verify specific papers.
80
79
 
81
80
  **Standard Approaches:**
82
81
  - How do others structure similar sections?
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "wtf-p-research-server",
3
+ "version": "0.4.0",
4
+ "description": "MCP Server for ArXiv and Semantic Scholar citation retrieval",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "wtfp-research": "src/index.js"
8
+ },
9
+ "dependencies": {
10
+ "@modelcontextprotocol/sdk": "^0.6.0",
11
+ "node-fetch": "^2.7.0"
12
+ }
13
+ }
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
4
+ const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
5
+ const {
6
+ CallToolRequestSchema,
7
+ ListToolsRequestSchema,
8
+ ErrorCode,
9
+ McpError
10
+ } = require("@modelcontextprotocol/sdk/types.js");
11
+ const fetch = require("node-fetch");
12
+
13
+ const SEMANTIC_SCHOLAR_API = "https://api.semanticscholar.org/graph/v1";
14
+
15
+ class ResearchServer {
16
+ constructor() {
17
+ this.server = new Server(
18
+ {
19
+ name: "wtf-p-research",
20
+ version: "0.4.0",
21
+ },
22
+ {
23
+ capabilities: {
24
+ tools: {},
25
+ },
26
+ }
27
+ );
28
+
29
+ this.setupTools();
30
+
31
+ this.server.onerror = (error) => console.error("[MCP Error]", error);
32
+ process.on("SIGINT", async () => {
33
+ await this.server.close();
34
+ process.exit(0);
35
+ });
36
+ }
37
+
38
+ setupTools() {
39
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
40
+ tools: [
41
+ {
42
+ name: "search_papers",
43
+ description: "Search for academic papers on Semantic Scholar",
44
+ inputSchema: {
45
+ type: "object",
46
+ properties: {
47
+ query: { type: "string", description: "Search query (title, authors, keywords)" },
48
+ limit: { type: "number", description: "Max results (default 5)", default: 5 },
49
+ },
50
+ required: ["query"],
51
+ },
52
+ },
53
+ {
54
+ name: "get_bibtex",
55
+ description: "Get BibTeX for a specific paper by its Semantic Scholar ID or DOI",
56
+ inputSchema: {
57
+ type: "object",
58
+ properties: {
59
+ paperId: { type: "string", description: "Semantic Scholar ID or DOI (prefix with 'DOI:')" },
60
+ },
61
+ required: ["paperId"],
62
+ },
63
+ },
64
+ ],
65
+ }));
66
+
67
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
68
+ switch (request.params.name) {
69
+ case "search_papers":
70
+ return await this.handleSearch(request.params.arguments);
71
+ case "get_bibtex":
72
+ return await this.handleGetBibtex(request.params.arguments);
73
+ default:
74
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
75
+ }
76
+ });
77
+ }
78
+
79
+ async handleSearch(args) {
80
+ const { query, limit = 5 } = args;
81
+ try {
82
+ const response = await fetch(
83
+ `${SEMANTIC_SCHOLAR_API}/paper/search?query=${encodeURIComponent(query)}&limit=${limit}&fields=title,authors,year,abstract,venue,externalIds`
84
+ );
85
+ if (!response.ok) throw new Error(`API error: ${response.statusText}`);
86
+ const data = await response.json();
87
+
88
+ return {
89
+ content: [{ type: "text", text: JSON.stringify(data.data || [], null, 2) }],
90
+ };
91
+ } catch (error) {
92
+ return {
93
+ content: [{ type: "text", text: `Error searching papers: ${error.message}` }],
94
+ isError: true,
95
+ };
96
+ }
97
+ }
98
+
99
+ async handleGetBibtex(args) {
100
+ const { paperId } = args;
101
+ try {
102
+ // In a real implementation, we might need a separate service or to construct BibTeX from the metadata
103
+ // For this prototype, we'll fetch the fields needed to construct a valid BibTeX entry.
104
+ const response = await fetch(
105
+ `${SEMANTIC_SCHOLAR_API}/paper/${paperId}?fields=title,authors,year,venue,externalIds,citationStyles`
106
+ );
107
+ if (!response.ok) throw new Error(`API error: ${response.statusText}`);
108
+ const data = await response.json();
109
+
110
+ const authors = (data.authors || []).map(a => a.name).join(' and ');
111
+ const bibtex = `@article{${data.externalIds?.DOI || data.paperId},\n title={${data.title}},\n author={${authors}},\n journal={${data.venue || 'Unknown'}},\n year={${data.year}}
112
+ }`;
113
+
114
+ return {
115
+ content: [{ type: "text", text: bibtex }],
116
+ };
117
+ } catch (error) {
118
+ return {
119
+ content: [{ type: "text", text: `Error fetching BibTeX: ${error.message}` }],
120
+ isError: true,
121
+ };
122
+ }
123
+ }
124
+
125
+ async run() {
126
+ const transport = new StdioServerTransport();
127
+ await this.server.connect(transport);
128
+ console.error("Research MCP server running on stdio");
129
+ }
130
+ }
131
+
132
+ const server = new ResearchServer();
133
+ server.run().catch(console.error);
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: wtfp-echarts
3
+ description: Generate publication-quality charts using Apache ECharts
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ ---
9
+
10
+ # ECharts Generator Skill
11
+
12
+ Use this skill to create charts from data for papers, posters, or slides.
13
+
14
+ ## Usage
15
+
16
+ Generate an HTML file with ECharts configuration.
17
+
18
+ ### Example Template
19
+ ```html
20
+ <!DOCTYPE html>
21
+ <html>
22
+ <head>
23
+ <meta charset="utf-8">
24
+ <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
25
+ </head>
26
+ <body>
27
+ <div id="main" style="width: 800px;height:600px;"></div>
28
+ <script type="text/javascript">
29
+ var myChart = echarts.init(document.getElementById('main'));
30
+ var option = {
31
+ title: { text: 'ECharts Example' },
32
+ tooltip: {},
33
+ xAxis: { data: ["A", "B", "C", "D"] },
34
+ yAxis: {},
35
+ series: [{ name: 'Sales', type: 'bar', data: [5, 20, 36, 10] }]
36
+ };
37
+ myChart.setOption(option);
38
+ </script>
39
+ </body>
40
+ </html>
41
+ ```
42
+
43
+ ## Strategy
44
+ 1. Receive data and chart requirements.
45
+ 2. Generate ECharts configuration object.
46
+ 3. Inject into HTML template.
47
+ 4. User can open HTML in browser to view/export.