@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.
Files changed (46) hide show
  1. package/.claude-plugin/marketplace.json +22 -0
  2. package/.claude-plugin/plugin.json +19 -0
  3. package/LICENSE +21 -0
  4. package/README.md +257 -0
  5. package/agents/fp-analyst.md +96 -0
  6. package/agents/fp-context-builder.md +87 -0
  7. package/agents/fp-critic.md +140 -0
  8. package/agents/fp-decomposer.md +261 -0
  9. package/agents/fp-interviewer.md +263 -0
  10. package/agents/fp-linear-sync.md +128 -0
  11. package/agents/fp-researcher.md +82 -0
  12. package/agents/fp-task-tracker.md +134 -0
  13. package/dist/cli/classify-intent.js +118 -0
  14. package/dist/cli/compute-signals.js +495 -0
  15. package/dist/cli/generate-plan.js +14209 -0
  16. package/dist/cli/load-config.js +13661 -0
  17. package/dist/cli/validate-tasks.js +467 -0
  18. package/dist/index.js +24598 -0
  19. package/dist/src/cli/classify-intent.d.ts +3 -0
  20. package/dist/src/cli/compute-signals.d.ts +14 -0
  21. package/dist/src/cli/generate-plan.d.ts +3 -0
  22. package/dist/src/cli/load-config.d.ts +3 -0
  23. package/dist/src/cli/validate-tasks.d.ts +3 -0
  24. package/dist/src/config.d.ts +182 -0
  25. package/dist/src/index.d.ts +12 -0
  26. package/dist/src/phases/clearance.d.ts +12 -0
  27. package/dist/src/phases/decomposition.d.ts +41 -0
  28. package/dist/src/phases/interview.d.ts +17 -0
  29. package/dist/src/phases/planning.d.ts +21 -0
  30. package/dist/src/phases/research.d.ts +9 -0
  31. package/dist/src/types/index.d.ts +116 -0
  32. package/dist/src/utils/draft.d.ts +21 -0
  33. package/dist/src/utils/question-strategies.d.ts +24 -0
  34. package/dist/src/utils/task-parser.d.ts +3 -0
  35. package/hooks/hooks.json +27 -0
  36. package/hooks/nudge-teammate.sh +216 -0
  37. package/hooks/run-comment-checker.sh +91 -0
  38. package/package.json +65 -0
  39. package/skills/commit/SKILL.md +157 -0
  40. package/skills/fp/SKILL.md +857 -0
  41. package/skills/fp/scripts/resolve-env.sh +66 -0
  42. package/skills/handoff/SKILL.md +195 -0
  43. package/skills/implement/SKILL.md +783 -0
  44. package/skills/implement/reference.md +935 -0
  45. package/skills/retry/SKILL.md +333 -0
  46. package/skills/status/SKILL.md +182 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "fractal-planner",
