forge-orkes 0.3.8 → 0.3.10

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,83 +1,51 @@
1
1
  ---
2
2
  name: executing
3
- description: "Use when building: writing code, creating files, running tests. Trigger when you have an approved plan and need to implement it. This skill enforces atomic commits, deviation rules, context engineering, and TDD when applicable."
3
+ description: "Build to plan with atomic commits, deviation rules, and context engineering. Trigger when an approved plan exists."
4
4
  ---
5
5
 
6
6
  # Executing
7
7
 
8
- Build to plan with atomic commits, smart deviation handling, and context engineering.
9
-
10
8
  ## Pre-Execution Checklist
11
-
12
- Before writing any code:
13
9
  - [ ] Plan exists (`.forge/phases/m{M}-{N}-{name}/plan-{NN}.md`)
14
- - [ ] Context.md reviewed (locked decisions noted)
15
- - [ ] Constitution.md gates satisfied (from planning phase)
16
- - [ ] Current milestone state (`.forge/state/milestone-{id}.yml`) updated to `status: executing`
10
+ - [ ] Context.md locked decisions noted
11
+ - [ ] Constitution.md gates satisfied
12
+ - [ ] Milestone state updated to `status: executing`
17
13
 
18
14
  ## Deviation Rules
19
15
 
20
- When you encounter issues while building, follow this decision tree:
21
-
22
16
  ### Rule 4 Check First (Architectural)
23
- Does the issue require a new database table, service layer, major schema change, library swap, or infrastructure change?
24
- - **YES** → **STOP.** Create checkpoint. Document: what you found, proposed change, why needed, impact, alternatives. Wait for user decision.
17
+ New DB table, service layer, schema change, library swap, or infra change?
18
+ - **YES** → **STOP.** Checkpoint: what, proposed change, why, impact, alternatives. Wait for user.
25
19
  - **NO** → Continue to Rules 1-3.
26
20
 
27
21
  ### Rule 1: Auto-Fix Bugs
28
- Issue is a simple bug blocking the current task (broken behavior, wrong output, error).
29
- → Fix inline. Add test if applicable. Document in summary: "Rule 1: Fixed [bug] because [reason]."
22
+ Bug blocking current task Fix inline. Add test if applicable. Document: "Rule 1: Fixed [bug] because [reason]."
30
23
 
31
24
  ### Rule 2: Auto-Add Critical Functionality
32
- Missing error handling, input validation, null checks, auth checks, CSRF protection, rate limiting, logging.
33
- → Add it. Document in summary: "Rule 2: Added [functionality] because [reason]."
25
+ Missing error handling, validation, null checks, auth, CSRF, rate limiting, logging → Add it. Document: "Rule 2: Added [what] because [reason]."
34
26
 
35
27
  ### Rule 3: Auto-Fix Blocking Infrastructure
36
- Missing dependency, wrong types, broken imports, env var misconfiguration, build config issue.
37
- → Fix it. Document in summary: "Rule 3: Fixed [issue] because [reason]."
28
+ Missing dep, wrong types, broken imports, env var, build config → Fix it. Document: "Rule 3: Fixed [issue] because [reason]."
38
29
 
39
30
  ### 3-Strike Limit
40
- After 3 auto-fix attempts on a single task → STOP fixing. Document remaining issues in summary. Move to next task.
31
+ 3 auto-fix attempts on a single task → STOP. Document remaining issues. Move to next task.
41
32
 
42
33
  ### Scope Boundary
43
- Only fix issues DIRECTLY caused by the current task. Pre-existing warnings, tech debt, unrelated bugs → log to `.forge/deferred-issues.md`, don't fix.
44
-
45
- ## Native Task Tracking (Hybrid Approach)
46
-
47
- Use Claude Code's native task tools (`TaskCreate`, `TaskUpdate`, `TaskList`) for **in-session visibility** during execution. The `.forge/state/milestone-{id}.yml` remains the **cross-session source of truth** — native tasks are a UI layer on top.
48
-
49
- ### On Plan Start
50
-
51
- After loading the plan file, create native tasks from the XML task blocks:
34
+ Only fix issues DIRECTLY caused by the current task. Pre-existing warnings, tech debt, unrelated bugs → log to `.forge/deferred-issues.md`.
52
35
 
