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.
- package/README.md +24 -2
- package/bin/commands/doctor.js +100 -0
- package/bin/commands/install-logic.js +231 -0
- package/bin/commands/list.js +88 -0
- package/bin/commands/status.js +85 -0
- package/bin/commands/update.js +50 -0
- package/bin/install.js +78 -629
- package/bin/lib/analyze-impact.js +105 -0
- package/bin/lib/bib-format.js +161 -0
- package/bin/lib/bib-index.js +104 -0
- package/bin/lib/citation-fetcher.js +299 -0
- package/bin/lib/citation-ranker.js +133 -0
- package/bin/lib/manifest.js +59 -0
- package/bin/lib/scholar-lookup.js +188 -0
- package/bin/lib/semantic-scholar.js +184 -0
- package/bin/lib/utils.js +37 -17
- package/bin/lib/wcn-compiler.js +226 -0
- package/bin/uninstall.js +51 -17
- package/core/write-the-f-paper/templates/posters/basic.md +34 -0
- package/core/write-the-f-paper/templates/slides/basic.md +31 -0
- package/package.json +12 -4
- package/vendors/claude/.claude-plugin/plugin.json +12 -0
- package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
- package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
- package/vendors/claude/agents/wtfp/citation-retriever.md +31 -0
- package/{commands → vendors/claude/commands}/wtfp/analyze-bib.md +41 -52
- package/{commands → vendors/claude/commands}/wtfp/check-refs.md +11 -9
- package/vendors/claude/commands/wtfp/create-poster.md +42 -0
- package/vendors/claude/commands/wtfp/create-slides.md +41 -0
- package/{commands → vendors/claude/commands}/wtfp/help.md +3 -0
- package/{commands → vendors/claude/commands}/wtfp/new-paper.md +42 -81
- package/{commands → vendors/claude/commands}/wtfp/research-gap.md +3 -4
- package/vendors/claude/mcp/research-server/package.json +13 -0
- package/vendors/claude/mcp/research-server/src/index.js +133 -0
- package/vendors/claude/skills/wtfp/echarts/SKILL.md +47 -0
- package/vendors/claude/skills/wtfp/marp/SKILL.md +49 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/checkpoints.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/continuation-format.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/git-integration.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/github-contrib.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/imrad-structure.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/length-estimation.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/plan-format.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/principles.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/questioning.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/references/research-pitfalls.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/config.json +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/context.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/continue-here.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/data-inventory.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/discovery.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/issues.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/manuscript.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/narrative-arc.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/outline.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/phase-prompt.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/prior-drafts.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/argument-structure.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/bibliography.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/gaps.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/imrad.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/peer-review.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/style-guide.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project-context/tools.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/project.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/research.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/review-comments.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/revision-issues.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/roadmap.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/section-archive.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/section-context.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/section.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/state.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/templates/summary.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/venues/acm-cs.yaml +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/venues/arxiv-ml.yaml +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/venues/ieee-cs.yaml +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/venues/nature.yaml +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/venues/thesis-chapter.yaml +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/create-outline.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/create-outline.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/discuss-section.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/discuss-section.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/execute-section.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/execute-section.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/list-assumptions.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/list-assumptions.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/lit-review-phase.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/lit-review-phase.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/map-project.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/map-project.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/plan-section.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/plan-section.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/research-gap.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/research-gap.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/resume-paper.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/resume-paper.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/review-section.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/review-section.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/submit-draft.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/submit-draft.wcn.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/transition.md +0 -0
- /package/{write-the-f-paper → core/write-the-f-paper}/workflows/transition.wcn.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/contribute.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/create-outline.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/discuss-section.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/export-latex.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/insert-section.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/list-assumptions.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/map-project.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/pause-writing.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/plan-revision.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/plan-section.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/polish-prose.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/progress.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/remove-section.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/report-bug.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/request-feature.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/resume-writing.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/review-section.md +0 -0
- /package/{commands → vendors/claude/commands}/wtfp/submit-milestone.md +0 -0
- /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
|
-
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
```bash
|
|
56
|
+
# Index the bibliography (returns JSON)
|
|
57
|
+
node ~/.claude/bin/bib-index.js index "$ARGUMENTS"
|
|
58
58
|
```
|
|
59
|
-
|
|
59
|
+
*(If $ARGUMENTS is empty, use the file found in previous step)*
|
|
60
60
|
|
|
61
61
|
</step>
|
|
62
62
|
|
|
63
|
-
<step name="
|
|
64
|
-
**
|
|
63
|
+
<step name="impact_analysis">
|
|
64
|
+
**Impact Analysis:**
|
|
65
65
|
|
|
66
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
**
|
|
119
|
+
**Verify Seminal Works:**
|
|
129
120
|
|
|
130
|
-
|
|
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 (
|
|
124
|
+
## Seminal Works (Verified High Impact)
|
|
139
125
|
|
|
140
|
-
| Key | Title | Why Seminal |
|
|
141
|
-
|
|
142
|
-
| [key] | [title] | [
|
|
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
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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="
|
|
91
|
+
<step name="initial_batch">
|
|
92
92
|
|
|
93
|
-
**
|
|
93
|
+
**Gather Core Context (Batched):**
|
|
94
94
|
|
|
95
|
-
Use AskUserQuestion
|
|
96
|
-
|
|
97
|
-
-
|
|
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
|
-
- "
|
|
100
|
-
- "
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
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 (
|
|
113
|
+
**Select venue template (if not inferred):**
|
|
111
114
|
|
|
112
|
-
If
|
|
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: "
|
|
118
|
+
- header: "Venue Structure"
|
|
119
|
+
- question: "Based on your input, which structure fits best?"
|
|
117
120
|
- options:
|
|
118
|
-
- "ACM CS" — Systems
|
|
119
|
-
- "IEEE CS" — HPC
|
|
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" —
|
|
122
|
-
- "
|
|
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="
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
If `core_argument` was weak or missing in the batch, drill down now.
|
|
156
139
|
|
|
157
140
|
Use AskUserQuestion:
|
|
158
|
-
- header: "
|
|
159
|
-
- question: "
|
|
160
|
-
- options:
|
|
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
|
-
|
|
150
|
+
</step>
|
|
163
151
|
|
|
164
|
-
|
|
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
|
-
**
|
|
154
|
+
**Gather Constraints & Boundaries (Batched):**
|
|
170
155
|
|
|
171
156
|
Use AskUserQuestion:
|
|
172
|
-
- header: "Scope"
|
|
173
|
-
- question: "What
|
|
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
|
-
- "
|
|
183
|
-
- "
|
|
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
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
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.
|