forge-orkes 0.3.11 → 0.3.13

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.
@@ -1,95 +1,80 @@
1
1
  ---
2
2
  name: planning
3
- description: "Break work into executable tasks with verification gates. Trigger after researching when context is sufficient. Enforces constitutional gates, structures requirements, decomposes tasks, sets up goal-backward verification."
3
+ description: "Break work into executable tasks with verification gates. Enforces constitutional gates, structures requirements, decomposes tasks, goal-backward verification."
4
4
  ---
5
5
 
6
6
  # Planning
7
7
 
8
- Turn research and requirements into executable, verifiable plans.
9
-
10
- > **Do NOT use `EnterPlanMode`.** All planning output goes to `.forge/phases/` as structured plan files. Follow the steps below directly.
8
+ > **Do NOT use `EnterPlanMode`.** Output -> `.forge/phases/`.
11
9
 
12
10
  ## Step 1: Resolution Gate
13
11
 
14
- Read `.forge/context.md`. Check the **Needs Resolution** section.
15
-
16
- If unresolved items exist (unchecked `- [ ]` items):
17
-
18
- Present all items and ask the user to decide on each:
19
- *"Before we plan, {N} items need your input: [list]. For each: lock, defer, fix, or drop?"*
12
+ Read `.forge/context.md` **Needs Resolution**. If unchecked `- [ ]` items:
13
+ *"{N} items need input: [list]. For each: lock, defer, fix, or drop?"*
20
14
 
21
15
  | Choice | Action |
22
16
  |--------|--------|
23
17
  | Lock | Record in Locked Decisions |
24
- | Defer | Move to Deferred Ideas with revisit date |
25
- | Fix | Add as FR-xxx in `.forge/requirements.yml` — flows into the plan |
18
+ | Defer | Move to Deferred Ideas + revisit date |
19
+ | Fix | Add as FR-xxx in `.forge/requirements.yml` |
26
20
  | Drop | Note in Amendment Log |
27
21
 
28
- Check off each resolved item `- [x]` and move to the appropriate section.
29
-
30
- Target: 2-5 minutes. Quick human decisions so planning proceeds with accurate info.
22
+ Mark resolved `- [x]`. Target: 2-5 min.
23
+ Scan **Carried Forward** -- items affecting current phase get same triage.
31
24
 
32
- Also scan **Carried Forward** — items affecting the current phase get the same triage.
25
+ ## Step 2: Constitutional Gate
33
26
 
34
- ## Step 2: Constitutional Gate Check
27
+ Read `.forge/constitution.md`. Per article:
28
+ - Check gate checkboxes
29
+ - Fail -> **STOP.** Resolve first.
30
+ - Needs amendment -> flag for user (discuss phase)
35
31
 
36
- Read `.forge/constitution.md`. For each relevant article:
37
- - Check the gate checkboxes
38
- - Gate fails → **STOP.** Resolve before planning.
39
- - Article needs amendment → flag for user decision (discuss phase)
32
+ Record results in plan frontmatter.
40
33
 
41
- Document gate results in the plan frontmatter.
34
+ ## Step 3: Lock Decisions
42
35
 
43
- ## Step 3: Lock User Decisions
36
+ If missing, create `.forge/context.md` from template:
37
+ 1. Ask user key decisions (framework, constraints, preferences)
38
+ 2. **Locked Decisions** (contracts)
39
+ 3. **Deferred Ideas** (out of scope)
40
+ 4. **Discretion Areas** (agent picks)
44
41
 
45
- If not done, create `.forge/context.md` from template:
46
-
47
- 1. Ask user about key decisions (framework choices, constraints, preferences)
48
- 2. Record as **Locked Decisions** — these are contracts
49
- 3. Record **Deferred Ideas** — explicitly out of scope
50
- 4. Record **Discretion Areas** — agent picks best approach
51
-
52
- Do this BEFORE creating plans. Plans must reference context.md.
42
+ Must complete BEFORE plans. Plans reference context.md.
53
43
 
