wtf-p 0.3.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 (183) hide show
  1. package/README.md +146 -208
  2. package/bin/commands/doctor.js +88 -2
  3. package/bin/commands/install-logic.js +127 -36
  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/analyze-impact.js +105 -0
  8. package/bin/lib/bib-format.js +161 -0
  9. package/bin/lib/bib-index.js +104 -0
  10. package/bin/lib/checkpoint.js +183 -0
  11. package/bin/lib/citation-fetcher.js +299 -0
  12. package/bin/lib/citation-ranker.js +133 -0
  13. package/bin/lib/context-primer.js +214 -0
  14. package/bin/lib/manifest.js +80 -2
  15. package/bin/lib/scholar-lookup.js +188 -0
  16. package/bin/lib/semantic-scholar.js +184 -0
  17. package/bin/lib/utils.js +22 -1
  18. package/bin/uninstall.js +270 -111
  19. package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
  20. package/core/write-the-f-paper/references/checkpoints.md +160 -9
  21. package/core/write-the-f-paper/references/context-fidelity.md +153 -0
  22. package/core/write-the-f-paper/references/deviation-rules.md +150 -0
  23. package/core/write-the-f-paper/references/git-integration.md +80 -0
  24. package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
  25. package/core/write-the-f-paper/references/planning-config.md +135 -0
  26. package/core/write-the-f-paper/references/ui-brand.md +186 -0
  27. package/core/write-the-f-paper/templates/UAT.md +80 -0
  28. package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
  29. package/core/write-the-f-paper/templates/config.json +31 -5
  30. package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
  31. package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
  32. package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
  33. package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
  34. package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
  35. package/core/write-the-f-paper/workflows/research-gap.md +27 -3
  36. package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
  37. package/core/write-the-f-paper/workflows/verify-work.md +251 -0
  38. package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
  39. package/package.json +19 -7
  40. package/vendors/claude/.claude-plugin/plugin.json +2 -2
  41. package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
  42. package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
  43. package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
  44. package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
  45. package/vendors/claude/agents/wtfp/outliner.md +259 -0
  46. package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
  47. package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
  48. package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
  49. package/vendors/claude/agents/wtfp/section-planner.md +364 -0
  50. package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
  51. package/vendors/claude/agents/wtfp/section-writer.md +312 -0
  52. package/vendors/claude/commands/wtfp/add-todo.md +108 -0
  53. package/vendors/claude/commands/wtfp/analyze-bib.md +60 -249
  54. package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
  55. package/vendors/claude/commands/wtfp/check-refs.md +60 -131
  56. package/vendors/claude/commands/wtfp/check-todos.md +152 -0
  57. package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
  58. package/vendors/claude/commands/wtfp/contribute.md +1 -1
  59. package/vendors/claude/commands/wtfp/create-outline.md +109 -195
  60. package/vendors/claude/commands/wtfp/create-poster.md +1 -1
  61. package/vendors/claude/commands/wtfp/create-slides.md +1 -1
  62. package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
  63. package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
  64. package/vendors/claude/commands/wtfp/export-latex.md +1 -1
  65. package/vendors/claude/commands/wtfp/help.md +174 -280
  66. package/vendors/claude/commands/wtfp/insert-section.md +1 -1
  67. package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
  68. package/vendors/claude/commands/wtfp/map-project.md +35 -124
  69. package/vendors/claude/commands/wtfp/new-paper.md +88 -362
  70. package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
  71. package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
  72. package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
  73. package/vendors/claude/commands/wtfp/plan-section.md +165 -190
  74. package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
  75. package/vendors/claude/commands/wtfp/progress.md +82 -254
  76. package/vendors/claude/commands/wtfp/quick.md +107 -0
  77. package/vendors/claude/commands/wtfp/remove-section.md +1 -1
  78. package/vendors/claude/commands/wtfp/report-bug.md +1 -1
  79. package/vendors/claude/commands/wtfp/request-feature.md +1 -1
  80. package/vendors/claude/commands/wtfp/research-gap.md +138 -151
  81. package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
  82. package/vendors/claude/commands/wtfp/review-section.md +55 -333
  83. package/vendors/claude/commands/wtfp/settings.md +197 -0
  84. package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
  85. package/vendors/claude/commands/wtfp/update.md +112 -0
  86. package/vendors/claude/commands/wtfp/verify-work.md +254 -0
  87. package/vendors/claude/commands/wtfp/write-section.md +144 -180
  88. package/vendors/claude/mcp/research-server/package.json +13 -0
  89. package/vendors/claude/mcp/research-server/src/index.js +133 -0
  90. package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
  91. package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
  92. package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
  93. package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
  94. package/vendors/gemini/agents/wtfp/outliner.md +252 -0
  95. package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
  96. package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
  97. package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
  98. package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
  99. package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
  100. package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
  101. package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
  102. package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
  103. package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
  104. package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
  105. package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
  106. package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
  107. package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
  108. package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
  109. package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
  110. package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
  111. package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
  112. package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
  113. package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
  114. package/vendors/gemini/commands/wtfp/help.toml +184 -0
  115. package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
  116. package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
  117. package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
  118. package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
  119. package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
  120. package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
  121. package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
  122. package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
  123. package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
  124. package/vendors/gemini/commands/wtfp/progress.toml +145 -0
  125. package/vendors/gemini/commands/wtfp/quick.toml +96 -0
  126. package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
  127. package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
  128. package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
  129. package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
  130. package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
  131. package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
  132. package/vendors/gemini/commands/wtfp/settings.toml +191 -0
  133. package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
  134. package/vendors/gemini/commands/wtfp/update.toml +107 -0
  135. package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
  136. package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
  137. package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
  138. package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
  139. package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
  140. package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
  141. package/vendors/opencode/agents/wtfp/outliner.md +252 -0
  142. package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
  143. package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
  144. package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
  145. package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
  146. package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
  147. package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
  148. package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
  149. package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
  150. package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
  151. package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
  152. package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
  153. package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
  154. package/vendors/opencode/commands/wtfp/contribute.md +266 -0
  155. package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
  156. package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
  157. package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
  158. package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
  159. package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
  160. package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
  161. package/vendors/opencode/commands/wtfp/help.md +185 -0
  162. package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
  163. package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
  164. package/vendors/opencode/commands/wtfp/map-project.md +100 -0
  165. package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
  166. package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
  167. package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
  168. package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
  169. package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
  170. package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
  171. package/vendors/opencode/commands/wtfp/progress.md +146 -0
  172. package/vendors/opencode/commands/wtfp/quick.md +97 -0
  173. package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
  174. package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
  175. package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
  176. package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
  177. package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
  178. package/vendors/opencode/commands/wtfp/review-section.md +123 -0
  179. package/vendors/opencode/commands/wtfp/settings.md +192 -0
  180. package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
  181. package/vendors/opencode/commands/wtfp/update.md +108 -0
  182. package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
  183. package/vendors/opencode/commands/wtfp/write-section.md +228 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wtfp:analyze-bib
