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.
- package/package.json +1 -1
- package/template/.claude/agents/executor.md +37 -50
- package/template/.claude/agents/planner.md +33 -41
- package/template/.claude/agents/researcher.md +24 -26
- package/template/.claude/agents/reviewer.md +45 -53
- package/template/.claude/agents/verifier.md +30 -50
- package/template/.claude/skills/architecting/SKILL.md +32 -46
- package/template/.claude/skills/beads-integration/SKILL.md +27 -43
- package/template/.claude/skills/debugging/SKILL.md +34 -35
- package/template/.claude/skills/designing/SKILL.md +33 -52
- package/template/.claude/skills/discussing/SKILL.md +139 -180
- package/template/.claude/skills/executing/SKILL.md +85 -157
- package/template/.claude/skills/forge/SKILL.md +101 -148
- package/template/.claude/skills/initializing/SKILL.md +104 -144
- package/template/.claude/skills/planning/SKILL.md +65 -67
- package/template/.claude/skills/quick-tasking/SKILL.md +25 -31
- package/template/.claude/skills/researching/SKILL.md +22 -32
- package/template/.claude/skills/reviewing/SKILL.md +406 -0
- package/template/.claude/skills/securing/SKILL.md +19 -19
- package/template/.claude/skills/upgrading/SKILL.md +19 -27
- package/template/.claude/skills/verifying/SKILL.md +53 -81
- package/template/CLAUDE.md +7 -10
- package/template/.claude/skills/auditing/SKILL.md +0 -314
- package/template/.claude/skills/refactoring/SKILL.md +0 -168
|
@@ -1,83 +1,51 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: executing
|
|
3
|
-
description: "
|
|
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
|
|
15
|
-
- [ ] Constitution.md gates satisfied
|
|
16
|
-
- [ ]
|
|
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
|
-
|
|
24
|
-
- **YES** → **STOP.**
|
|
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
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
38
|
+
Use `TaskCreate`/`TaskUpdate`/`TaskList` for in-session visibility. `.forge/state/milestone-{id}.yml` remains the cross-session source of truth.
|
|
62
39
|
|
|
63
|
-
|
|
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
|
-
|
|
42
|
+
**On Task Start:** `TaskUpdate` → `status: "in_progress"`.
|
|
68
43
|
|
|
69
|
-
|
|
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
|
-
|
|
46
|
+
**On Plan Complete:** Native tasks are session-scoped — disappear on `/clear`. No cleanup needed.
|
|
74
47
|
|
|
75
|
-
|
|
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**
|
|
89
|
-
2. **Mark in-progress** — `TaskUpdate`
|
|
90
|
-
3. **Check** context.md —
|
|
91
|
-
4. **Implement**
|
|
92
|
-
5. **Verify** using the verify step
|
|
93
|
-
6. **Confirm** done criteria
|
|
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**
|
|
96
|
-
9. **Mark complete** — `TaskUpdate`
|
|
63
|
+
8. **Run verification gate** (see below)
|
|
64
|
+
9. **Mark complete** — `TaskUpdate` to `completed`
|
|
97
65
|
|
|
98
|
-
## TDD Flow (
|
|
66
|
+
## TDD Flow (task type="tdd")
|
|
99
67
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
108
|
-
1. **RED:** Write failing tests
|
|
109
|
-
2. **GREEN:**
|
|
110
|
-
3. **REFACTOR:** Clean up
|
|
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
|
-
|
|
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.
|
|
83
|
+
3. Format: `{type}({phase}-{plan}): {description}`
|
|
119
84
|
4. Include bullet-point body listing key changes
|
|
120
|
-
5. Verify
|
|
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
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- **
|
|
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
|
|
171
|
-
2.
|
|
172
|
-
- YES → fix
|
|
173
|
-
- NO
|
|
174
|
-
3. Re-run
|
|
175
|
-
4.
|
|
176
|
-
5.
|
|
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. Fail → next attempt (up to max_retries)
|
|
177
135
|
|
|
178
136
|
After max_retries exhausted:
|
|
179
|
-
→ Log
|
|
180
|
-
→ Continue to next task
|
|
181
|
-
→
|
|
137
|
+
→ Log failure in execution summary
|
|
138
|
+
→ Continue to next task
|
|
139
|
+
→ Verifying skill catches persistent failures later
|
|
182
140
|
```
|
|
183
141
|
|
|
184
|
-
###
|
|
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
|
-
###
|
|
189
|
-
|
|
190
|
-
- **
|
|
191
|
-
- **
|
|
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 changes → note 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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
|
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
|
|
252
|
-
3. Update `.forge/state/index.yml` — set
|
|
253
|
-
4.
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
- **
|
|
260
|
-
- **
|
|
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
|
-
|
|
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."*
|