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.
- package/README.md +146 -208
- package/bin/commands/doctor.js +88 -2
- package/bin/commands/install-logic.js +127 -36
- package/bin/commands/status.js +22 -4
- package/bin/commands/update.js +5 -4
- package/bin/install.js +66 -26
- package/bin/lib/analyze-impact.js +105 -0
- package/bin/lib/bib-format.js +161 -0
- package/bin/lib/bib-index.js +104 -0
- package/bin/lib/checkpoint.js +183 -0
- package/bin/lib/citation-fetcher.js +299 -0
- package/bin/lib/citation-ranker.js +133 -0
- package/bin/lib/context-primer.js +214 -0
- package/bin/lib/manifest.js +80 -2
- package/bin/lib/scholar-lookup.js +188 -0
- package/bin/lib/semantic-scholar.js +184 -0
- package/bin/lib/utils.js +22 -1
- package/bin/uninstall.js +270 -111
- package/core/write-the-f-paper/references/agent-model-matrix.md +62 -0
- package/core/write-the-f-paper/references/checkpoints.md +160 -9
- package/core/write-the-f-paper/references/context-fidelity.md +153 -0
- package/core/write-the-f-paper/references/deviation-rules.md +150 -0
- package/core/write-the-f-paper/references/git-integration.md +80 -0
- package/core/write-the-f-paper/references/orchestrator-pattern.md +167 -0
- package/core/write-the-f-paper/references/planning-config.md +135 -0
- package/core/write-the-f-paper/references/ui-brand.md +186 -0
- package/core/write-the-f-paper/templates/UAT.md +80 -0
- package/core/write-the-f-paper/templates/base-prefs.yaml +42 -0
- package/core/write-the-f-paper/templates/config.json +31 -5
- package/core/write-the-f-paper/workflows/create-outline.wcn.md +1 -1
- package/core/write-the-f-paper/workflows/execute-outline.md +163 -0
- package/core/write-the-f-paper/workflows/execute-outline.wcn.md +73 -0
- package/core/write-the-f-paper/workflows/execute-section.wcn.md +141 -169
- package/core/write-the-f-paper/workflows/plan-section.wcn.md +96 -103
- package/core/write-the-f-paper/workflows/research-gap.md +27 -3
- package/core/write-the-f-paper/workflows/research-gap.wcn.md +18 -1
- package/core/write-the-f-paper/workflows/verify-work.md +251 -0
- package/core/write-the-f-paper/workflows/verify-work.wcn.md +74 -0
- package/package.json +19 -7
- package/vendors/claude/.claude-plugin/plugin.json +2 -2
- package/vendors/claude/agents/wtfp/argument-verifier.md +189 -0
- package/vendors/claude/agents/wtfp/citation-expert.md +45 -0
- package/vendors/claude/agents/wtfp/citation-formatter.md +42 -0
- package/vendors/claude/agents/wtfp/coherence-checker.md +167 -0
- package/vendors/claude/agents/wtfp/outliner.md +259 -0
- package/vendors/claude/agents/wtfp/plan-checker.md +249 -0
- package/vendors/claude/agents/wtfp/prose-polisher.md +166 -0
- package/vendors/claude/agents/wtfp/research-synthesizer.md +215 -0
- package/vendors/claude/agents/wtfp/section-planner.md +364 -0
- package/vendors/claude/agents/wtfp/section-reviewer.md +182 -0
- package/vendors/claude/agents/wtfp/section-writer.md +312 -0
- package/vendors/claude/commands/wtfp/add-todo.md +108 -0
- package/vendors/claude/commands/wtfp/analyze-bib.md +60 -249
- package/vendors/claude/commands/wtfp/audit-milestone.md +286 -0
- package/vendors/claude/commands/wtfp/check-refs.md +60 -131
- package/vendors/claude/commands/wtfp/check-todos.md +152 -0
- package/vendors/claude/commands/wtfp/checkpoint.md +105 -0
- package/vendors/claude/commands/wtfp/contribute.md +1 -1
- package/vendors/claude/commands/wtfp/create-outline.md +109 -195
- package/vendors/claude/commands/wtfp/create-poster.md +1 -1
- package/vendors/claude/commands/wtfp/create-slides.md +1 -1
- package/vendors/claude/commands/wtfp/discuss-section.md +1 -1
- package/vendors/claude/commands/wtfp/execute-outline.md +257 -0
- package/vendors/claude/commands/wtfp/export-latex.md +1 -1
- package/vendors/claude/commands/wtfp/help.md +174 -280
- package/vendors/claude/commands/wtfp/insert-section.md +1 -1
- package/vendors/claude/commands/wtfp/list-assumptions.md +1 -1
- package/vendors/claude/commands/wtfp/map-project.md +35 -124
- package/vendors/claude/commands/wtfp/new-paper.md +88 -362
- package/vendors/claude/commands/wtfp/pause-writing.md +1 -1
- package/vendors/claude/commands/wtfp/plan-milestone-gaps.md +255 -0
- package/vendors/claude/commands/wtfp/plan-revision.md +1 -1
- package/vendors/claude/commands/wtfp/plan-section.md +165 -190
- package/vendors/claude/commands/wtfp/polish-prose.md +66 -118
- package/vendors/claude/commands/wtfp/progress.md +82 -254
- package/vendors/claude/commands/wtfp/quick.md +107 -0
- package/vendors/claude/commands/wtfp/remove-section.md +1 -1
- package/vendors/claude/commands/wtfp/report-bug.md +1 -1
- package/vendors/claude/commands/wtfp/request-feature.md +1 -1
- package/vendors/claude/commands/wtfp/research-gap.md +138 -151
- package/vendors/claude/commands/wtfp/resume-writing.md +1 -1
- package/vendors/claude/commands/wtfp/review-section.md +55 -333
- package/vendors/claude/commands/wtfp/settings.md +197 -0
- package/vendors/claude/commands/wtfp/submit-milestone.md +248 -99
- package/vendors/claude/commands/wtfp/update.md +112 -0
- package/vendors/claude/commands/wtfp/verify-work.md +254 -0
- package/vendors/claude/commands/wtfp/write-section.md +144 -180
- package/vendors/claude/mcp/research-server/package.json +13 -0
- package/vendors/claude/mcp/research-server/src/index.js +133 -0
- package/vendors/gemini/agents/wtfp/argument-verifier.md +184 -0
- package/vendors/gemini/agents/wtfp/citation-expert.md +41 -0
- package/vendors/gemini/agents/wtfp/citation-formatter.md +38 -0
- package/vendors/gemini/agents/wtfp/coherence-checker.md +162 -0
- package/vendors/gemini/agents/wtfp/outliner.md +252 -0
- package/vendors/gemini/agents/wtfp/plan-checker.md +244 -0
- package/vendors/gemini/agents/wtfp/prose-polisher.md +158 -0
- package/vendors/gemini/agents/wtfp/research-synthesizer.md +205 -0
- package/vendors/gemini/agents/wtfp/section-planner.md +355 -0
- package/vendors/gemini/agents/wtfp/section-reviewer.md +175 -0
- package/vendors/gemini/agents/wtfp/section-writer.md +304 -0
- package/vendors/gemini/commands/wtfp/add-todo.toml +102 -0
- package/vendors/gemini/commands/wtfp/analyze-bib.toml +126 -0
- package/vendors/gemini/commands/wtfp/audit-milestone.toml +278 -0
- package/vendors/gemini/commands/wtfp/check-refs.toml +123 -0
- package/vendors/gemini/commands/wtfp/check-todos.toml +145 -0
- package/vendors/gemini/commands/wtfp/checkpoint.toml +96 -0
- package/vendors/gemini/commands/wtfp/contribute.toml +269 -0
- package/vendors/gemini/commands/wtfp/create-outline.toml +180 -0
- package/vendors/gemini/commands/wtfp/create-poster.toml +36 -0
- package/vendors/gemini/commands/wtfp/create-slides.toml +35 -0
- package/vendors/gemini/commands/wtfp/discuss-section.toml +62 -0
- package/vendors/gemini/commands/wtfp/execute-outline.toml +247 -0
- package/vendors/gemini/commands/wtfp/export-latex.toml +209 -0
- package/vendors/gemini/commands/wtfp/help.toml +184 -0
- package/vendors/gemini/commands/wtfp/insert-section.toml +123 -0
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +104 -0
- package/vendors/gemini/commands/wtfp/map-project.toml +99 -0
- package/vendors/gemini/commands/wtfp/new-paper.toml +160 -0
- package/vendors/gemini/commands/wtfp/pause-writing.toml +140 -0
- package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +249 -0
- package/vendors/gemini/commands/wtfp/plan-revision.toml +171 -0
- package/vendors/gemini/commands/wtfp/plan-section.toml +212 -0
- package/vendors/gemini/commands/wtfp/polish-prose.toml +114 -0
- package/vendors/gemini/commands/wtfp/progress.toml +145 -0
- package/vendors/gemini/commands/wtfp/quick.toml +96 -0
- package/vendors/gemini/commands/wtfp/remove-section.toml +140 -0
- package/vendors/gemini/commands/wtfp/report-bug.toml +126 -0
- package/vendors/gemini/commands/wtfp/request-feature.toml +155 -0
- package/vendors/gemini/commands/wtfp/research-gap.toml +214 -0
- package/vendors/gemini/commands/wtfp/resume-writing.toml +136 -0
- package/vendors/gemini/commands/wtfp/review-section.toml +121 -0
- package/vendors/gemini/commands/wtfp/settings.toml +191 -0
- package/vendors/gemini/commands/wtfp/submit-milestone.toml +351 -0
- package/vendors/gemini/commands/wtfp/update.toml +107 -0
- package/vendors/gemini/commands/wtfp/verify-work.toml +245 -0
- package/vendors/gemini/commands/wtfp/write-section.toml +228 -0
- package/vendors/opencode/agents/wtfp/argument-verifier.md +184 -0
- package/vendors/opencode/agents/wtfp/citation-expert.md +41 -0
- package/vendors/opencode/agents/wtfp/citation-formatter.md +38 -0
- package/vendors/opencode/agents/wtfp/coherence-checker.md +162 -0
- package/vendors/opencode/agents/wtfp/outliner.md +252 -0
- package/vendors/opencode/agents/wtfp/plan-checker.md +244 -0
- package/vendors/opencode/agents/wtfp/prose-polisher.md +158 -0
- package/vendors/opencode/agents/wtfp/research-synthesizer.md +205 -0
- package/vendors/opencode/agents/wtfp/section-planner.md +355 -0
- package/vendors/opencode/agents/wtfp/section-reviewer.md +175 -0
- package/vendors/opencode/agents/wtfp/section-writer.md +304 -0
- package/vendors/opencode/commands/wtfp/add-todo.md +103 -0
- package/vendors/opencode/commands/wtfp/analyze-bib.md +127 -0
- package/vendors/opencode/commands/wtfp/audit-milestone.md +279 -0
- package/vendors/opencode/commands/wtfp/check-refs.md +124 -0
- package/vendors/opencode/commands/wtfp/check-todos.md +146 -0
- package/vendors/opencode/commands/wtfp/checkpoint.md +97 -0
- package/vendors/opencode/commands/wtfp/contribute.md +266 -0
- package/vendors/opencode/commands/wtfp/create-outline.md +181 -0
- package/vendors/opencode/commands/wtfp/create-poster.md +37 -0
- package/vendors/opencode/commands/wtfp/create-slides.md +36 -0
- package/vendors/opencode/commands/wtfp/discuss-section.md +63 -0
- package/vendors/opencode/commands/wtfp/execute-outline.md +248 -0
- package/vendors/opencode/commands/wtfp/export-latex.md +210 -0
- package/vendors/opencode/commands/wtfp/help.md +185 -0
- package/vendors/opencode/commands/wtfp/insert-section.md +124 -0
- package/vendors/opencode/commands/wtfp/list-assumptions.md +105 -0
- package/vendors/opencode/commands/wtfp/map-project.md +100 -0
- package/vendors/opencode/commands/wtfp/new-paper.md +161 -0
- package/vendors/opencode/commands/wtfp/pause-writing.md +141 -0
- package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +250 -0
- package/vendors/opencode/commands/wtfp/plan-revision.md +174 -0
- package/vendors/opencode/commands/wtfp/plan-section.md +214 -0
- package/vendors/opencode/commands/wtfp/polish-prose.md +115 -0
- package/vendors/opencode/commands/wtfp/progress.md +146 -0
- package/vendors/opencode/commands/wtfp/quick.md +97 -0
- package/vendors/opencode/commands/wtfp/remove-section.md +141 -0
- package/vendors/opencode/commands/wtfp/report-bug.md +127 -0
- package/vendors/opencode/commands/wtfp/request-feature.md +156 -0
- package/vendors/opencode/commands/wtfp/research-gap.md +215 -0
- package/vendors/opencode/commands/wtfp/resume-writing.md +137 -0
- package/vendors/opencode/commands/wtfp/review-section.md +123 -0
- package/vendors/opencode/commands/wtfp/settings.md +192 -0
- package/vendors/opencode/commands/wtfp/submit-milestone.md +352 -0
- package/vendors/opencode/commands/wtfp/update.md +108 -0
- package/vendors/opencode/commands/wtfp/verify-work.md +246 -0
- package/vendors/opencode/commands/wtfp/write-section.md +228 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:polish-prose
|
|
3
|
+
description: Improve clarity, flow, and academic voice in written prose
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<execution_context>
|
|
7
|
+
@~/.opencode/write-the-f-paper/references/principles.md
|
|
8
|
+
</execution_context>
|
|
9
|
+
|
|
10
|
+
<objective>
|
|
11
|
+
Polish prose to eliminate robotic AI-sounding text and improve academic voice.
|
|
12
|
+
|
|
13
|
+
**Orchestrator role:** Identify target files, gather voice preference, resolve model profile, spawn prose-polisher agent, present results.
|
|
14
|
+
</objective>
|
|
15
|
+
|
|
16
|
+
<context>
|
|
17
|
+
Target: $ARGUMENTS (section number, file path, or "all" for full manuscript)
|
|
18
|
+
|
|
19
|
+
**Load project state:**
|
|
20
|
+
@.planning/STATE.md
|
|
21
|
+
</context>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
## 1. Validate Environment and Resolve Model Profile
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
ls paper/*.md 2>/dev/null || echo "No content in paper/ directory"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Agent | quality | balanced | budget |
|
|
36
|
+
|-------|---------|----------|--------|
|
|
37
|
+
| prose-polisher | opus | sonnet | haiku |
|
|
38
|
+
|
|
39
|
+
## 2. Identify Target and Gather Preferences
|
|
40
|
+
|
|
41
|
+
Parse $ARGUMENTS to find target file(s).
|
|
42
|
+
|
|
43
|
+
Use the question tool:
|
|
44
|
+
- header: "Voice"
|
|
45
|
+
- question: "What tone should dominate this section?"
|
|
46
|
+
- options:
|
|
47
|
+
- "Authoritative" — Confident, direct claims
|
|
48
|
+
- "Measured" — Careful hedging, academic caution
|
|
49
|
+
- "Accessible" — Clear to non-specialists
|
|
50
|
+
- "Technical" — Dense, specialist terminology OK
|
|
51
|
+
|
|
52
|
+
## 3. Read Context Files
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
TARGET_CONTENT=$(cat paper/[target].md 2>/dev/null)
|
|
56
|
+
STYLE_CONTENT=$(cat .planning/sources/style-guide.md 2>/dev/null)
|
|
57
|
+
|
|
58
|
+
SECTION_DIR=$(ls -d .planning/sections/${SECTION}-* 2>/dev/null | head -1)
|
|
59
|
+
CONTEXT_CONTENT=$(cat "${SECTION_DIR}"/*-CONTEXT.md 2>/dev/null)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 4. Spawn wtfp-prose-polisher Agent
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
+
WTF-P ► POLISHING PROSE
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
Task(
|
|
72
|
+
prompt="First, read ~/.opencode/agents/wtfp/prose-polisher.md for your role and instructions.\n\n" + filled_polish_prompt,
|
|
73
|
+
subagent_type="general-purpose",
|
|
74
|
+
model="{polisher_model}",
|
|
75
|
+
description="Polish prose"
|
|
76
|
+
)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Polish prompt includes: `<target_content>` with section text, `<voice_preference>` with user selection, `<style_guide>` with style context, `<user_decisions>` with CONTEXT_CONTENT.
|
|
80
|
+
|
|
81
|
+
## 5. Handle Polisher Return
|
|
82
|
+
|
|
83
|
+
**`## POLISH COMPLETE`:** Present before/after summary.
|
|
84
|
+
|
|
85
|
+
**`## POLISH BLOCKED`:** Present blocker, ask user how to proceed.
|
|
86
|
+
|
|
87
|
+
## 6. Present Results
|
|
88
|
+
|
|
89
|
+
</process>
|
|
90
|
+
|
|
91
|
+
<offer_next>
|
|
92
|
+
|
|
93
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
94
|
+
WTF-P ► PROSE POLISHED ✓
|
|
95
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
96
|
+
|
|
97
|
+
───────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
## Next Up
|
|
100
|
+
|
|
101
|
+
- `/wtfp:review-section {N}` — Get reviewer feedback
|
|
102
|
+
- `/wtfp:check-refs` — Verify citations
|
|
103
|
+
- `/wtfp:export-latex` — Generate LaTeX
|
|
104
|
+
|
|
105
|
+
───────────────────────────────────────────
|
|
106
|
+
|
|
107
|
+
</offer_next>
|
|
108
|
+
|
|
109
|
+
<success_criteria>
|
|
110
|
+
- [ ] Target file(s) identified
|
|
111
|
+
- [ ] Voice preference gathered
|
|
112
|
+
- [ ] Prose-polisher spawned with full context
|
|
113
|
+
- [ ] Changes applied to paper/ files
|
|
114
|
+
- [ ] User knows next steps
|
|
115
|
+
</success_criteria>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:progress
|
|
3
|
+
description: Check writing progress, show context, and route to next action
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Check writing progress, summarize recent work, and intelligently route to the next action.
|
|
8
|
+
|
|
9
|
+
**Orchestrator role:** Load state files, calculate progress metrics, present rich status report, determine and offer the next logical command.
|
|
10
|
+
</objective>
|
|
11
|
+
|
|
12
|
+
<context>
|
|
13
|
+
No arguments. Reads project state from .planning/.
|
|
14
|
+
</context>
|
|
15
|
+
|
|
16
|
+
<process>
|
|
17
|
+
|
|
18
|
+
## 1. Validate Environment
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
ls .planning/STATE.md .planning/ROADMAP.md .planning/PROJECT.md 2>/dev/null
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If missing `.planning/` -> suggest `/wtfp:new-paper`.
|
|
25
|
+
If missing STATE.md or ROADMAP.md -> suggest what's needed.
|
|
26
|
+
|
|
27
|
+
## 2. Load Project Context
|
|
28
|
+
|
|
29
|
+
Read: STATE.md, ROADMAP.md, PROJECT.md, config.json (for model_profile).
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 3. Gather Recent Work
|
|
36
|
+
|
|
37
|
+
Find 2-3 most recent SUMMARY.md files. Extract: what was written, key decisions, issues.
|
|
38
|
+
|
|
39
|
+
## 4. Parse Current Position
|
|
40
|
+
|
|
41
|
+
From STATE.md: current section, plan number, status, word count.
|
|
42
|
+
Calculate: total plans, completed, remaining. Total words vs target.
|
|
43
|
+
Check for CONTEXT.md in current section directory.
|
|
44
|
+
|
|
45
|
+
## 4b. Build Statusline
|
|
46
|
+
|
|
47
|
+
Build the statusline string:
|
|
48
|
+
```
|
|
49
|
+
WTF-P > {section progress} * {word count} > {model_profile}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Section progress:** `{completed}/{total} sections` (count SUMMARY.md files vs total sections)
|
|
53
|
+
|
|
54
|
+
**Word count:** `{current_words}/{target_words}w` (from STATE.md and PROJECT.md)
|
|
55
|
+
|
|
56
|
+
**Model profile:** from config.json (quality/balanced/budget)
|
|
57
|
+
|
|
58
|
+
**Update indicator:** Check for newer version quietly:
|
|
59
|
+
```bash
|
|
60
|
+
CURRENT=$(node -e "console.log(require('$(npm root -g)/wtf-p/package.json').version)" 2>/dev/null || echo "")
|
|
61
|
+
LATEST=$(npm view wtf-p version 2>/dev/null || echo "")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If LATEST exists and CURRENT < LATEST, append ` ^ update` to statusline.
|
|
65
|
+
|
|
66
|
+
**Pending todos:** Count files:
|
|
67
|
+
```bash
|
|
68
|
+
PENDING_TODOS=$(ls -1 .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 5. Present Status Report
|
|
72
|
+
|
|
73
|
+
**Display statusline FIRST** (before all other output):
|
|
74
|
+
```
|
|
75
|
+
WTF-P > 3/6 sections * 4200/8000w > balanced ^ update
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then the detailed status report:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
# [Paper Title]
|
|
82
|
+
|
|
83
|
+
**Progress:** [########--] 8/10 sections drafted
|
|
84
|
+
**Words:** [current] / [target] ([percentage]%)
|
|
85
|
+
**Profile:** [quality/balanced/budget]
|
|
86
|
+
|
|
87
|
+
## Recent Work
|
|
88
|
+
- [Section X]: [1-line summary]
|
|
89
|
+
|
|
90
|
+
## Current Position
|
|
91
|
+
Section [N] of [total]: [name] -- [status]
|
|
92
|
+
CONTEXT: [yes | -]
|
|
93
|
+
|
|
94
|
+
## Key Decisions
|
|
95
|
+
- [from STATE.md]
|
|
96
|
+
|
|
97
|
+
## Open Issues
|
|
98
|
+
- [deferred items]
|
|
99
|
+
|
|
100
|
+
## Pending Todos
|
|
101
|
+
{PENDING_TODOS} pending (run /wtfp:check-todos to review)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 6. Route to Next Action
|
|
105
|
+
|
|
106
|
+
**Count files in current section:**
|
|
107
|
+
```bash
|
|
108
|
+
ls -1 .planning/sections/[dir]/*-PLAN.md 2>/dev/null | wc -l
|
|
109
|
+
ls -1 .planning/sections/[dir]/*-SUMMARY.md 2>/dev/null | wc -l
|
|
110
|
+
ls -1 .planning/sections/[dir]/*-ISSUES.md 2>/dev/null | wc -l
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Route A -- Unexecuted plan exists** (summaries < plans):
|
|
114
|
+
Find first PLAN.md without SUMMARY.md. Offer `/wtfp:write-section [path]`.
|
|
115
|
+
|
|
116
|
+
**Route B -- Section needs planning** (plans = 0):
|
|
117
|
+
If CONTEXT.md exists -> offer `/wtfp:plan-section {N}`.
|
|
118
|
+
If not -> offer `/wtfp:discuss-section {N}` or `/wtfp:plan-section {N}`.
|
|
119
|
+
|
|
120
|
+
**Route C -- Section complete, more remain** (summaries = plans, not last section):
|
|
121
|
+
Offer `/wtfp:plan-section {N+1}`. Also: `/wtfp:review-section {N}`.
|
|
122
|
+
|
|
123
|
+
**Route D -- Draft complete** (all sections done):
|
|
124
|
+
Offer `/wtfp:review-section` and `/wtfp:export-latex`.
|
|
125
|
+
|
|
126
|
+
**Route E -- Review issues need revision** (ISSUES.md without REVISION.md):
|
|
127
|
+
Offer `/wtfp:plan-revision {plan}`.
|
|
128
|
+
|
|
129
|
+
</process>
|
|
130
|
+
|
|
131
|
+
<offer_next>
|
|
132
|
+
|
|
133
|
+
Show the routed next action with clear command and `/clear` suggestion.
|
|
134
|
+
|
|
135
|
+
</offer_next>
|
|
136
|
+
|
|
137
|
+
<success_criteria>
|
|
138
|
+
- [ ] Statusline displayed first: WTF-P > {sections} * {words} > {profile} [^ update]
|
|
139
|
+
- [ ] Update indicator shown when newer version available
|
|
140
|
+
- [ ] Pending todo count shown
|
|
141
|
+
- [ ] Rich context provided (recent work, word counts, decisions)
|
|
142
|
+
- [ ] Current position clear with visual progress
|
|
143
|
+
- [ ] Model profile shown
|
|
144
|
+
- [ ] Smart routing to next command
|
|
145
|
+
- [ ] User confirms before any action
|
|
146
|
+
</success_criteria>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:quick
|
|
3
|
+
description: Run a small writing fix without full planning overhead
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Execute a quick writing task with atomic commits and state tracking but skip optional agents (plan-checker, argument-verifier).
|
|
8
|
+
|
|
9
|
+
**Orchestrator role:** Parse task, load minimal context, execute directly or spawn writer agent, commit result.
|
|
10
|
+
|
|
11
|
+
Use for small targeted tasks: fix a paragraph, add a citation, tweak wording, expand a point.
|
|
12
|
+
</objective>
|
|
13
|
+
|
|
14
|
+
<context>
|
|
15
|
+
Task: $ARGUMENTS (natural language description of what to do)
|
|
16
|
+
|
|
17
|
+
**Load project state:**
|
|
18
|
+
@.planning/STATE.md
|
|
19
|
+
@.planning/config.json
|
|
20
|
+
</context>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
## 1. Validate Environment
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ls .planning/ 2>/dev/null || echo "No project — will work on files directly"
|
|
28
|
+
ls paper/*.md 2>/dev/null
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 2. Parse Task Intent
|
|
32
|
+
|
|
33
|
+
Classify $ARGUMENTS into task type:
|
|
34
|
+
- **fix** — Correct an error, fix citation, resolve contradiction
|
|
35
|
+
- **add** — Add a paragraph, citation, transition, figure reference
|
|
36
|
+
- **revise** — Rewrite a paragraph, strengthen argument, tighten prose
|
|
37
|
+
- **cite** — Add or fix specific citations
|
|
38
|
+
|
|
39
|
+
## 3. Load Minimal Context
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
43
|
+
STATE_CONTENT=$(cat .planning/STATE.md 2>/dev/null)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Only load files directly relevant to the task. No full context dump.
|
|
47
|
+
|
|
48
|
+
## 4. Execute Task
|
|
49
|
+
|
|
50
|
+
**For simple tasks (fix, cite):** Execute directly in orchestrator — read target file, make edit, verify.
|
|
51
|
+
|
|
52
|
+
**For complex tasks (add, revise):** Spawn section-writer agent with focused prompt.
|
|
53
|
+
|
|
54
|
+
| Agent | quality | balanced | budget |
|
|
55
|
+
|-------|---------|----------|--------|
|
|
56
|
+
| section-writer | opus | sonnet | sonnet |
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Task(
|
|
60
|
+
prompt="First, read ~/.opencode/agents/wtfp/section-writer.md for your role.\n\n" + focused_prompt,
|
|
61
|
+
subagent_type="general-purpose",
|
|
62
|
+
model="{writer_model}",
|
|
63
|
+
description="Quick: [task summary]"
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Skip:** plan-checker, argument-verifier (quick mode = no verification loop).
|
|
68
|
+
|
|
69
|
+
## 5. Commit and Update State
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
git add paper/
|
|
73
|
+
git commit -m "[type](quick): [task description]"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Update STATE.md word count if changed.
|
|
77
|
+
|
|
78
|
+
</process>
|
|
79
|
+
|
|
80
|
+
<offer_next>
|
|
81
|
+
|
|
82
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
83
|
+
WTF-P ► QUICK TASK DONE ✓
|
|
84
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
85
|
+
|
|
86
|
+
[task summary] — [words changed]
|
|
87
|
+
|
|
88
|
+
───────────────────────────────────────────
|
|
89
|
+
|
|
90
|
+
</offer_next>
|
|
91
|
+
|
|
92
|
+
<success_criteria>
|
|
93
|
+
- [ ] Task executed with minimal context loading
|
|
94
|
+
- [ ] Changes committed atomically
|
|
95
|
+
- [ ] STATE.md word count updated
|
|
96
|
+
- [ ] No unnecessary agent spawning
|
|
97
|
+
</success_criteria>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:remove-section
|
|
3
|
+
description: Remove an unwritten section and renumber the rest
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Remove a future (unwritten) section and renumber subsequent sections.
|
|
8
|
+
|
|
9
|
+
Only works on sections that haven't been started yet.
|
|
10
|
+
|
|
11
|
+
Git commit preserves historical record of what was removed.
|
|
12
|
+
</objective>
|
|
13
|
+
|
|
14
|
+
<process>
|
|
15
|
+
|
|
16
|
+
<step name="verify">
|
|
17
|
+
**Verify project and section:**
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
[ ! -f .planning/ROADMAP.md ] && echo "ERROR: No roadmap found" && exit 1
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Check section exists and hasn't been started:
|
|
24
|
+
- No PLAN.md files in section directory
|
|
25
|
+
- No SUMMARY.md files in section directory
|
|
26
|
+
- Status is "Not started" in ROADMAP.md
|
|
27
|
+
|
|
28
|
+
If section has work:
|
|
29
|
+
```
|
|
30
|
+
ERROR: Section [N] has already been started.
|
|
31
|
+
|
|
32
|
+
To remove a section with existing work:
|
|
33
|
+
1. Manually delete the content
|
|
34
|
+
2. Update ROADMAP.md
|
|
35
|
+
3. Commit the changes
|
|
36
|
+
|
|
37
|
+
This command only removes future/unstarted sections.
|
|
38
|
+
```
|
|
39
|
+
</step>
|
|
40
|
+
|
|
41
|
+
<step name="confirm">
|
|
42
|
+
**Confirm removal:**
|
|
43
|
+
|
|
44
|
+
Show what will be removed:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
## Section to Remove
|
|
48
|
+
|
|
49
|
+
Section [N]: [Name]
|
|
50
|
+
- Goal: [goal]
|
|
51
|
+
- Word target: [X]
|
|
52
|
+
- Status: Not started
|
|
53
|
+
|
|
54
|
+
## Impact
|
|
55
|
+
|
|
56
|
+
Sections to renumber:
|
|
57
|
+
- Section [N+1] → Section [N]
|
|
58
|
+
- Section [N+2] → Section [N+1]
|
|
59
|
+
- ...
|
|
60
|
+
|
|
61
|
+
Files to delete:
|
|
62
|
+
- .planning/sections/[NN]-[name]/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the question tool:
|
|
66
|
+
- header: "Remove Section"
|
|
67
|
+
- question: "Remove Section [N]: [name] and renumber subsequent sections?"
|
|
68
|
+
- options:
|
|
69
|
+
- "Yes, remove it" — Delete and renumber
|
|
70
|
+
- "Cancel" — Keep the section
|
|
71
|
+
|
|
72
|
+
</step>
|
|
73
|
+
|
|
74
|
+
<step name="remove">
|
|
75
|
+
**Remove section:**
|
|
76
|
+
|
|
77
|
+
1. Delete section directory:
|
|
78
|
+
```bash
|
|
79
|
+
rm -rf ".planning/sections/[NN]-[name]/"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
2. Update ROADMAP.md:
|
|
83
|
+
- Remove section entry
|
|
84
|
+
- Renumber all subsequent sections
|
|
85
|
+
|
|
86
|
+
3. Rename subsequent section directories:
|
|
87
|
+
```bash
|
|
88
|
+
mv ".planning/sections/[N+1]-[name]/" ".planning/sections/[N]-[name]/"
|
|
89
|
+
# ... for all subsequent sections
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
4. Update any references in STATE.md
|
|
93
|
+
|
|
94
|
+
</step>
|
|
95
|
+
|
|
96
|
+
<step name="commit">
|
|
97
|
+
```bash
|
|
98
|
+
git add .planning/
|
|
99
|
+
git commit -m "$(cat <<'EOF'
|
|
100
|
+
docs: remove Section [N] - [name]
|
|
101
|
+
|
|
102
|
+
Removed unstarted section.
|
|
103
|
+
Renumbered sections [N+1]-[total] to [N]-[total-1].
|
|
104
|
+
EOF
|
|
105
|
+
)"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
</step>
|
|
109
|
+
|
|
110
|
+
<step name="done">
|
|
111
|
+
**Present completion:**
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Section removed:
|
|
115
|
+
|
|
116
|
+
- Removed: Section [N] - [Name]
|
|
117
|
+
- Renumbered: Sections [N+1]-[total] → [N]-[total-1]
|
|
118
|
+
- Total sections: [new total]
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## ▶ Next Up
|
|
123
|
+
|
|
124
|
+
`/wtfp:progress` — check updated status
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
</step>
|
|
130
|
+
|
|
131
|
+
</process>
|
|
132
|
+
|
|
133
|
+
<success_criteria>
|
|
134
|
+
- [ ] Section verified as unstarted
|
|
135
|
+
- [ ] User confirmed removal
|
|
136
|
+
- [ ] Section directory deleted
|
|
137
|
+
- [ ] ROADMAP.md updated
|
|
138
|
+
- [ ] Subsequent sections renumbered
|
|
139
|
+
- [ ] All references updated
|
|
140
|
+
- [ ] Committed to git with clear history
|
|
141
|
+
</success_criteria>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wtfp:report-bug
|
|
3
|
+
description: Report a bug via GitHub issue
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<objective>
|
|
7
|
+
Help the user report a bug in WTF-P by creating a well-formatted GitHub issue.
|
|
8
|
+
</objective>
|
|
9
|
+
|
|
10
|
+
<context>
|
|
11
|
+
@~/.opencode/write-the-f-paper/references/github-contrib.md
|
|
12
|
+
</context>
|
|
13
|
+
|
|
14
|
+
<process>
|
|
15
|
+
|
|
16
|
+
## Step 1: Verify GitHub CLI
|
|
17
|
+
|
|
18
|
+
Check if `gh` is authenticated:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
gh auth status 2>&1
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If not authenticated, inform the user:
|
|
25
|
+
> To create GitHub issues, you need to authenticate the GitHub CLI.
|
|
26
|
+
> Run: `gh auth login`
|
|
27
|
+
> Then try this command again.
|
|
28
|
+
|
|
29
|
+
## Step 2: Gather Bug Information
|
|
30
|
+
|
|
31
|
+
Use the question tool to collect bug details:
|
|
32
|
+
|
|
33
|
+
**Question 1: Bug Category**
|
|
34
|
+
- Header: "Bug Type"
|
|
35
|
+
- Options:
|
|
36
|
+
- "Command fails" - A /wtfp:* command doesn't work as expected
|
|
37
|
+
- "Installation issue" - Problems with npx wtf-p install/uninstall
|
|
38
|
+
- "Workflow error" - Writing workflow produces wrong output
|
|
39
|
+
- "Documentation gap" - Docs are missing or incorrect
|
|
40
|
+
|
|
41
|
+
**Question 2: Bug Description**
|
|
42
|
+
- Header: "Description"
|
|
43
|
+
- Options:
|
|
44
|
+
- "Let me describe it" - User provides description
|
|
45
|
+
- "Help me articulate" - Assistant helps user describe the bug
|
|
46
|
+
|
|
47
|
+
If user needs help articulating, ask follow-up questions:
|
|
48
|
+
- What were you trying to do?
|
|
49
|
+
- What happened instead?
|
|
50
|
+
- What did you expect to happen?
|
|
51
|
+
|
|
52
|
+
## Step 3: Gather Environment Info
|
|
53
|
+
|
|
54
|
+
Automatically collect:
|
|
55
|
+
```bash
|
|
56
|
+
npx wtf-p --version 2>/dev/null || echo "Not installed via npx"
|
|
57
|
+
node --version
|
|
58
|
+
uname -s 2>/dev/null || echo "Unknown OS"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Step 4: Collect Reproduction Steps
|
|
62
|
+
|
|
63
|
+
Ask user:
|
|
64
|
+
- What command or action triggered the bug?
|
|
65
|
+
- Can you reproduce it consistently?
|
|
66
|
+
- Any error messages? (ask to paste them)
|
|
67
|
+
|
|
68
|
+
## Step 5: Draft the Issue
|
|
69
|
+
|
|
70
|
+
Create a draft and show it to the user:
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## Bug Description
|
|
74
|
+
[From user input]
|
|
75
|
+
|
|
76
|
+
## Steps to Reproduce
|
|
77
|
+
1. [Step 1]
|
|
78
|
+
2. [Step 2]
|
|
79
|
+
3. [What happened vs expected]
|
|
80
|
+
|
|
81
|
+
## Environment
|
|
82
|
+
- WTF-P version: [collected]
|
|
83
|
+
- Node.js version: [collected]
|
|
84
|
+
- OS: [collected]
|
|
85
|
+
|
|
86
|
+
## Additional Context
|
|
87
|
+
[Error messages, logs, screenshots mentioned]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 6: Confirm and Create
|
|
91
|
+
|
|
92
|
+
Ask user to confirm:
|
|
93
|
+
- "Create this issue?" with options: Yes / Edit first / Cancel
|
|
94
|
+
|
|
95
|
+
If confirmed, create the issue:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
gh issue create \
|
|
99
|
+
--repo akougkas/wtf-p \
|
|
100
|
+
--title "bug: [SHORT_TITLE]" \
|
|
101
|
+
--body "$(cat <<'EOF'
|
|
102
|
+
[FULL_BODY_HERE]
|
|
103
|
+
EOF
|
|
104
|
+
)" \
|
|
105
|
+
--label "bug"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Step 7: Report Success
|
|
109
|
+
|
|
110
|
+
Show the user:
|
|
111
|
+
- Issue URL (from gh output)
|
|
112
|
+
- Issue number
|
|
113
|
+
- What happens next (maintainer will review)
|
|
114
|
+
|
|
115
|
+
</process>
|
|
116
|
+
|
|
117
|
+
<error-handling>
|
|
118
|
+
|
|
119
|
+
**gh not installed**: Direct user to https://cli.github.com/
|
|
120
|
+
|
|
121
|
+
**gh not authenticated**: Guide through `gh auth login`
|
|
122
|
+
|
|
123
|
+
**Network error**: Save draft locally, retry later
|
|
124
|
+
|
|
125
|
+
**Permission denied**: User may need to fork first for external contributors
|
|
126
|
+
|
|
127
|
+
</error-handling>
|