54
44
  ## Step 4: Structure Requirements
55
45
 
56
- If `.forge/requirements.yml` doesn't exist, create from template:
57
-
58
- 1. Extract functional requirements from user description + research
59
- 2. Assign IDs: FR-001, FR-002, etc.
60
- 3. Write acceptance criteria in Given/When/Then format
61
- 4. Mark uncertain items: `[NEEDS CLARIFICATION]`
62
- 5. Separate P1 (must-have) from P2 (should-have) and P3 (nice-to-have)
63
- 6. List deferred items explicitly (DEF-001, etc.)
46
+ If `.forge/requirements.yml` missing, create from template:
47
+ 1. Extract from user description + research
48
+ 2. IDs: FR-001, FR-002...
49
+ 3. Acceptance: Given/When/Then
50
+ 4. Uncertain: `[NEEDS CLARIFICATION]`
51
+ 5. P1 (must) / P2 (should) / P3 (nice)
52
+ 6. Deferred: DEF-001...
64
53
 
65
- **Planning blocks until all P1 `[NEEDS CLARIFICATION]` items are resolved.**
54
+ **Blocks until all P1 `[NEEDS CLARIFICATION]` resolved.**
66
55
 
67
56
  ## Step 5: Create Roadmap
68
57
 
69
- If `.forge/roadmap.yml` doesn't exist (Full tier only):
58
+ If `.forge/roadmap.yml` missing (Full only):
59
+ 1. Group by delivery boundaries
60
+ 2. Inter-group dependencies
61
+ 3. Phases (coherent, verifiable)
62
+ 4. Every FR -> one phase, no orphans
63
+ 5. Waves: independent=1, dependent=2+
70
64
 
71
- 1. Group requirements by natural delivery boundaries
72
- 2. Identify dependencies between groups
73
- 3. Create phases (coherent, verifiable capabilities)
74
- 4. Assign requirements to phases (every FR → exactly one phase, no orphans)
75
- 5. Analyze waves (independent phases = Wave 1, dependencies = Wave 2+)
65
+ ## Step 6: Decompose Tasks
76
66
 
77
- ## Step 6: Decompose into Tasks
67
+ Per phase (or feature, Standard tier):
78
68
 
79
- For each phase (or single feature in Standard tier):
80
-
81
- 1. Copy `.forge/templates/plan.md` → `.forge/phases/m{M}-{N}-{name}/plan-{NN}.md`
82
- - `{M}` = milestone ID from `roadmap.yml`
83
- - `{N}` = phase number within milestone (sequential)
84
- - `{name}` = phase `name` from `roadmap.yml` in kebab-case
85
- - `{NN}` = plan sequence within the phase (`01`, `02`, etc.)
86
- - Example: `.forge/phases/m3-2-providers/plan-01.md`
87
- 2. Fill in frontmatter (phase, plan number, wave, dependencies)
88
- 3. Create goal-backward must_haves:
89
- - **Truths:** Observable from user perspective when done (3-7)
90
- - **Artifacts:** Files that must exist and be substantive, not stubs
91
- - **Key Links:** Critical connections between artifacts
92
- 4. Decompose into XML tasks (2-3 per plan, 15-60 min each):
69
+ 1. `.forge/templates/plan.md` -> `.forge/phases/m{M}-{N}-{name}/plan-{NN}.md`
70
+ - `{M}`=milestone, `{N}`=phase#, `{name}`=kebab, `{NN}`=seq
71
+ - Ex: `.forge/phases/m3-2-providers/plan-01.md`
72
+ 2. Frontmatter: phase, plan#, wave, deps
73
+ 3. must_haves:
74
+ - **Truths:** User-observable outcomes (3-7)
75
+ - **Artifacts:** Must exist, substantive not stubs
76
+ - **Key Links:** Connections between artifacts
77
+ 4. XML tasks (2-3/plan, 15-60 min):
93
78
 