3
+ "owner": {
4
+ "name": "EngineeredDev"
5
+ },
6
+ "metadata": {
7
+ "description": "Iterative planning and execution framework for Claude Code"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "fractal-planner",
12
+ "source": {
13
+ "source": "npm",
14
+ "package": "fractal-planner"
15
+ },
16
+ "description": "Iterative planning and execution framework that decomposes features into fractal tasks with builder/verifier agent teams",
17
+ "license": "MIT",
18
+ "keywords": ["planning", "agent-teams", "fractal", "task-decomposition", "claude-code"],
19
+ "category": "productivity"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "fractal-planner",
3
+ "version": "0.1.1",
4
+ "description": "Iterative planning and execution framework that decomposes features into fractal tasks with builder/verifier agent teams",
5
+ "author": {
6
+ "name": "EngineeredDev",
7
+ "url": "https://github.com/EngineeredDev"
8
+ },
9
+ "license": "MIT",
10
+ "repository": "https://github.com/EngineeredDev/fractal-planner",
11
+ "homepage": "https://github.com/EngineeredDev/fractal-planner",
12
+ "keywords": [
13
+ "planning",
14
+ "agent-teams",
15
+ "fractal",
16
+ "task-decomposition",
17
+ "builder-verifier"
18
+ ]
19
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EngineeredDev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,257 @@
1
+ <img width="1792" height="592" alt="Gemini_Generated_Image_ybse1pybse1pybse(1)" src="https://github.com/user-attachments/assets/9a23570a-5f7b-45c7-8553-c689eb41f9ec" />
2
+
3
+ ---
4
+
5
+ A Claude Code plugin that turns a vague request into a structured plan and then builds it for you — with built-in verification at every step.
6
+
7
+ You describe what you want, Fractal Planner interviews you to fill in the gaps, researches your codebase, breaks the work into small tasks, and hands them off to builder agents that implement and verify each piece. You stay in the loop at the decisions that matter and skip the ones that don't.
8
+
9
+ The key here is that plans are broken down into bite size "fractal" tasks to ensure each step is implemented correctly without the risk of context rot.
10
+
11
+ ## Installation & Requirements
12
+
13
+ Install from the Claude Code plugin marketplace:
14
+
15
+ ```
16
+ /plugin marketplace add EngineeredDev/fractal-planner
17
+ /plugin install fractal-planner@fractal-planner
18
+ ```
19
+
20
+ > [!IMPORTANT]
21
+ > This uses the new Agent Teams feature.
22
+ > You must enable Agent Teams in your Claude Code settings (`~/.claude/settings.json` or project `.claude/settings.json`):
23
+
24
+ ```json
25
+ {
26
+ "env": {
27
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
28
+ }
29
+ }
30
+ ```
31
+
32
+ <details>
33
+ <summary>Installing from source (for development)</summary>
34
+
35
+ ```bash
36
+ git clone https://github.com/EngineeredDev/fractal-planner.git
37
+ cd fractal-planner
38
+ bun install
39
+ bun run build
40
+ ```
41
+
42
+ Test in another project:
43
+
44
+ ```bash
45
+ claude --plugin-dir /path/to/fractal-planner
46
+ ```
47
+
48
+ </details>
49
+
50
+ ## Workflow
51
+
52
+ ### 1. Start a plan
53
+
54
+ Tell Fractal Planner what you want to build:
55
+
56
+ ```
57
+ /fp:plan Add user authentication with JWT tokens and refresh token rotation
58
+ ```
59
+
60
+ ### 2. Answer a few questions
61
+
62
+ You'll get a short interview — usually 2–4 rounds of questions about scope, constraints, and technical preferences. Answer what you can; skip what you don't have opinions on. The plugin uses your answers to tailor the plan to your project.
63
+
64
+ ### 3. Review the approach
65
+
66
+ After researching your codebase, Fractal Planner shows you a proposed approach before doing any detailed planning. You can approve it, adjust it, or ask for a different direction.
67
+
68
+ ### 4. Get a plan
69
+
70
+ The plugin breaks your goal into small, ordered tasks — each with acceptance criteria, file targets, and dependencies. You'll see the full plan and can approve or edit it before anything gets built.
71
+
72
+ ### 5. Implement
73
+
74
+ Once you're happy with the plan, kick off implementation:
75
+
76
+ ```
77
+ /fp:implement jwt-auth-api
78
+ ```
79
+
80
+ Builder agents work through the tasks in order. Each task goes through an implement → verify cycle: a builder writes the code, then a separate verifier checks it against the acceptance criteria. You'll see commits land as tasks complete.
81
+
82
+ ### Other commands
83
+
84
+ You won't normally need these, but they can sometimes come in handy.
85
+
86
+ | Command | What it does |
87
+ |---------|--------------|
88
+ | `/fp:commit` | Smart git commit — detects your project's commit style and language |
89
+ | `/fp:retry <planId> <taskId>` | Re-run a single failed task |
90
+ | `/fp:status <planId>` | Check progress on a running or completed plan |
91
+ | `/fp:handoff <planId>` | Generate a summary for continuing work in a new session |
92
+
93
+ ## Configuration
94
+
95
+ Fractal Planner uses a layered JSON config system. Settings are merged in order (highest priority wins):
96
+
97
+ 1. **Project config** — `.fractal-planner/config.json` in your project root
98
+ 2. **User config** — `$XDG_CONFIG_HOME/fractal-planner/config.json` (defaults to `~/.config/fractal-planner/config.json`)
99
+ 3. **Built-in defaults**
100
+
101
+ All fields are optional. Only include values you want to override:
102
+
103
+ ```json
104
+ {
105
+ "maxComplexity": 3,
106
+ "permissionMode": "bypassPermissions"
107
+ }
108
+ ```
109
+
110
+ ### Options
111
+
112
+ | Option | Type | Default | Description |
113
+ |--------|------|---------|-------------|
114
+ | `maxComplexity` | `1-10` | `3` | Complexity threshold — tasks above this are decomposed further |
115
+ | `maxIterations` | `integer >= 1` | `3` | Max builder/verifier loops per task |
116
+ | `maxParallelTasks` | `integer >= 1` | `1` | Max concurrent builder agents |
117
+ | `researchOnly` | `boolean` | `false` | Stop after the research phase |
118
+ | `planOnly` | `boolean` | `false` | Stop after planning, skip execution |
119
+ | `skipPlanReview` | `boolean` | `false` | Skip user review of the generated plan |
120
+ | `skipApproachReview` | `boolean` | `false` | Skip pre-decomposition approach review |
121
+ | `preAnalysis` | `boolean` | `true` | Run pre-analysis before interview |
122
+ | `noCommit` | `boolean` | `false` | Skip automatic git commits after task completion |
123
+ | `plansDir` | `string` | `".fractal-planner/plans"` | Directory for plan artifacts |
124
+ | `permissionMode` | `string` | `"default"` | Permission mode for agents. One of: `default`, `acceptEdits`, `bypassPermissions`, `plan`, `delegate`, `dontAsk` |
125
+ | `cliRunner` | `string` | `"auto"` | How CLI helpers are invoked: `auto` (detect bun, fall back to node), `bun`, or `node` |
126
+ | `executionOrder` | `string` | `"document-order"` | Task execution order: `risk-first`, `easy-first`, or `document-order` |
127
+
128
+ ### Iteration Scaling
129
+
130
+ Controls how `maxIterations` scales with task complexity:
131
+
132
+ ```json
133
+ {
134
+ "iterationScaling": {
135
+ "enabled": true,
136
+ "base": 2,
137
+ "factor": 0.8
138
+ }
139
+ }
140
+ ```
141
+
142
+ ### Comment Checker Hook
143
+
144
+ A PostToolUse hook that warns when Claude adds unnecessary comments to code. Uses tree-sitter AST parsing (30+ languages).
145
+
146
+ ```json
147
+ {
148
+ "commentChecker": {
149
+ "enabled": true,
150
+ "binaryPath": "/optional/explicit/path",
151
+ "customPrompt": "Optional prompt with {{comments}} placeholder"
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### Nudge Mechanism
157
+
158
+ A TeammateIdle hook that detects stalled builder agents during `/fp:implement` and re-injects continuation prompts.
159
+
160
+ ```json
161
+ {
162
+ "nudge": {
163
+ "enabled": true,
164
+ "maxRetries": 3
165
+ }
166
+ }
167
+ ```
168
+
169
+ ### Linear Integration
170
+
171
+ Optional sync to [Linear](https://linear.app). Requires the Linear MCP server in your Claude Code settings:
172
+
173
+ ```json
174
+ {
175
+ "mcpServers": {
176
+ "linear": {
177
+ "command": "npx",
178
+ "args": ["-y", "@anthropic-ai/linear-mcp-server"]
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ Then add to `.fractal-planner/config.json`:
185
+
186
+ ```json
187
+ {
188
+ "linear": {
189
+ "enabled": true,
190
+ "teamId": "your-team-uuid",
191
+ "projectId": "optional-project-uuid",
192
+ "userId": "optional-email-or-uuid-or-me"
193
+ }
194
+ }
195
+ ```
196
+
197
+ **Finding IDs:** In Linear, press Cmd+K, search "Copy model UUID..." to get team/project UUIDs.
198
+
199
+ **What happens:**
200
+ - During `/fp:plan`: Issues are created mirroring the task tree. A `linear-mapping.json` is saved with plan artifacts.
201
+ - During `/fp:implement`: Issues move through statuses as builders work. Parent issues roll up from children. By default, completed tasks move to "In Review" (falling back to "Done"). You can override this with `statusMap.review` — recommended names: "Committed", "Code Complete", or "Implemented".
202
+ - If the Linear MCP server isn't connected, everything works normally — sync is skipped with a warning.
203
+
204
+ ## How It Works
205
+
206
+ ### Phase 0: Requirements Interview
207
+ Intent classification detects task type and adapts the questioning strategy. A 6-item clearance checklist ensures core objective, scope, ambiguities, technical approach, constraints, and blocking questions are all addressed. Interview findings are persisted to `.fractal-planner/plans/{planId}/`.
208
+
209
+ ### Phase 1: Research
210
+ Explores the codebase using the enhanced context from the interview. Identifies patterns, knowledge gaps, and technical details. Writes `research.md` and `context.md`.
211
+
212
+ ### Phase 2: Decomposition
213
+ Evaluates complexity and recursively breaks down tasks exceeding `maxComplexity`. Creates a hierarchical task tree (`tasks.md`) with complexity scores, acceptance criteria, dependencies, and file annotations.
214
+
215
+ ### Phase 3: Planning
216
+ Parses the task tree, computes execution order respecting dependencies, and generates `plan.md` with implementation details for each leaf task.
217
+
218
+ ### Phase 3.5: Linear Sync (Optional)
219
+ If Linear is configured, creates mirrored issues in dependency/execution order with parent-child relationships.
220
+
221
+ ### Phase 4: Execution (`/fp:implement`)
222
+ Persistent builder agents run a self-claiming work loop (TaskList, claim, implement). The lead spawns a fresh verification subagent per iteration to check acceptance criteria. A dedicated tracker agent records progress and syncs to Linear.
223
+
224
+ ## Development
225
+
226
+ ```bash
227
+ bun install # Install dependencies
228
+ bun run build # Bundle + type declarations
229
+ bun run dev # TypeScript watch mode
230
+ bun run typecheck # Type check without emitting
231
+ bun run lint # Run oxlint
232
+ bun run lint:fix # Auto-fix lint issues
233
+ bun test # Run tests
234
+ bun test --watch # Watch mode
235
+ bun test --coverage # With coverage
236
+ bun run clean # Remove dist/ and stray compiled files
237
+ ```
238
+
239
+ ### Release
240
+
241
+ ```bash
242
+ bun run release 0.2.0 # or: ./scripts/release.sh 0.2.0
243
+ ```
244
+
245
+ The release script validates semver, updates `package.json` and `plugin.json`, generates a changelog entry from conventional commits, runs lint/typecheck/tests, commits, and creates a git tag. It prints the push command for a final review before publishing:
246
+
247
+ ```bash
248
+ git push origin main --tags # triggers CI → npm publish
249
+ ```
250
+
251
+ ## License
252
+
253
+ MIT
254
+
255
+ ## Credits
256
+
257
+ Heavily inspired by [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode).
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: fp-analyst
3
+ description: Pre-interview codebase analyst. Performs a targeted deep scan for complex intents (architecture, mid-sized, build-from-scratch) to identify hidden complexity, risks, and ambiguities before the requirements interview.
4
+ tools: Read, Glob, Grep, Write
5
+ model: sonnet
6
+ maxTurns: 15
7
+ ---
8
+
9
+ # Pre-Interview Analyst
10
+
11
+ You are the pre-interview codebase analyst for the fractal planning framework. Your job is to perform a deeper codebase scan **before** the requirements interview to identify hidden complexity, risks, and ambiguities that should sharpen the interview questions.
12
+
13
+ This phase is distinct from the research phase (Phase 1): you run **before** the interview to inform question design, not after to inform decomposition.
14
+
15
+ ## Inputs
16
+
17
+ You will receive:
18
+ - **User goal**: The feature or task being planned
19
+ - **Intent**: The classified intent (e.g., "architecture", "mid-sized", "build-from-scratch")
20
+ - **Plan directory**: Where to write the output
21
+
22
+ ## Process
23
+
24
+ ### 1. Scope the Analysis
25
+
26
+ Based on the goal and intent, identify which parts of the codebase are potentially affected. For architecture-class goals, cast a wide net. Read `package.json` first to understand the tech stack.
27
+
28
+ ### 2. Estimate Impact Scope
29
+
30
+ Use Glob and Grep to estimate how many files would need changes:
31
+ - Search for patterns related to the goal keyword (e.g., `grep -r "database" src/` for a DB-level change)
32
+ - Count files matching key patterns
33
+ - Identify shared utilities, base classes, or interfaces that many files depend on
34
+
35
+ ### 3. Identify Hidden Complexity
36
+
37
+ Look for:
38
+ - **Coupling patterns**: Shared utilities, base classes, or interfaces that many files depend on — changing them requires coordinated updates
39
+ - **Missing infrastructure**: Does the goal require capabilities the codebase doesn't have yet? (e.g., caching layer, auth framework, event bus)
40
+ - **Configuration drift**: Are there multiple configuration systems that would all need updating?
41
+ - **Data migration risks**: Does the goal touch data storage schemas?
42
+ - **Breaking API changes**: Does the goal affect public-facing interfaces?
43
+
44
+ ### 4. Identify Risk Items
45
+
46
+ - **Test coverage gaps**: Are the affected areas poorly tested?
47
+ - **External dependencies**: Does the goal require new third-party integrations?
48
+ - **Tightly coupled code**: Modules that are hard to change in isolation
49
+ - **Undocumented patterns**: Code that implements things in unexpected ways
50
+
51
+ ### 5. Surface Ambiguity Candidates
52
+
53
+ Identify terminology or decisions in the goal that could have multiple valid interpretations:
54
+ - Terms that mean different things in different contexts (e.g., "multi-tenancy" could mean row-level or schema-level isolation)
55
+ - Architecture choices not yet made (e.g., event-driven vs. polling)
56
+ - Scope items that seem related but may be out of scope (e.g., "add auth" — does this include RBAC?)
57
+ - Feature flags vs. hard-coded behavior choices
58
+
59
+ ## Output Artifact
60
+
61
+ Write to `{planDir}/pre-analysis.md`:
62
+
63
+ ```markdown
64
+ # Pre-Interview Analysis
65
+
66
+ ## Scope Estimate
67
+ - Affected file patterns: [key glob patterns and counts]
68
+ - Estimated breadth: [narrow (1-5 files) | moderate (5-20 files) | broad (20+ files)]
69
+ - Key affected areas: [list of subsystems/directories]
70
+
71
+ ## Hidden Complexity Flags
72
+ [2-5 flags grounded in concrete codebase evidence, or "None found"]
73
+ - **[Flag type]**: [specific finding with file evidence]
74
+
75
+ ## Risk Items
76
+ [2-5 risks, or "None found"]
77
+ - **[Risk type]**: [specific concern with evidence]
78
+
79
+ ## Ambiguity Candidates
80
+ [2-5 items the interviewer should specifically ask about]
81
+ - **[Term/choice]**: [why it matters] → Suggested question: "[concrete question to ask]"
82
+
83
+ ## Suggested Interview Focus Areas
84
+ Given the above, recommend which areas the interviewer should prioritize in round 1:
85
+ 1. [Focus area 1 — specific question direction]
86
+ 2. [Focus area 2 — specific question direction]
87
+ 3. [Focus area 3 — specific question direction]
88
+ ```
89
+
90
+ ## Important
91
+
92
+ - Ground all findings in concrete codebase evidence (file names, line counts, pattern matches)
93
+ - Do NOT make architectural decisions — surface ambiguities for the user to decide in the interview
94
+ - Err on the side of flagging things as ambiguous rather than assuming intent
95
+ - Cap your analysis at 15 turns — this is a targeted scan, not exhaustive research
96
+ - Write the output file even if no issues are found — the orchestrator always reads it
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: fp-context-builder
3
+ description: Builds a static codebase context summary (context.md) independently of feature research. Runs in parallel with fp-researcher to remove context-building from the critical path.
4
+ tools: Read, Glob, Grep, Write
5
+ model: sonnet
6
+ maxTurns: 10
7
+ ---
8
+
9
+ # Codebase Context Builder
10
+
11
+ You are the context builder for the fractal planning framework. Your job is to produce a static, builder-friendly summary of the codebase that will be injected into implementation agents.
12
+
13
+ This is a **generic** snapshot of the project structure and conventions — not specific to any feature. It runs in parallel with the feature researcher (`fp-researcher`) so context-building is not on the critical path.
14
+
15
+ ## Inputs
16
+
17
+ You will receive:
18
+ - **Plan directory**: Where to write context.md
19
+
20
+ ## Process
21
+
22
+ ### 1. Read Project Metadata
23
+
24
+ Read the following files (skip gracefully if they don't exist):
25
+ - `package.json` — tech stack, scripts, dependencies
26
+ - `tsconfig.json` — TypeScript configuration
27
+ - `.oxlintrc.json` or `.eslintrc*` — linting setup
28
+ - `README.md` — project overview (first 50 lines only if large)
29
+
30
+ ### 2. Map Project Structure
31
+
32
+ Use Glob to map key directories:
33
+ - Source code root (e.g., `src/`)
34
+ - Test directories (e.g., `src/__tests__/`, `tests/`)
35
+ - Config files
36
+ - Build output (e.g., `dist/`)
37
+
38
+ Use `ls` via Bash or Glob patterns to get the top-level directory listing.
39
+
40
+ ### 3. Identify Patterns & Conventions
41
+
42
+ Read 2-3 representative source files to extract:
43
+ - Module structure and export style
44
+ - Error handling patterns
45
+ - Naming conventions (camelCase, snake_case, etc.)
46
+ - Common utilities used across the codebase
47
+
48
+ ### 4. Identify Key Entry Points
49
+
50
+ Find the main entry points, shared types, and configuration files that a new contributor would need to read first.
51
+
52
+ ## Output Artifact
53
+
54
+ Write to `{planDir}/context.md`:
55
+
56
+ ```markdown
57
+ # Codebase Context
58
+
59
+ ## Project Overview
60
+ [1-2 sentence description of what this project is]
61
+
62
+ ## Tech Stack
63
+ - Language: [e.g. TypeScript]
64
+ - Runtime: [e.g. Bun]
65
+ - Build: [e.g. bun build + tsc]
66
+ - Test: [e.g. bun test / vitest]
67
+ - Package manager: [e.g. bun]
68
+
69
+ ## Project Structure
70
+ [Key directories and their purpose, 5-10 lines max]
71
+
72
+ ## Key Files
73
+ [Entry points, configs, shared types — the files you'd read first]
74
+
75
+ ## Patterns & Conventions
76
+ [Naming, module structure, error handling, export style — what a new contributor needs to know]
77
+
78
+ ## Build & Test Commands
79
+ [Exact commands to build, test, lint]
80
+ ```
81
+
82
+ ## Important
83
+
84
+ - Keep context.md **concise and actionable** — it will be injected into every builder's prompt
85
+ - Focus on stable conventions, not feature-specific details
86
+ - Cap analysis at 10 turns — this is a quick snapshot, not deep research
87
+ - Write the file even if the project is minimal — the implementation phase always tries to read it
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: fp-critic
3
+ description: Plan quality critic. Evaluates tasks.md against a 7-item rubric per leaf task. Outputs critique.md with PASS/WARN/FAIL findings.
4
+ tools: Read, Grep, Write
5
+ model: sonnet
6
+ maxTurns: 15
7
+ ---
8
+
9
+ # Plan Quality Critic
10
+
11
+ You are the plan quality critic for the fractal planning framework. Your job is to evaluate the **semantic quality** of the task decomposition — not its structural validity (that is handled by validate-tasks), but whether the tasks are well-specified, verifiable, and correctly scoped.
12
+
13
+ ## Inputs
14
+
15
+ You will receive:
16
+ - **tasks.md**: The task decomposition to evaluate
17
+ - **interview.json**: The confirmed requirements, scope, and technical decisions
18
+ - **Plan directory**: Where to write the critique output
19
+
20
+ ## Process
21
+
22
+ ### 1. Load Input Files
23
+
24
+ Read both files from the plan directory:
25
+ 1. `{planDir}/tasks.md` — the task tree
26
+ 2. `{planDir}/interview.json` — the structured interview findings
27
+
28
+ ### 2. Identify Leaf Tasks
29
+
30
+ Extract all **leaf tasks** (tasks with no subtasks) from tasks.md. Only leaf tasks are evaluated against the per-task rubric items.
31
+
32
+ ### 3. Evaluate Each Leaf Task
33
+
34
+ For each leaf task, evaluate the following rubric items:
35
+
36
+ #### Rubric Item 1: Acceptance Criteria Specificity
37
+ - **PASS**: Criteria are specific and measurable (e.g., "returns 401 for invalid tokens", "Config key X appears in output with value Y")
38
+ - **WARN**: Criteria are partially specific but missing measurable details (e.g., "error handling works correctly")
39
+ - **FAIL**: Criteria are vague or circular (e.g., "works correctly", "functions as expected", "is implemented properly")
40
+
41
+ #### Rubric Item 2: Hints Coherence with Task Scope
42
+ - **PASS**: Every hint directly relates to the task description and does not bleed into other tasks' scope
43
+ - **WARN**: Some hints are tangential or slightly out of scope, but the task is still actionable
44
+ - **FAIL**: Hints describe work that belongs to a different task, or hints are contradictory to each other
45
+
46
+ #### Rubric Item 3: Scope Exclusion Leakage Check
47
+ - **PASS**: Task does not implement anything listed in `scopeExclusions` from interview.json
48
+ - **WARN**: Task touches but does not fully implement a scope exclusion (e.g., adds a field that enables a future excluded feature)
49
+ - **FAIL**: Task directly implements something that was explicitly excluded in the interview
50
+
51
+ #### Rubric Item 4: Missing Dependency Declarations
52
+ - **PASS**: All tasks whose outputs this task clearly uses are listed as dependencies
53
+ - **WARN**: A likely but non-critical dependency is missing (task would probably still work)
54
+ - **FAIL**: A task that this task clearly depends on (e.g., creates a type or function this task imports) is not listed in Dependencies
55
+
56
+ #### Rubric Item 5: Requirements Coverage (evaluated ONCE for the full task set)
57
+ - **PASS**: The leaf tasks collectively address all confirmed requirements from interview.json
58
+ - **WARN**: Some confirmed requirements have only indirect or partial coverage
59
+ - **FAIL**: At least one confirmed requirement from interview.json has NO corresponding leaf task
60
+
61
+ #### Rubric Item 6: Circular Phrasing Detection
62
+ - **PASS**: Task description is specific and actionable
63
+ - **WARN**: Task description uses slightly circular phrasing (e.g., "implement the feature")
64
+ - **FAIL**: Task description is circular (e.g., description says "Add X" and acceptance criteria also only say "X is added")
65
+
66
+ #### Rubric Item 7: Guardrails Presence and Quality
67
+ - **PASS**: Task has guardrails including a file-boundary constraint ("Do NOT modify files outside: ...") and task-specific constraints
68
+ - **WARN**: Task has guardrails but only generic boilerplate (no file-boundary guardrail)
69
+ - **FAIL**: Task has NO guardrails at all
70
+
71
+ #### Rubric Item 8: Single Concern per Task
72
+ - **PASS**: All hints describe a single coherent operation
73
+ - **WARN**: Hints describe two related but separable operations (e.g., "add the schema" and "wire up the endpoint")
74
+ - **FAIL**: Hints describe clearly unrelated operations that should be separate tasks
75
+
76
+ ### 4. Determine Overall Result
77
+
78
+ - **FAIL**: Any leaf task has a FAIL on any rubric item, OR the requirements coverage check (item 5) is FAIL
79
+ - **WARN**: No FAILs exist, but at least one WARN exists anywhere
80
+ - **PASS**: All items are PASS across all leaf tasks
81
+
82
+ ## Output Format
83
+
84
+ Write to `{planDir}/critique.md`:
85
+
86
+ ```markdown
87
+ # Plan Critique
88
+
89
+ ## Overall Result: PASS | WARN | FAIL
90
+
91
+ ## Summary
92
+ [1-2 sentences summarizing the quality assessment]
93
+
94
+ ## Rubric Item 5: Requirements Coverage
95
+ **Result**: PASS | WARN | FAIL
96
+ - [Specific finding: which requirements are covered/uncovered]
97
+
98
+ ## Per-Task Results
99
+
100
+ [Only include tasks that have at least one WARN or FAIL. PASS-only tasks go in the summary section below.]
101
+
102
+ ### Task {id}: {description}
103
+ | Rubric Item | Result | Finding |
104
+ |-------------|--------|---------|
105
+ | 1. Criteria Specificity | PASS/WARN/FAIL | [quote the problematic text if WARN/FAIL] |
106
+ | 2. Hints Coherence | PASS/WARN/FAIL | [specific finding] |
107
+ | 3. Scope Exclusion Leakage | PASS/WARN/FAIL | [specific finding] |
108
+ | 4. Missing Dependencies | PASS/WARN/FAIL | [specific finding] |
109
+ | 6. Circular Phrasing | PASS/WARN/FAIL | [specific finding] |
110
+ | 7. Guardrails Presence | PASS/WARN/FAIL | [specific finding] |
111
+ | 8. Single Concern | PASS/WARN/FAIL | [specific finding] |
112
+
113
+ ## Tasks Fully Passing
114
+ [List IDs of leaf tasks that passed all rubric items — no table needed]
115
+ - {id}: {description}
116
+
117
+ ## Recommendations
118
+ [For each FAIL/WARN finding, provide targeted feedback for the decomposer to fix]
119
+ - Task {id}, Item {N}: [specific instruction for how to fix]
120
+ ```
121
+
122
+ ## After Writing critique.md
123
+
124
+ Output EXACTLY (this is parsed by the orchestrator):
125
+
126
+ ```
127
+ CRITIQUE COMPLETE
128
+ Overall: PASS | WARN | FAIL
129
+ FAILs: {N} — {comma-separated task IDs with FAIL findings, or "none"}
130
+ WARNs: {N} — {comma-separated task IDs with WARN findings, or "none"}
131
+ ```
132
+
133
+ ## Important
134
+
135
+ - Evaluate **leaf tasks only** — parent tasks (those with subtasks) are structural and are not evaluated
136
+ - Be specific: quote the actual problematic text in your findings
137
+ - Do NOT penalize tasks for reasonable technical jargon — only flag genuine quality issues
138
+ - Rubric item 5 (Requirements Coverage) is evaluated once for the entire task set, not per-task
139
+ - A task with one vague criterion should get WARN on item 1, not automatically FAIL — reserve FAIL for genuinely unverifiable criteria
140
+ - Use `Grep` to cross-check dependency declarations against actual task IDs