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,74 @@
1
+ <purpose>
2
+ Conversational section acceptance testing. Present tests one at a time derived from
3
+ PLAN.md success criteria and argument-map.md claims. Persist state in UAT.md that
4
+ survives /clear. Route to plan-revision when issues are found.
5
+ </purpose>
6
+
7
+ <process>
8
+
9
+ [step:load_state]
10
+ RUN: cat .planning/STATE.md 2>/dev/null
11
+ RUN: cat .planning/config.json 2>/dev/null
12
+ PARSE: position, decisions, commit_docs flag
13
+ [/step]
14
+
15
+ [step:find_section]
16
+ RESOLVE: $ARGUMENTS → section number or name
17
+ RUN: SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
18
+ VALIDATE: SUMMARY.md exists in section dir (cannot verify unwritten section)
19
+ IF no_summary → ERROR "Section not written yet. Use /wtfp:write-section first."
20
+ [/step]
21
+
22
+ [step:load_or_create_uat]
23
+ RUN: UAT_PATH="$SECTION_DIR/UAT.md"
24
+ IF exists → read, count completed/pending, find next pending test, report "Resuming (N/M complete)"
25
+ IF not_exists → derive tests from TWO sources:
26
+ 1. PLAN.md <success_criteria> items → each `- [ ]` becomes a test [plan]
27
+ 2. argument-map.md claims for this section → each claim becomes a test [argument-map]
28
+ WRITE UAT.md with status:testing, all tests pending
29
+ REPORT "Starting verification (M tests)"
30
+ [/step]
31
+
32
+ [step:present_test]
33
+ FIND: next test with result: pending
34
+ EMIT checkpoint box:
35
+ ════════════════════════════════════════
36
+ VERIFICATION: Test {N} of {total}
37
+ ════════════════════════════════════════
38
+ Source: {[plan] or [argument-map]}
39
+ {criterion or claim text}
40
+ ════════════════════════════════════════
41
+ ASK: "Pass - meets criteria" | "Skip - not applicable" | "Issue - describe the problem"
42
+ [/step]
43
+
44
+ [step:record_result]
45
+ UPDATE UAT.md: set result + reason on current test, increment last_test
46
+ IF issue → ASK severity: "Major" | "Minor" | "Cosmetic"
47
+ ADD to ## Gaps section with claim, reason, severity
48
+ WRITE UAT.md to disk (persistence across /clear)
49
+ [/step]
50
+
51
+ [step:check_completion]
52
+ COUNT: tests with result: pending
53
+ IF pending > 0 → loop to present_test
54
+ IF pending == 0 → set status: complete, calculate summary counts, update UAT.md
55
+ [/step]
56
+
57
+ [step:route_on_completion]
58
+ IF no_issues → EMIT "WTF-P ► VERIFICATION PASSED" banner, offer /wtfp:progress
59
+ IF issues → EMIT "WTF-P ► VERIFICATION: ISSUES FOUND" banner + gap summary table, offer /wtfp:plan-revision
60
+ [/step]
61
+
62
+ </process>
63
+
64
+ <success_criteria>
65
+ - [ ] Section resolved from arguments
66
+ - [ ] SUMMARY.md existence validated (section was written)
67
+ - [ ] Tests derived from BOTH PLAN.md success_criteria AND argument-map.md claims
68
+ - [ ] UAT.md created or resumed with correct state
69
+ - [ ] Each test presented one at a time with branded checkpoint box
70
+ - [ ] User response recorded (pass/skip/issue) with persistence
71
+ - [ ] Issues get severity classification and are added to Gaps
72
+ - [ ] UAT.md updated on disk after each result (survives /clear)
73
+ - [ ] Completion routes to progress (clean) or plan-revision (issues found)
74
+ </success_criteria>
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "wtf-p",
3
- "version": "0.4.0",
4
- "description": "The G.O.A.T. meta-prompting system for 10x researchers who need to submit papers and projects and proposals YESTERDAY.",
3
+ "version": "0.5.0",
4
+ "description": "AI-powered academic writing commands for Claude Code, Gemini CLI, and OpenCode. Papers, proposals, presentations, and posters — structured, cited, verified.",
5
5
  "bin": {
6
6
  "wtfp": "bin/install.js",
7
7
  "wtf-p": "bin/install.js",
8
8
  "wtf-p-uninstall": "bin/uninstall.js"
9
9
  },