94
79
  ```xml
95
80
  <task type="auto">
@@ -123,7 +108,7 @@ For each phase (or single feature in Standard tier):
123
108
  Plan 01: User feature (model + API + UI) → Wave 1
124
109
  Plan 02: Product feature (model + API + UI) → Wave 1
125
110
  ```
126
- Independent plans run in parallel.
111
+ Independent plans run parallel.
127
112
 
128
113
  ### Avoid Horizontal Layers
129
114
  ```
@@ -131,36 +116,31 @@ Plan 01: All models → Wave 1
131
116
  Plan 02: All APIs → Wave 2 (depends on 01)
132
117
  Plan 03: All UI → Wave 3 (depends on 02)
133
118
  ```
134
- Forces sequential execution. Only use when architecturally necessary.
119
+ Sequential. Only when architecturally required.
135
120
 
136
- ## Step 7: Test Spec Generation (Optional)
121
+ ## Step 7: Test Specs (Optional)
137
122
 
138
- **When to use:** Work involves testable contracts APIs with defined endpoints, libraries with public interfaces, data transformations with known inputs/outputs, or services with observable behavior. Skip for UI-heavy work. User can request explicitly: *"Generate test specs for this plan."*
123
+ **When:** Testable contracts (APIs, libraries, transforms, services). Skip UI-heavy.
139
124
 
140
- ### Detect Testable Contracts
125
+ ### Detect Contracts
141
126
 
142
- Scan tasks from Step 6. A task is a testable contract candidate if it involves:
143
- - API endpoints defined request/response shapes, status codes, error cases
144
- - Library/module interfaces public functions with typed inputs and expected outputs
145
- - Data transformations parsers, formatters, validators with known inputoutput mappings
146
- - Service integrations external API calls with expected payloads and error handling
147
- - Business logic calculations, rules engines, state machines with deterministic behavior
127
+ Scan tasks. Candidate if:
128
+ - API endpoints -- shapes, codes, errors
129
+ - Library interfaces -- typed functions, outputs
130
+ - Transforms -- parsers, validators, input->output
131
+ - Services -- external calls, payloads, errors
132
+ - Business logic -- calculations, state machines
148
133
 
149
- No testable contracts found → skip to Step 8.
134
+ None -> skip to Step 8.
150
135
 
151
- ### Generate Test Specifications
136
+ ### Generate Specs
152
137
 
153
138
  **Location:** `.forge/phases/m{M}-{N}-{name}/specs/`