3
- description: Analyze BibTeX file and suggest citation placement by section
3
+ description: Analyze bibliography and map citations to sections
4
4
  argument-hint: "[bib-file]"
5
5
  allowed-tools:
6
6
  - Read
@@ -8,24 +8,25 @@ allowed-tools:
8
8
  - Write
9
9
  - Glob
10
10
  - Grep
11
+ - Task
11
12
  - AskUserQuestion
12
13
  - WebFetch
13
14
  ---
14
15
 
16
+ <execution_context>
17
+ @~/.claude/write-the-f-paper/templates/project-context/bibliography.md
18
+ </execution_context>
19
+
15
20
  <objective>
16
21
  Deep analysis of BibTeX bibliography to inform writing strategy.
17
22
 
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>
23
+ **Orchestrator role:** Locate bib file, run deterministic indexing/impact tools, resolve model profile, spawn citation-expert agent for analysis, present results.
21
24
 
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>
25
+ Output: REFS.md with citation strategy mapped to paper sections.
26
+ </objective>
26
27
 
27
28
  <context>
28
- BibTeX file: $ARGUMENTS (optional - auto-detects .bib files if not provided)
29
+ BibTeX file: $ARGUMENTS (optional — auto-detects .bib files if not provided)
29
30
 
30
31
  **Load project context:**
