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,469 @@
1
+ <purpose>
2
+ Comprehensive literature research for a section or topic before planning/writing.
3
+
4
+ Triggered by /wtfp:research-gap command when the section requires external sources,
5
+ literature positioning, or understanding of prior work.
6
+
7
+ Produces RESEARCH.md with sources, findings, and positioning that informs quality writing.
8
+ </purpose>
9
+
10
+ <when_to_use>
11
+ **This workflow is for sections/topics requiring literature grounding:**
12
+ - Related Work / Background sections
13
+ - Introduction (establishing gap, positioning)
14
+ - Discussion (interpreting findings in context)
15
+ - Any claim requiring external evidence
16
+ - Theoretical framework development
17
+ - Methodological justification
18
+
19
+ **Skip this for:**
20
+ - Describing your own methods
21
+ - Presenting your own results
22
+ - Abstract (synthesize from other sections)
23
+ - Procedural descriptions
24
+ </when_to_use>
25
+
26
+ <key_insight>
27
+ The question isn't "which papers should I cite?"
28
+
29
+ The question is: "What does the reader need to know about prior work to understand why my research matters?"
30
+
31
+ For academic writing, research answers:
32
+ - What's the current state of knowledge?
33
+ - Where are the gaps my work addresses?
34
+ - How do I position my contribution?
35
+ - What competing views exist?
36
+ - What methodology precedents support my approach?
37
+ </key_insight>
38
+
39
+ <process>
40
+
41
+ <step name="validate_topic" priority="first">
42
+ Topic: $ARGUMENTS (required)
43
+
44
+ **If argument is a section number:**
45
+ Validate section exists in roadmap and extract its focus.
46
+
47
+ ```bash
48
+ if [ -f .planning/ROADMAP.md ]; then
49
+ grep -A5 "Section ${SECTION}:" .planning/ROADMAP.md
50
+ fi
51
+ ```
52
+
53
+ **If argument is a topic string:**
54
+ Accept directly and proceed to check_existing.
55
+
56
+ **If no argument:**
57
+ ```
58
+ Error: Topic or section number required.
59
+
60
+ Usage: /wtfp:research-gap [section-number or topic]
61
+ Examples:
62
+ /wtfp:research-gap 3
63
+ /wtfp:research-gap "autonomous vehicle ethics"
64
+ ```
65
+
66
+ Exit workflow.
67
+ </step>
68
+
69
+ <step name="check_existing">
70
+ Check if RESEARCH.md already exists:
71
+
72
+ ```bash
73
+ ls .planning/sections/${SECTION}-*/RESEARCH.md 2>/dev/null
74
+ ls .planning/sections/${SECTION}-*/${SECTION}-RESEARCH.md 2>/dev/null
75
+ ```
76
+
77
+ **If exists:**
78
+ ```
79
+ Research already exists: [path to RESEARCH.md]
80
+
81
+ What's next?
82
+ 1. Update research - Refresh with new findings
83
+ 2. View existing - Show me the current research
84
+ 3. Skip - Use existing research as-is
85
+ ```
86
+
87
+ Wait for user response.
88
+
89
+ **If doesn't exist:**
90
+ Continue to load_context.
91
+ </step>
92
+
93
+ <step name="load_context">
94
+ Load available context to inform research direction:
95
+
96
+ **1. Project context:**
97
+ ```bash
98
+ cat .planning/PROJECT.md 2>/dev/null | head -50
99
+ ```
100
+
101
+ **2. Argument map (what claims need support):**
102
+ ```bash
103
+ cat .planning/structure/argument-map.md 2>/dev/null
104
+ ```
105
+
106
+ **3. Existing literature index:**
107
+ ```bash
108
+ cat .planning/sources/literature.md 2>/dev/null
109
+ ```
110
+
111
+ **4. Section context (if exists from /wtfp:discuss-section):**
112
+ ```bash
113
+ cat .planning/sections/${SECTION}-*/${SECTION}-CONTEXT.md 2>/dev/null
114
+ ```
115
+
116
+ If CONTEXT.md exists, use it to understand:
117
+ - User's specific goals for this section
118
+ - What claims need supporting
119
+ - Any specific sources they want included
120
+
121
+ Present what was found:
122
+ ```
123
+ Research context for: ${TOPIC}
124
+
125
+ Project thesis: ${THESIS}
126
+
127
+ [If argument-map exists:]
128
+ Claims needing support: [list relevant claims]
129
+
130
+ [If existing literature:]
131
+ Already indexed: [N] sources
132
+
133
+ [If CONTEXT.md exists:]
134
+ Section context available - will incorporate user direction.
135
+
136
+ Proceeding with literature research...
137
+ ```
138
+ </step>
139
+
140
+ <step name="identify_research_needs">
141
+ Analyze what needs researching for this topic/section.
142
+
143
+ **Ask: "What knowledge does the reader need from prior work?"**
144
+
145
+ Categories to consider:
146
+
147
+ **1. Foundational Work:**
148
+ - Seminal papers establishing the field
149
+ - Key theoretical frameworks
150
+ - Widely-cited methodology papers
151
+
152
+ **2. Recent Advances:**
153
+ - Work from last 3-5 years
154
+ - Current state of the art
155
+ - Emerging trends
156
+
157
+ **3. Competing Approaches:**
158
+ - Alternative methods to yours
159
+ - Contrasting theoretical positions
160
+ - Why your approach differs
161
+
162
+ **4. Gap Evidence:**
163
+ - What hasn't been studied
164
+ - Limitations of existing work
165
+ - Your unique contribution positioning
166
+
167
+ **5. Methodological Precedent:**
168
+ - Similar methods in your field
169
+ - Validation of your approach
170
+ - Statistical/analytical justification
171
+
172
+ Present research scope:
173
+ ```
174
+ Research scope identified:
175
+
176
+ 1. Foundational: [e.g., "Core AI safety papers, alignment frameworks"]
177
+ 2. Recent: [e.g., "2022-2024 work on RLHF and constitutional AI"]
178
+ 3. Competing: [e.g., "Capability-focused vs safety-focused approaches"]
179
+ 4. Gap: [e.g., "Limited work on long-term value alignment"]
180
+ 5. Methods: [e.g., "Interpretability evaluation frameworks"]
181
+
182
+ Proceeding with systematic research...
183
+ ```
184
+ </step>
185
+
186
+ <step name="execute_research">
187
+ Execute research systematically.
188
+
189
+ **CRITICAL: Source hierarchy**
190
+
191
+ 1. **User's own sources first:**
192
+ - Check .planning/sources/literature.md
193
+ - Check .planning/sources/prior-drafts.md for cited works
194
+ - User may have PDFs or notes to reference
195
+
196
+ 2. **Database search (conceptual):**
197
+ - Google Scholar for academic sources
198
+ - Field-specific databases (PubMed, IEEE, ACL, etc.)
199
+ - Preprint servers (arXiv, SSRN, bioRxiv)
200
+
201
+ 3. **WebSearch for recent/emerging work:**
202
+ ```
203
+ "[topic] research [current_year]"
204
+ "[topic] systematic review"
205
+ "[topic] meta-analysis"
206
+ "[author name] [topic]" for known experts
207
+ ```
208
+
209
+ <research_protocol>
210
+
211
+ **For each research category:**
212
+
213
+ **1. Identify key sources:**
214
+ - 3-5 foundational/seminal works
215
+ - 5-10 recent works (last 5 years prioritized)
216
+ - 2-3 competing perspectives
217
+ - As many as needed for gap documentation
218
+
219
+ **2. Extract for each source:**
220
+ - Full citation (authors, year, title, venue)
221
+ - Key findings/claims relevant to your work
222
+ - How it relates to your research
223
+ - Where it might be cited in your document
224
+
225
+ **3. Synthesize themes:**
226
+ - Group sources by argument they support
227
+ - Identify consensus vs controversy
228
+ - Note methodological trends
229
+ - Document the gap your work addresses
230
+
231
+ **4. Cross-verification:**
232
+ - Confirm sources are legitimate academic work
233
+ - Check citation counts for influence
234
+ - Verify recency and relevance
235
+ - Mark confidence level
236
+
237
+ </research_protocol>
238
+
239
+ Track findings as you go:
240
+
241
+ **Foundational Sources:**
242
+ - [Citation 1]: [key claim, relevance, where to cite]
243
+ - [Citation 2]: [key claim, relevance, where to cite]
244
+
245
+ **Recent Advances:**
246
+ - [Citation 3]: [key claim, relevance, where to cite]
247
+
248
+ **Competing Views:**
249
+ - [Citation 4]: [their position, how we differ]
250
+
251
+ **Gap Evidence:**
252
+ - [What hasn't been done, citing sources that show the gap]
253
+
254
+ **Methodological Support:**
255
+ - [Citation 5]: [precedent for our method]
256
+ </step>
257
+
258
+ <step name="quality_check">
259
+ Before creating RESEARCH.md, verify research quality:
260
+
261
+ **Coverage checklist:**
262
+ - [ ] Foundational work represented (seminal papers)
263
+ - [ ] Recent work included (last 3-5 years)
264
+ - [ ] Competing perspectives acknowledged
265
+ - [ ] Gap clearly documented
266
+ - [ ] Methodological precedent if needed
267
+ - [ ] Sources properly attributed
268
+
269
+ **Balance checklist:**
270
+ - [ ] Not over-relying on single authors/groups
271
+ - [ ] Multiple perspectives represented fairly
272
+ - [ ] Both supporting and challenging views included
273
+ - [ ] Self-citation kept proportional
274
+
275
+ **Quality checklist:**
276
+ - [ ] Sources are peer-reviewed or reputable
277
+ - [ ] Citations are complete and accurate
278
+ - [ ] Recent sources are actually recent
279
+ - [ ] Claims attributed correctly
280
+ </step>
281
+
282
+ <step name="write_research">
283
+ Create RESEARCH.md using accumulated findings.
284
+
285
+ **File location:** `.planning/sections/${SECTION}-${SLUG}/${SECTION}-RESEARCH.md`
286
+
287
+ **If section directory doesn't exist:**
288
+ Create it: `.planning/sections/${SECTION}-${SLUG}/`
289
+
290
+ **Structure:**
291
+
292
+ ```markdown
293
+ # Literature Research: [Topic/Section]
294
+
295
+ ## Research Summary
296
+
297
+ **Focus:** [What was researched]
298
+ **Scope:** [Foundational, recent, competing, gap, methods]
299
+ **Sources identified:** [N] relevant sources
300
+
301
+ ## Key Findings
302
+
303
+ ### Foundational Work
304
+
305
+ [Author (Year)] - [Title]
306
+ - **Key claim:** [What they established]
307
+ - **Relevance:** [How it relates to our work]
308
+ - **Cite in:** [Which section(s)]
309
+
310
+ [Continue for each foundational source]
311
+
312
+ ### Recent Advances (2020-present)
313
+
314
+ [Continue same format]
315
+
316
+ ### Competing Perspectives
317
+
318
+ [Author (Year)] argues [position]
319
+ - **How we differ:** [Our contrasting position]
320
+ - **Acknowledgment:** [How to fairly represent their view]
321
+
322
+ ### The Gap
323
+
324
+ Based on literature review:
325
+ - [Gap 1]: [What hasn't been addressed]
326
+ - [Gap 2]: [Limitation in current approaches]
327
+ - [Gap 3]: [Our unique contribution]
328
+
329
+ Supporting evidence for gap:
330
+ - [Author (Year)] notes "[quote about limitation]"
331
+ - [Author (Year)] calls for "[quote about future work]"
332
+
333
+ ### Methodological Precedent
334
+
335
+ [If applicable - sources supporting your methods]
336
+
337
+ ## Synthesis for Writing
338
+
339
+ ### For Introduction
340
+ Use these sources to establish:
341
+ - Context: [sources]
342
+ - Gap: [sources]
343
+ - Significance: [sources]
344
+
345
+ ### For Related Work
346
+ Organize by theme:
347
+ - Theme 1: [sources]
348
+ - Theme 2: [sources]
349
+ - Positioning: [sources]
350
+
351
+ ### For Discussion
352
+ Compare findings to:
353
+ - [sources for interpretation]
354
+ - [sources for implications]
355
+
356
+ ## Full Bibliography
357
+
358
+ [Complete citations in target format]
359
+
360
+ ## Confidence Assessment
361
+
362
+ **Overall confidence:** [HIGH/MEDIUM/LOW]
363
+ **Coverage:** [Comprehensive/Adequate/Partial]
364
+ **Recency:** [Current/Mostly current/Dated areas]
365
+ **Gaps in research:** [Any areas needing more sources]
366
+ ```
367
+
368
+ Write file.
369
+ </step>
370
+
371
+ <step name="update_literature_index">
372
+ If .planning/sources/literature.md exists, update it with new sources:
373
+
374
+ ```bash
375
+ cat .planning/sources/literature.md 2>/dev/null
376
+ ```
377
+
378
+ Add new sources to the index:
379
+ - Core References (cite in paper)
380
+ - Background Reading (inform writing)
381
+ - To Find (if any gaps identified)
382
+ </step>
383
+
384
+ <step name="confirm_creation">
385
+ Present RESEARCH.md summary to user:
386
+
387
+ ```
388
+ Created: .planning/sections/${SECTION}-${SLUG}/${SECTION}-RESEARCH.md
389
+
390
+ ## Research Summary
391
+
392
+ **Topic:** [what was researched]
393
+
394
+ **Key Sources:**
395
+ - Foundational: [N] sources
396
+ - Recent: [N] sources
397
+ - Competing: [N] perspectives
398
+ - Gap documented with [N] supporting citations
399
+
400
+ **Synthesis ready for:**
401
+ - Introduction (gap establishment)
402
+ - Related Work (thematic organization)
403
+ - Discussion (interpretation context)
404
+
405
+ **Confidence:** [HIGH/MEDIUM/LOW]
406
+
407
+ What's next?
408
+ 1. Plan this section (/wtfp:plan-section ${SECTION}) - RESEARCH.md will be loaded automatically
409
+ 2. Dig deeper - Research specific areas more thoroughly
410
+ 3. Review full RESEARCH.md
411
+ 4. Done for now
412
+ ```
413
+ </step>
414
+
415
+ <step name="git_commit">
416
+ Commit section research:
417
+
418
+ ```bash
419
+ git add .planning/sections/${SECTION}-${SLUG}/${SECTION}-RESEARCH.md
420
+ git add .planning/sources/literature.md 2>/dev/null
421
+ git commit -m "$(cat <<'EOF'
422
+ docs(${SECTION}): complete literature research
423
+
424
+ Section ${SECTION}: ${SECTION_NAME}
425
+ - [N] key sources identified
426
+ - Gap documented
427
+ - Synthesis prepared for writing
428
+ EOF
429
+ )"
430
+ ```
431
+
432
+ Confirm: "Committed: docs(${SECTION}): complete literature research"
433
+ </step>
434
+
435
+ </process>
436
+
437
+ <success_criteria>
438
+ - [ ] Topic/section validated
439
+ - [ ] Research scope identified (foundational, recent, competing, gap, methods)
440
+ - [ ] Sources systematically gathered
441
+ - [ ] User's existing sources checked first
442
+ - [ ] Quality checklist completed
443
+ - [ ] RESEARCH.md created with:
444
+ - [ ] Key sources with relevance noted
445
+ - [ ] Gap clearly documented
446
+ - [ ] Synthesis organized by section need
447
+ - [ ] Full bibliography
448
+ - [ ] Confidence assessment
449
+ - [ ] Literature index updated if exists
450
+ - [ ] RESEARCH.md committed to git
451
+ - [ ] User knows next steps (plan section)
452
+ </success_criteria>
453
+
454
+ <integration_with_planning>
455
+ When /wtfp:plan-section runs after research:
456
+
457
+ 1. plan-section detects RESEARCH.md exists in section directory
458
+ 2. RESEARCH.md loaded as @context reference
459
+ 3. "Key sources" inform citation placement in tasks
460
+ 4. "Gap" informs introduction framing
461
+ 5. "Synthesis" informs section structure
462
+ 6. "Competing perspectives" ensure fair representation
463
+
464
+ This produces higher quality plans because Claude knows:
465
+ - What sources to cite where
466
+ - How to position the argument
467
+ - What prior work to acknowledge
468
+ - How to frame the contribution
469
+ </integration_with_planning>
@@ -0,0 +1,119 @@
1
+ <purpose>
2
+ Comprehensive literature research for a section or topic before planning/writing.
3
+
4
+ Triggered by /wtfp:research-gap command when the section requires external sources,
5
+ literature positioning, or understanding of prior work.
6
+
7
+ Produces RESEARCH.md with sources, findings, and positioning that informs quality writing.
8
+ </purpose>
9
+
10
+ <when_to_use>
11
+ **This workflow is for sections/topics requiring literature grounding:**
12
+ - Related Work / Background sections
13
+ - Introduction (establishing gap, positioning)
14
+ - Discussion (interpreting findings in context)
15
+ - Any claim requiring external evidence
16
+ - Theoretical framework development
17
+ - Methodological justification
18
+
19
+ **Skip this for:**
20
+ - Describing your own methods
21
+ - Presenting your own results
22
+ - Abstract (synthesize from other sections)
23
+ - Procedural descriptions
24
+ </when_to_use>
25
+
26
+ <key_insight>
27
+ The question isn't "which papers should I cite?"
28
+
29
+ The question is: "What does the reader need to know about prior work to understand why my research matters?"
30
+
31
+ For academic writing, research answers:
32
+ - What's the current state of knowledge?
33
+ - Where are the gaps my work addresses?
34
+ - How do I position my contribution?
35
+ - What competing views exist?
36
+ - What methodology precedents support my approach?
37
+ </key_insight>
38
+
39
+ <process>
40
+
41
+ [step:validate_topic p=1]
42
+ RUN: if [ -f .planning/ROADMAP.md ]; then
43
+ IF argument_is_a_section_number → Validate section exists in roadmap and extract ...
44
+ IF argument_is_a_topic_string → Accept directly and proceed to check_existing.
45
+ IF no_argument → ```
46
+ [/step]
47
+
48
+ [step:check_existing]
49
+ RUN: ls .planning/sections/${SECTION}-*/RESEARCH.md 2>/dev/null
50
+ IF exists → ```
51
+ IF doesnt_exist → Continue to load_context.
52
+ [/step]
53
+
54
+ [step:load_context]
55
+ RUN: cat .planning/PROJECT.md 2>/dev/null | head -50
56
+ RUN: cat .planning/structure/argument-map.md 2>/dev/null
57
+ RUN: cat .planning/sources/literature.md 2>/dev/null
58
+ RUN: cat .planning/sections/${SECTION}-*/${SECTION}-CONTEXT.md 2>/dev/null
59
+ [/step]
60
+
61
+ [step:identify_research_needs]
62
+ [/step]
63
+
64
+ [step:execute_research]
65
+ [/step]
66
+
67
+ [step:quality_check]
68
+ [/step]
69
+
70
+ [step:write_research]
71
+ IF section_directory_doesnt_exist → Create it: `.planning/sections/${SECTION}-${SLU...
72
+ [/step]
73
+
74
+ [step:update_literature_index]
75
+ RUN: cat .planning/sources/literature.md 2>/dev/null
76
+ [/step]
77
+
78
+ [step:confirm_creation]
79
+ [/step]
80
+
81
+ [step:git_commit]
82
+ RUN: git add .planning/sections/${SECTION}-${SLUG}/${SECTION}-RESEARCH.md
83
+ [/step]
84
+
85
+ </process>
86
+
87
+ <success_criteria>
88
+ - [ ] Topic/section validated
89
+ - [ ] Research scope identified (foundational, recent, competing, gap, methods)
90
+ - [ ] Sources systematically gathered
91
+ - [ ] User's existing sources checked first
92
+ - [ ] Quality checklist completed
93
+ - [ ] RESEARCH.md created with:
94
+ - [ ] Key sources with relevance noted
95
+ - [ ] Gap clearly documented
96
+ - [ ] Synthesis organized by section need
97
+ - [ ] Full bibliography
98
+ - [ ] Confidence assessment
99
+ - [ ] Literature index updated if exists
100
+ - [ ] RESEARCH.md committed to git
101
+ - [ ] User knows next steps (plan section)
102
+ </success_criteria>
103
+
104
+ <integration_with_planning>
105
+ When /wtfp:plan-section runs after research:
106
+
107
+ 1. plan-section detects RESEARCH.md exists in section directory
108
+ 2. RESEARCH.md loaded as @context reference
109
+ 3. "Key sources" inform citation placement in tasks
110
+ 4. "Gap" informs introduction framing
111
+ 5. "Synthesis" informs section structure
112
+ 6. "Competing perspectives" ensure fair representation
113
+
114
+ This produces higher quality plans because Claude knows:
115
+ - What sources to cite where
116
+ - How to position the argument
117
+ - What prior work to acknowledge
118
+ - How to frame the contribution
119
+ </integration_with_planning>