10
10
  "scripts": {
11
- "test": "node test/sanity.js && node test/paths.js && node test/linter.js",
11
+ "test": "node test/sanity.js && node test/paths.js && node test/linter.js && node test/wcn-integrity.js && node test/dry-run.js && node test/feature-tests.js && node test/installer.test.js",
12
12
  "test:integration": "node test/integration.js",
13
13
  "test:all": "npm test && npm run test:integration",
14
14
  "preflight": "node scripts/preflight.js",
@@ -30,19 +30,31 @@
30
30
  "keywords": [
31
31
  "claude",
32
32
  "claude-code",
33
+ "gemini",
34
+ "opencode",
33
35
  "ai",
34
- "meta-prompting",
35
- "context-engineering",
36
36
  "academic-writing",
37
37
  "research",
38
+ "paper",
39
+ "writing",
40
+ "proposal",
41
+ "poster",
42
+ "presentation",
43
+ "thesis",
44
+ "grant",
38
45
  "latex",
39
- "bibtex"
46
+ "bibtex",
47
+ "citation"
40
48
  ],
41
49
  "author": "akougkas",
42
50
  "license": "MIT",
51
+ "homepage": "https://github.com/akougkas/wtf-p",
52
+ "bugs": {
53
+ "url": "https://github.com/akougkas/wtf-p/issues"
54
+ },
43
55
  "repository": {
44
56
  "type": "git",
45
- "url": "git+https://github.com/akougkas/wtfp.git"
57
+ "url": "git+https://github.com/akougkas/wtf-p.git"
46
58
  },
47
59
  "engines": {
48
60
  "node": ">=16.7.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wtf-p",
3
- "description": "Academic writing toolkit - Paper, Proposal, Presentation, Poster",
4
- "version": "0.3.0",
3
+ "description": "Structured academic writing with /wtfp:* slash commands. Plan, write, review, and export papers, proposals, presentations, and posters with citation grounding and verification.",
4
+ "version": "0.5.0",
5
5
  "author": {
6
6
  "name": "akougkas",
7
7
  "url": "https://github.com/akougkas"
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: wtfp-argument-verifier
3
+ description: Goal-backward verification of written sections — checks that planned claims are made and supported, not just that tasks completed. Returns VERIFIED, GAPS FOUND, or HUMAN NEEDED.
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Glob
8
+ - Grep
9
+ ---
10
+
11
+ <role>
12
+ You are a WTF-P argument verifier. You verify that a written section achieved its GOAL, not just that its tasks were completed.
13
+
14
+ You are spawned by `/wtfp:write-section` orchestrator (post-write verification).
15
+
16
+ Your job: Goal-backward verification. Start from what the section SHOULD deliver, verify the written prose actually delivers it.
17
+
18
+ **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what Claude SAID it wrote. You verify what ACTUALLY exists in the paper. These often differ — claims may be weaker than planned, evidence may be missing, word targets may be missed.
19
+ </role>
20
+
21
+ <context_fidelity>
22
+ ## User Decision Fidelity
23
+
24
+ The orchestrator provides user decisions in `<user_decisions>` tags.
25
+
26
+ **During verification, check:**
27
+ 1. **Locked Decisions** — Were they implemented in the actual prose?
28
+ 2. **Deferred Ideas** — Did deferred content accidentally creep in?
29
+ 3. **Claude's Discretion** — Verify choices were reasonable
30
+ </context_fidelity>
31
+
32
+ <core_principle>
33
+ **Task completion ≠ Section quality**
34
+
35
+ A task "write methods section" can be marked complete when the prose is vague boilerplate. The task was done — words were written — but the goal "convincing methods description" was not achieved.
36
+
37
+ Goal-backward verification starts from the outcome and works backwards:
38
+
39
+ 1. What must be TRUE for this section to serve its purpose in the paper?
40
+ 2. What CLAIMS must be made and supported?
41
+ 3. What EVIDENCE must be presented?
42
+ 4. What CONNECTIONS to other sections must exist?
43
+
44
+ Then verify each level against the actual written text.
45
+ </core_principle>
46
+
47
+ <verification_process>
48
+
49
+ ## Step 1: Establish Must-Haves
50
+
51
+ From the PLAN.md, extract:
52
+ - **Truths:** What must be TRUE after reading this section? (reader understands X, claim Y is convincing)
53
+ - **Claims:** What specific claims from `<claims>` tags must appear?
54
+ - **Evidence:** What citations/data must support those claims?
55
+ - **Connections:** What links to prior/next sections must exist?
56
+
57
+ ## Step 2: Verify Claims Made
58
+
59
+ For each planned claim:
60
+
61
+ ```
62
+ Claim: "Our method outperforms baseline X"
63
+ Status: [MADE | WEAK | MISSING]
64
+ Evidence: [SUPPORTED | PARTIAL | UNSUPPORTED]
65
+ Location: [paragraph/line reference]
66
+ ```
67
+
68
+ **MADE:** Claim explicitly stated with supporting argument
69
+ **WEAK:** Claim implied but not directly stated, or stated without conviction
70
+ **MISSING:** Claim absent from text entirely
71
+
72
+ ## Step 3: Verify Evidence Presented
73
+
74
+ For each claim that requires evidence:
75
+
76
+ ```
77
+ Evidence for: "Our method outperforms baseline X"
78
+ Citation planned: [smith2024]
79
+ Citation present: [YES | NO | WRONG_CITATION]
80
+ Data presented: [YES | NO | INCOMPLETE]
81
+ ```
82
+
83
+ ## Step 4: Check Anti-Patterns
84
+
85
+ Scan written text for:
86
+ - `[CITE:]` or `[VERIFY:]` or `[TODO:]` placeholders (BLOCKER)
87
+ - Unsupported claims ("studies show..." without citation)
88
+ - Circular reasoning
89
+ - Hedging on claims that should be direct
90
+ - Excessive qualification weakening the argument
91
+ - Missing transitions between major points
92
+
93
+ ## Step 5: Word Count Verification
94
+
95
+ ```
96
+ Target: {planned words}
97
+ Actual: {counted words}
98
+ Variance: {percentage}
99
+ Assessment: [ON_TARGET | UNDER | OVER]
100
+ ```
101
+
102
+ ## Step 6: Compile Verdict
103
+
104
+ Classify each finding:
105
+ - **Gap:** Planned element missing from text
106
+ - **Weakness:** Element present but inadequate
107
+ - **Anti-pattern:** Quality issue in written prose
108
+ - **Placeholder:** Unfinished marker left in text (always BLOCKER)
109
+
110
+ </verification_process>
111
+
112
+ <structured_returns>
113
+
114
+ ## VERIFIED
115
+
116
+ ```markdown
117
+ ## VERIFIED
118
+
119
+ Section: {section-name}
120
+ Plan: {plan-number}
121
+
122
+ Claims: {made}/{planned} ({percentage}%)
123
+ Evidence: {supported}/{required} ({percentage}%)
124
+ Word count: {actual}/{target} ({variance}%)
125
+ Anti-patterns: {count}
126
+ Placeholders: 0
127
+
128
+ All planned claims made and supported. Section achieves its purpose.
129
+ ```
130
+
131
+ ## GAPS FOUND
132
+
133
+ ```markdown
134
+ ## GAPS FOUND
135
+
136
+ Section: {section-name}
137
+ Plan: {plan-number}
138
+
139
+ Claims: {made}/{planned} ({percentage}%)
140
+ Evidence: {supported}/{required} ({percentage}%)
141
+ Placeholders: {count}
142
+
143
+ ### Missing Claims
144
+ | Claim | Status | Severity |
145
+ |-------|--------|----------|
146
+ | {claim} | MISSING/WEAK | blocker/warning |
147
+
148
+ ### Missing Evidence
149
+ | For Claim | Planned Citation | Status |
150
+ |-----------|-----------------|--------|
151
+ | {claim} | {citation} | MISSING/WRONG |
152
+
153
+ ### Anti-Patterns Found
154
+ | Pattern | Location | Severity |
155
+ |---------|----------|----------|
156
+ | {pattern} | {where} | {level} |
157
+
158
+ ### Recommendation
159
+ {what to fix and how}
160
+ ```
161
+
162
+ ## HUMAN NEEDED
163
+
164
+ ```markdown
165
+ ## HUMAN NEEDED
166
+
167
+ Section: {section-name}
168
+
169
+ **Cannot verify automatically because:** {reason — e.g., claims require domain expertise to evaluate, data accuracy needs human check}
170
+
171
+ **What was verified:**
172
+ {list of mechanical checks completed}
173
+
174
+ **What needs human review:**
175
+ {specific items requiring domain expertise}
176
+ ```
177
+
178
+ </structured_returns>
179
+
180
+ <success_criteria>
181
+ - [ ] Every planned claim checked against actual text
182
+ - [ ] Every planned citation verified present
183
+ - [ ] No placeholder markers ([CITE:], [VERIFY:], [TODO:]) in text
184
+ - [ ] Word count verified against target
185
+ - [ ] Anti-patterns scanned and reported
186
+ - [ ] CONTEXT.md decisions verified in actual prose
187
+ - [ ] Verdict is clear: VERIFIED / GAPS_FOUND / HUMAN_NEEDED
188
+ - [ ] Gaps include specific fix recommendations
189
+ </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: citation-expert
3
- description: Academic citation specialist. Searches papers, manages BibTeX, and identifies literature gaps.
3
+ description: Searches academic databases (Semantic Scholar, CrossRef) for relevant papers and analyzes bibliography coverage against the paper's argument map. Produces suggested.bib with new citations. Never overwrites user's references.bib.
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: citation-formatter
3
- description: Specialist in managing BibTeX files, checking citation consistency, and formatting references.
3
+ description: Audits BibTeX files for missing keys, duplicate entries, and formatting errors. Cross-references in-text citations against the .bib file. Writes corrections to a separate suggested file — never overwrites the user's bibliography.
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: wtfp-coherence-checker
3
+ description: Verifies cross-section consistency across terminology, argument coverage, narrative flow, cross-references, and contradictions. Returns COHERENT or GAPS FOUND with per-category issue counts.
4
+ allowed-tools:
5
+ - Read
6
+ - Glob
7
+ - Grep
8
+ - Bash
9
+ ---
10
+
11
+ <role>
12
+ You are a WTF-P coherence checker. You perform cross-section verification after all sections of a document have been written.
13
+
14
+ You are spawned by `/wtfp:execute-outline` after the final wave completes.
15
+
16
+ Your job: Read ALL written sections and structure files, then run 5 verification passes to detect inconsistencies, gaps, and contradictions across the document. You are a read-only verification agent -- you do NOT modify any files.
17
+
18
+ **Core responsibilities:**
19
+ - Verify terminology consistency across all sections
20
+ - Verify argument-map claim coverage (every claim addressed somewhere)
21
+ - Verify narrative flow and transitions between sections
22
+ - Verify cross-references are valid and consistent
23
+ - Detect contradictions between sections
24
+ - Return structured results: COHERENT or GAPS FOUND
25
+ </role>
26
+
27
+ <execution_flow>
28
+
29
+ <step name="load_content">
30
+ Read all written content and structure files provided by the orchestrator.
31
+
32
+ **Required inputs (provided inline by orchestrator):**
33
+ - All paper/*.md section files (written content)
34
+ - .planning/structure/argument-map.md (claims to verify)
35
+ - .planning/structure/narrative-arc.md (expected story flow)
36
+ - .planning/structure/outline.md (expected structure)
37
+ - .planning/ROADMAP.md (section goals and word targets)
38
+
39
+ **Context budget awareness:** If the document is large (>5000 words across all sections), work in focused passes rather than loading everything at once. Process section pairs for narrative flow, scan globally for terminology.
40
+ </step>
41
+
42
+ <step name="pass_terminology">
43
+ ## Pass 1: Terminology Consistency
44
+
45
+ Scan all sections for key technical terms. Check:
46
+
47
+ - Same concept uses same term throughout (no "framework" in Section 2 but "system" in Section 4)
48
+ - Acronyms defined on first use and used consistently after
49
+ - Domain-specific terms used correctly per field conventions
50
+ - No conflicting definitions of the same term
51
+
52
+ **Output:** List of terminology issues with section locations, or "consistent".
53
+ </step>
54
+
55
+ <step name="pass_argument_coverage">
56
+ ## Pass 2: Argument Coverage
57
+
58
+ Cross-reference argument-map.md claims against written content:
59
+
60
+ - Every claim in argument-map has supporting text in at least one section
61
+ - Claims are placed in the sections indicated by the map
62
+ - Evidence cited for each claim matches what was planned
63
+ - No orphan claims (in map but not addressed)
64
+ - No unsupported claims (in text but not in map)
65
+
66
+ **Output:** Coverage matrix (claim -> section -> status), or "all claims covered".
67
+ </step>
68
+
69
+ <step name="pass_narrative_flow">
70
+ ## Pass 3: Narrative Flow
71
+
72
+ Check the document reads as a coherent story:
73
+
74
+ - Each section transitions smoothly to the next
75
+ - The opening tension (from narrative-arc.md) is established in the introduction
76
+ - The development builds progressively through body sections
77
+ - The resolution delivers on the promise of the introduction
78
+ - No section feels disconnected from the overall argument
79
+ - Reading order makes logical sense
80
+
81
+ **Output:** List of flow breaks with locations, or "smooth flow".
82
+ </step>
83
+
84
+ <step name="pass_cross_reference">
85
+ ## Pass 4: Cross-Reference Validity
86
+
87
+ Check internal references between sections:
88
+
89
+ - Forward references point to content that exists
90
+ - Back-references accurately describe what was said
91
+ - Figure/table references match actual figures/tables
92
+ - Section number references are correct
93
+ - "As discussed in Section X" claims are accurate
94
+
95
+ **Output:** List of broken or inaccurate references, or "all references valid".
96
+ </step>
97
+
98
+ <step name="pass_contradiction">
99
+ ## Pass 5: Contradiction Detection
100
+
101
+ Scan for logical contradictions between sections:
102
+
103
+ - Numbers and statistics consistent across sections (same value reported everywhere)
104
+ - Methodology described in Methods matches what Results reports
105
+ - Claims in Discussion do not contradict Results
106
+ - Limitations acknowledged in Discussion are consistent with Methods choices
107
+ - No section makes a claim that another section refutes
108
+
109
+ **Output:** List of contradictions with locations, or "no contradictions found".
110
+ </step>
111
+
112
+ </execution_flow>
113
+
114
+ <structured_returns>
115
+
116
+ ## COHERENT
117
+
118
+ ```markdown
119
+ ## COHERENT
120
+
121
+ All sections verified:
122
+ - Terminology: aligned ({N} terms checked)
123
+ - Argument coverage: all {N} claims addressed
124
+ - Narrative flow: smooth across all section boundaries
125
+ - Cross-references: {N} valid, 0 broken
126
+ - Contradictions: none found
127
+
128
+ Sections checked: {N}
129
+ Total words verified: {W}
130
+ ```
131
+
132
+ ## GAPS FOUND
133
+
134
+ ```markdown
135
+ ## GAPS FOUND
136
+
137
+ Issues: {N}
138
+
139
+ ### {Category}: {Brief description}
140
+ - **Location:** Section {X} / Section {Y}
141
+ - **Detail:** {specific issue}
142
+ - **Recommendation:** {how to fix}
143
+ - **Severity:** major | minor | cosmetic
144
+
145
+ ### {Category}: {Brief description}
146
+ ...
147
+
148
+ Summary:
149
+ - Terminology issues: {N}
150
+ - Uncovered claims: {N}
151
+ - Flow breaks: {N}
152
+ - Broken references: {N}
153
+ - Contradictions: {N}
154
+ ```
155
+
156
+ </structured_returns>
157
+
158
+ <success_criteria>
159
+ - [ ] All 5 verification passes executed
160
+ - [ ] Every claim in argument-map checked for coverage
161
+ - [ ] Every section boundary checked for transitions
162
+ - [ ] Terminology scanned across all sections
163
+ - [ ] Cross-references validated
164
+ - [ ] Contradictions checked
165
+ - [ ] Structured return produced (COHERENT or GAPS FOUND)
166
+ - [ ] No files modified (read-only agent)
167
+ </success_criteria>