wtf-p 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +338 -0
  3. package/bin/install.js +358 -0
  4. package/bin/uninstall.js +485 -0
  5. package/commands/wtfp/analyze-bib.md +326 -0
  6. package/commands/wtfp/check-refs.md +205 -0
  7. package/commands/wtfp/create-outline.md +275 -0
  8. package/commands/wtfp/discuss-section.md +71 -0
  9. package/commands/wtfp/export-latex.md +216 -0
  10. package/commands/wtfp/help.md +342 -0
  11. package/commands/wtfp/insert-section.md +130 -0
  12. package/commands/wtfp/list-assumptions.md +109 -0
  13. package/commands/wtfp/map-project.md +197 -0
  14. package/commands/wtfp/new-paper.md +443 -0
  15. package/commands/wtfp/pause-writing.md +145 -0
  16. package/commands/wtfp/plan-revision.md +180 -0
  17. package/commands/wtfp/plan-section.md +247 -0
  18. package/commands/wtfp/polish-prose.md +177 -0
  19. package/commands/wtfp/progress.md +325 -0
  20. package/commands/wtfp/remove-section.md +147 -0
  21. package/commands/wtfp/research-gap.md +235 -0
  22. package/commands/wtfp/resume-writing.md +142 -0
  23. package/commands/wtfp/review-section.md +409 -0
  24. package/commands/wtfp/submit-milestone.md +211 -0
  25. package/commands/wtfp/write-section.md +273 -0
  26. package/package.json +40 -0
  27. package/write-the-f-paper/references/checkpoints.md +213 -0
  28. package/write-the-f-paper/references/continuation-format.md +223 -0
  29. package/write-the-f-paper/references/git-integration.md +241 -0
  30. package/write-the-f-paper/references/imrad-structure.md +212 -0
  31. package/write-the-f-paper/references/length-estimation.md +148 -0
  32. package/write-the-f-paper/references/plan-format.md +361 -0
  33. package/write-the-f-paper/references/principles.md +158 -0
  34. package/write-the-f-paper/references/questioning.md +132 -0
  35. package/write-the-f-paper/references/research-pitfalls.md +208 -0
  36. package/write-the-f-paper/templates/config.json +30 -0
  37. package/write-the-f-paper/templates/context.md +179 -0
  38. package/write-the-f-paper/templates/continue-here.md +142 -0
  39. package/write-the-f-paper/templates/data-inventory.md +142 -0
  40. package/write-the-f-paper/templates/discovery.md +146 -0
  41. package/write-the-f-paper/templates/issues.md +59 -0
  42. package/write-the-f-paper/templates/manuscript.md +253 -0
  43. package/write-the-f-paper/templates/narrative-arc.md +227 -0
  44. package/write-the-f-paper/templates/outline.md +274 -0
  45. package/write-the-f-paper/templates/phase-prompt.md +348 -0
  46. package/write-the-f-paper/templates/prior-drafts.md +204 -0
  47. package/write-the-f-paper/templates/project-context/argument-structure.md +267 -0
  48. package/write-the-f-paper/templates/project-context/bibliography.md +152 -0
  49. package/write-the-f-paper/templates/project-context/gaps.md +122 -0
  50. package/write-the-f-paper/templates/project-context/imrad.md +140 -0
  51. package/write-the-f-paper/templates/project-context/peer-review.md +152 -0
  52. package/write-the-f-paper/templates/project-context/style-guide.md +198 -0
  53. package/write-the-f-paper/templates/project-context/tools.md +170 -0
  54. package/write-the-f-paper/templates/project.md +185 -0
  55. package/write-the-f-paper/templates/research.md +384 -0
  56. package/write-the-f-paper/templates/review-comments.md +253 -0
  57. package/write-the-f-paper/templates/revision-issues.md +169 -0
  58. package/write-the-f-paper/templates/roadmap.md +187 -0
  59. package/write-the-f-paper/templates/section-archive.md +178 -0
  60. package/write-the-f-paper/templates/section-context.md +114 -0
  61. package/write-the-f-paper/templates/section.md +128 -0
  62. package/write-the-f-paper/templates/state.md +244 -0
  63. package/write-the-f-paper/templates/summary.md +277 -0
  64. package/write-the-f-paper/venues/acm-cs.yaml +102 -0
  65. package/write-the-f-paper/venues/arxiv-ml.yaml +103 -0
  66. package/write-the-f-paper/venues/ieee-cs.yaml +100 -0
  67. package/write-the-f-paper/venues/nature.yaml +81 -0
  68. package/write-the-f-paper/venues/thesis-chapter.yaml +101 -0
  69. package/write-the-f-paper/workflows/create-outline.md +462 -0
  70. package/write-the-f-paper/workflows/create-outline.wcn.md +194 -0
  71. package/write-the-f-paper/workflows/discuss-section.md +249 -0
  72. package/write-the-f-paper/workflows/discuss-section.wcn.md +63 -0
  73. package/write-the-f-paper/workflows/execute-section.md +704 -0
  74. package/write-the-f-paper/workflows/execute-section.wcn.md +219 -0
  75. package/write-the-f-paper/workflows/list-assumptions.md +183 -0
  76. package/write-the-f-paper/workflows/list-assumptions.wcn.md +42 -0
  77. package/write-the-f-paper/workflows/lit-review-phase.md +281 -0
  78. package/write-the-f-paper/workflows/lit-review-phase.wcn.md +92 -0
  79. package/write-the-f-paper/workflows/map-project.md +359 -0
  80. package/write-the-f-paper/workflows/map-project.wcn.md +73 -0
  81. package/write-the-f-paper/workflows/plan-section.md +409 -0
  82. package/write-the-f-paper/workflows/plan-section.wcn.md +236 -0
  83. package/write-the-f-paper/workflows/research-gap.md +469 -0
  84. package/write-the-f-paper/workflows/research-gap.wcn.md +119 -0
  85. package/write-the-f-paper/workflows/resume-paper.md +274 -0
  86. package/write-the-f-paper/workflows/resume-paper.wcn.md +93 -0
  87. package/write-the-f-paper/workflows/review-section.md +329 -0
  88. package/write-the-f-paper/workflows/review-section.wcn.md +91 -0
  89. package/write-the-f-paper/workflows/submit-draft.md +368 -0
  90. package/write-the-f-paper/workflows/submit-draft.wcn.md +69 -0
  91. package/write-the-f-paper/workflows/transition.md +375 -0
  92. package/write-the-f-paper/workflows/transition.wcn.md +113 -0