31
32
  @.planning/PROJECT.md
@@ -35,292 +36,102 @@ BibTeX file: $ARGUMENTS (optional - auto-detects .bib files if not provided)
35
36
 
36
37
  <process>
37
38
 
38
- <step name="locate_bib">
39
- **Find BibTeX file:**
39
+ ## 1. Validate Environment and Resolve Model Profile
40
40
 
41
41
  ```bash
42
- # Find .bib files
43
42
  find . -name "*.bib" -type f 2>/dev/null | grep -v node_modules | grep -v .git | head -10
44
43
  ```
45
44
 
46
- If multiple found, use AskUserQuestion:
47
- - header: "BibTeX"
48
- - question: "Which bibliography file should I analyze?"
49
- - options: [list found files] + "Analyze all"
45
+ If multiple found, ask via AskUserQuestion. If none found, exit with error.
50
46
 
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
47
+ ```bash
48
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
58
49
  ```
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
50
 
80
- <step name="temporal_analysis">
81
- **Temporal Analysis:**
51
+ | Agent | quality | balanced | budget |
52
+ |-------|---------|----------|--------|
53
+ | citation-expert | opus | sonnet | haiku |
82
54
 
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
55
+ ## 2. Run Deterministic Tools
88
56
 
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] |
57
+ ```bash
58
+ node ~/.claude/bin/bib-index.js index "$BIB_FILE"
59
+ node ~/.claude/bin/analyze-impact.js "$BIB_FILE"
98
60
  ```
99
61
 
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
62
+ Capture JSON output from indexer and impact analysis results.
110
63
 
111
- ```markdown
112
- ## Topic Clusters
64
+ ## 3. Read Context Files
113
65
 
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]
66
+ ```bash
67
+ PROJECT_CONTENT=$(cat .planning/PROJECT.md)
68
+ OUTLINE_CONTENT=$(cat .planning/structure/outline.md 2>/dev/null)
123
69
  ```
124
70
 
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
71
+ ## 4. Spawn citation-expert Agent
136
72
 
137
- ```markdown
138
- ## Seminal Works (Must Cite)
139
-
140
- | Key | Title | Why Seminal |
141
- |-----|-------|-------------|
142
- | [key] | [title] | [reason: foundational method, influential framework, etc.] |
143
73
  ```
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
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ WTF-P ► ANALYZING BIBLIOGRAPHY
76
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
195
77
  ```
196
78
 
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] |
79
+ ```
80
+ Task(
81
+ prompt="First, read ~/.claude/agents/wtfp/citation-expert.md for your role.\n\n" + analysis_prompt,
82
+ subagent_type="general-purpose",
83
+ model="{expert_model}",
84
+ description="Analyze bibliography"
85
+ )
212
86
  ```
213
87
 
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]
88
+ Analysis prompt includes: `<bib_index>` with parsed entries, `<impact_analysis>` with metrics, `<project_context>` with PROJECT + outline, `<output>` targeting `.planning/sources/REFS.md`.
250
89
 
251
- ## Quick Reference
90
+ Agent performs: temporal analysis, topic clustering, seminal work identification, section mapping, gap identification.
252
91
 
253
- ### High-Priority Citations (use frequently)
254
- - [key1] — [one-liner why]
255
- - [key2] — [one-liner why]
92
+ ## 5. Handle Expert Return
256
93
 
257
- ### Context Citations (use once for background)
258
- - [key3] — [one-liner why]
94
+ **`## ANALYSIS COMPLETE`:** Present summary, ask user to confirm seminal works via AskUserQuestion.
259
95
 
260
- ### Comparison Citations (evaluation section)
261
- - [key4] — [one-liner why]
96
+ **`## ANALYSIS BLOCKED`:** Present blocker (missing .bib, empty file, etc.), ask user how to proceed.
262
97
 
