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,409 @@
1
+ <decimal_section_numbering>
2
+ Decimal sections enable urgent content insertion without renumbering:
3
+
4
+ - Integer sections (1, 2, 3) = planned document structure
5
+ - Decimal sections (2.1, 2.2) = urgent insertions between integers
6
+
7
+ **Rules:**
8
+ - Decimals between consecutive integers (2.1 between 2 and 3)
9
+ - Filesystem sorting works automatically (2 < 2.1 < 2.2 < 3)
10
+ - Directory format: `02.1-description/`, Plan format: `02.1-01-PLAN.md`
11
+
12
+ **Validation:** Integer X must exist and be complete, X+1 must exist, decimal X.Y must not exist, Y >= 1
13
+ </decimal_section_numbering>
14
+
15
+ <required_reading>
16
+ **Read these files NOW:**
17
+
18
+ 1. ~/.claude/write-the-f-paper/templates/section-prompt.md
19
+ 2. ~/.claude/write-the-f-paper/references/plan-format.md
20
+ 3. ~/.claude/write-the-f-paper/references/verification-layers.md
21
+ 4. .planning/ROADMAP.md
22
+ 5. .planning/PROJECT.md
23
+
24
+ **Load structure files:**
25
+ - .planning/structure/argument-map.md
26
+ - .planning/structure/outline.md
27
+ - .planning/structure/narrative-arc.md
28
+ </required_reading>
29
+
30
+ <purpose>
31
+ Create an executable section prompt (PLAN.md). PLAN.md IS the prompt that Claude executes - not a document that gets transformed.
32
+ </purpose>
33
+
34
+ <planning_principles>
35
+ **Argument-first:** Every paragraph must serve the core argument. Plan prose that advances the thesis, not filler.
36
+
37
+ **Evidence-grounded:** Plan where citations go before writing. Claims need sources identified.
38
+
39
+ **Reader-aware:** Plan for the target audience. Technical depth, assumed knowledge, explanation level.
40
+ </planning_principles>
41
+
42
+ <process>
43
+
44
+ <step name="load_project_state" priority="first">
45
+ Read `.planning/STATE.md` and parse:
46
+ - Current position (which section we're planning)
47
+ - Accumulated decisions (constraints on this section)
48
+ - Open questions (things this section may need to address)
49
+ - Argument strength (how solid is the overall thesis)
50
+
51
+ If STATE.md missing but .planning/ exists, offer to reconstruct or continue without.
52
+ </step>
53
+
54
+ <step name="load_structure_context">
55
+ Check for structure documents:
56
+
57
+ ```bash
58
+ ls .planning/structure/*.md 2>/dev/null
59
+ ```
60
+
61
+ **If .planning/structure/ exists:** Load relevant documents:
62
+
63
+ | Section Type | Load These |
64
+ |--------------|------------|
65
+ | Introduction | argument-map.md, narrative-arc.md |
66
+ | Methods | argument-map.md (what claims need methodological support) |
67
+ | Results | argument-map.md (which claims get supported here) |
68
+ | Discussion | argument-map.md, narrative-arc.md |
69
+ | Related Work | argument-map.md (positioning), literature.md |
70
+ | Abstract | All (summary of everything) |
71
+
72
+ Track extracted context for PLAN.md context section.
73
+ </step>
74
+
75
+ <step name="identify_section">
76
+ Check roadmap and existing sections:
77
+
78
+ ```bash
79
+ cat .planning/ROADMAP.md
80
+ ls .planning/sections/
81
+ ```
82
+
83
+ If multiple sections available, ask which one to plan. If obvious (first incomplete section), proceed.
84
+
85
+ **Section number parsing:** Regex `^(\d+)(?:\.(\d+))?$` - Group 1: integer, Group 2: decimal (optional)
86
+
87
+ **If decimal section:** Validate integer X exists and is complete, X+1 exists in roadmap, decimal X.Y doesn't exist, Y >= 1.
88
+
89
+ Read any existing PLAN.md or RESEARCH.md in the section directory.
90
+ </step>
91
+
92
+ <step name="mandatory_literature_check">
93
+ **Literature check is MANDATORY for sections flagged with Research: Likely.**
94
+
95
+ <literature_decision>
96
+ **Level 0 - Skip** (internal content only)
97
+ - Section is about own methods/results
98
+ - No claims requiring external evidence
99
+ - Examples: Describing own data collection, presenting own findings
100
+
101
+ **Level 1 - Quick Verification** (2-5 min)
102
+ - Single source to verify
103
+ - Confirming a specific citation
104
+ - Action: Quick check, no RESEARCH.md needed
105
+
106
+ **Level 2 - Standard Research** (15-30 min)
107
+ - Need to cite multiple sources
108
+ - Positioning against prior work
109
+ - Action: Route to workflows/research-gap.md, produces RESEARCH.md
110
+
111
+ **Level 3 - Deep Literature Review** (1+ hour)
112
+ - Core literature review section
113
+ - Establishing theoretical framework
114
+ - Comprehensive gap analysis
115
+ - Action: Route to workflows/research-gap.md depth=deep, full RESEARCH.md
116
+ </literature_decision>
117
+
118
+ If roadmap flagged `Research: Likely`, Level 0 (skip) is not available.
119
+ </step>
120
+
121
+ <step name="read_prior_sections">
122
+ **Intelligent context assembly from completed sections:**
123
+
124
+ **1. Scan all summary frontmatter:**
125
+
126
+ ```bash
127
+ for f in .planning/sections/*/*-SUMMARY.md; do
128
+ sed -n '1,/^---$/p; /^---$/q' "$f" | head -30
129
+ done
130
+ ```
131
+
132
+ Parse to extract: section, subsection, key-claims, evidence-used, decisions
133
+
134
+ **2. Build dependency context for current section:**
135
+
136
+ - **Check logical flow:** What claims from prior sections does this section build on?
137
+ - **Check evidence used:** What sources were already cited?
138
+ - **Check decisions:** What stylistic or structural decisions constrain this section?
139
+
140
+ **3. Select relevant summaries:**
141
+
142
+ Auto-select sections that match ANY of:
143
+ - Current section directly follows (immediate prior)
144
+ - Shares argumentative thread (part of same logical chain)
145
+ - Explicitly mentioned in STATE.md as affecting current section
146
+
147
+ **4. Extract context from summaries:**
148
+
149
+ From selected sections, extract:
150
+ - **Claims established:** What's been argued so far
151
+ - **Evidence cited:** Sources already used (avoid over-citation)
152
+ - **Patterns established:** Writing style, terminology decisions
153
+ - **Decisions:** Key choices from prior sections
154
+
155
+ **Answer before proceeding:**
156
+ - Q1: What claims from previous sections does this section build on?
157
+ - Q2: What sources have already been cited that might be relevant?
158
+ - Q3: What writing patterns should be maintained?
159
+ - Q4: Given all context, does the roadmap's section goal still make sense?
160
+ </step>
161
+
162
+ <step name="gather_section_context">
163
+ Understand:
164
+ - Section goal (from roadmap)
165
+ - Word budget (from roadmap)
166
+ - What exists already (prior drafts in sources/prior-drafts.md?)
167
+ - Dependencies met (previous sections complete?)
168
+ - Any {section}-RESEARCH.md (from /wtfp:research-gap)
169
+ - Any {section}-CONTEXT.md (from /wtfp:discuss-section)
170
+
171
+ ```bash
172
+ # Check for literature research (from /wtfp:research-gap)
173
+ cat .planning/sections/XX-name/${SECTION}-RESEARCH.md 2>/dev/null
174
+
175
+ # Check for section context (from /wtfp:discuss-section)
176
+ cat .planning/sections/XX-name/${SECTION}-CONTEXT.md 2>/dev/null
177
+
178
+ # Check for prior drafts
179
+ cat .planning/sources/prior-drafts.md 2>/dev/null
180
+ ```
181
+
182
+ **If RESEARCH.md exists:** Use sources (cite these), key_findings (incorporate), gaps (address or note), positioning (how we differ from prior work).
183
+
184
+ **If CONTEXT.md exists:** Honor vision, prioritize essential content, respect boundaries, incorporate user specifics.
185
+
186
+ **If neither exist:** Suggest /wtfp:research-gap for literature-heavy sections, /wtfp:discuss-section for simpler sections.
187
+ </step>
188
+
189
+ <step name="break_into_tasks">
190
+ Decompose section into writing tasks.
191
+
192
+ **Writing tasks need:**
193
+ - **Type**: auto, checkpoint:human-verify, checkpoint:decision
194
+ - **Task name**: Clear, action-oriented
195
+ - **Paragraphs/Subsections**: Which part of section
196
+ - **Action**: Specific writing action (draft, revise, cite, strengthen)
197
+ - **Mode**: co-author (Claude drafts), scaffold (Claude outlines), reviewer (Claude critiques)
198
+ - **Verify**: How to prove it's done well
199
+ - **Done**: Acceptance criteria
200
+
201
+ **Task types by section:**
202
+
203
+ | Section | Typical Tasks |
204
+ |---------|--------------|
205
+ | Abstract | Draft complete abstract, verify all elements present |
206
+ | Introduction | Hook paragraph, context paragraphs, gap statement, thesis, roadmap |
207
+ | Methods | Protocol description, measures, analysis approach |
208
+ | Results | Finding 1 narrative, Finding 2 narrative, supporting analyses |
209
+ | Discussion | Summary, interpretation, limitations, future work, conclusion |
210
+ | Related Work | Theme 1 synthesis, Theme 2 synthesis, positioning statement |
211
+
212
+ **Mode selection per task:**
213
+ - Procedural content (methods, data description) → co-author
214
+ - Argument-heavy content (discussion, intro) → scaffold or reviewer
215
+ - Personal voice required (abstract conclusion, thesis) → scaffold with user writing
216
+
217
+ **Checkpoints:** Visual/prose verification → checkpoint:human-verify. Voice/framing choices → checkpoint:decision.
218
+ </step>
219
+
220
+ <step name="estimate_scope">
221
+ After tasks, assess against quality needs.
222
+
223
+ **Check depth setting:**
224
+ ```bash
225
+ cat .planning/config.json 2>/dev/null | grep depth
226
+ ```
227
+
228
+ <depth_aware_splitting>
229
+ **Depth controls thoroughness, not artificial padding.**
230
+
231
+ | Depth | Typical Plans/Section | Tasks/Plan |
232
+ |-------|----------------------|------------|
233
+ | Quick | 1-2 | 2-3 |
234
+ | Standard | 2-4 | 2-3 |
235
+ | Comprehensive | 3-6 | 2-3 |
236
+
237
+ **Key principle:** Derive plans from actual writing needs. Depth determines how carefully you break down complex sections.
238
+
239
+ - Comprehensive Discussion = 4 plans (interpretation, limitations, future work, conclusion)
240
+ - Comprehensive Abstract = 1 plan (it's just one paragraph)
241
+
242
+ For comprehensive depth:
243
+ - Create MORE plans for complex sections, not longer ones
244
+ - Each plan stays focused: 2-3 tasks, single concern
245
+
246
+ For quick depth:
247
+ - Combine aggressively into fewer plans
248
+ - Focus on critical argument path
249
+ </depth_aware_splitting>
250
+
251
+ **ALWAYS split if:** >3 tasks, multiple argumentative threads, complex literature integration.
252
+
253
+ **Each plan must be:** 2-3 tasks max, focused on one aspect, independently verifiable.
254
+ </step>
255
+
256
+ <step name="confirm_breakdown">
257
+ <if mode="yolo">
258
+ Auto-approve and proceed to write_section_prompt.
259
+ </if>
260
+
261
+ <if mode="interactive">
262
+ Present breakdown inline:
263
+
264
+ ```
265
+ Section [X] breakdown:
266
+
267
+ ### Tasks ({section}-01-PLAN.md)
268
+ 1. [Task] - [brief] [type] [mode]
269
+ 2. [Task] - [brief] [type] [mode]
270
+
271
+ Does this look right? (yes / adjust / start over)
272
+ ```
273
+
274
+ For multiple plans, show each plan with its tasks.
275
+
276
+ Wait for confirmation. If "adjust": revise. If "start over": return to gather_section_context.
277
+ </if>
278
+ </step>
279
+
280
+ <step name="write_section_prompt">
281
+ Use template from `~/.claude/write-the-f-paper/templates/section-prompt.md`.
282
+
283
+ **Single plan:** Write to `.planning/sections/XX-name/{section}-01-PLAN.md`
284
+
285
+ **Multiple plans:** Write separate files ({section}-01-PLAN.md, {section}-02-PLAN.md, etc.)
286
+
287
+ Each plan follows template structure with:
288
+ - Frontmatter (section, plan, type, mode)
289
+ - Objective (plan-specific goal, word target, output)
290
+ - Execution context (write-section.md, summary template, verification-layers.md)
291
+ - Context (@references to PROJECT, ROADMAP, STATE, structure docs, RESEARCH/CONTEXT if exist, prior summaries, sources)
292
+ - Tasks (XML format with types and modes)
293
+ - Verification (citation check, coherence check, rubric check)
294
+ - Success criteria, Output specification
295
+
296
+ **Context section population:**
297
+
298
+ ```markdown
299
+ <context>
300
+ @.planning/PROJECT.md
301
+ @.planning/ROADMAP.md
302
+ @.planning/STATE.md
303
+
304
+ # Structure documents:
305
+ @.planning/structure/argument-map.md
306
+ @.planning/structure/narrative-arc.md
307
+
308
+ # Auto-selected based on logical flow:
309
+ @.planning/sections/XX-name/YY-ZZ-SUMMARY.md
310
+
311
+ # Key sources (relevant to this section):
312
+ @.planning/sources/literature.md
313
+ @.planning/sources/data.md
314
+
315
+ **Argument thread:** [what this section must establish]
316
+ **Prior claims to build on:** [from frontmatter analysis]
317
+ **Sources to cite:** [identified from RESEARCH.md or literature.md]
318
+
319
+ **Decisions constraining this section:** [If any from STATE.md]
320
+ </context>
321
+ ```
322
+ </step>
323
+
324
+ <step name="git_commit">
325
+ Commit section plan(s):
326
+
327
+ ```bash
328
+ # Stage all PLAN.md files for this section
329
+ git add .planning/sections/${SECTION}-*/${SECTION}-*-PLAN.md
330
+
331
+ # Also stage RESEARCH.md if it was created during mandatory_literature_check
332
+ git add .planning/sections/${SECTION}-*/RESEARCH.md 2>/dev/null
333
+
334
+ git commit -m "$(cat <<'EOF'
335
+ docs(${SECTION}): create section plan
336
+
337
+ Section ${SECTION}: ${SECTION_NAME}
338
+ - [N] plan(s) created
339
+ - [X] total tasks defined
340
+ - Ready for writing
341
+ EOF
342
+ )"
343
+ ```
344
+
345
+ Confirm: "Committed: docs(${SECTION}): create section plan"
346
+ </step>
347
+
348
+ <step name="offer_next">
349
+ ```
350
+ Section plan created: .planning/sections/XX-name/{section}-01-PLAN.md
351
+ [X] tasks defined.
352
+
353
+ ---
354
+
355
+ ## Next Up
356
+
357
+ **{section}-01: [Plan Name]** - [objective summary]
358
+
359
+ `/wtfp:write-section .planning/sections/XX-name/{section}-01-PLAN.md`
360
+
361
+ <sub>`/clear` first - fresh context window</sub>
362
+
363
+ ---
364
+
365
+ **Also available:**
366
+ - Review/adjust tasks before writing
367
+ [If multiple plans: - View all plans: `ls .planning/sections/XX-name/*-PLAN.md`]
368
+
369
+ ---
370
+ ```
371
+ </step>
372
+
373
+ </process>
374
+
375
+ <task_quality>
376
+ **Good tasks:** Specific paragraphs, clear actions, verifiable output
377
+ - "Draft hook paragraph establishing the research gap in autonomous systems"
378
+ - "Write methods subsection on data collection protocol, ~150 words"
379
+ - "Synthesize Smith2023 and Jones2024 findings on intervention efficacy"
380
+
381
+ **Bad tasks:** Vague, not actionable
382
+ - "Write introduction" / "Add citations" / "Make it better"
383
+
384
+ If you can't specify Paragraphs + Action + Mode + Verify + Done, the task is too vague.
385
+ </task_quality>
386
+
387
+ <anti_patterns>
388
+ - No hour estimates
389
+ - No "perfect prose" expectations (first drafts are drafts)
390
+ - No style committee approvals
391
+ - No sub-sub-sub tasks
392
+ Tasks are instructions for Claude writing, not editorial board requirements.
393
+ </anti_patterns>
394
+
395
+ <success_criteria>
396
+ Section planning complete when:
397
+ - [ ] STATE.md read, project context absorbed
398
+ - [ ] Mandatory literature check completed (Level 0-3)
399
+ - [ ] Prior sections, sources, structure synthesized
400
+ - [ ] PLAN file(s) exist with XML structure
401
+ - [ ] Each plan: Objective, context, tasks, verification, success criteria, output
402
+ - [ ] @context references included (STATE, RESEARCH if exist, relevant summaries)
403
+ - [ ] Each plan: 2-3 tasks (~focused scope)
404
+ - [ ] Each task: Type, Mode, Paragraphs (if applicable), Action, Verify, Done
405
+ - [ ] Checkpoints properly structured
406
+ - [ ] If RESEARCH.md exists: sources cited in plan, positioning clear
407
+ - [ ] PLAN file(s) committed to git
408
+ - [ ] User knows next steps
409
+ </success_criteria>
@@ -0,0 +1,236 @@
1
+ <decimal_section_numbering>
2
+ integers (1,2,3) = planned structure
3
+ decimals (2.1,2.2) = urgent insertions between integers
4
+ Dir format: 02.1-description/, Plan format: 02.1-01-PLAN.md
5
+ Validation: X exists+complete, X+1 exists, X.Y doesn't exist, Y >= 1
6
+ </decimal_section_numbering>
7
+
8
+ <required_reading>
9
+ READ: ~/.claude/write-the-f-paper/templates/section-prompt.md
10
+ READ: ~/.claude/write-the-f-paper/references/plan-format.md
11
+ READ: ~/.claude/write-the-f-paper/references/verification-layers.md
12
+ READ: .planning/ROADMAP.md
13
+ READ: .planning/PROJECT.md
14
+ LOAD: .planning/structure/argument-map.md, outline.md, narrative-arc.md
15
+ </required_reading>
16
+
17
+ <purpose>
18
+ Create executable section prompt (PLAN.md). PLAN.md IS the prompt Claude executes - not a doc that gets transformed.
19
+ </purpose>
20
+
21
+ <planning_principles>
22
+ Argument-first: Every paragraph serves core argument. Plan prose that advances thesis, not filler.
23
+ Evidence-grounded: Plan where citations go before writing. Claims need sources identified.
24
+ Reader-aware: Plan for target audience. Technical depth, assumed knowledge, explanation level.
25
+ </planning_principles>
26
+
27
+ <process>
28
+
29
+ [step:load_project_state p=1]
30
+ READ: .planning/STATE.md
31
+ PARSE: current_position, accumulated_decisions, open_questions, argument_strength
32
+ IF missing+.planning_exists → OFFER reconstruct|continue
33
+ [/step]
34
+
35
+ [step:load_structure_context]
36
+ RUN: ls .planning/structure/*.md 2>/dev/null
37
+
38
+ STRUCTURE_LOAD{section_type → files}:
39
+ introduction → argument-map.md, narrative-arc.md
40
+ methods → argument-map.md (claims needing methodological support)
41
+ results → argument-map.md (claims supported here)
42
+ discussion → argument-map.md, narrative-arc.md
43
+ related_work → argument-map.md (positioning), literature.md
44
+ abstract → all (summary of everything)
45
+
46
+ TRACK: extracted context for PLAN.md
47
+ [/step]
48
+
49
+ [step:identify_section]
50
+ RUN: cat .planning/ROADMAP.md
51
+ RUN: ls .planning/sections/
52
+ IF multiple_available → ASK which to plan
53
+ IF obvious → proceed with first incomplete
54
+ REGEX: ^(\d+)(?:\.(\d+))?$ → Group1: integer, Group2: decimal
55
+ IF decimal → validate: X complete, X+1 exists, X.Y doesn't exist, Y >= 1
56
+ READ: existing PLAN.md or RESEARCH.md in section dir
57
+ [/step]
58
+
59
+ [step:mandatory_literature_check]
60
+ MANDATORY for sections flagged Research: Likely
61
+
62
+ LIT_LEVEL{level,desc,action}:
63
+ 0-skip | internal content only, no external evidence | skip
64
+ 1-quick | single source verify, 2-5 min | quick check, no RESEARCH.md
65
+ 2-standard | multiple sources, positioning, 15-30 min | /wtfp:research-gap → RESEARCH.md
66
+ 3-deep | core lit review, theoretical framework, 1+ hr | /wtfp:research-gap depth=deep → full RESEARCH.md
67
+
68
+ IF roadmap=Research:Likely → Level 0 not available
69
+ [/step]
70
+
71
+ [step:read_prior_sections]
72
+ RUN: for f in .planning/sections/*/*-SUMMARY.md; do sed -n '1,/^---$/p' "$f" | head -30; done
73
+ PARSE: section, subsection, key-claims, evidence-used, decisions
74
+
75
+ BUILD context:
76
+ - Check logical flow (what claims does this section build on?)
77
+ - Check evidence used (what sources already cited?)
78
+ - Check decisions (stylistic/structural constraints?)
79
+
80
+ AUTO-SELECT sections matching:
81
+ - Immediate prior section
82
+ - Same argumentative thread
83
+ - Mentioned in STATE.md as affecting current
84
+
85
+ EXTRACT from selected:
86
+ - Claims established
87
+ - Evidence cited (avoid over-citation)
88
+ - Patterns established (style, terminology)
89
+ - Decisions
90
+
91
+ ANSWER before proceeding:
92
+ Q1: What claims from previous sections does this build on?
93
+ Q2: What sources already cited might be relevant?
94
+ Q3: What writing patterns to maintain?
95
+ Q4: Does roadmap goal still make sense given context?
96
+ [/step]
97
+
98
+ [step:gather_section_context]
99
+ UNDERSTAND: section_goal, word_budget, existing_drafts, dependencies_met
100
+
101
+ RUN: cat .planning/sections/XX-name/${SECTION}-RESEARCH.md 2>/dev/null
102
+ RUN: cat .planning/sections/XX-name/${SECTION}-CONTEXT.md 2>/dev/null
103
+ RUN: cat .planning/sources/prior-drafts.md 2>/dev/null
104
+
105
+ IF RESEARCH.md → USE: sources (cite), key_findings (incorporate), gaps (address), positioning
106
+ IF CONTEXT.md → HONOR: vision, essential content, boundaries, user specifics
107
+ IF neither → SUGGEST: /wtfp:research-gap (lit-heavy) or /wtfp:discuss-section (simpler)
108
+ [/step]
109
+
110
+ [step:break_into_tasks]
111
+ Decompose section into writing tasks.
112
+
113
+ TASK_FIELDS:
114
+ - Type: auto | checkpoint:human-verify | checkpoint:decision
115
+ - Name: clear, action-oriented
116
+ - Paragraphs/Subsections: which part
117
+ - Action: draft | revise | cite | strengthen
118
+ - Mode: co-author (Claude drafts) | scaffold (Claude outlines) | reviewer (Claude critiques)
119
+ - Verify: how to prove done well
120
+ - Done: acceptance criteria
121
+
122
+ TASKS_BY_SECTION{section → typical_tasks}:
123
+ abstract | draft complete, verify elements
124
+ intro | hook, context, gap, thesis, roadmap
125
+ methods | protocol, measures, analysis approach
126
+ results | finding narratives, supporting analyses
127
+ discussion | summary, interpretation, limitations, future work, conclusion
128
+ related_work | theme syntheses, positioning statement
129
+
130
+ MODE_SELECT:
131
+ - Procedural content (methods, data) → co-author
132
+ - Argument-heavy (discussion, intro) → scaffold | reviewer
133
+ - Personal voice (abstract conclusion, thesis) → scaffold + user writing
134
+
135
+ CHECKPOINTS: visual/prose verify → human-verify. Voice/framing choices → decision.
136
+ [/step]
137
+
138
+ [step:estimate_scope]
139
+ RUN: cat .planning/config.json 2>/dev/null | grep depth
140
+
141
+ DEPTH{level,plans_per,tasks_per}:
142
+ quick | 1-2 | 2-3
143
+ standard | 2-4 | 2-3
144
+ comprehensive | 3-6 | 2-3
145
+
146
+ PRINCIPLE: Derive plans from actual writing needs. Depth = how carefully to break down complex sections.
147
+ - Comprehensive Discussion = 4 plans (interpretation, limitations, future work, conclusion)
148
+ - Comprehensive Abstract = 1 plan (one paragraph)
149
+
150
+ ALWAYS_SPLIT if: >3 tasks, multiple threads, complex lit integration
151
+ EACH_PLAN must be: 2-3 tasks max, focused on one aspect, independently verifiable
152
+ [/step]
153
+
154
+ [step:confirm_breakdown]
155
+ IF mode=yolo → auto-approve, proceed
156
+ IF mode=interactive → present breakdown:
157
+ "Section [X] breakdown:
158
+ ### Tasks ({section}-01-PLAN.md)
159
+ 1. [Task] - [brief] [type] [mode]
160
+ 2. [Task] - [brief] [type] [mode]
161
+ Does this look right? (yes/adjust/start over)"
162
+
163
+ IF adjust → revise
164
+ IF start_over → return to gather_section_context
165
+ [/step]
166
+
167
+ [step:write_section_prompt]
168
+ READ: ~/.claude/write-the-f-paper/templates/section-prompt.md
169
+
170
+ SINGLE_PLAN → .planning/sections/XX-name/{section}-01-PLAN.md
171
+ MULTI_PLAN → {section}-01-PLAN.md, {section}-02-PLAN.md, etc.
172
+
173
+ EACH_PLAN includes:
174
+ - Frontmatter (section, plan, type, mode)
175
+ - Objective (goal, word target, output)
176
+ - Execution context (write-section.md, summary template, verification-layers.md)
177
+ - Context (@refs: PROJECT, ROADMAP, STATE, structure docs, RESEARCH/CONTEXT, prior summaries, sources)
178
+ - Tasks (XML format with types/modes)
179
+ - Verification (citation, coherence, rubric checks)
180
+ - Success criteria, Output specification
181
+ [/step]
182
+
183
+ [step:git_commit]
184
+ RUN: git add .planning/sections/${SECTION}-*/${SECTION}-*-PLAN.md
185
+ RUN: git add .planning/sections/${SECTION}-*/RESEARCH.md 2>/dev/null
186
+ COMMIT: "docs(${SECTION}): create section plan - [N] plans, [X] tasks"
187
+ EMIT: "Committed: docs(${SECTION}): create section plan"
188
+ [/step]
189
+
190
+ [step:offer_next]
191
+ EMIT:
192
+ Section plan created: .planning/sections/XX-name/{section}-01-PLAN.md
193
+ [X] tasks defined.
194
+
195
+ Next: {section}-01: [Plan Name] - [objective]
196
+ → /wtfp:write-section .planning/sections/XX-name/{section}-01-PLAN.md
197
+
198
+ Also: Review/adjust tasks, View all plans
199
+ [/step]
200
+
201
+ </process>
202
+
203
+ <task_quality>
204
+ GOOD: Specific paragraphs, clear actions, verifiable output
205
+ - "Draft hook paragraph establishing research gap in autonomous systems"
206
+ - "Write methods subsection on data collection protocol, ~150 words"
207
+ - "Synthesize Smith2023 and Jones2024 findings on intervention efficacy"
208
+
209
+ BAD: Vague, not actionable
210
+ - "Write introduction" / "Add citations" / "Make it better"
211
+
212
+ TEST: If you can't specify Paragraphs + Action + Mode + Verify + Done → too vague
213
+ </task_quality>
214
+
215
+ <anti_patterns>
216
+ - No hour estimates
217
+ - No "perfect prose" expectations (first drafts are drafts)
218
+ - No style committee approvals
219
+ - No sub-sub-sub tasks
220
+ Tasks = instructions for Claude writing, not editorial board requirements.
221
+ </anti_patterns>
222
+
223
+ <success_criteria>
224
+ - [ ] STATE.md read, project context absorbed
225
+ - [ ] Mandatory literature check completed (Level 0-3)
226
+ - [ ] Prior sections, sources, structure synthesized
227
+ - [ ] PLAN file(s) exist with XML structure
228
+ - [ ] Each plan: Objective, context, tasks, verification, success criteria, output
229
+ - [ ] @context references included (STATE, RESEARCH if exist, relevant summaries)
230
+ - [ ] Each plan: 2-3 tasks (~focused scope)
231
+ - [ ] Each task: Type, Mode, Paragraphs (if applicable), Action, Verify, Done
232
+ - [ ] Checkpoints properly structured
233
+ - [ ] If RESEARCH.md exists: sources cited in plan, positioning clear
234
+ - [ ] PLAN file(s) committed to git
235
+ - [ ] User knows next steps
236
+ </success_criteria>