@engineereddev/fractal-planner 0.1.1
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/.claude-plugin/marketplace.json +22 -0
- package/.claude-plugin/plugin.json +19 -0
- package/LICENSE +21 -0
- package/README.md +257 -0
- package/agents/fp-analyst.md +96 -0
- package/agents/fp-context-builder.md +87 -0
- package/agents/fp-critic.md +140 -0
- package/agents/fp-decomposer.md +261 -0
- package/agents/fp-interviewer.md +263 -0
- package/agents/fp-linear-sync.md +128 -0
- package/agents/fp-researcher.md +82 -0
- package/agents/fp-task-tracker.md +134 -0
- package/dist/cli/classify-intent.js +118 -0
- package/dist/cli/compute-signals.js +495 -0
- package/dist/cli/generate-plan.js +14209 -0
- package/dist/cli/load-config.js +13661 -0
- package/dist/cli/validate-tasks.js +467 -0
- package/dist/index.js +24598 -0
- package/dist/src/cli/classify-intent.d.ts +3 -0
- package/dist/src/cli/compute-signals.d.ts +14 -0
- package/dist/src/cli/generate-plan.d.ts +3 -0
- package/dist/src/cli/load-config.d.ts +3 -0
- package/dist/src/cli/validate-tasks.d.ts +3 -0
- package/dist/src/config.d.ts +182 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/phases/clearance.d.ts +12 -0
- package/dist/src/phases/decomposition.d.ts +41 -0
- package/dist/src/phases/interview.d.ts +17 -0
- package/dist/src/phases/planning.d.ts +21 -0
- package/dist/src/phases/research.d.ts +9 -0
- package/dist/src/types/index.d.ts +116 -0
- package/dist/src/utils/draft.d.ts +21 -0
- package/dist/src/utils/question-strategies.d.ts +24 -0
- package/dist/src/utils/task-parser.d.ts +3 -0
- package/hooks/hooks.json +27 -0
- package/hooks/nudge-teammate.sh +216 -0
- package/hooks/run-comment-checker.sh +91 -0
- package/package.json +65 -0
- package/skills/commit/SKILL.md +157 -0
- package/skills/fp/SKILL.md +857 -0
- package/skills/fp/scripts/resolve-env.sh +66 -0
- package/skills/handoff/SKILL.md +195 -0
- package/skills/implement/SKILL.md +783 -0
- package/skills/implement/reference.md +935 -0
- package/skills/retry/SKILL.md +333 -0
- package/skills/status/SKILL.md +182 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fp:retry
|
|
3
|
+
description: Retry a single failed task from a fractal-planner plan. Spawns a fresh builder → verifier → committer cycle for the specified task and updates execution-state.json on success.
|
|
4
|
+
argument-hint: <plan-session-id> <task-id> [--max-iterations N]
|
|
5
|
+
allowed-tools: AskUserQuestion, Read, Write, Edit, Bash, Task, Glob, Grep, mcp__linear-server__update_issue
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Fractal Planner: Task Retry
|
|
9
|
+
|
|
10
|
+
You are retrying a single failed task from a fractal-planner implementation plan. You spawn a fresh builder → verifier → committer cycle and update `execution-state.json` (and Linear) on success.
|
|
11
|
+
|
|
12
|
+
## Step 1: Parse Arguments
|
|
13
|
+
|
|
14
|
+
Parse `$ARGUMENTS` to extract:
|
|
15
|
+
- `planId` — first positional argument (required)
|
|
16
|
+
- `taskId` — second positional argument (required)
|
|
17
|
+
- `--max-iterations N` — optional, defaults to 3
|
|
18
|
+
|
|
19
|
+
Usage examples:
|
|
20
|
+
- `/fp:retry abc123 1.2`
|
|
21
|
+
- `/fp:retry abc123 1.2 --max-iterations 5`
|
|
22
|
+
|
|
23
|
+
If `planId` or `taskId` is missing, report the error and stop:
|
|
24
|
+
> "Usage: `/fp:retry <plan-session-id> <task-id> [--max-iterations N]`"
|
|
25
|
+
|
|
26
|
+
## Step 2: Load Plan & Validate Preconditions
|
|
27
|
+
|
|
28
|
+
Read from `.fractal-planner/plans/{planId}/`:
|
|
29
|
+
1. `plan.md` — execution order and acceptance criteria (REQUIRED)
|
|
30
|
+
2. `tasks.md` — full task tree with hints and metadata (REQUIRED)
|
|
31
|
+
3. `execution-state.json` — resume artifact with task map and status (REQUIRED)
|
|
32
|
+
|
|
33
|
+
If any required file is missing, report the error and stop:
|
|
34
|
+
> "Plan '{planId}' not found or implementation not yet started. Run `/fp:plan` then `/fp:implement {planId}` first."
|
|
35
|
+
|
|
36
|
+
Parse `execution-state.json`:
|
|
37
|
+
- Extract `taskMap` — object mapping plan task IDs to native task IDs
|
|
38
|
+
- Extract `failureReasons` — object mapping plan task IDs to failure reasons
|
|
39
|
+
- Extract `skippedTasks`
|
|
40
|
+
|
|
41
|
+
**Validate task exists in taskMap:**
|
|
42
|
+
|
|
43
|
+
If `taskId` is NOT a key in `taskMap`, stop:
|
|
44
|
+
> "Task {taskId} not found in execution state. Valid task IDs: {comma-separated taskMap keys}"
|
|
45
|
+
|
|
46
|
+
Get `nativeId = taskMap[taskId]`.
|
|
47
|
+
|
|
48
|
+
**Read native task file to validate FAILED status:**
|
|
49
|
+
|
|
50
|
+
Read `~/.claude/tasks/fp-impl-{planId}/{nativeId}.json`.
|
|
51
|
+
|
|
52
|
+
If the file does not exist, stop:
|
|
53
|
+
> "Native task file not found for {taskId}. The implementation team may have been deleted."
|
|
54
|
+
|
|
55
|
+
Parse the JSON and check:
|
|
56
|
+
- If `status != "completed"` OR `metadata.fpStatus != "FAILED"`:
|
|
57
|
+
> "Task {taskId} is not in FAILED state (current status: {status}, fpStatus: {metadata.fpStatus or 'none'}). Only FAILED tasks can be retried."
|
|
58
|
+
|
|
59
|
+
**Validate dependencies are completed:**
|
|
60
|
+
|
|
61
|
+
Find task `{taskId}` in `plan.md` to get its dependencies. For each dependency `depId`:
|
|
62
|
+
- Get `depNativeId = taskMap[depId]`
|
|
63
|
+
- Read `~/.claude/tasks/fp-impl-{planId}/{depNativeId}.json`
|
|
64
|
+
- If `status != "completed"` OR `metadata.fpStatus != "COMPLETED"`:
|
|
65
|
+
> "Cannot retry task {taskId}: dependency {depId} is not COMPLETED (status: {status}, fpStatus: {metadata.fpStatus or 'none'}). Complete or fix dependencies first."
|
|
66
|
+
|
|
67
|
+
## Step 3: Load Task Context
|
|
68
|
+
|
|
69
|
+
From `tasks.md` and `plan.md`, extract for task `{taskId}`:
|
|
70
|
+
- Description
|
|
71
|
+
- Acceptance criteria (numbered list)
|
|
72
|
+
- Implementation hints
|
|
73
|
+
- References (file:line pairs)
|
|
74
|
+
- Files to modify
|
|
75
|
+
- Tests required flag
|
|
76
|
+
- Test commands
|
|
77
|
+
|
|
78
|
+
**Load codebase context** (same three-tier fallback as fp:implement):
|
|
79
|
+
1. Try `.fractal-planner/plans/{planId}/context.md`
|
|
80
|
+
2. If not found, generate it by reading `package.json`, scanning project structure, identifying patterns
|
|
81
|
+
3. If both fail, set codebaseContext to empty string
|
|
82
|
+
|
|
83
|
+
**Check for previous evidence**:
|
|
84
|
+
Read `.fractal-planner/plans/{planId}/evidence/task-{taskId}-verification.md` if it exists. Extract the failure details to inject into the builder's context.
|
|
85
|
+
|
|
86
|
+
## Step 4: Execute Retry Loop
|
|
87
|
+
|
|
88
|
+
Initialize `iteration = 1`.
|
|
89
|
+
|
|
90
|
+
Display to user:
|
|
91
|
+
```
|
|
92
|
+
Retrying task {taskId}: {description}
|
|
93
|
+
Max iterations: {maxIterations}
|
|
94
|
+
Previous failure evidence: {found / not found}
|
|
95
|
+
Previous failure reason: {failureReasons[taskId] or "not recorded"}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4.1: Spawn Builder
|
|
99
|
+
|
|
100
|
+
Spawn a fresh builder as a subagent via the Task tool:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Task(
|
|
104
|
+
subagent_type: "general-purpose",
|
|
105
|
+
description: "Implement task {taskId}",
|
|
106
|
+
prompt: "You are a builder agent implementing a single task.
|
|
107
|
+
|
|
108
|
+
{codebaseContext}
|
|
109
|
+
|
|
110
|
+
{If iteration > 1 or previous evidence exists:}
|
|
111
|
+
PREVIOUS ATTEMPT FAILED.
|
|
112
|
+
Failure details:
|
|
113
|
+
{previousFailureDetails or evidence file contents}
|
|
114
|
+
|
|
115
|
+
Review the existing code and fix all issues listed.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
Implement task {taskId}:
|
|
120
|
+
Description: {description}
|
|
121
|
+
|
|
122
|
+
Acceptance Criteria:
|
|
123
|
+
{numbered criteria}
|
|
124
|
+
|
|
125
|
+
Implementation Hints:
|
|
126
|
+
{hints, or omit section if empty}
|
|
127
|
+
|
|
128
|
+
References:
|
|
129
|
+
{file:line refs, or omit section if empty}
|
|
130
|
+
|
|
131
|
+
Files to Modify: {list or 'determine from context'}
|
|
132
|
+
Tests Required: {yes/no}
|
|
133
|
+
Test Commands: {commands or omit if empty}
|
|
134
|
+
|
|
135
|
+
MUST NOT DO:
|
|
136
|
+
{guardrails, or omit section if empty}
|
|
137
|
+
|
|
138
|
+
RULES:
|
|
139
|
+
- Implement with REAL code only. No stubs, placeholders, or TODOs.
|
|
140
|
+
- If testsRequired is true, write tests.
|
|
141
|
+
- Follow existing codebase patterns.
|
|
142
|
+
- Track ALL files you create or modify.
|
|
143
|
+
|
|
144
|
+
When done, output EXACTLY this format:
|
|
145
|
+
IMPLEMENTATION COMPLETE: {taskId}
|
|
146
|
+
|
|
147
|
+
FILES_MODIFIED:
|
|
148
|
+
- /absolute/path/to/file1
|
|
149
|
+
- /absolute/path/to/file2"
|
|
150
|
+
)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Wait for the builder subagent to complete. Extract `FILES_MODIFIED` from its output.
|
|
154
|
+
|
|
155
|
+
If the builder's output does not contain `IMPLEMENTATION COMPLETE`, treat it as a failure and proceed to 4.3 (failure handling) with the builder output as the error.
|
|
156
|
+
|
|
157
|
+
### 4.2: Verify Implementation
|
|
158
|
+
|
|
159
|
+
Spawn a verification subagent:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Task(
|
|
163
|
+
subagent_type: "general-purpose",
|
|
164
|
+
description: "Verify task {taskId}",
|
|
165
|
+
prompt: "You are a verification agent for a fractal-planner retry.
|
|
166
|
+
|
|
167
|
+
Task ID: {taskId}
|
|
168
|
+
Description: {description}
|
|
169
|
+
|
|
170
|
+
Acceptance Criteria:
|
|
171
|
+
{numbered criteria}
|
|
172
|
+
|
|
173
|
+
Files Modified by Builder:
|
|
174
|
+
{FILES_MODIFIED list}
|
|
175
|
+
|
|
176
|
+
Test Commands: {commands or 'none'}
|
|
177
|
+
Tests Required: {yes/no}
|
|
178
|
+
|
|
179
|
+
{codebaseContext}
|
|
180
|
+
|
|
181
|
+
Instructions:
|
|
182
|
+
1. Read each modified file listed above.
|
|
183
|
+
2. For each acceptance criterion, verify it is met by the code.
|
|
184
|
+
3. If tests are required, run the test commands via Bash.
|
|
185
|
+
4. Run: bun run typecheck (if tsconfig.json exists in the project root).
|
|
186
|
+
5. Write your evidence to: .fractal-planner/plans/{planId}/evidence/task-{taskId}-verification.md
|
|
187
|
+
|
|
188
|
+
Evidence file format:
|
|
189
|
+
---
|
|
190
|
+
# Verification Evidence: Task {taskId}
|
|
191
|
+
|
|
192
|
+
Result: PASS | FAIL
|
|
193
|
+
Timestamp: {ISO timestamp}
|
|
194
|
+
Task: {description}
|
|
195
|
+
|
|
196
|
+
## Criteria Results
|
|
197
|
+
| # | Criterion | Result | Evidence |
|
|
198
|
+
|---|-----------|--------|---------|
|
|
199
|
+
| 1 | {text} | PASS/FAIL | {snippet} |
|
|
200
|
+
|
|
201
|
+
## Test Output
|
|
202
|
+
\`\`\`
|
|
203
|
+
{test output or 'Tests not required'}
|
|
204
|
+
\`\`\`
|
|
205
|
+
|
|
206
|
+
## Typecheck Output
|
|
207
|
+
\`\`\`
|
|
208
|
+
{typecheck output or 'No tsconfig.json found'}
|
|
209
|
+
\`\`\`
|
|
210
|
+
|
|
211
|
+
## Files Reviewed
|
|
212
|
+
- {absolute file path}
|
|
213
|
+
|
|
214
|
+
## Summary
|
|
215
|
+
{1-2 sentence summary}
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
6. After writing the evidence file, output EXACTLY:
|
|
219
|
+
If ALL criteria pass: VERIFICATION PASSED
|
|
220
|
+
If ANY check fails:
|
|
221
|
+
VERIFICATION FAILED
|
|
222
|
+
Failed:
|
|
223
|
+
- Criterion {N}: {text} — {reason and fix instruction}
|
|
224
|
+
Passed:
|
|
225
|
+
- Criterion {N}: {text}
|
|
226
|
+
Tests: {PASS/FAIL with relevant output}
|
|
227
|
+
Typecheck: {PASS/FAIL with errors if any}"
|
|
228
|
+
)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 4.3: Handle Verification Result
|
|
232
|
+
|
|
233
|
+
**If VERIFICATION PASSED:**
|
|
234
|
+
1. Proceed to Step 5 (commit + update state).
|
|
235
|
+
|
|
236
|
+
**If VERIFICATION FAILED:**
|
|
237
|
+
1. Store the failure report as `previousFailureDetails`.
|
|
238
|
+
2. Increment `iteration`.
|
|
239
|
+
3. If `iteration > maxIterations`:
|
|
240
|
+
- Display to user: "Task {taskId} still fails after {maxIterations} iterations."
|
|
241
|
+
- Show the last `VERIFICATION FAILED` report.
|
|
242
|
+
- Suggest: "Check evidence at `.fractal-planner/plans/{planId}/evidence/task-{taskId}-verification.md`"
|
|
243
|
+
- Stop.
|
|
244
|
+
4. Else: loop back to Step 4.1 (fresh builder with failure context).
|
|
245
|
+
|
|
246
|
+
## Step 5: Commit
|
|
247
|
+
|
|
248
|
+
Spawn a committer subagent:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
Task(
|
|
252
|
+
subagent_type: "general-purpose",
|
|
253
|
+
description: "Commit task {taskId} changes",
|
|
254
|
+
prompt: "You are a git commit specialist.
|
|
255
|
+
|
|
256
|
+
Follow the fp:commit skill instructions to create ONE git commit.
|
|
257
|
+
|
|
258
|
+
TASK CONTEXT:
|
|
259
|
+
- Task ID: {taskId}
|
|
260
|
+
- Description: {description}
|
|
261
|
+
|
|
262
|
+
FILES_MODIFIED:
|
|
263
|
+
{paste the file list}
|
|
264
|
+
|
|
265
|
+
INSTRUCTIONS:
|
|
266
|
+
1. Detect commit style from git log (SEMANTIC|PLAIN|SHORT)
|
|
267
|
+
2. Detect language (Korean|English)
|
|
268
|
+
3. Stage only these specific files
|
|
269
|
+
4. Create ONE commit with message based on task description
|
|
270
|
+
5. Output EXACTLY:
|
|
271
|
+
COMMIT COMPLETED
|
|
272
|
+
Hash: {short hash}
|
|
273
|
+
Message: {commit message}
|
|
274
|
+
OR: COMMIT FAILED
|
|
275
|
+
Error: {error message}"
|
|
276
|
+
)
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Extract commit hash from committer output. If commit fails, use `AskUserQuestion`:
|
|
280
|
+
- "Git commit failed for task {taskId}. How should we proceed?"
|
|
281
|
+
- Options: "Continue without committing" / "Stop"
|
|
282
|
+
- If "Stop", report failure and stop.
|
|
283
|
+
|
|
284
|
+
## Step 6: Update Execution State & Linear
|
|
285
|
+
|
|
286
|
+
**Update native task status:**
|
|
287
|
+
|
|
288
|
+
The native task system has no live team context during `fp:retry` (the team was deleted after `fp:implement`). Update `execution-state.json` directly instead of calling `TaskUpdate`:
|
|
289
|
+
|
|
290
|
+
1. Read `.fractal-planner/plans/{planId}/execution-state.json`
|
|
291
|
+
2. Remove `{taskId}` from `failureReasons` (it is no longer failed)
|
|
292
|
+
3. Write the updated JSON back
|
|
293
|
+
|
|
294
|
+
**Note on native task file**: The task JSON at `~/.claude/tasks/fp-impl-{planId}/{nativeId}.json` reflects the old FAILED status, but since the team is deleted, `TaskUpdate` is not available. The `execution-state.json` is the authoritative resume artifact for `fp:implement` resumes; `fp:status` reads both files and should prefer `execution-state.json` for retry-updated tasks.
|
|
295
|
+
|
|
296
|
+
**Update Linear (if mapping exists):**
|
|
297
|
+
|
|
298
|
+
Check for `.fractal-planner/plans/{planId}/linear-mapping.json`. If it exists:
|
|
299
|
+
1. Read it to find the Linear issue ID for task `{taskId}`
|
|
300
|
+
2. Find the resolved status ID for "review" (or "completed" as fallback)
|
|
301
|
+
3. Call `mcp__linear-server__update_issue` with the resolved status
|
|
302
|
+
4. If the call fails, log a warning but do NOT stop
|
|
303
|
+
|
|
304
|
+
## Step 7: Report & Next Steps
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
## Retry Result: {planId} / {taskId}
|
|
308
|
+
|
|
309
|
+
**Status**: PASSED ✅
|
|
310
|
+
**Iterations**: {iteration}/{maxIterations}
|
|
311
|
+
**Commit**: {hash or "none (commit failed or skipped)"}
|
|
312
|
+
|
|
313
|
+
Task {taskId} ({description}) has been completed.
|
|
314
|
+
Execution state updated: `.fractal-planner/plans/{planId}/execution-state.json`
|
|
315
|
+
|
|
316
|
+
### P1 Limitation
|
|
317
|
+
Tasks previously skipped due to this failure (blocked dependents) remain deleted
|
|
318
|
+
in the native task system and will NOT be automatically re-queued. To implement
|
|
319
|
+
downstream tasks, start a new plan:
|
|
320
|
+
/fp:plan (then /fp:implement on the new plan)
|
|
321
|
+
|
|
322
|
+
To resume the original plan for any remaining non-blocked tasks:
|
|
323
|
+
/fp:implement {planId}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Important
|
|
327
|
+
|
|
328
|
+
- This skill operates WITHOUT a live tracker teammate — `execution-state.json` is updated directly
|
|
329
|
+
- The builder and verifier are spawned as **subagents** (Task tool), not teammates
|
|
330
|
+
- Always validate preconditions (FAILED status + all deps COMPLETED) before proceeding
|
|
331
|
+
- Evidence files are written to `.fractal-planner/plans/{planId}/evidence/` — create the directory if needed
|
|
332
|
+
- If Linear mapping exists, update Linear after updating execution state (best-effort, never block on failure)
|
|
333
|
+
- The native team `fp-impl-{planId}` has been deleted by `fp:implement` Step 6, so `TaskUpdate` is unavailable; use `execution-state.json` as the authoritative resume artifact
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fp:status
|
|
3
|
+
description: Read-only status reporter for fractal-planner implementation plans. Shows progress bar, per-task status table, and links to evidence files. Reads native task JSON files directly.
|
|
4
|
+
argument-hint: <plan-session-id>
|
|
5
|
+
allowed-tools: Read, Glob, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Fractal Planner: Plan Status
|
|
9
|
+
|
|
10
|
+
You are generating a read-only status report for a fractal-planner implementation plan.
|
|
11
|
+
|
|
12
|
+
## Step 1: Parse Arguments
|
|
13
|
+
|
|
14
|
+
Parse `$ARGUMENTS` to extract `planId` (the first positional argument).
|
|
15
|
+
|
|
16
|
+
If no `planId` is provided, report the error and stop:
|
|
17
|
+
> "Usage: `/fp:status <plan-session-id>`"
|
|
18
|
+
|
|
19
|
+
## Step 2: Load Execution State & Native Task Files
|
|
20
|
+
|
|
21
|
+
### 2.1: Read Execution State
|
|
22
|
+
|
|
23
|
+
Read `.fractal-planner/plans/{planId}/execution-state.json`.
|
|
24
|
+
|
|
25
|
+
If missing, report the error and stop:
|
|
26
|
+
> "Plan '{planId}' has no execution state. Run `/fp:implement {planId}` first to start implementation."
|
|
27
|
+
|
|
28
|
+
Parse:
|
|
29
|
+
- `taskMap` — object mapping plan task IDs to native task IDs (e.g., `{ "1.1": "3", "2.1": "5" }`)
|
|
30
|
+
- `skippedTasks` — object mapping plan task IDs to skip reasons
|
|
31
|
+
- `failureReasons` — object mapping plan task IDs to failure reasons
|
|
32
|
+
- `maxIterations`, `planId`, `team`
|
|
33
|
+
|
|
34
|
+
Also read `plan.md` for task descriptions (used in the task table):
|
|
35
|
+
Read `.fractal-planner/plans/{planId}/plan.md`. If missing, use task IDs as descriptions.
|
|
36
|
+
|
|
37
|
+
### 2.2: Read Native Task JSON Files
|
|
38
|
+
|
|
39
|
+
The native task JSON files are stored at `~/.claude/tasks/fp-impl-{planId}/`.
|
|
40
|
+
|
|
41
|
+
Use Glob to find all task files:
|
|
42
|
+
```
|
|
43
|
+
Glob("~/.claude/tasks/fp-impl-{planId}/*.json")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For each file found, read it and parse:
|
|
47
|
+
- `id` — native task ID
|
|
48
|
+
- `subject` — contains `[{planTaskId}] {description}` — extract planTaskId from the `[...]` prefix
|
|
49
|
+
- `status` — `pending`, `in_progress`, `completed`, or `deleted`
|
|
50
|
+
- `metadata` — object with `fpStatus`, `iterations`, `commit`, `summary`, `reason` fields
|
|
51
|
+
- `blockedBy` — array of blocking native task IDs (empty if unblocked)
|
|
52
|
+
|
|
53
|
+
Build a `statusMap` keyed by plan task ID:
|
|
54
|
+
```
|
|
55
|
+
statusMap[planTaskId] = {
|
|
56
|
+
nativeId,
|
|
57
|
+
status, // native status
|
|
58
|
+
fpStatus, // metadata.fpStatus (COMPLETED | FAILED | SKIPPED | absent)
|
|
59
|
+
iterations, // metadata.iterations (e.g. "1/3")
|
|
60
|
+
commit, // metadata.commit
|
|
61
|
+
summary, // metadata.summary
|
|
62
|
+
reason, // metadata.reason (for FAILED) or skippedTasks[planTaskId] (for SKIPPED)
|
|
63
|
+
blockedBy // array of native IDs still blocking this task
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If the `~/.claude/tasks/fp-impl-{planId}/` directory does not exist or is empty:
|
|
68
|
+
- Fallback: use only `execution-state.json` data
|
|
69
|
+
- Mark all tasks in `taskMap` as PENDING (the team may still be initializing, or files are unavailable)
|
|
70
|
+
|
|
71
|
+
### 2.3: Scan for Evidence Files
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
ls .fractal-planner/plans/{planId}/evidence/ 2>/dev/null
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Collect evidence file names for later display.
|
|
78
|
+
|
|
79
|
+
## Step 3: Classify Tasks & Compute Statistics
|
|
80
|
+
|
|
81
|
+
For each plan task ID in `taskMap`, classify its status:
|
|
82
|
+
|
|
83
|
+
| Condition | Classification |
|
|
84
|
+
|-----------|---------------|
|
|
85
|
+
| In `skippedTasks` AND (`status == "deleted"` OR native file absent) | **SKIPPED** |
|
|
86
|
+
| `status == "completed"` AND `fpStatus == "FAILED"` | **FAILED** |
|
|
87
|
+
| `status == "completed"` AND (`fpStatus == "COMPLETED"` OR fpStatus absent) | **COMPLETED** |
|
|
88
|
+
| `status == "in_progress"` | **IN_PROGRESS** |
|
|
89
|
+
| `status == "pending"` | **PENDING** |
|
|
90
|
+
| `status == "deleted"` AND `fpStatus == "SKIPPED"` | **SKIPPED** |
|
|
91
|
+
| Native file not found AND not in `skippedTasks` | **PENDING** (not yet created or team initializing) |
|
|
92
|
+
|
|
93
|
+
Count each classification:
|
|
94
|
+
- `total` = number of keys in `taskMap`
|
|
95
|
+
- `completed` = count of COMPLETED
|
|
96
|
+
- `inProgress` = count of IN_PROGRESS
|
|
97
|
+
- `pending` = count of PENDING
|
|
98
|
+
- `failed` = count of FAILED
|
|
99
|
+
- `skipped` = count of SKIPPED
|
|
100
|
+
|
|
101
|
+
Compute progress percentage: `floor((completed / total) * 100)`
|
|
102
|
+
|
|
103
|
+
Build a 20-character progress bar using block characters:
|
|
104
|
+
- Filled blocks (`█`): `floor(completed / total * 20)` chars
|
|
105
|
+
- Empty blocks (`░`): remainder
|
|
106
|
+
|
|
107
|
+
## Step 4: Render Status Report
|
|
108
|
+
|
|
109
|
+
Present the following formatted report:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
## Plan Status: {planId}
|
|
113
|
+
|
|
114
|
+
**Progress**: [{████████░░░░░░░░░░░░}] {completed}/{total} tasks ({pct}%)
|
|
115
|
+
|
|
116
|
+
### Summary
|
|
117
|
+
| Status | Count |
|
|
118
|
+
|-------------|-------|
|
|
119
|
+
| ✅ Completed | {N} |
|
|
120
|
+
| 🔄 In Progress | {N} |
|
|
121
|
+
| ⏳ Pending | {N} |
|
|
122
|
+
| ❌ Failed | {N} |
|
|
123
|
+
| ⏭️ Skipped | {N} |
|
|
124
|
+
|
|
125
|
+
### Task Table
|
|
126
|
+
| # | ID | Description | Status | Iterations | Commit | Notes |
|
|
127
|
+
|---|-----|-------------|--------|------------|--------|-------|
|
|
128
|
+
{one row per task in taskMap order, using statusMap data}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Row format:
|
|
132
|
+
- `#` — sequential number
|
|
133
|
+
- `ID` — plan task ID
|
|
134
|
+
- `Description` — from plan.md or `[{planTaskId}] {subject}` if plan.md unavailable
|
|
135
|
+
- `Status` — COMPLETED / IN_PROGRESS / PENDING / FAILED / SKIPPED
|
|
136
|
+
- `Iterations` — `metadata.iterations` or `-` if not started
|
|
137
|
+
- `Commit` — `metadata.commit` (short hash) or `-`
|
|
138
|
+
- `Notes` — `metadata.summary` for COMPLETED, `metadata.reason` for FAILED, `skippedTasks[id]` for SKIPPED, blank otherwise
|
|
139
|
+
|
|
140
|
+
If there are FAILED tasks, add a section:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
### Failed Tasks
|
|
144
|
+
{For each FAILED task:}
|
|
145
|
+
- **[{id}]** {description}
|
|
146
|
+
- Iterations used: {iterations}
|
|
147
|
+
- Reason: {reason from metadata or failureReasons}
|
|
148
|
+
- Evidence: `.fractal-planner/plans/{planId}/evidence/task-{id}-verification.md` {(exists) or (not found)}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
If evidence files were found, add a section:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
### Evidence Files
|
|
155
|
+
{For each evidence file found, read it and extract the Result line:}
|
|
156
|
+
- `task-{id}-verification.md`: {PASS | FAIL} — {1-line summary from evidence file}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Step 5: Show Next Steps
|
|
160
|
+
|
|
161
|
+
After the report, show contextual next steps:
|
|
162
|
+
|
|
163
|
+
- If all tasks are COMPLETED:
|
|
164
|
+
> "All {N} tasks complete. Implementation finished."
|
|
165
|
+
- If any IN_PROGRESS tasks exist:
|
|
166
|
+
> "Implementation session is active. A `/fp:implement` session may be running."
|
|
167
|
+
- If PENDING tasks remain and no IN_PROGRESS tasks:
|
|
168
|
+
> "Run `/fp:implement {planId}` to continue implementation."
|
|
169
|
+
- If FAILED tasks exist:
|
|
170
|
+
> "To retry a failed task: `/fp:retry {planId} {taskId}`"
|
|
171
|
+
> "To resume full implementation (if all deps are met): `/fp:implement {planId}`"
|
|
172
|
+
- If SKIPPED tasks exist (and some FAILED tasks exist):
|
|
173
|
+
> "Note: {N} tasks were skipped due to failed dependencies. Use `/fp:retry` to fix failed tasks, then start a new plan to implement the skipped downstream tasks."
|
|
174
|
+
|
|
175
|
+
## Important
|
|
176
|
+
|
|
177
|
+
- This skill is **read-only** — it does not modify any files
|
|
178
|
+
- Primary source of truth: native task JSON files at `~/.claude/tasks/fp-impl-{planId}/`
|
|
179
|
+
- Secondary source of truth: `execution-state.json` (for `skippedTasks`, `failureReasons`, and `taskMap`)
|
|
180
|
+
- `progress.md` (if it exists) is a human-readable snapshot from the end of the last `fp:implement` run — do NOT use it as a status source
|
|
181
|
+
- If task JSON files are unavailable (team not yet initialized or already deleted), fall back to `execution-state.json` data only
|
|
182
|
+
- Present the report in a clean, scannable format — users run this to get a quick health check
|