263
- ---
264
- *Generated by /wtfp:analyze-bib*
265
- *Review and adjust as you write*
266
- ```
98
+ ## 6. Commit
267
99
 
268
- </step>
269
-
270
- <step name="commit">
271
100
  ```bash
272
101
  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
- )"
102
+ git commit -m "refs: analyze bibliography for citation strategy"
282
103
  ```
283
104
 
284
- </step>
105
+ </process>
106
+
107
+ <offer_next>
285
108
 
286
- <step name="done">
287
- ```
288
- Bibliography analyzed:
109
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
110
+ WTF-P ► BIBLIOGRAPHY ANALYZED ✓
111
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
289
112
 
290
- - Source: [filename.bib]
291
113
  - Entries: [N]
292
114
  - Topic clusters: [N]
293
115
  - Seminal works: [N]
294
116
  - Citation map: .planning/sources/REFS.md
295
117
 
296
- ## Key Insights
118
+ ───────────────────────────────────────────
297
119
 
298
- [2-3 bullet observations about the bibliography]
120
+ ## ▶ Next Up
299
121
 
300
- ---
301
-
302
- ## Next Up
303
-
304
- **Create outline** — use citation map to inform section planning
305
-
306
- `/wtfp:create-outline`
122
+ `/wtfp:create-outline` — use citation map to inform section planning
307
123
 
308
- Or review REFS.md and adjust before proceeding.
124
+ <sub>`/clear` first → fresh context window</sub>
309
125
 