@@ -0,0 +1,326 @@
1
+ ---
2
+ name: wtfp:analyze-bib
3
+ description: Analyze BibTeX file and suggest citation placement by section
4
+ argument-hint: "[bib-file]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Glob
10
+ - Grep
11
+ - AskUserQuestion
12
+ - WebFetch
13
+ ---
14
+
15
+ <objective>
16
+ Deep analysis of BibTeX bibliography to inform writing strategy.
17
+
18
+ Purpose: Understand your literature landscape before writing. Cluster papers by topic, identify seminal vs recent work, and pre-populate citation suggestions per section.
19
+ Output: REFS.md with citation strategy mapped to your paper's sections.
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @~/.claude/write-the-f-paper/references/citation-formats.md
24
+ @~/.claude/write-the-f-paper/templates/project-context/bibliography.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ BibTeX file: $ARGUMENTS (optional - auto-detects .bib files if not provided)
29
+
30
+ **Load project context:**
31
+ @.planning/PROJECT.md
32
+ @.planning/config.json
33
+ @.planning/structure/outline.md
34
+ </context>
35
+
36
+ <process>
37
+
38
+ <step name="locate_bib">
39
+ **Find BibTeX file:**
40
+
41
+ ```bash
42
+ # Find .bib files
43
+ find . -name "*.bib" -type f 2>/dev/null | grep -v node_modules | grep -v .git | head -10
44
+ ```
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"
50
+
51
+ If none found:
52
+ ```
53
+ No .bib file found.
54
+
55
+ Either:
56
+ 1. Add your .bib file to the project
57
+ 2. Specify path: /wtfp:analyze-bib path/to/refs.bib
58
+ ```
59
+ Exit command.
60
+
61
+ </step>
62
+
63
+ <step name="parse_entries">
64
+ **Parse all BibTeX entries:**
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)
75
+
76
+ Build structured inventory of all references.
77
+
78
+ </step>
79
+
80
+ <step name="temporal_analysis">
81
+ **Temporal Analysis:**
82
+
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
88
+
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
+ ```
99
+
100
+ </step>
101
+
102
+ <step name="cluster_topics">
103
+ **Topic Clustering:**
104
+
105
+ Analyze titles, abstracts, and keywords to cluster papers by theme:
106
+
107
+ 1. Extract key terms from titles/abstracts
108
+ 2. Group papers with overlapping terminology
109
+ 3. Label clusters with descriptive names
110
+
111
+ ```markdown
112
+ ## Topic Clusters
113
+
114
+ ### Cluster 1: [Theme Name]
115
+ **Papers:** [key1], [key2], [key3]
116
+ **Common themes:** [extracted keywords]
117
+ **Use for:** [which section this supports]
118
+
119
+ ### Cluster 2: [Theme Name]
120
+ **Papers:** [key4], [key5]
121
+ **Common themes:** [extracted keywords]
122
+ **Use for:** [which section this supports]
123
+ ```
124
+
125
+ </step>
126
+
127
+ <step name="identify_seminal">
128
+ **Identify Seminal Works:**
129
+
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
136
+
137
+ ```markdown
138
+ ## Seminal Works (Must Cite)
139
+
140
+ | Key | Title | Why Seminal |
141
+ |-----|-------|-------------|
142
+ | [key] | [title] | [reason: foundational method, influential framework, etc.] |
143
+ ```
144
+
145
+ Use AskUserQuestion:
146
+ - header: "Seminal"
147
+ - question: "Which of these are definitely seminal works in your field?"
148
+ - multiSelect: true
149
+ - options: [top candidates] + "None of these" + "Let me add others"
150
+
151
+ </step>
152
+
153
+ <step name="map_to_sections">
154
+ **Map Citations to Sections:**
155
+
156
+ Based on venue template and topic clusters, suggest where each citation belongs:
157
+
158
+ Read outline.md to get section structure.
159
+
160
+ For each section, identify relevant citations:
161
+
162
+ ```markdown
163
+ ## Citation Map
164
+
165
+ ### Section 1: Introduction
166
+ **Purpose:** Establish problem importance, cite motivation
167
+ **Suggested citations:**
168
+ - [key1] — establishes the problem exists
169
+ - [key2] — shows prior failed attempts
170
+ - [key3] — motivates urgency
171
+
172
+ ### Section 2: Background
173
+ **Purpose:** Technical foundations
174
+ **Suggested citations:**
175
+ - [key4] — defines key concept X
176
+ - [key5] — introduces method Y
177
+
178
+ ### Section 3: Approach
179
+ **Purpose:** Your contribution (cite sparingly)
180
+ **Suggested citations:**
181
+ - [key6] — technique you build on
182
+
183
+ ### Section 4: Evaluation
184
+ **Purpose:** Comparison baselines
185
+ **Suggested citations:**
186
+ - [key7] — baseline method 1
187
+ - [key8] — baseline method 2
188
+
189
+ ### Section 5: Related Work
190
+ **Purpose:** Position in literature (cite heavily)
191
+ **Suggested citations:**
192
+ - [key9], [key10] — similar approaches
193
+ - [key11], [key12] — alternative methods
194
+ - [key13] — concurrent work
195
+ ```
196
+
197
+ </step>
198
+
199
+ <step name="identify_gaps">
200
+ **Identify Citation Gaps:**
201
+
202
+ Based on topic clusters and section needs, flag potential missing references:
203
+
204
+ ```markdown
205
+ ## Potential Gaps
206
+
207
+ | Section | Gap | Suggestion |
208
+ |---------|-----|------------|
209
+ | Background | No citation for [concept] | Search for foundational paper on X |
210
+ | Related Work | Missing [approach type] | Add recent work on Y |
211
+ | Evaluation | Only [N] baselines | Consider adding [method] |
212
+ ```
213
+
214
+ Use AskUserQuestion:
215
+ - header: "Gaps"
216
+ - question: "Any topics you know you need to cite but don't have in your .bib yet?"
217
+ - options:
218
+ - "No gaps" — Coverage looks good
219
+ - "Missing some" — I'll list what I need
220
+ - "Not sure" — Help me identify gaps
221
+
222
+ </step>
223
+
224
+ <step name="write_refs">
225
+ **Create REFS.md:**
226
+
227
+ Write to `.planning/sources/REFS.md`:
228
+
229
+ ```markdown
230
+ # Citation Strategy
231
+
232
+ ## Bibliography: [filename.bib]
233
+ **Total entries:** [N]
234
+ **Analysis date:** [date]
235
+
236
+ ## Temporal Distribution
237
+ [From temporal_analysis step]
238
+
239
+ ## Topic Clusters
240
+ [From cluster_topics step]
241
+
242
+ ## Seminal Works
243
+ [From identify_seminal step]
244
+
245
+ ## Citation Map by Section
246
+ [From map_to_sections step]
247
+
248
+ ## Potential Gaps
249
+ [From identify_gaps step]
250
+
251
+ ## Quick Reference
252
+
253
+ ### High-Priority Citations (use frequently)
254
+ - [key1] — [one-liner why]
255
+ - [key2] — [one-liner why]
256
+
257
+ ### Context Citations (use once for background)
258
+ - [key3] — [one-liner why]
259
+
260
+ ### Comparison Citations (evaluation section)
261
+ - [key4] — [one-liner why]
262
+
263
+ ---
264
+ *Generated by /wtfp:analyze-bib*
265
+ *Review and adjust as you write*
266
+ ```
267
+
268
+ </step>
269
+
270
+ <step name="commit">
271
+ ```bash
272
+ git add .planning/sources/REFS.md
273
+ git commit -m "$(cat <<'EOF'
274
+ refs: analyze bibliography for citation strategy
275
+
276
+ - Entries: [N] total
277
+ - Clusters: [N] topic groups
278
+ - Seminal works: [N] identified
279
+ - Citation map: all sections covered
280
+ EOF
281
+ )"
282
+ ```
283
+
284
+ </step>
285
+
286
+ <step name="done">
287
+ ```
288
+ Bibliography analyzed:
289
+
290
+ - Source: [filename.bib]
291
+ - Entries: [N]
292
+ - Topic clusters: [N]
293
+ - Seminal works: [N]
294
+ - Citation map: .planning/sources/REFS.md
295
+
296
+ ## Key Insights
297
+
298
+ [2-3 bullet observations about the bibliography]
299
+
300
+ ---
301
+
302
+ ## Next Up
303
+
304
+ **Create outline** — use citation map to inform section planning
305
+
306
+ `/wtfp:create-outline`
307
+
308
+ Or review REFS.md and adjust before proceeding.
309
+
310
+ ---
311
+ ```
312
+
313
+ </step>
314
+
315
+ </process>
316
+
317
+ <success_criteria>
318
+ - [ ] BibTeX file parsed completely
319
+ - [ ] Temporal distribution analyzed
320
+ - [ ] Topic clusters identified
321
+ - [ ] Seminal works flagged (with user confirmation)
322
+ - [ ] Citations mapped to paper sections
323
+ - [ ] Gaps identified
324
+ - [ ] REFS.md created in .planning/sources/
325
+ - [ ] Committed to git
326
+ </success_criteria>
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: wtfp:check-refs
3
+ description: BibTeX audit - verify citations are complete and consistent
4
+ argument-hint: "[bib-file]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Edit
10
+ - Glob
11
+ - Grep
12
+ ---
13
+
14
+ <objective>
15
+ Audit citations for completeness and consistency.
16
+
17
+ Purpose: Ensure all in-text citations have BibTeX entries, all BibTeX entries are cited, and references are properly formatted.
18
+ Output: Report of citation issues with fixes applied or flagged for user action.
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @~/.claude/write-the-f-paper/references/citation-formats.md
23
+ </execution_context>
24
+
25
+ <context>
26
+ BibTeX file: $ARGUMENTS (optional - auto-detects .bib files if not provided)
27
+
28
+ **Load project state:**
29
+ @.planning/STATE.md
30
+
31
+ **Scan for:**
32
+ - .bib files in project root and common locations
33
+ - Draft files with citations (\cite{}, [@...], etc.)
34
+ </context>
35
+
36
+ <process>
37
+
38
+ <step name="locate_files">
39
+ 1. Find BibTeX file(s):
40
+ ```bash
41
+ find . -name "*.bib" -type f 2>/dev/null | head -20
42
+ ```
43
+
44
+ 2. Find files with citations:
45
+ ```bash
46
+ grep -rl "\\\\cite\|\\[@\|\\[.*\\]" --include="*.tex" --include="*.md" . 2>/dev/null
47
+ ```
48
+
49
+ 3. If no .bib found, error:
50
+ ```
51
+ No .bib file found.
52
+
53
+ Create one or specify path: /wtfp:check-refs path/to/refs.bib
54
+ ```
55
+ </step>
56
+
57
+ <step name="parse_bib">
58
+ **Extract all BibTeX keys:**
59
+
60
+ ```bash
61
+ grep -E "^@[a-zA-Z]+\{" *.bib | sed 's/.*{\([^,]*\),.*/\1/'
62
+ ```
63
+
64
+ Build inventory:
65
+ - Entry key
66
+ - Entry type (@article, @inproceedings, etc.)
67
+ - Required fields present/missing
68
+ - Year
69
+ </step>
70
+
71
+ <step name="parse_citations">
72
+ **Extract all in-text citations:**
73
+
74
+ LaTeX style: `\cite{key}`, `\citep{key}`, `\citet{key}`, `\cite{key1,key2}`
75
+ Markdown style: `[@key]`, `[@key1; @key2]`
76
+
77
+ Build list of all citation keys used in text.
78
+ </step>
79
+
80
+ <step name="cross_reference">
81
+ **Compare citations vs BibTeX:**
82
+
83
+ | Check | Status |
84
+ |-------|--------|
85
+ | Cited but no BibTeX entry | ❌ MISSING |
86
+ | BibTeX entry but never cited | ⚠️ UNUSED |
87
+ | Entry missing required fields | ⚠️ INCOMPLETE |
88
+ | Duplicate keys | ❌ DUPLICATE |
89
+ | Year out of range (< 1900 or > current) | ⚠️ SUSPICIOUS |
90
+
91
+ **Required fields by type:**
92
+
93
+ | Type | Required |
94
+ |------|----------|
95
+ | @article | author, title, journal, year |
96
+ | @inproceedings | author, title, booktitle, year |
97
+ | @book | author/editor, title, publisher, year |
98
+ | @phdthesis | author, title, school, year |
99
+ | @misc | author, title, year, howpublished/url |
100
+ </step>
101
+
102
+ <step name="report">
103
+ **Present findings:**
104
+
105
+ ```
106
+ ## Citation Audit
107
+
108
+ ### ❌ Missing BibTeX Entries (cited but not in .bib)
109
+ - `smith2023` — cited in intro.tex:45
110
+ - `jones2022deep` — cited in methods.md:112
111
+
112
+ ### ⚠️ Unused References (in .bib but never cited)
113
+ - `oldpaper1999` — consider removing or citing
114
+ - `tangential2020` — consider removing or citing
115
+
116
+ ### ⚠️ Incomplete Entries (missing required fields)
117
+ - `chen2021` — missing: journal
118
+ - `kumar2022` — missing: booktitle
119
+
120
+ ### ✓ Valid Citations: [N]
121
+ ### ✓ Valid BibTeX Entries: [N]
122
+ ```
123
+ </step>
124
+
125
+ <step name="offer_fixes">
126
+ **For fixable issues:**
127
+
128
+ Use AskUserQuestion:
129
+ - header: "Fixes"
130
+ - question: "How should I handle unused references?"
131
+ - options:
132
+ - "Remove unused" — Delete entries not cited in text
133
+ - "Keep all" — Leave .bib unchanged
134
+ - "Comment out" — Keep but mark as unused
135
+
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
140
+ </step>
141
+
142
+ <step name="apply_fixes">
143
+ Apply approved fixes to .bib file.
144
+
145
+ If removing unused:
146
+ ```bash
147
+ # Backup first
148
+ cp references.bib references.bib.backup
149
+ ```
150
+
151
+ Apply edits.
152
+ </step>
153
+
154
+ <step name="commit">
155
+ ```bash
156
+ git add *.bib
157
+ git commit -m "$(cat <<'EOF'
158
+ refs: audit and clean bibliography
159
+
160
+ - Verified [N] citations against BibTeX
161
+ - Removed [N] unused entries (if applicable)
162
+ - Fixed [N] incomplete entries (if applicable)
163
+ - [N] issues flagged for manual review
164
+ EOF
165
+ )"
166
+ ```
167
+ </step>
168
+
169
+ <step name="done">
170
+ ```
171
+ Citation audit complete:
172
+
173
+ - Citations in text: [N]
174
+ - BibTeX entries: [N]
175
+ - Issues fixed: [N]
176
+ - Issues flagged: [N]
177
+
178
+ ---
179
+
180
+ ## Manual Action Required (if any)
181
+
182
+ [List of issues requiring user intervention]
183
+
184
+ ---
185
+
186
+ ## Next Up
187
+
188
+ - `/wtfp:polish-prose` — Refine writing
189
+ - `/wtfp:export-latex` — Generate LaTeX
190
+ - `/wtfp:review-section` — Get reviewer feedback
191
+
192
+ ---
193
+ ```
194
+ </step>
195
+
196
+ </process>
197
+
198
+ <success_criteria>
199
+ - All in-text citations have corresponding BibTeX entries
200
+ - All BibTeX entries have required fields
201
+ - Unused references identified (removed or flagged)
202
+ - No duplicate keys
203
+ - Changes committed to git
204
+ - User knows what manual fixes remain
205
+ </success_criteria>