154
-
155
- **Format:** Language-appropriate test files (`.test.ts`, `_test.go`, `test_*.py`) that:
156
-
157
- 1. Import the module that will exist (path from task's `<files>`)
158
- 2. Describe expected behavior from requirements, not implementation:
159
- - Happy path from acceptance criteria
160
- - Edge cases from requirements (empty input, max limits, invalid data)
161
- - Error cases from `<done>` criteria
162
- 3. Assert outcomes, not internals
163
- 4. Mark as pending/skipped (`it.skip()`, `@pytest.mark.skip`, `t.Skip()`) so CI doesn't break before implementation
139
+ Test files (`.test.ts`, `_test.go`, `test_*.py`):
140
+ 1. Import from `<files>` path
141
+ 2. Behavior from requirements (happy, edge, error)
142
+ 3. Assert outcomes not internals
143
+ 4. Mark pending (`it.skip()`, `@pytest.mark.skip`, `t.Skip()`)
164
144
 
165
145
  ```typescript
166
146
  // Example: .forge/phases/m1-1-auth/specs/login-endpoint.test.ts
@@ -183,9 +163,9 @@ describe('POST /api/auth/login', () => {
183
163
  });
184
164
  ```
185
165
 
186
- ### Update Plan Tasks
166
+ ### Update Tasks
187
167
 
188
- For tasks with generated test specs, update the task XML to reference the spec:
168
+ Specs -> type becomes `tdd`:
189
169
 
190
170
  ```xml
191
171
  <task type="tdd">
@@ -198,45 +178,39 @@ For tasks with generated test specs, update the task XML to reference the spec:
198
178
  </task>
199
179
  ```
200
180
 
201
- Task type changes to `tdd` when a spec exists. The executor's TDD flow (RED GREEN REFACTOR) kicks in automatically.
181
+ Executor TDD (RED -> GREEN -> REFACTOR) auto-activates.
202
182
 
203
- ### What NOT to Spec
204
- - UI component rendering (use must_haves truths)
205
- - Visual layout and styling (use human verification)
206
- - Integration flows spanning many components (use key_links verification)
207
- - Undefined interfaces (spec after architecting, not before)
183
+ ### Do NOT Spec
184
+ - UI rendering (must_haves truths)
185
+ - Layout/styling (human verify)
186
+ - Multi-component integration (key_links)
187
+ - Undefined interfaces (spec after architecting)
208
188
 
209
189
  ## Step 8: Verify Plans
210
190
 
211
- Before passing to executor, check 8 dimensions:
212
-
213
- 1. **Requirement Coverage** Every phase requirement has task(s)
214
- 2. **Task Completeness** All tasks have files + action + verify + done
215
- 3. **Dependency Correctness** Valid DAG, no circular deps
216
- 4. **Key Links Planned** Artifacts will be wired together, not orphaned
217
- 5. **Scope Sanity** 2-3 tasks per plan, targeting ~50% context
218
- 6. **Verification Derivation** must_haves trace to phase goal
219
- 7. **Context Compliance** Plans honor locked decisions, exclude deferred ideas
220
- 8. **Spec Validity** (when Step 7 used) — Valid syntax, correct paths, derived from requirements not assumptions
221
-
222
- Issues found → fix and re-verify. Max 3 revision cycles.
223
-
224
- ## Step 9: Present to User
191
+ 8 dimensions:
192
+ 1. **Requirement Coverage** -- every req has task(s)
193
+ 2. **Task Completeness** -- files + action + verify + done
194
+ 3. **Deps** -- valid DAG, no cycles
195
+ 4. **Key Links** -- wired, not orphaned
196
+ 5. **Scope** -- 2-3 tasks/plan, ~50% context
197
+ 6. **Verification** -- must_haves trace to goal
198
+ 7. **Context** -- honors locked, excludes deferred
199
+ 8. **Spec Validity** -- valid syntax, correct paths
225
200
 
226
- Show:
227
- 1. Requirements summary (P1/P2/P3 counts, clarifications needed)
228
- 2. Phase/plan structure with wave analysis
229
- 3. Estimated effort per phase
230
- 4. Ask: "Does this plan match your expectations? Any changes?"
201
+ Issues -> fix, re-verify. Max 3 cycles.
231
202
 
232
- Planning is complete when user approves.
203
+ ## Step 9: Present
233
204
 
234
- ## Phase Handoff
205
+ 1. Requirements (P1/P2/P3, clarifications)
206
+ 2. Phase/plan structure + waves
207
+ 3. Effort estimates
208
+ 4. "Does this plan match expectations? Changes?"
235
209
 
236
- After user approves:
210
+ Done when approved.
237
211
 
238
- 1. **Verify persistence** — Confirm plans written to `.forge/phases/m{M}-{N}-{name}/plan-{NN}.md`, requirements to `.forge/requirements.yml`, roadmap to `.forge/roadmap.yml`, context to `.forge/context.md`
239
- 2. **Update state** — Set `current.status` to `executing` in `.forge/state/milestone-{id}.yml`
240
- 3. **Recommend context clear:**
212
+ ## Handoff
241
213
 
242
- *"Plan written. `/clear` then `/forge` to continue with executing."*
214
+ 1. **Persist** -- plans `.forge/phases/`, reqs `.forge/requirements.yml`, roadmap `.forge/roadmap.yml`, context `.forge/context.md`
215
+ 2. **State** -- `current.status` = `executing` in `.forge/state/milestone-{id}.yml`
216
+ 3. *"Plan written. `/clear` then `/forge` to continue."*