310
- ---
311
- ```
126
+ ───────────────────────────────────────────
312
127
 
313
- </step>
314
-
315
- </process>
128
+ </offer_next>
316
129
 
317
130
  <success_criteria>
318
131
  - [ ] 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/
132
+ - [ ] Impact analysis run
133
+ - [ ] Citation-expert spawned with full context
134
+ - [ ] REFS.md created with citation strategy
135
+ - [ ] Seminal works confirmed with user
325
136
  - [ ] Committed to git
326
137
  </success_criteria>
@@ -0,0 +1,286 @@
1
+ ---
2
+ name: wtfp:audit-milestone
3
+ description: Run pre-submission checks on sections, citations, and word counts
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Write
8
+ - Glob
9
+ - Grep
10
+ - AskUserQuestion
11
+ ---
12
+
13
+ <objective>
14
+ Check paper readiness before submission.
15
+
16
+ Runs 5 audit checks:
17
+ 1. Section completion status
18
+ 2. Argument coverage (all claims addressed)
19
+ 3. Word targets (within tolerance)
20
+ 4. Citation completeness (all resolved)
21
+ 5. Review status (all sections reviewed)
22
+
23
+ Produces MILESTONE-AUDIT.md with pass/gap for each criterion.
24
+ </objective>
25
+
26
+ <process>
27
+
28
+ <step name="validate">
29
+ **Step 1: Validate Environment**
30
+
31
+ ```bash
32
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: No PROJECT.md found" && exit 1
33
+ [ ! -f .planning/ROADMAP.md ] && echo "ERROR: No ROADMAP.md found" && exit 1
34
+ [ ! -f .planning/STATE.md ] && echo "ERROR: No STATE.md found" && exit 1
35
+ ```
36
+
37
+ </step>
38
+
39
+ <step name="banner">
40
+ **Step 2: Display Banner**
41
+
42
+ ```
43
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44
+ WTF-P ► AUDITING MILESTONE
45
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46
+
47
+ Running 5 pre-submission checks...
48
+ ```
49
+
50
+ </step>
51
+
52
+ <step name="check_sections">
53
+ **Check 1: Section Completion**
54
+
55
+ Read ROADMAP.md. For each section entry:
56
+ - Is it marked `[x]` complete?
57
+ - Extract section name and completion status
58
+
59
+ Count:
60
+ - `TOTAL_SECTIONS`: Number of section entries
61
+ - `COMPLETE_SECTIONS`: Number with `[x]`
62
+ - `INCOMPLETE_SECTIONS`: Number with `[ ]`
63
+
64
+ **Result:**
65
+ - PASS if `COMPLETE_SECTIONS == TOTAL_SECTIONS`
66
+ - GAP if any sections incomplete
67
+
68
+ Store result:
69
+ ```
70
+ CHECK_1_STATUS="{PASS|GAP}"
71
+ CHECK_1_DETAIL="{M}/{N} complete"
72
+ CHECK_1_GAPS="{list of incomplete section names, if any}"
73
+ ```
74
+
75
+ </step>
76
+
77
+ <step name="check_arguments">
78
+ **Check 2: Argument Coverage**
79
+
80
+ Read `.planning/structure/argument-map.md` if it exists.
81
+
82
+ Extract all claims (lines starting with `- **Claim**:` or numbered claims).
83
+
84
+ For each claim:
85
+ - Search paper content files (`paper/` directory or equivalent)
86
+ - Check if evidence of the claim being addressed exists
87
+
88
+ **Result:**
89
+ - PASS if all claims addressed
90
+ - GAP listing unaddressed claims
91
+
92
+ Store result:
93
+ ```
94
+ CHECK_2_STATUS="{PASS|GAP}"
95
+ CHECK_2_DETAIL="{M}/{N} claims addressed"
96
+ CHECK_2_GAPS="{list of unaddressed claims, if any}"
97
+ ```
98
+
99
+ If argument-map.md doesn't exist:
100
+ ```
101
+ CHECK_2_STATUS="SKIP"
102
+ CHECK_2_DETAIL="No argument-map.md found"
103
+ ```
104
+
105
+ </step>
106
+
107
+ <step name="check_words">
108
+ **Check 3: Word Targets**
109
+
110
+ Read `.planning/structure/outline.md` for word budget per section.
111
+
112
+ For each section:
113
+ - Count actual words in the paper content file
114
+ - Compare to target from outline
115
+
116
+ **Tolerance:** +/- 15% of target per section
117
+
118
+ **Result:**
119
+ - PASS if all sections within range
120
+ - GAP listing sections outside range (with actual vs target)
121
+
122
+ Store result:
123
+ ```
124
+ CHECK_3_STATUS="{PASS|GAP}"
125
+ CHECK_3_DETAIL="{N}/{M} sections within range"
126
+ CHECK_3_GAPS="{list of sections outside range: 'Section X: Y words (target: Z, variance: +/-W%)'}"
127
+ ```
128
+
129
+ If outline.md doesn't exist or has no word targets:
130
+ ```
131
+ CHECK_3_STATUS="SKIP"
132
+ CHECK_3_DETAIL="No word targets defined in outline.md"
133
+ ```
134
+
135
+ </step>
136
+
137
+ <step name="check_citations">
138
+ **Check 4: Citation Completeness**
139
+
140
+ Scan all paper content files for citation patterns:
141
+ - `(Author, Year)` - APA style
142
+ - `\cite{key}` - LaTeX style
143
+ - `[@key]` - Pandoc/markdown style
144
+ - `[N]` - IEEE style
145
+
146
+ Cross-reference with bibliography file:
147
+ - `references.bib` (BibTeX)
148
+ - `.planning/sources/bibliography.md`
149
+ - Any `.bib` files in project
150
+
151
+ Check for:
152
+ 1. **Uncited references**: Entries in bibliography not cited in text
153
+ 2. **Undefined citations**: Citations in text not in bibliography
154
+
155
+ **Result:**
156
+ - PASS if all citations resolved
157
+ - GAP listing issues
158
+
159
+ Store result:
160
+ ```
161
+ CHECK_4_STATUS="{PASS|GAP}"
162
+ CHECK_4_DETAIL="{N} issues found"
163
+ CHECK_4_GAPS="{list: 'Uncited: [keys]', 'Undefined: [keys]'}"
164
+ ```
165
+
166
+ If no bibliography file found:
167
+ ```
168
+ CHECK_4_STATUS="SKIP"
169
+ CHECK_4_DETAIL="No bibliography file found"
170
+ ```
171
+
172
+ </step>
173
+
174
+ <step name="check_reviews">
175
+ **Check 5: Review Status**
176
+
177
+ For each section:
178
+ - Check if review SUMMARY.md exists in `.planning/sections/{section}/`
179
+ - Or check if "review: pass" noted in section summary
180
+
181
+ **Result:**
182
+ - PASS if all sections reviewed
183
+ - GAP listing unreviewed sections
184
+
185
+ Store result:
186
+ ```
187
+ CHECK_5_STATUS="{PASS|GAP}"
188
+ CHECK_5_DETAIL="{M}/{N} sections reviewed"
189
+ CHECK_5_GAPS="{list of unreviewed sections}"
190
+ ```
191
+
192
+ </step>
193
+
194
+ <step name="write_audit">
195
+ **Step 3: Write MILESTONE-AUDIT.md**
196
+
197
+ Determine overall status:
198
+ - `OVERALL="PASS"` if all checks pass or skip
199
+ - `OVERALL="GAPS FOUND"` if any check has GAP status
200
+
201
+ Write `.planning/MILESTONE-AUDIT.md`:
202
+
203
+ ```markdown
204
+ # Milestone Audit
205
+
206
+ **Date:** {YYYY-MM-DD}
207
+ **Overall:** {PASS | GAPS FOUND}
208
+
209
+ ## Results
210
+
211
+ | Check | Status | Details |
212
+ |-------|--------|---------|
213
+ | Section Completion | {PASS/GAP/SKIP} | {CHECK_1_DETAIL} |
214
+ | Argument Coverage | {PASS/GAP/SKIP} | {CHECK_2_DETAIL} |
215
+ | Word Targets | {PASS/GAP/SKIP} | {CHECK_3_DETAIL} |
216
+ | Citation Completeness | {PASS/GAP/SKIP} | {CHECK_4_DETAIL} |
217
+ | Review Status | {PASS/GAP/SKIP} | {CHECK_5_DETAIL} |
218
+
219
+ ## Gaps
220
+
221
+ {For each GAP status, create a subsection:}
222
+
223
+ ### {Check Name}
224
+ - **Status:** gap
225
+ - **Finding:** {what's missing}
226
+ - **Affected:** {sections/claims/files}
227
+ - **Recommendation:** {what to do}
228
+
229
+ {If no gaps:}
230
+ No gaps found. Paper is ready for submission.
231
+
232
+ ## Summary
233
+
234
+ {If PASS: "Paper is ready for submission. Run `/wtfp:submit-milestone {version}` to archive."}
235
+ {If GAPS: "Found {N} gaps requiring attention. Run `/wtfp:plan-milestone-gaps` to create fix plans."}
236
+ ```
237
+
238
+ </step>
239
+
240
+ <step name="present_results">
241
+ **Step 4: Present Results**
242
+
243
+ ```
244
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
245
+ WTF-P ► AUDIT COMPLETE
246
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
247
+
248
+ Overall: {PASS | GAPS FOUND}
249
+
250
+ Results:
251
+ ✓ Section Completion: {details}
252
+ ✓ Argument Coverage: {details}
253
+ ✓ Word Targets: {details}
254
+ ✓ Citation Completeness: {details}
255
+ ✓ Review Status: {details}
256
+
257
+ {Use ✓ for PASS, ✗ for GAP, — for SKIP}
258
+
259
+ Audit saved to: .planning/MILESTONE-AUDIT.md
260
+
261
+ ───────────────────────────────────────────
262
+
263
+ ## Next Up
264
+
265
+ {If PASS:}
266
+ **Ready to submit:**
267
+ `/wtfp:submit-milestone {version}`
268
+
269
+ {If GAPS:}
270
+ **Fix gaps first:**
271
+ `/wtfp:plan-milestone-gaps` - Create fix plans from audit
272
+
273
+ ───────────────────────────────────────────
274
+ ```
275
+
276
+ </step>
277
+
278
+ </process>
279
+
280
+ <success_criteria>
281
+ - [ ] Environment validated
282
+ - [ ] 5 audit checks run (section, argument, word, citation, review)
283
+ - [ ] MILESTONE-AUDIT.md created with pass/gap per check
284
+ - [ ] Gaps include actionable recommendations
285
+ - [ ] Next steps offered based on result
286
+ </success_criteria>