wtf-p 0.4.0 → 0.5.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 (175) hide show
  1. package/README.md +146 -226
  2. package/bin/commands/doctor.js +88 -2
  3. package/bin/commands/install-logic.js +121 -26
  4. package/bin/commands/status.js +22 -4
  5. package/bin/commands/update.js +5 -4
  6. package/bin/install.js +66 -26
  7. package/bin/lib/checkpoint.js +183 -0
  8. package/bin/lib/context-primer.js +214 -0
  9. package/bin/lib/manifest.js +62 -2
  10. package/bin/lib/utils.js +22 -1
  11. package/bin/uninstall.js +270 -111
  12. package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
  13. package/core/write-the-f-paper/references/checkpoints.md +160 -9
  14. package/core/write-the-f-paper/references/context-fidelity.md +153 -0
  15. package/core/write-the-f-paper/references/deviation-rules.md +150 -0
  16. package/core/write-the-f-paper/references/git-integration.md +80 -0
  17. package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
  18. package/core/write-the-f-paper/references/planning-config.md +135 -0
  19. package/core/write-the-f-paper/references/ui-brand.md +186 -0
  20. package/core/write-the-f-paper/templates/UAT.md +80 -0
  21. package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
  22. package/core/write-the-f-paper/templates/config.json +31 -5
  23. package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
  24. package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
  25. package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
  26. package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
  27. package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
  28. package/core/write-the-f-paper/workflows/research-gap.md +27 -3
  29. package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
  30. package/core/write-the-f-paper/workflows/verify-work.md +251 -0
  31. package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
  32. package/package.json +19 -7
  33. package/vendors/claude/.claude-plugin/plugin.json +2 -2
  34. package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
  35. package/vendors/claude/agents/wtfp/citation-expert.md +1 -1
  36. package/vendors/claude/agents/wtfp/citation-formatter.md +1 -1
  37. package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
  38. package/vendors/claude/agents/wtfp/outliner.md +259 -0
  39. package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
  40. package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
  41. package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
  42. package/vendors/claude/agents/wtfp/section-planner.md +364 -0
  43. package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
  44. package/vendors/claude/agents/wtfp/section-writer.md +312 -0
  45. package/vendors/claude/commands/wtfp/add-todo.md +108 -0
  46. package/vendors/claude/commands/wtfp/analyze-bib.md +58 -236
  47. package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
  48. package/vendors/claude/commands/wtfp/check-refs.md +60 -133
  49. package/vendors/claude/commands/wtfp/check-todos.md +152 -0
  50. package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
  51. package/vendors/claude/commands/wtfp/contribute.md +1 -1
  52. package/vendors/claude/commands/wtfp/create-outline.md +109 -195
  53. package/vendors/claude/commands/wtfp/create-poster.md +1 -1
  54. package/vendors/claude/commands/wtfp/create-slides.md +1 -1
  55. package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
  56. package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
  57. package/vendors/claude/commands/wtfp/export-latex.md +1 -1
  58. package/vendors/claude/commands/wtfp/help.md +174 -280
  59. package/vendors/claude/commands/wtfp/insert-section.md +1 -1
  60. package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
  61. package/vendors/claude/commands/wtfp/map-project.md +35 -124
  62. package/vendors/claude/commands/wtfp/new-paper.md +85 -320
  63. package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
  64. package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
  65. package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
  66. package/vendors/claude/commands/wtfp/plan-section.md +165 -190
  67. package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
  68. package/vendors/claude/commands/wtfp/progress.md +82 -254
  69. package/vendors/claude/commands/wtfp/quick.md +107 -0
  70. package/vendors/claude/commands/wtfp/remove-section.md +1 -1
  71. package/vendors/claude/commands/wtfp/report-bug.md +1 -1
  72. package/vendors/claude/commands/wtfp/request-feature.md +1 -1
  73. package/vendors/claude/commands/wtfp/research-gap.md +138 -150
  74. package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
  75. package/vendors/claude/commands/wtfp/review-section.md +55 -333
  76. package/vendors/claude/commands/wtfp/settings.md +197 -0
  77. package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
  78. package/vendors/claude/commands/wtfp/update.md +112 -0
  79. package/vendors/claude/commands/wtfp/verify-work.md +254 -0
  80. package/vendors/claude/commands/wtfp/write-section.md +144 -180
  81. package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
  82. package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
  83. package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
  84. package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
  85. package/vendors/gemini/agents/wtfp/outliner.md +252 -0
  86. package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
  87. package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
  88. package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
  89. package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
  90. package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
  91. package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
  92. package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
  93. package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
  94. package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
  95. package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
  96. package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
  97. package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
  98. package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
  99. package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
  100. package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
  101. package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
  102. package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
  103. package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
  104. package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
  105. package/vendors/gemini/commands/wtfp/help.toml +184 -0
  106. package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
  107. package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
  108. package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
  109. package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
  110. package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
  111. package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
  112. package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
  113. package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
  114. package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
  115. package/vendors/gemini/commands/wtfp/progress.toml +145 -0
  116. package/vendors/gemini/commands/wtfp/quick.toml +96 -0
  117. package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
  118. package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
  119. package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
  120. package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
  121. package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
  122. package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
  123. package/vendors/gemini/commands/wtfp/settings.toml +191 -0
  124. package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
  125. package/vendors/gemini/commands/wtfp/update.toml +107 -0
  126. package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
  127. package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
  128. package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
  129. package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
  130. package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
  131. package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
  132. package/vendors/opencode/agents/wtfp/outliner.md +252 -0
  133. package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
  134. package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
  135. package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
  136. package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
  137. package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
  138. package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
  139. package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
  140. package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
  141. package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
  142. package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
  143. package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
  144. package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
  145. package/vendors/opencode/commands/wtfp/contribute.md +266 -0
  146. package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
  147. package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
  148. package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
  149. package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
  150. package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
  151. package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
  152. package/vendors/opencode/commands/wtfp/help.md +185 -0
  153. package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
  154. package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
  155. package/vendors/opencode/commands/wtfp/map-project.md +100 -0
  156. package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
  157. package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
  158. package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
  159. package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
  160. package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
  161. package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
  162. package/vendors/opencode/commands/wtfp/progress.md +146 -0
  163. package/vendors/opencode/commands/wtfp/quick.md +97 -0
  164. package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
  165. package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
  166. package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
  167. package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
  168. package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
  169. package/vendors/opencode/commands/wtfp/review-section.md +123 -0
  170. package/vendors/opencode/commands/wtfp/settings.md +192 -0
  171. package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
  172. package/vendors/opencode/commands/wtfp/update.md +108 -0
  173. package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
  174. package/vendors/opencode/commands/wtfp/write-section.md +228 -0
  175. package/vendors/claude/agents/wtfp/citation-retriever.md +0 -31
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: wtfp:insert-section
3
+ description: Insert a new section between existing sections
4
+ ---
5
+
6
+ <objective>
7
+ Insert a new section between existing sections as a decimal phase.
8
+
9
+ Creates intermediate section (e.g., 3.1 between sections 3 and 4).
10
+
11
+ Useful for discovered gaps that must be addressed mid-draft.
12
+
13
+ Maintains section ordering without renumbering.
14
+ </objective>
15
+
16
+ <process>
17
+
18
+ <step name="parse">
19
+ **Parse arguments:**
20
+
21
+ Expect: `<after> <description>`
22
+ - after: Section number to insert after (e.g., 3)
23
+ - description: Brief description of new section
24
+
25
+ Example: `/wtfp:insert-section 3 "Add methodology validation subsection"`
26
+ </step>
27
+
28
+ <step name="verify">
29
+ **Verify project exists:**
30
+
31
+ ```bash
32
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No roadmap found. Run /wtfp:create-outline first" && exit 1
33
+ ```
34
+
35
+ Check that "after" section exists in ROADMAP.md.
36
+ </step>
37
+
38
+ <step name="determine_number">
39
+ **Determine new section number:**
40
+
41
+ Check for existing decimal sections after the target:
42
+ - If 3.1 doesn't exist → new section is 3.1
43
+ - If 3.1 exists but 3.2 doesn't → new section is 3.2
44
+ - Continue until finding available slot
45
+ </step>
46
+
47
+ <step name="confirm">
48
+ **Confirm with user:**
49
+
50
+ Use the question tool:
51
+ - header: "Insert Section"
52
+ - question: "Insert Section [X.Y]: [description] after Section [X]?"
53
+ - options:
54
+ - "Yes, create it" — Insert the section
55
+ - "Different position" — Let me specify another location
56
+ - "Cancel" — Don't insert
57
+
58
+ </step>
59
+
60
+ <step name="create">
61
+ **Create section:**
62
+
63
+ 1. Create directory:
64
+ ```bash
65
+ mkdir -p ".planning/sections/[XX.Y]-[section-name-slug]"
66
+ ```
67
+
68
+ 2. Update ROADMAP.md:
69
+ - Insert new section entry after section [X]
70
+ - Include goal, word target, status
71
+
72
+ 3. Update STATE.md if needed.
73
+
74
+ </step>
75
+
76
+ <step name="commit">
77
+ ```bash
78
+ git add .planning/ROADMAP.md .planning/sections/
79
+ git commit -m "$(cat <<'EOF'
80
+ docs: insert Section [X.Y] - [name]
81
+
82
+ [Description]
83
+
84
+ Inserted between Section [X] and Section [X+1]
85
+ EOF
86
+ )"
87
+ ```
88
+
89
+ </step>
90
+
91
+ <step name="done">
92
+ **Present completion:**
93
+
94
+ ```
95
+ Section inserted:
96
+
97
+ - Section [X.Y]: [Name]
98
+ - Directory: .planning/sections/[XX.Y]-[name]/
99
+ - ROADMAP.md updated
100
+
101
+ ---
102
+
103
+ ## ▶ Next Up
104
+
105
+ **Plan new section** — create writing plan
106
+
107
+ `/wtfp:plan-section [X.Y]`
108
+
109
+ <sub>`/clear` first → fresh context window</sub>
110
+
111
+ ---
112
+ ```
113
+
114
+ </step>
115
+
116
+ </process>
117
+
118
+ <success_criteria>
119
+ - [ ] New section number determined (no conflicts)
120
+ - [ ] Directory created
121
+ - [ ] ROADMAP.md updated with new section
122
+ - [ ] Ordering preserved
123
+ - [ ] Committed to git
124
+ </success_criteria>
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: wtfp:list-assumptions
3
+ description: Preview intended approach for a section before writing
4
+ ---
5
+
6
+ <objective>
7
+ Show Claude's intended approach for a section before planning begins.
8
+
9
+ Lets you course-correct if Claude misunderstood your vision.
10
+
11
+ No files created - conversational output only.
12
+ </objective>
13
+
14
+ <process>
15
+
16
+ <step name="verify">
17
+ **Verify project exists:**
18
+
19
+ ```bash
20
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No project found. Run /wtfp:new-paper first" && exit 1
21
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No outline found. Run /wtfp:create-outline first" && exit 1
22
+ ```
23
+
24
+ </step>
25
+
26
+ <step name="load">
27
+ **Load all relevant context:**
28
+
29
+ - Read PROJECT.md for paper vision
30
+ - Read ROADMAP.md for section goal
31
+ - Read argument-map.md for relevant claims
32
+ - Read outline.md for structure expectations
33
+ - Read narrative-arc.md for story context
34
+ - Read any prior SUMMARY.md files
35
+ - Check for CONTEXT.md or RESEARCH.md in section directory
36
+ </step>
37
+
38
+ <step name="present">
39
+ **Present assumptions in 5 areas:**
40
+
41
+ ```
42
+ # Assumptions for Section [N]: [Name]
43
+
44
+ ## 1. Content Approach
45
+ Based on the section goal and argument map, I plan to:
46
+ - [Main point 1]
47
+ - [Main point 2]
48
+ - [Main point 3]
49
+
50
+ Key claims I'll develop:
51
+ - [Claim from argument-map]
52
+ - [Claim from argument-map]
53
+
54
+ ## 2. Structure
55
+ I'm planning to organize this section as:
56
+ 1. [Opening approach]
57
+ 2. [Body structure]
58
+ 3. [Closing approach]
59
+
60
+ Word allocation:
61
+ - [Part 1]: ~[X] words
62
+ - [Part 2]: ~[Y] words
63
+ - [Part 3]: ~[Z] words
64
+
65
+ ## 3. Writing Mode
66
+ Based on the section type, I recommend:
67
+ - Mode: [Co-Author/Scaffold/Reviewer]
68
+ - Reason: [Why this mode fits]
69
+
70
+ ## 4. Dependencies
71
+ This section relies on:
72
+ - Prior sections: [What must be established first]
73
+ - Citations needed: [Key references]
74
+ - Evidence: [Data/figures to reference]
75
+
76
+ This section sets up:
77
+ - Following sections: [What this enables]
78
+
79
+ ## 5. Potential Challenges
80
+ I anticipate:
81
+ - [Challenge 1]: [How I'd address it]
82
+ - [Challenge 2]: [How I'd address it]
83
+
84
+ ## Questions for You
85
+ - [Any clarifications needed]
86
+ - [Decisions that need your input]
87
+
88
+ ---
89
+
90
+ **Does this match your vision?**
91
+ - If yes: Run `/wtfp:plan-section [section]`
92
+ - If concerns: Tell me what to adjust
93
+ - If major changes: Run `/wtfp:discuss-section [section]`
94
+ ```
95
+
96
+ </step>
97
+
98
+ </process>
99
+
100
+ <success_criteria>
101
+ - [ ] All 5 assumption areas covered
102
+ - [ ] Based on actual project context
103
+ - [ ] Clear path to course-correct
104
+ - [ ] No files created (conversational only)
105
+ </success_criteria>
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: wtfp:map-project
3
+ description: Index existing drafts, data, and references for a project
4
+ ---
5
+
6
+ <execution_context>
7
+ @~/.opencode/write-the-f-paper/workflows/map-project.md
8
+ </execution_context>
9
+
10
+ <objective>
11
+ Index existing source materials (literature, data, prior drafts) for a writing project.
12
+
13
+ **Orchestrator role:** Detect existing materials, resolve model profile, create `.planning/sources/` with organized references, commit.
14
+
15
+ Use before `/wtfp:new-paper` on existing writing projects.
16
+ </objective>
17
+
18
+ <context>
19
+ No arguments. Scans current directory for existing materials.
20
+ </context>
21
+
22
+ <process>
23
+
24
+ ## 1. Validate Environment and Resolve Model Profile
25
+
26
+ ```bash
27
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
28
+ ```
29
+
30
+ ## 2. Detect Existing Materials
31
+
32
+ ```bash
33
+ find . -name "*.bib" -o -name "references.md" -o -name "bibliography.md" 2>/dev/null | head -20
34
+ find . -name "*.tex" -o -name "*.md" -o -name "*.docx" 2>/dev/null | grep -v node_modules | grep -v .planning | head -20
35
+ find . -name "*.csv" -o -name "*.json" -o -name "*.xlsx" 2>/dev/null | head -20
36
+ find . -name "*.png" -o -name "*.pdf" -o -name "*.svg" -o -name "*.jpg" 2>/dev/null | head -20
37
+ ```
38
+
39
+ ## 3. Create Sources Directory
40
+
41
+ ```bash
42
+ mkdir -p .planning/sources
43
+ ```
44
+
45
+ ## 4. Index Literature
46
+
47
+ If .bib files found, parse via `node ~/.opencode/bin/bib-index.js index [file]`.
48
+
49
+ Write `.planning/sources/literature.md`: Core References table (key, citation, relevance, status), Background Reading, To Find list, source paths.
50
+
51
+ ## 5. Index Data and Evidence
52
+
53
+ Scan for figures, tables, data files.
54
+
55
+ Write `.planning/sources/data.md`: Figures table (ID, file, description, status, target section), Tables, Data Files, Statistics.
56
+
57
+ ## 6. Index Prior Drafts
58
+
59
+ Scan for existing writing.
60
+
61
+ Write `.planning/sources/prior-drafts.md`: Existing Documents table (file, type, description, usable, target section), Key Passages, Material to Avoid.
62
+
63
+ ## 7. Commit
64
+
65
+ ```bash
66
+ git add .planning/sources/
67
+ git commit -m "docs: index source materials"
68
+ ```
69
+
70
+ </process>
71
+
72
+ <offer_next>
73
+
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ WTF-P ► SOURCES INDEXED ✓
76
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
+
78
+ - Literature: .planning/sources/literature.md ([N] references)
79
+ - Data: .planning/sources/data.md ([N] figures, [N] tables)
80
+ - Prior Drafts: .planning/sources/prior-drafts.md ([N] documents)
81
+
82
+ ───────────────────────────────────────────
83
+
84
+ ## ▶ Next Up
85
+
86
+ **Initialize paper** — capture vision and structure
87
+
88
+ `/wtfp:new-paper`
89
+
90
+ ───────────────────────────────────────────
91
+
92
+ </offer_next>
93
+
94
+ <success_criteria>
95
+ - [ ] All existing materials discovered
96
+ - [ ] literature.md indexes all citations
97
+ - [ ] data.md inventories figures and evidence
98
+ - [ ] prior-drafts.md catalogs existing writing
99
+ - [ ] All committed to git
100
+ </success_criteria>
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: wtfp:new-paper
3
+ description: Initialize a new paper with deep context gathering and PROJECT.md
4
+ ---
5
+
6
+ <execution_context>
7
+ @~/.opencode/write-the-f-paper/references/principles.md
8
+ @~/.opencode/write-the-f-paper/references/questioning.md
9
+ @~/.opencode/write-the-f-paper/templates/project.md
10
+ @~/.opencode/write-the-f-paper/templates/config.json
11
+ @~/.opencode/write-the-f-paper/venues/
12
+ </execution_context>
13
+
14
+ <objective>
15
+ Initialize a new academic paper through comprehensive context gathering.
16
+
17
+ **Orchestrator role:** Check preconditions, detect brownfield projects, gather paper vision through batched questioning, synthesize PROJECT.md + config.json + structure documents, commit.
18
+
19
+ Creates `.planning/` with PROJECT.md, config.json, and structure documents.
20
+ </objective>
21
+
22
+ <context>
23
+ No arguments. Runs in current directory.
24
+ </context>
25
+
26
+ <process>
27
+
28
+ ## 1. Validate Environment
29
+
30
+ ```bash
31
+ [ -f .planning/PROJECT.md ] && echo "ERROR: Paper already initialized. Use /wtfp:progress" && exit 1
32
+ ```
33
+
34
+ Initialize git if needed:
35
+ ```bash
36
+ [ -d .git ] || [ -f .git ] || git init
37
+ ```
38
+
39
+ ## 2. Brownfield Detection
40
+
41
+ ```bash
42
+ WRITING_FILES=$(find . -name "*.tex" -o -name "*.md" -o -name "*.bib" -o -name "*.docx" 2>/dev/null | grep -v node_modules | grep -v .git | grep -v .planning | head -20)
43
+ HAS_SOURCES=$([ -d sources ] || [ -d references ] || [ -d literature ] && echo "yes")
44
+ HAS_SOURCE_MAP=$([ -d .planning/sources ] && echo "yes")
45
+ ```
46
+
47
+ **If materials detected and no source map:** Offer `/wtfp:map-project` first via the question tool.
48
+
49
+ ## 3. Gather Core Context (Batched)
50
+
51
+ Use the question tool -- collect foundations in one turn:
52
+ - header: "Paper Foundations"
53
+ - question: "1. **Type** (Research paper, Grant, Thesis)\n2. **Venue** (NeurIPS, CHI, Nature, etc.)\n3. **Core Argument** (one thing you're proving)\n4. **Audience** (who is this for?)"
54
+ - options: "I provided the details" | "Guide me step-by-step"
55
+
56
+ If step-by-step selected, ask Type -> Venue -> Argument sequentially.
57
+
58
+ ## 4. Venue Template Selection
59
+
60
+ If ambiguous, ask via the question tool:
61
+ - header: "Venue Structure"
62
+ - options: "ACM CS" | "IEEE CS" | "ML/AI" | "Nature/Science" | "Thesis"
63
+
64
+ Load corresponding YAML from `~/.opencode/write-the-f-paper/venues/`.
65
+
66
+ ## 5. Sharpen Core Argument
67
+
68
+ If core_argument was weak, drill down:
69
+ - header: "Refine Core"
70
+ - question: "If reviewers remember ONE thing, what is it?"
71
+ - options: "The Method" | "The Findings" | "The Theory" | "The System"
72
+
73
+ ## 6. Gather Constraints
74
+
75
+ - header: "Scope & Limits"
76
+ - question: "1. **Out of Scope?** 2. **Hard Constraints?** (page limits, deadlines)"
77
+ - options: "Provided details" | "No constraints"
78
+
79
+ ## 7. Synthesize PROJECT.md
80
+
81
+ Write `.planning/PROJECT.md` using template from `~/.opencode/write-the-f-paper/templates/project.md`.
82
+
83
+ Populate: What This Is, Core Argument, Requirements (Must/Should/Out of Scope), Target Audience, Constraints, Key Decisions.
84
+
85
+ ## 8. Create Structure Documents
86
+
87
+ Create `.planning/structure/` with:
88
+ - **argument-map.md** -- Central thesis, supporting claims, logical flow, gaps
89
+ - **outline.md** -- Venue template sections, word budget table
90
+ - **narrative-arc.md** -- Problem/Journey/Resolution, reader experience
91
+
92
+ ## 9. Workflow Mode & Config
93
+
94
+ Ask mode (Interactive / Flow) and depth (Quick / Standard / Comprehensive) via the question tool.
95
+
96
+ ## 9b. Git & Planning Settings
97
+
98
+ Ask about git tracking via the question tool:
99
+ - header: "Git & Planning"
100
+ - question: "Track planning documents in git?"
101
+ - options:
102
+ - "Yes (default)" -- commit_docs: true, planning artifacts are version-controlled
103
+ - "No" -- commit_docs: false, only paper content is committed
104
+
105
+ Use the answer to set `planning.commit_docs` in config.json.
106
+
107
+ Ask about branching strategy via the question tool:
108
+ - header: "Git Branching"
109
+ - question: "Branch strategy for git history?"
110
+ - options:
111
+ - "None (default)" -- all commits on current branch, git.branching_strategy: "none"
112
+ - "Section branches" -- one branch per section, merged on review pass, git.branching_strategy: "section"
113
+ - "Submission branches" -- branch per milestone/submission target, git.branching_strategy: "submission"
114
+
115
+ Use the answer to set `git.branching_strategy` in config.json.
116
+
117
+ ## 9c. Write Config
118
+
119
+ Write `.planning/config.json` with the full v0.5.0 schema: mode, depth, document_type, output_format, model_profile ("balanced"), venue_template, gates (8 gate types: confirm_outline, confirm_plan, confirm_write, confirm_review, execute_next_section, issues_review, confirm_transition, confirm_submission), writing, workflow, verification, planning (commit_docs, search_gitignored), parallelization, safety (always_confirm_destructive, always_confirm_external_services, backup_before_major_edits), git (branching_strategy, section_branch_template, submission_branch_template, squash_on_merge).
120
+
121
+ ## 10. Commit
122
+
123
+ ```bash
124
+ git add .planning/PROJECT.md .planning/config.json .planning/structure/
125
+ git commit -m "docs: initialize [paper-title]"
126
+ ```
127
+
128
+ </process>
129
+
130
+ <offer_next>
131
+
132
+ ---
133
+ WTF-P > PAPER INITIALIZED
134
+ ---
135
+
136
+ - Project: .planning/PROJECT.md
137
+ - Config: .planning/config.json (mode: [chosen])
138
+ - Structure: .planning/structure/
139
+
140
+ ---
141
+
142
+ ## > Next Up
143
+
144
+ **Create section outline**
145
+
146
+ `/wtfp:create-outline`
147
+
148
+ <sub>`/clear` first -> fresh context window</sub>
149
+
150
+ ---
151
+
152
+ </offer_next>
153
+
154
+ <success_criteria>
155
+ - [ ] Deep questioning completed (not rushed)
156
+ - [ ] PROJECT.md captures paper vision with core argument
157
+ - [ ] Structure documents created (argument-map, outline, narrative-arc)
158
+ - [ ] config.json has gates, safety, planning, and git sections
159
+ - [ ] config.json has workflow mode and model_profile
160
+ - [ ] All committed to git
161
+ </success_criteria>
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: wtfp:pause-writing
3
+ description: Save current progress so you can resume later
4
+ ---
5
+
6
+ <objective>
7
+ Create context handoff file when pausing work mid-section.
8
+
9
+ Captures current state so next session can resume seamlessly.
10
+
11
+ Creates .continue-here.md with current state and updates STATE.md.
12
+ </objective>
13
+
14
+ <process>
15
+
16
+ <step name="verify">
17
+ **Verify project exists:**
18
+
19
+ ```bash
20
+ [ ! -f .planning/STATE.md ] && echo "ERROR: No project state found" && exit 1
21
+ ```
22
+
23
+ </step>
24
+
25
+ <step name="gather">
26
+ **Gather current state:**
27
+
28
+ - Read STATE.md for current position
29
+ - Find any in-progress PLAN.md files
30
+ - Check for uncommitted changes
31
+ - Identify what was being worked on
32
+ </step>
33
+
34
+ <step name="handoff">
35
+ **Create .continue-here.md:**
36
+
37
+ In the current section directory:
38
+
39
+ ```markdown
40
+ ---
41
+ section: XX-name
42
+ task: [current task number]
43
+ total_tasks: [total]
44
+ status: [in_progress/blocked/almost_done]
45
+ last_updated: [ISO timestamp]
46
+ ---
47
+
48
+ # Continue Here: [Section Name]
49
+
50
+ ## Current State
51
+ [What's currently happening - in progress, waiting for input, etc.]
52
+
53
+ ## Completed Work
54
+ - [Task 1]: [done]
55
+ - [Task 2]: [done]
56
+ - [Task 3]: [in progress - description of where stopped]
57
+
58
+ ## Remaining Work
59
+ - [Task 4]: [not started]
60
+ - [Task 5]: [not started]
61
+
62
+ ## Decisions Made
63
+ | Decision | Rationale |
64
+ |----------|-----------|
65
+ | [choice] | [why] |
66
+
67
+ ## Blockers (if any)
68
+ - [What's blocking progress]
69
+
70
+ ## Context Notes
71
+ [Any important context for resuming:
72
+ - Why work was paused
73
+ - What was being figured out
74
+ - Any insights not yet captured elsewhere]
75
+
76
+ ## Next Action
77
+ [Exactly what to do when resuming]
78
+
79
+ ---
80
+ *Paused: [timestamp]*
81
+ ```
82
+
83
+ </step>
84
+
85
+ <step name="update_state">
86
+ **Update STATE.md:**
87
+
88
+ Add to Session Continuity section:
89
+ ```markdown
90
+ ## Session Continuity
91
+ - Last session: [timestamp]
92
+ - Handoff: .planning/sections/XX-name/.continue-here.md
93
+ - Status: [in_progress/blocked]
94
+ ```
95
+
96
+ </step>
97
+
98
+ <step name="commit">
99
+ ```bash
100
+ git add .planning/sections/XX-name/.continue-here.md .planning/STATE.md
101
+ git commit -m "$(cat <<'EOF'
102
+ wip: pause [section name]
103
+
104
+ Task [X] of [Y] in progress
105
+ EOF
106
+ )"
107
+ ```
108
+
109
+ </step>
110
+
111
+ <step name="done">
112
+ **Present completion:**
113
+
114
+ ```
115
+ Work paused:
116
+
117
+ - Handoff: .planning/sections/XX-name/.continue-here.md
118
+ - State: .planning/STATE.md updated
119
+ - Position: Task [X] of [Y]
120
+
121
+ ## To Resume
122
+
123
+ `/wtfp:resume-writing`
124
+
125
+ This will restore full context and continue from task [X].
126
+
127
+ ---
128
+ ```
129
+
130
+ </step>
131
+
132
+ </process>
133
+
134
+ <success_criteria>
135
+ - [ ] .continue-here.md captures current state
136
+ - [ ] Completed work documented
137
+ - [ ] Remaining work listed
138
+ - [ ] Next action is clear and actionable
139
+ - [ ] STATE.md updated with handoff reference
140
+ - [ ] All committed to git
141
+ </success_criteria>