53
- 1. Parse all `<task>` XML blocks from the plan
54
- 2. For each task, call `TaskCreate`:
55
- - `subject`: The task's `<name>` value
56
- - `description`: Combine `<action>`, `<verify>`, and `<done>` fields
57
- - `activeForm`: Present-continuous form of the task name (e.g., "Implementing login form")
58
- 3. If the plan has ordered tasks (task 2 depends on task 1), set dependencies via `TaskUpdate` with `addBlockedBy`
59
- 4. Store the mapping: native task ID → plan task number (track mentally or in first task's metadata)
36
+ ## Native Task Tracking
60
37
 
61
- ### On Task Start
38
+ Use `TaskCreate`/`TaskUpdate`/`TaskList` for in-session visibility. `.forge/state/milestone-{id}.yml` remains the cross-session source of truth.
62
39
 
63
- Before implementing each task:
64
- 1. Call `TaskUpdate` with `status: "in_progress"` on the current native task
65
- 2. This gives the user a visible spinner with the `activeForm` text
40
+ **On Plan Start:** Parse `<task>` XML blocks. `TaskCreate` each: `subject` = name, `description` = action + verify + done, `activeForm` = present-continuous form. Set dependencies via `addBlockedBy`. Track native task ID → plan task number.
66
41
 
67
- ### On Task Complete
42
+ **On Task Start:** `TaskUpdate` → `status: "in_progress"`.
68
43
 
69
- After each task's commit:
70
- 1. Call `TaskUpdate` with `status: "completed"` on the finished native task
71
- 2. The next task automatically becomes unblocked (if dependencies were set)
44
+ **On Task Complete:** `TaskUpdate` → `status: "completed"`.
72
45
 
73
- ### On Plan Complete
46
+ **On Plan Complete:** Native tasks are session-scoped — disappear on `/clear`. No cleanup needed.
74
47
 
75
- Native tasks are session-scoped they disappear on `/clear` or session end. No cleanup needed. The authoritative state has already been written to `.forge/state/milestone-{id}.yml`.
76
-
77
- ### When NOT to Create Native Tasks
78
-
79
- - **Spawned fresh agents**: Subagents don't share the parent's task list. The parent agent creates the native tasks; the subagent just does the work.
80
- - **Single-task plans**: If the plan has only 1 task, skip native task creation — the overhead isn't worth it.
48
+ **Skip native tasks when:** spawned fresh agents (subagents don't share parent task list) or single-task plans.
81
49
 
82
50
  ---
83
51
 
@@ -85,39 +53,36 @@ Native tasks are session-scoped — they disappear on `/clear` or session end. N
85
53
 
86
54
  For each task in the plan:
87
55
 
88
- 1. **Read** the task XML (name, files, action, verify, done)
89
- 2. **Mark in-progress** — `TaskUpdate` the native task to `in_progress`
90
- 3. **Check** context.md — does this task touch a locked decision? Honor it exactly.
91
- 4. **Implement** following the action instructions
92
- 5. **Verify** using the verify step (run tests, inspect output)
93
- 6. **Confirm** done criteria are met
56
+ 1. **Read** task XML (name, files, action, verify, done)
57
+ 2. **Mark in-progress** — `TaskUpdate` to `in_progress`
58
+ 3. **Check** context.md — honor locked decisions exactly
59
+ 4. **Implement** per action instructions
60
+ 5. **Verify** using the verify step
61
+ 6. **Confirm** done criteria met
94
62
  7. **Commit** atomically
95
- 8. **Run verification gate** — execute configured verification commands (see Verification Gate below)
96
- 9. **Mark complete** — `TaskUpdate` the native task to `completed`
63
+ 8. **Run verification gate** (see below)
64
+ 9. **Mark complete** — `TaskUpdate` to `completed`
97
65
 
98
- ## TDD Flow (When task type="tdd")
66
+ ## TDD Flow (task type="tdd")
99
67
 
100
- ### With Test Spec (from planning Step 7)
101
- When the task has a `<spec>` field, test specs already exist:
102
- 1. **Copy spec to test location:** Move from `.forge/phases/m{M}-{N}-{name}/specs/` to the project's test directory
103
- 2. **RED:** Remove `skip` markers from the first test. Confirm it fails. Commit: `test({scope}): activate spec tests for {feature}`
104
- 3. **GREEN:** Write minimal code to make it pass. Repeat for each test in the spec.
68
+ **With Test Spec:**
69
+ 1. Copy spec from `.forge/phases/m{M}-{N}-{name}/specs/` to test directory
70
+ 2. **RED:** Remove `skip` markers. Confirm failure. Commit: `test({scope}): activate spec tests for {feature}`
71
+ 3. **GREEN:** Minimal code to pass. Repeat per test.
105
72
  4. **REFACTOR:** Clean up. Commit: `feat({scope}): implement {feature}`
106
73
 
107
- ### Without Test Spec (standard TDD)
108
- 1. **RED:** Write failing tests first. Commit: `test({scope}): add failing tests for {feature}`
109
- 2. **GREEN:** Write minimal code to pass tests. Commit: `feat({scope}): implement {feature}`
110
- 3. **REFACTOR:** Clean up if needed. Commit: `refactor({scope}): clean up {feature}`
74
+ **Without Test Spec:**
75
+ 1. **RED:** Write failing tests. Commit: `test({scope}): add failing tests for {feature}`
76
+ 2. **GREEN:** Minimal code to pass. Commit: `feat({scope}): implement {feature}`
77
+ 3. **REFACTOR:** Clean up. Commit: `refactor({scope}): clean up {feature}`
111
78
 
112
79
  ## Atomic Commit Protocol
113
80
 
114
- After each task completes:
115
-
116
- 1. Stage only task-related files individually: `git add src/specific/file.ts`
81
+ 1. Stage files individually: `git add src/specific/file.ts`
117
82
  2. **NEVER** use `git add .` or `git add -A`
118
- 3. Commit with format: `{type}({phase}-{plan}): {description}`
83
+ 3. Format: `{type}({phase}-{plan}): {description}`
119
84
  4. Include bullet-point body listing key changes
120
- 5. Verify commit was created: `git log -1`
85
+ 5. Verify: `git log -1`
121
86
 
122
87
  ```
123
88
  feat(auth-01): implement JWT-based login
@@ -130,14 +95,12 @@ feat(auth-01): implement JWT-based login
130
95
 
131
96
  ## Verification Gate
132
97
 
133
- After each task commit, run the project's configured verification commands to catch regressions immediately. This is mechanical enforcement — not optional, not agent-directed.
98
+ After each task commit, run configured verification commands. Mechanical — not optional.
134
99
 
135
100
  ### Load Config
136
-
137
- Read `.forge/project.yml → verification`. If `verification.commands` is empty or missing, skip this section entirely.
101
+ Read `.forge/project.yml → verification`. Empty or missing `commands` → skip entirely.
138
102
 
139
103
  ```yaml
140
- # Example from project.yml:
141
104
  verification:
142
105
  commands:
143
106
  - cmd: "npm run lint"
@@ -151,127 +114,92 @@ verification:
151
114
  ```
152
115
 
153
116
  ### Execution Flow
154
-
155
- For each verification command, in order:
156
-
157
- 1. **Run the command** via Bash
158
- 2. **If it passes** move to next command
159
- 3. **If it fails:**
160
- - **Advisory command?** → Log warning: *"Advisory: `{cmd}` failed (pre-existing issue, not blocking)."* Move to next command.
161
- - **Non-advisory + `auto_fix: false`?** → Log failure and continue to next task. Don't block.
162
- - **Non-advisory + `auto_fix: true`?** → Enter auto-fix loop (below)
117
+ For each command, in order:
118
+ 1. **Run** via Bash
119
+ 2. **Pass** → next command
120
+ 3. **Fail:**
121
+ - **Advisory?** Log warning, move on
122
+ - **Non-advisory + `auto_fix: false`?** → Log failure, next task
123
+ - **Non-advisory + `auto_fix: true`?** Auto-fix loop
163
124
 
164
125
  ### Auto-Fix Loop
165
-
166
- When a non-advisory verification command fails with `auto_fix: true`:
167
-
168
126
  ```
169
127
  Attempt 1:
170
- 1. Read the command output (error messages, failing tests, lint errors)
171
- 2. Identify the issue — is it caused by the current task's changes?
172
- - YES → fix the code, stage fixes, amend the commit
173
- - NO (pre-existing) → mark this command as advisory for this session, log warning, continue
174
- 3. Re-run the verification command
175
- 4. If passes continue to next command
176
- 5. If fails → attempt 2 (up to max_retries)
128
+ 1. Read error output
129
+ 2. Caused by current task?
130
+ - YES → fix code, stage fixes, amend commit
131
+ - NO → mark advisory for this session, log warning, continue
132
+ 3. Re-run command
133
+ 4. Pass → next command
134
+ 5. Failnext attempt (up to max_retries)
177
135
 
178
136
  After max_retries exhausted:
179
- → Log the failure in the execution summary
180
- → Continue to next task (don't block the whole plan)
181
- The verifying skill will catch persistent failures later
137
+ → Log failure in execution summary
138
+ → Continue to next task
139
+ Verifying skill catches persistent failures later
182
140
  ```
183
141
 
184
- ### Integration with 3-Strike Rule
185
-
186
- Verification auto-fix attempts count toward the task's 3-strike limit. If a task has already used 2 strikes on implementation issues, it gets 1 verification retry max.
142
+ ### 3-Strike Integration
143
+ Verification retries count toward the task's 3-strike limit. 2 strikes used = 1 verification retry max.
187
144
 
188
- ### What NOT to Fix in Verification
189
-
190
- - **Pre-existing failures** not caused by the current task mark advisory
191
- - **Flaky tests** that pass on re-run without code changes note in summary, don't count as a strike
192
- - **Unrelated warnings** (deprecation notices, non-blocking lint info) → ignore
145
+ ### Do NOT Fix
146
+ - **Pre-existing failures** not from current task → mark advisory
147
+ - **Flaky tests** passing on re-run without changesnote in summary, no strike
148
+ - **Unrelated warnings** (deprecation, non-blocking lint)ignore
193
149
 
194
150
  ### Quick Tier
195
-
196
- Verification gates also run for Quick tier tasks (`quick-tasking` skill). After the commit, run all non-advisory verification commands once. If they fail, show the output and let the agent fix — but limit to 1 retry (Quick tier shouldn't spend time in fix loops).
151
+ Run all non-advisory verification commands once after commit. 1 retry max.
197
152
 
198
153
  ## Context Engineering
199
154
 
200
- ### When to Spawn Fresh Agent
201
- - Task touches 20+ files
202
- - Task involves complex subsystem with deep dependency tree
203
- - Current context exceeds ~60% utilization
204
- - Switching between unrelated subsystems
205
-
206
- ### How to Spawn
207
- Use the Task tool with a focused prompt:
208
- - Include only relevant plan details
209
- - Reference specific files to modify
210
- - Pass locked decisions from context.md
211
- - Set clear success criteria
212
-
213
- ### Size Monitoring
214
- After each task, mentally assess context usage:
215
- - Under 40%: continue normally
216
- - 40-60%: consider fresh agent for next task
217
- - Over 60%: spawn fresh agent
155
+ | Trigger | Action |
156
+ |---------|--------|
157
+ | Task touches 20+ files | Spawn fresh agent |
158
+ | Deep dependency tree subsystem | Spawn fresh agent |
159
+ | Context over 60% | Spawn fresh agent |
160
+ | Context 40-60% | Consider fresh agent |
161
+ | Context under 40% | Continue normally |
162
+ | Switching unrelated subsystems | Spawn fresh agent |
163
+
164
+ **Spawn via Task tool** with: relevant plan details, specific files, locked decisions from context.md, clear success criteria.
218
165
 
219
166
  ## Execution Summary
220
167
 
221
- After completing all tasks in a plan, create a summary:
168
+ After completing all tasks in a plan:
222
169
 
223
170
  ```markdown
224
171
  # Execution Summary: m{M}-{N}-{name}, Plan {NN}
225
172
 
226
173
  ## Completed Tasks
227
174
  1. [Task name] — [one-line result]
228
- 2. [Task name] — [one-line result]
229
175
 
230
176
  ## Deviations
231
177
  - Rule 1: Fixed [bug] in [file] because [reason]
232
- - Rule 2: Added [functionality] to [file] because [reason]
233
178
 
234
179
  ## Commits
235
180
  - abc1234: feat(auth-01): implement login form
236
- - def5678: test(auth-01): add login integration tests
237
181
 
238
182
  ## Files Modified
239
183
  - src/components/Login.tsx (created)
240
- - src/hooks/useAuth.ts (created)
241
- - src/api/auth/login.ts (created)
242
184
 
243
185
  ## Notes
244
186
  [Anything the verifier should know]
245
187
  ```
246
188
 
247
189
  ## State Updates
248
-
249
- After plan execution:
250
190
  1. Update `.forge/state/milestone-{id}.yml` — advance plan counter, update progress
251
- 2. Record deviations in the milestone state file
252
- 3. Update `.forge/state/index.yml` — set milestone `last_updated` timestamp
253
- 4. If all plans in phase complete → transition to `verifying`
191
+ 2. Record deviations in milestone state
192
+ 3. Update `.forge/state/index.yml` — set `last_updated` timestamp
193
+ 4. All plans in phase complete → transition to `verifying`
254
194
 
255
195
  ## Desire Path Signals
256
196
 
257
- While executing, watch for and log these patterns in `.forge/state/index.yml → desire_paths` (desire paths are global, not per-milestone):
258
-
259
- - **Repeated deviations**: If you apply the same deviation rule for the same reason more than once (e.g., adding null checks in every API handler), log it as a `deviation_pattern`. Don't just record each deviation individually — notice when they form a pattern.
260
- - **User corrections**: If the user corrects your output and the correction matches something they've corrected before (e.g., "use the Card component, not a div"), log it as a `user_correction` and increment the count.
261
- - **Agent struggles**: If you need multiple attempts to get something right, or the user has to guide you through it, log the task type as an `agent_struggle`.
262
-
263
- This takes seconds per signal. Don't skip it — this data drives framework evolution.
197
+ Log to `.forge/state/index.yml → desire_paths` (global, not per-milestone):
198
+ - **Repeated deviations**: Same rule, same reason, more than once → `deviation_pattern`
199
+ - **User corrections**: Repeated correction matching a prior one `user_correction`, increment count
200
+ - **Agent struggles**: Multiple attempts or user guidance needed `agent_struggle`
264
201
 
265
202
  ## Phase Handoff
266
-
267
- After all plans in the phase are executed:
268
-
269
- 1. **Verify persistence** — Confirm execution summary is documented, all commits are made, milestone state is updated with progress and deviations, and desire path signals are logged
270
- 2. **Update state** — Set `current.status` to `verifying` in `.forge/state/milestone-{id}.yml`
271
- 3. **Recommend context clear:**
272
-
273
- *"Execution phase complete. All tasks committed, state updated, deviations logged. I recommend clearing context (`/clear`) before starting verification — the verifier needs a fresh window to objectively assess the work against must_haves, without carrying the executor's assumptions.*
274
-
275
- *Ready to continue? Clear context and invoke `/forge` to resume."*
276
-
277
- This handoff is especially important after execution — the verifier should approach the code with fresh eyes, not the executor's memory of what it intended to build.
203
+ 1. Confirm persistence — summary documented, commits made, state updated, desire paths logged
204
+ 2. Set `current.status` to `verifying`
205
+ 3. Recommend: *"Tasks committed, state updated. `/clear` then `/forge` to continue with verifying."*