@tianhai/pi-workflow-kit 0.11.1 → 0.13.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/README.md +19 -0
- package/docs/plans/completed/2026-05-08-lessons-learned-design.md +76 -0
- package/docs/plans/completed/2026-05-08-lessons-learned-implementation.md +219 -0
- package/docs/plans/completed/2026-05-08-lessons-learned-progress.md +15 -0
- package/docs/plans/completed/2026-05-08-worktree-handoff-design.md +118 -0
- package/docs/plans/completed/2026-05-08-worktree-handoff-implementation.md +140 -0
- package/docs/plans/completed/2026-05-08-worktree-handoff-progress.md +10 -0
- package/package.json +1 -1
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/executing-tasks/SKILL.md +95 -23
- package/skills/finalizing/SKILL.md +25 -3
- package/skills/writing-plans/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -74,6 +74,25 @@ Each task is labeled with its TDD scenario during planning:
|
|
|
74
74
|
| **Modifying tested code** | Changing existing behavior | Run existing tests first → modify → verify |
|
|
75
75
|
| **Trivial** | Config, docs, naming | Use judgment |
|
|
76
76
|
|
|
77
|
+
### Lessons Learned
|
|
78
|
+
|
|
79
|
+
A persistent rules file (`docs/lessons.md`) helps the agent learn from repeat mistakes across sessions. When the agent catches itself making the same error — like forgetting to run `make lint` — it writes a rule immediately. Future sessions (even after `/new`) pick it up automatically.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
brainstorm → reads lessons (design context)
|
|
83
|
+
plan → reads lessons (task breakdown)
|
|
84
|
+
execute → reads lessons per task, writes new ones on repeat mistakes
|
|
85
|
+
finalize → reviews and retires stale rules
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Rules are simple imperative bullets:
|
|
89
|
+
|
|
90
|
+
- After completing each task, run `make lint && make fmt` before committing
|
|
91
|
+
- Never import `testify` in this project
|
|
92
|
+
- Always check for existing test helpers before writing new ones
|
|
93
|
+
|
|
94
|
+
No configuration needed — the file is created automatically when the first lesson is written.
|
|
95
|
+
|
|
77
96
|
### Checkpoint Review Gates
|
|
78
97
|
|
|
79
98
|
Optionally label tasks with a `checkpoint` to pause for human review. At each checkpoint the agent stops and waits for your feedback — you can approve, ask for changes, or send it back to rethink. Only when you're satisfied does it move on to the next task.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Lessons Learned
|
|
2
|
+
|
|
3
|
+
Date: 2026-05-08
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
During task execution, the AI agent repeatedly makes the same project-specific mistakes — e.g., forgetting to run `make lint && make fmt` in Go projects, ignoring test helper conventions, or violating code style rules. These mistakes persist across sessions because there's no persistent memory the agent reads at the start of each task.
|
|
8
|
+
|
|
9
|
+
## Solution
|
|
10
|
+
|
|
11
|
+
A flat rules file (`docs/lessons.md`) that the agent reads before each task and writes to when it catches repeat mistakes. Integrated into the existing 4 workflow skills.
|
|
12
|
+
|
|
13
|
+
## File: `docs/lessons.md`
|
|
14
|
+
|
|
15
|
+
Created automatically when the first lesson is written. Never archived or moved.
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# Lessons Learned
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
22
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
23
|
+
Retire rules that no longer apply during finalizing.
|
|
24
|
+
-->
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- After completing each task in a Go project, run `make lint && make fmt` before committing
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Rules for the agent
|
|
32
|
+
|
|
33
|
+
- Each rule is a single bullet under `## Rules`
|
|
34
|
+
- Write rules as imperative commands ("do X", "never Y", "always Z before W")
|
|
35
|
+
- A rule is only added when it would **change future behavior** — not one-off errors
|
|
36
|
+
- Rules can be removed (retired) during finalizing if they no longer apply
|
|
37
|
+
|
|
38
|
+
## Data flow
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
brainstorming ──── reads lessons (context for design)
|
|
42
|
+
│
|
|
43
|
+
writing-plans ──── reads lessons (informs task breakdown)
|
|
44
|
+
│
|
|
45
|
+
executing-tasks ── reads lessons at start of EACH task
|
|
46
|
+
│ appends new lessons when catching repeat mistakes
|
|
47
|
+
│
|
|
48
|
+
finalizing ─────── reviews session for missed lessons
|
|
49
|
+
retires stale rules
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Lessons are persisted to disk as soon as they're learned, so `/new` sessions don't lose them.
|
|
53
|
+
|
|
54
|
+
## Skill changes
|
|
55
|
+
|
|
56
|
+
### executing-tasks (3 changes)
|
|
57
|
+
|
|
58
|
+
1. **Per-task execution, step 2** — add bullet: "Read `docs/lessons.md` if it exists — follow all rules listed there while working on this task."
|
|
59
|
+
2. **New step between step 9 (refactor) and step 10 (checkpoint: done)** — "Learn from mistakes: if you caught yourself making a repeat mistake, append a rule to `docs/lessons.md`. Only add rules that would change future behavior."
|
|
60
|
+
3. **"If you're stuck" section** — add at end: "Check `docs/lessons.md` — a previous lesson may be relevant."
|
|
61
|
+
|
|
62
|
+
### finalizing (1 change)
|
|
63
|
+
|
|
64
|
+
Add a new step before "Update documentation": "Review `docs/lessons.md` if it exists — add missed lessons, retire stale rules. Create it if lessons were learned but the file doesn't exist yet."
|
|
65
|
+
|
|
66
|
+
### brainstorming (1 change)
|
|
67
|
+
|
|
68
|
+
Step 2 (understand the idea) — add after checking package.json/dependencies: "Check `docs/lessons.md` if it exists — known constraints and patterns may affect the design."
|
|
69
|
+
|
|
70
|
+
### writing-plans (1 change)
|
|
71
|
+
|
|
72
|
+
Step 1 (check for a design doc) — add after reading relevant code: "Read `docs/lessons.md` if it exists — incorporate known patterns into the task breakdown."
|
|
73
|
+
|
|
74
|
+
## Slice
|
|
75
|
+
|
|
76
|
+
Single slice: all 5 skill changes + file format convention. No new skills, extensions, or config.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Implementation Plan: Lessons Learned
|
|
2
|
+
|
|
3
|
+
Design: `docs/plans/2026-05-08-lessons-learned-design.md`
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Add a `docs/lessons.md` rules file that the agent reads at natural points in the workflow and writes to when it catches repeat mistakes. Changes are purely instructional — edits to 4 SKILL.md files plus documentation updates.
|
|
8
|
+
|
|
9
|
+
No TypeScript code changes. No new extensions or skills. The existing `workflow-guard.ts` already allows writes to `docs/` during execute/finalize phases (it only blocks outside `docs/plans/` during brainstorm/plan). Since `docs/lessons.md` is at `docs/` level (not inside `docs/plans/`), it won't interfere with archiving.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Task 1: Add lessons-learned read step to executing-tasks skill
|
|
14
|
+
|
|
15
|
+
<!-- tdd: trivial -->
|
|
16
|
+
<!-- checkpoint: done -->
|
|
17
|
+
|
|
18
|
+
**File:** `skills/executing-tasks/SKILL.md`
|
|
19
|
+
|
|
20
|
+
**Change 1** — In "Per-task execution", step 2, add a new bullet after the existing ones:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
- **Read `docs/lessons.md` if it exists** — follow all rules listed there while working on this task.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The full step 2 should become:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
2. **Read the plan selectively** — read the plan's overview section (everything before `## Task 1:`). Skim all `## Task N:` headings for dependency awareness. Then read the current task's body in full. **Read `docs/lessons.md` if it exists** — follow all rules listed there while working on this task.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Change 2** — In "Per-task execution", insert a new step between step 9 (Refactor if needed) and step 10 (checkpoint: done). The new step becomes step 10, and all subsequent steps renumber by 1 (step 10→11, 11→12, 12→13, 13→14, 14→15):
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
10. **Learn from mistakes** — if you caught yourself making a mistake during this task that you've made before or that would apply to future tasks, append a rule to `docs/lessons.md`. Only add rules that would change future behavior. If the file doesn't exist, create it with the standard format (see below). Do not add one-off errors or things you self-corrected immediately.
|
|
36
|
+
|
|
37
|
+
**`docs/lessons.md` format:**
|
|
38
|
+
```markdown
|
|
39
|
+
# Lessons Learned
|
|
40
|
+
|
|
41
|
+
<!--
|
|
42
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
43
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
44
|
+
Retire rules that no longer apply during finalizing.
|
|
45
|
+
-->
|
|
46
|
+
|
|
47
|
+
## Rules
|
|
48
|
+
|
|
49
|
+
- <new rule here>
|
|
50
|
+
```
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Change 3** — In "If you're stuck" section, add a new item at the end:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
5. **Check `docs/lessons.md`** — a previous lesson may be relevant to your current problem.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Renumber the existing item 4 to 5 if needed (it's currently the last item).
|
|
60
|
+
|
|
61
|
+
**Command:**
|
|
62
|
+
```
|
|
63
|
+
git add skills/executing-tasks/SKILL.md
|
|
64
|
+
git commit -m "feat(executing-tasks): read and write lessons learned per task"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Task 2: Add lessons-learned review step to finalizing skill
|
|
70
|
+
|
|
71
|
+
<!-- tdd: trivial -->
|
|
72
|
+
<!-- checkpoint: none -->
|
|
73
|
+
|
|
74
|
+
**File:** `skills/finalizing/SKILL.md`
|
|
75
|
+
|
|
76
|
+
Insert a new step between the existing step 1 (Move planning docs) and step 2 (Update documentation). The new step becomes step 2, and existing steps 2-4 renumber to 3-5:
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
2. **Review lessons learned** — if `docs/lessons.md` exists, review it:
|
|
80
|
+
- Add any lessons from this session that were missed during execution
|
|
81
|
+
- Retire rules that no longer apply (remove the bullet)
|
|
82
|
+
- If no changes are needed, leave it as-is
|
|
83
|
+
|
|
84
|
+
If `docs/lessons.md` doesn't exist but lessons were learned this session, create it with the standard format:
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
# Lessons Learned
|
|
88
|
+
|
|
89
|
+
<!--
|
|
90
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
91
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
92
|
+
Retire rules that no longer apply during finalizing.
|
|
93
|
+
-->
|
|
94
|
+
|
|
95
|
+
## Rules
|
|
96
|
+
|
|
97
|
+
- <rule 1>
|
|
98
|
+
- <rule 2>
|
|
99
|
+
```
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Command:**
|
|
103
|
+
```
|
|
104
|
+
git add skills/finalizing/SKILL.md
|
|
105
|
+
git commit -m "feat(finalizing): review and update lessons learned"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Task 3: Add lessons-learned read step to brainstorming skill
|
|
111
|
+
|
|
112
|
+
<!-- tdd: trivial -->
|
|
113
|
+
<!-- checkpoint: none -->
|
|
114
|
+
|
|
115
|
+
**File:** `skills/brainstorming/SKILL.md`
|
|
116
|
+
|
|
117
|
+
In step 2 (Understand the idea), add a new bullet after "check package.json/dependencies and module structure":
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
- **Check `docs/lessons.md`** if it exists — known constraints and patterns may affect the design.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The full relevant part of step 2 should become:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
2. **Understand the idea** — read existing code, docs, and recent commits. Grep for related functionality, check package.json/dependencies and module structure. **Check `docs/lessons.md`** if it exists — known constraints and patterns may affect the design. Read only what's necessary to ground the design — don't read the entire codebase. Ask questions to refine the idea. Prefer multiple choice when possible. After each question, check: can you clearly articulate (a) what the user wants to build, (b) why, and (c) key constraints? If yes, present your understanding as a short summary and ask: "Should I proceed with this, or is there more to add?" The human decides when to move on.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Command:**
|
|
130
|
+
```
|
|
131
|
+
git add skills/brainstorming/SKILL.md
|
|
132
|
+
git commit -m "feat(brainstorming): read lessons learned for design context"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Task 4: Add lessons-learned read step to writing-plans skill
|
|
138
|
+
|
|
139
|
+
<!-- tdd: trivial -->
|
|
140
|
+
<!-- checkpoint: none -->
|
|
141
|
+
|
|
142
|
+
**File:** `skills/writing-plans/SKILL.md`
|
|
143
|
+
|
|
144
|
+
In step 1 (Check for a design doc), add a new sentence after "If no design doc exists, ask the user to describe what they want to build and read relevant code.":
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
**Read `docs/lessons.md`** if it exists — incorporate known patterns into the task breakdown (e.g., if a lesson says "always run lint before commit," include that in relevant task instructions).
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Command:**
|
|
151
|
+
```
|
|
152
|
+
git add skills/writing-plans/SKILL.md
|
|
153
|
+
git commit -m "feat(writing-plans): read lessons learned for task breakdown"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Task 5: Update README.md with lessons-learned feature documentation
|
|
159
|
+
|
|
160
|
+
<!-- tdd: trivial -->
|
|
161
|
+
<!-- checkpoint: done -->
|
|
162
|
+
|
|
163
|
+
**File:** `README.md`
|
|
164
|
+
|
|
165
|
+
Add a new section after "TDD Three-Scenario Model" and before "Checkpoint Review Gates":
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
### Lessons Learned
|
|
169
|
+
|
|
170
|
+
A persistent rules file (`docs/lessons.md`) helps the agent learn from repeat mistakes across sessions. When the agent catches itself making the same error — like forgetting to run `make lint` — it writes a rule immediately. Future sessions (even after `/new`) pick it up automatically.
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
brainstorm → reads lessons (design context)
|
|
174
|
+
plan → reads lessons (task breakdown)
|
|
175
|
+
execute → reads lessons per task, writes new ones on repeat mistakes
|
|
176
|
+
finalize → reviews and retires stale rules
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Rules are simple imperative bullets:
|
|
180
|
+
|
|
181
|
+
- After completing each task, run `make lint && make fmt` before committing
|
|
182
|
+
- Never import `testify` in this project
|
|
183
|
+
- Always check for existing test helpers before writing new ones
|
|
184
|
+
|
|
185
|
+
No configuration needed — the file is created automatically when the first lesson is written.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Command:**
|
|
189
|
+
```
|
|
190
|
+
git add README.md
|
|
191
|
+
git commit -m "docs: add lessons-learned section to README"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Task 6: Update CHANGELOG.md
|
|
197
|
+
|
|
198
|
+
<!-- tdd: trivial -->
|
|
199
|
+
<!-- checkpoint: none -->
|
|
200
|
+
|
|
201
|
+
**File:** `CHANGELOG.md`
|
|
202
|
+
|
|
203
|
+
Add a new entry at the top (after the header):
|
|
204
|
+
|
|
205
|
+
```markdown
|
|
206
|
+
## [0.13.0] - 2026-05-08
|
|
207
|
+
|
|
208
|
+
### Added
|
|
209
|
+
|
|
210
|
+
- Lessons learned: persistent rules file (`docs/lessons.md`) read at every workflow phase and written to when the agent catches repeat mistakes. Survives `/new` sessions.
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Bump version in `package.json` from `0.12.0` to `0.13.0`.
|
|
214
|
+
|
|
215
|
+
**Command:**
|
|
216
|
+
```
|
|
217
|
+
git add CHANGELOG.md package.json
|
|
218
|
+
git commit -m "chore: bump version to 0.13.0"
|
|
219
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Progress: Lessons Learned
|
|
2
|
+
|
|
3
|
+
Plan: docs/plans/2026-05-08-lessons-learned-implementation.md
|
|
4
|
+
Branch: lessons-learned
|
|
5
|
+
Started: 2026-05-08T04:21:50Z
|
|
6
|
+
Last updated: 2026-05-08T04:27:15Z
|
|
7
|
+
|
|
8
|
+
| # | Status | Task | Commit |
|
|
9
|
+
|---|--------|------|--------|
|
|
10
|
+
| 1 | ✅ done | Add lessons-learned read step to executing-tasks skill | 0ad24d6 |
|
|
11
|
+
| 2 | ✅ done | Add lessons-learned review step to finalizing skill | 7ac8097 |
|
|
12
|
+
| 3 | ✅ done | Add lessons-learned read step to brainstorming skill | 7cb69fe |
|
|
13
|
+
| 4 | ✅ done | Add lessons-learned read step to writing-plans skill | ed0aab7 |
|
|
14
|
+
| 5 | ✅ done | Update README.md with lessons-learned feature documentation | d16e407 |
|
|
15
|
+
| 6 | ✅ done | Update CHANGELOG.md | 2525662 |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Worktree Handoff: Stop & Restart in New Directory
|
|
2
|
+
|
|
3
|
+
## Problem
|
|
4
|
+
|
|
5
|
+
When the user asks the agent to create a worktree during `executing-tasks`, the agent creates the worktree on disk but continues running in the original directory. All subsequent file operations, git commands, and task execution happen in the wrong place.
|
|
6
|
+
|
|
7
|
+
Pi sessions are tied to their working directory — the agent cannot `cd` or spawn a sub-session in a different directory.
|
|
8
|
+
|
|
9
|
+
## Root cause
|
|
10
|
+
|
|
11
|
+
The `executing-tasks` skill creates the worktree (step 2) then continues executing tasks in the original directory instead of stopping and handing off to a new session.
|
|
12
|
+
|
|
13
|
+
## Solution
|
|
14
|
+
|
|
15
|
+
When the user chooses worktree isolation in `executing-tasks`, the agent:
|
|
16
|
+
|
|
17
|
+
1. Creates the worktree
|
|
18
|
+
2. Moves all plan docs into the worktree
|
|
19
|
+
3. Commits the removal on the current branch
|
|
20
|
+
4. Stops and tells the user to restart in the worktree
|
|
21
|
+
|
|
22
|
+
The new session in the worktree finds the plan docs and continues seamlessly.
|
|
23
|
+
|
|
24
|
+
## Changes
|
|
25
|
+
|
|
26
|
+
### `skills/executing-tasks/SKILL.md`
|
|
27
|
+
|
|
28
|
+
Replace step 2 ("Suggest workspace isolation") with a "Create & handoff" pattern for worktrees:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
2. **Suggest workspace isolation** — if the user isn't already on a feature branch or worktree, present the options:
|
|
32
|
+
|
|
33
|
+
- **Branch** (smaller changes):
|
|
34
|
+
```
|
|
35
|
+
git checkout -b <feature-name>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **Worktree** (larger features, keeps main clean):
|
|
39
|
+
```
|
|
40
|
+
git worktree add ../<repo>-<feature-name> -b <feature-name>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Derive `<feature-name>` from the plan doc (e.g. `docs/plans/2026-04-16-auth-design.md` → `auth`). Ask the user which they prefer, then wait for confirmation before proceeding.
|
|
44
|
+
|
|
45
|
+
3. **If worktree was chosen — hand off to new session:**
|
|
46
|
+
|
|
47
|
+
a. Move plan docs into the worktree:
|
|
48
|
+
```
|
|
49
|
+
mv docs/plans/*-design.md docs/plans/*-implementation.md docs/plans/*-progress.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
50
|
+
mv docs/plans/adr/*.md <worktree>/docs/plans/adr/ 2>/dev/null || true
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
b. Commit the removal on the current branch (if files were committed):
|
|
54
|
+
```
|
|
55
|
+
git rm docs/plans/*-design.md docs/plans/*-implementation.md docs/plans/*-progress.md 2>/dev/null || true
|
|
56
|
+
git rm -r docs/plans/adr/ 2>/dev/null || true
|
|
57
|
+
git commit -m "chore: move plan docs to worktree for <feature-name>"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
c. Stop and show the user:
|
|
61
|
+
```
|
|
62
|
+
✅ Worktree created at ../<repo>-<feature-name>
|
|
63
|
+
📄 Plan docs moved to the worktree.
|
|
64
|
+
|
|
65
|
+
To continue, start a new session there:
|
|
66
|
+
cd ../<repo>-<feature-name> && pi
|
|
67
|
+
|
|
68
|
+
Then run: /skill:executing-tasks
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
d. **Do not proceed with task execution.** The session ends here.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Remove the current step 3–4 numbering (progress file, commit plan docs) and renumber to account for the new handoff step. The "First run" flow becomes:
|
|
75
|
+
|
|
76
|
+
1. Parse the implementation plan
|
|
77
|
+
2. Suggest workspace isolation (branch or worktree)
|
|
78
|
+
3. **If branch:** create progress file, commit plan docs, begin execution (existing flow)
|
|
79
|
+
4. **If worktree:** move docs, commit removal, stop with handoff message (new flow)
|
|
80
|
+
|
|
81
|
+
### No changes to other skills
|
|
82
|
+
|
|
83
|
+
- `brainstorming` — read-only phase, no isolation needed
|
|
84
|
+
- `writing-plans` — read-only phase, no isolation needed
|
|
85
|
+
- `finalizing` — already handles worktree cleanup (`git worktree remove`)
|
|
86
|
+
|
|
87
|
+
## User experience
|
|
88
|
+
|
|
89
|
+
### Branch isolation (unchanged)
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Agent: Would you like branch or worktree isolation?
|
|
93
|
+
User: branch
|
|
94
|
+
Agent: [creates branch, creates progress file, begins executing tasks]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Worktree isolation (new)
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Agent: Would you like branch or worktree isolation?
|
|
101
|
+
User: worktree
|
|
102
|
+
Agent: ✅ Worktree created at ../my-repo-auth
|
|
103
|
+
📄 Plan docs moved to the worktree.
|
|
104
|
+
|
|
105
|
+
To continue, start a new session there:
|
|
106
|
+
cd ../my-repo-auth && pi
|
|
107
|
+
|
|
108
|
+
Then run: /skill:executing-tasks
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
User opens a new terminal, runs the commands, and the new session picks up where the old one left off.
|
|
112
|
+
|
|
113
|
+
## Edge cases
|
|
114
|
+
|
|
115
|
+
- **No plan docs exist yet** — just create the worktree, don't try to move files
|
|
116
|
+
- **Partial progress (some tasks done)** — progress file is moved, preserving state
|
|
117
|
+
- **Uncommitted plan docs** — `mv` removes them, no `git rm` needed; commit only if they were previously committed
|
|
118
|
+
- **Other uncommitted changes on current branch** — only touch plan docs, leave everything else untouched
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Implementation Plan: Worktree Handoff
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Modify `skills/executing-tasks/SKILL.md` so that when the user chooses worktree isolation, the agent moves plan docs to the worktree, commits the removal, and stops with a handoff message instead of continuing execution in the wrong directory.
|
|
6
|
+
|
|
7
|
+
**Design doc:** `docs/plans/2026-05-08-worktree-handoff-design.md`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Task 1: Add worktree handoff flow to executing-tasks
|
|
12
|
+
|
|
13
|
+
<!-- tdd: trivial -->
|
|
14
|
+
<!-- checkpoint: none -->
|
|
15
|
+
|
|
16
|
+
Modify the "First run" section of `skills/executing-tasks/SKILL.md`. After the workspace isolation prompt (step 2), add a branching path: if the user chose worktree, move docs and stop; if branch, continue with existing flow.
|
|
17
|
+
|
|
18
|
+
### File: `skills/executing-tasks/SKILL.md`
|
|
19
|
+
|
|
20
|
+
Replace the current steps 2–5 in the "First run" section:
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
2. **Suggest workspace isolation** — if the user isn't already on a feature branch or worktree, present the options:
|
|
24
|
+
|
|
25
|
+
- **Branch** (smaller changes):
|
|
26
|
+
```
|
|
27
|
+
git checkout -b <feature-name>
|
|
28
|
+
```
|
|
29
|
+
- **Worktree** (larger features, keeps main clean):
|
|
30
|
+
```
|
|
31
|
+
git worktree add ../<repo>-<feature-name> -b <feature-name>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Derive `<feature-name>` from the plan doc (e.g. `docs/plans/2026-04-16-auth-design.md` → `auth`). Ask the user which they prefer, then wait for confirmation before proceeding.
|
|
35
|
+
|
|
36
|
+
3. **Create the progress file** — save to `docs/plans/<plan-name>-progress.md` (replace `-implementation` with `-progress` in the plan filename):
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
# Progress: <topic>
|
|
40
|
+
|
|
41
|
+
Plan: docs/plans/YYYY-MM-DD-<topic>-implementation.md
|
|
42
|
+
Branch: <actual branch name>
|
|
43
|
+
Started: <ISO timestamp>
|
|
44
|
+
Last updated: <ISO timestamp>
|
|
45
|
+
|
|
46
|
+
| # | Status | Task | Commit |
|
|
47
|
+
|---|--------|------|--------|
|
|
48
|
+
| 1 | ⬜ pending | Task description (preserve checkpoint labels) | — |
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use the actual branch name — whether it's the original branch or a new one from the isolation step.
|
|
52
|
+
|
|
53
|
+
4. **Commit the plan docs** — if `docs/plans/` has uncommitted files, commit them on the new branch:
|
|
54
|
+
```
|
|
55
|
+
git add docs/plans/ && git commit -m "docs: add design and implementation plan"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
5. **Begin task execution** — start with task 1 (see [Per-task execution](#per-task-execution)).
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
With:
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
2. **Suggest workspace isolation** — if the user isn't already on a feature branch or worktree, present the options:
|
|
65
|
+
|
|
66
|
+
- **Branch** (smaller changes):
|
|
67
|
+
```
|
|
68
|
+
git checkout -b <feature-name>
|
|
69
|
+
```
|
|
70
|
+
- **Worktree** (larger features, keeps main clean):
|
|
71
|
+
```
|
|
72
|
+
git worktree add ../<repo>-<feature-name> -b <feature-name>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Derive `<feature-name>` from the plan doc (e.g. `docs/plans/2026-04-16-auth-design.md` → `auth`). Ask the user which they prefer, then wait for confirmation before proceeding.
|
|
76
|
+
|
|
77
|
+
3. **If worktree was chosen — hand off to new session:**
|
|
78
|
+
|
|
79
|
+
a. Ensure the worktree's `docs/plans/` directory exists:
|
|
80
|
+
```
|
|
81
|
+
mkdir -p <worktree>/docs/plans
|
|
82
|
+
mkdir -p <worktree>/docs/plans/adr
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
b. Move plan docs into the worktree:
|
|
86
|
+
```
|
|
87
|
+
mv docs/plans/*-design.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
88
|
+
mv docs/plans/*-implementation.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
89
|
+
mv docs/plans/*-progress.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
90
|
+
mv docs/plans/adr/*.md <worktree>/docs/plans/adr/ 2>/dev/null || true
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
c. Commit the removal on the current branch (if any plan docs were committed):
|
|
94
|
+
```
|
|
95
|
+
git rm docs/plans/*-design.md docs/plans/*-implementation.md docs/plans/*-progress.md 2>/dev/null || true
|
|
96
|
+
git rm -r docs/plans/adr/ 2>/dev/null || true
|
|
97
|
+
git commit -m "chore: move plan docs to worktree for <feature-name>"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
d. Stop and show the user:
|
|
101
|
+
```
|
|
102
|
+
✅ Worktree created at ../<repo>-<feature-name>
|
|
103
|
+
📄 Plan docs moved to the worktree.
|
|
104
|
+
|
|
105
|
+
To continue, start a new session there:
|
|
106
|
+
cd ../<repo>-<feature-name> && pi
|
|
107
|
+
|
|
108
|
+
Then run: /skill:executing-tasks
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
e. **Do not proceed with task execution.** The session ends here.
|
|
112
|
+
|
|
113
|
+
4. **If branch was chosen — continue with execution:**
|
|
114
|
+
|
|
115
|
+
a. **Create the progress file** — save to `docs/plans/<plan-name>-progress.md` (replace `-implementation` with `-progress` in the plan filename):
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# Progress: <topic>
|
|
119
|
+
|
|
120
|
+
Plan: docs/plans/YYYY-MM-DD-<topic>-implementation.md
|
|
121
|
+
Branch: <actual branch name>
|
|
122
|
+
Started: <ISO timestamp>
|
|
123
|
+
Last updated: <ISO timestamp>
|
|
124
|
+
|
|
125
|
+
| # | Status | Task | Commit |
|
|
126
|
+
|---|--------|------|--------|
|
|
127
|
+
| 1 | ⬜ pending | Task description (preserve checkpoint labels) | — |
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Use the actual branch name — whether it's the original branch or a new one from the isolation step.
|
|
131
|
+
|
|
132
|
+
b. **Commit the plan docs** — if `docs/plans/` has uncommitted files, commit them on the new branch:
|
|
133
|
+
```
|
|
134
|
+
git add docs/plans/ && git commit -m "docs: add design and implementation plan"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
c. **Begin task execution** — start with task 1 (see [Per-task execution](#per-task execution)).
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Commit:** `feat(executing-tasks): add worktree handoff with plan doc migration`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Progress: Worktree Handoff
|
|
2
|
+
|
|
3
|
+
Plan: docs/plans/2026-05-08-worktree-handoff-implementation.md
|
|
4
|
+
Branch: main
|
|
5
|
+
Started: 2026-05-08T00:00:00Z
|
|
6
|
+
Last updated: 2026-05-08T00:00:00Z
|
|
7
|
+
|
|
8
|
+
| # | Status | Task | Commit |
|
|
9
|
+
|---|--------|------|--------|
|
|
10
|
+
| 1 | ✅ done | Add worktree handoff flow to executing-tasks | 2ce48e7 |
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ Read-only exploration. You may **not** edit or create any files except under `do
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
12
|
1. **Check git state** — run `git status` and `git log --oneline -5`. If there's uncommitted work, ask the user what to do with it first.
|
|
13
|
-
2. **Understand the idea** — read existing code, docs, and recent commits. Grep for related functionality, check package.json/dependencies and module structure. Read only what's necessary to ground the design — don't read the entire codebase. Ask questions to refine the idea. Prefer multiple choice when possible. After each question, check: can you clearly articulate (a) what the user wants to build, (b) why, and (c) key constraints? If yes, present your understanding as a short summary and ask: "Should I proceed with this, or is there more to add?" The human decides when to move on.
|
|
13
|
+
2. **Understand the idea** — read existing code, docs, and recent commits. Grep for related functionality, check package.json/dependencies and module structure. **Check `docs/lessons.md`** if it exists — known constraints and patterns may affect the design. Read only what's necessary to ground the design — don't read the entire codebase. Ask questions to refine the idea. Prefer multiple choice when possible. After each question, check: can you clearly articulate (a) what the user wants to build, (b) why, and (c) key constraints? If yes, present your understanding as a short summary and ask: "Should I proceed with this, or is there more to add?" The human decides when to move on.
|
|
14
14
|
3. **Explore approaches** — propose 2-3 approaches. For each approach, sketch the concrete interface (types, method signatures, example caller code) so the comparison is grounded in actual code, not abstract descriptions. Lead with your recommendation.
|
|
15
15
|
4. **Present the design** — break it into focused sections. Each section should be one screen of reading. Present each section to the human and wait for approval before continuing. Cover: architecture, components, data flow, error handling, testing. On feedback, incorporate it and re-present the revised section.
|
|
16
16
|
|
|
@@ -29,29 +29,84 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
|
|
|
29
29
|
|
|
30
30
|
Derive `<feature-name>` from the plan doc (e.g. `docs/plans/2026-04-16-auth-design.md` → `auth`). Ask the user which they prefer, then wait for confirmation before proceeding.
|
|
31
31
|
|
|
32
|
-
3. **
|
|
32
|
+
3. **If worktree was chosen — hand off to new session:**
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
a. Ensure the worktree's `docs/plans/` directory exists:
|
|
35
|
+
```
|
|
36
|
+
mkdir -p <worktree>/docs/plans
|
|
37
|
+
mkdir -p <worktree>/docs/plans/adr
|
|
38
|
+
```
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
b. Move plan docs into the worktree:
|
|
41
|
+
```
|
|
42
|
+
mv docs/plans/*-design.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
43
|
+
mv docs/plans/*-implementation.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
44
|
+
mv docs/plans/*-progress.md <worktree>/docs/plans/ 2>/dev/null || true
|
|
45
|
+
mv docs/plans/adr/*.md <worktree>/docs/plans/adr/ 2>/dev/null || true
|
|
46
|
+
```
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
c. Commit the removal on the current branch (if any plan docs were committed):
|
|
49
|
+
```
|
|
50
|
+
git rm docs/plans/*-design.md docs/plans/*-implementation.md docs/plans/*-progress.md 2>/dev/null || true
|
|
51
|
+
git rm -r docs/plans/adr/ 2>/dev/null || true
|
|
52
|
+
git commit -m "chore: move plan docs to worktree for <feature-name>"
|
|
53
|
+
```
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
d. Stop and show the user:
|
|
56
|
+
```
|
|
57
|
+
✅ Worktree created at ../<repo>-<feature-name>
|
|
58
|
+
📄 Plan docs moved to the worktree.
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
git add docs/plans/ && git commit -m "docs: add design and implementation plan"
|
|
52
|
-
```
|
|
60
|
+
To continue, start a new session there:
|
|
61
|
+
cd ../<repo>-<feature-name> && pi
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
Then run: /skill:executing-tasks
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
e. **Create the progress file** in the worktree — save to `<worktree>/docs/plans/<plan-name>-progress.md`:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
# Progress: <topic>
|
|
70
|
+
|
|
71
|
+
Plan: docs/plans/YYYY-MM-DD-<topic>-implementation.md
|
|
72
|
+
Branch: <feature-name>
|
|
73
|
+
Started: <ISO timestamp>
|
|
74
|
+
Last updated: <ISO timestamp>
|
|
75
|
+
|
|
76
|
+
| # | Status | Task | Commit |
|
|
77
|
+
|---|--------|------|--------|
|
|
78
|
+
| 1 | ⬜ pending | Task description (preserve checkpoint labels) | — |
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This ensures the new session in the worktree will detect the progress file and resume correctly.
|
|
82
|
+
|
|
83
|
+
f. **Do not proceed with task execution.** The session ends here.
|
|
84
|
+
|
|
85
|
+
4. **If branch was chosen — continue with execution:**
|
|
86
|
+
|
|
87
|
+
a. **Create the progress file** — save to `docs/plans/<plan-name>-progress.md` (replace `-implementation` with `-progress` in the plan filename):
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
# Progress: <topic>
|
|
91
|
+
|
|
92
|
+
Plan: docs/plans/YYYY-MM-DD-<topic>-implementation.md
|
|
93
|
+
Branch: <actual branch name>
|
|
94
|
+
Started: <ISO timestamp>
|
|
95
|
+
Last updated: <ISO timestamp>
|
|
96
|
+
|
|
97
|
+
| # | Status | Task | Commit |
|
|
98
|
+
|---|--------|------|--------|
|
|
99
|
+
| 1 | ⬜ pending | Task description (preserve checkpoint labels) | — |
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Use the actual branch name — whether it's the original branch or a new one from the isolation step.
|
|
103
|
+
|
|
104
|
+
b. **Commit the plan docs** — if `docs/plans/` has uncommitted files, commit them on the new branch:
|
|
105
|
+
```
|
|
106
|
+
git add docs/plans/ && git commit -m "docs: add design and implementation plan"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
c. **Begin task execution** — start with task 1 (see [Per-task execution](#per-task-execution)).
|
|
55
110
|
|
|
56
111
|
## Resume
|
|
57
112
|
|
|
@@ -94,7 +149,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
|
|
|
94
149
|
For each task the agent works on:
|
|
95
150
|
|
|
96
151
|
1. **Mark in-progress** — update the progress file: `🔄 in-progress`
|
|
97
|
-
2. **Read the plan selectively** — read the plan's overview section (everything before `## Task 1:`). Skim all `## Task N:` headings for dependency awareness. Then read the current task's body in full.
|
|
152
|
+
2. **Read the plan selectively** — read the plan's overview section (everything before `## Task 1:`). Skim all `## Task N:` headings for dependency awareness. Then read the current task's body in full. **Read `docs/lessons.md` if it exists** — follow all rules listed there while working on this task.
|
|
98
153
|
3. **Write the test** — for `new-feature`: write a failing test. For `modifying-tested-code`: run existing tests first. For `trivial`: skip steps 3-5, go to step 6.
|
|
99
154
|
4. **Run the test** — confirm it fails (new-feature) or passes (modifying-tested-code). Fix if needed.
|
|
100
155
|
5. **⏸ PAUSE if `checkpoint: test`** — present the [checkpoint review](#checkpoint-review) below. Wait for human input. On changes, update and re-present at this same pause.
|
|
@@ -108,10 +163,26 @@ For each task the agent works on:
|
|
|
108
163
|
- **Seam discipline** — don't introduce abstraction unless something actually varies across it. One adapter = hypothetical seam. Two adapters = real seam
|
|
109
164
|
|
|
110
165
|
Run tests after each refactor step. Never refactor while tests are failing.
|
|
111
|
-
10.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
166
|
+
10. **Learn from mistakes** — if you caught yourself making a mistake during this task that you've made before or that would apply to future tasks, append a rule to `docs/lessons.md`. Only add rules that would change future behavior. If the file doesn't exist, create it with the standard format (see below). Do not add one-off errors or things you self-corrected immediately.
|
|
167
|
+
|
|
168
|
+
**`docs/lessons.md` format:**
|
|
169
|
+
```markdown
|
|
170
|
+
# Lessons Learned
|
|
171
|
+
|
|
172
|
+
<!--
|
|
173
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
174
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
175
|
+
Retire rules that no longer apply during finalizing.
|
|
176
|
+
-->
|
|
177
|
+
|
|
178
|
+
## Rules
|
|
179
|
+
|
|
180
|
+
- <new rule here>
|
|
181
|
+
```
|
|
182
|
+
11. **⏸ PAUSE if `checkpoint: done`** — present the [checkpoint review](#checkpoint-review) below. Wait for human input. On changes, update and re-present at this same pause.
|
|
183
|
+
12. **Commit** — `git add` the relevant files and commit with a clear message.
|
|
184
|
+
13. **Update progress** — mark `✅ done` + record the commit hash.
|
|
185
|
+
14. **Suggest session break if needed** — after completing ~3-5 tasks since the last break, suggest:
|
|
115
186
|
```
|
|
116
187
|
✅ Tasks N-M done (commits: abc, def)
|
|
117
188
|
Progress: X/Y tasks done
|
|
@@ -121,7 +192,7 @@ For each task the agent works on:
|
|
|
121
192
|
(or just say "continue" to keep going here)
|
|
122
193
|
```
|
|
123
194
|
Also suggest at checkpoint review pauses when multiple tasks have been completed since the last break. Respect the user's choice if they say "continue".
|
|
124
|
-
|
|
195
|
+
15. **Loop** — go back to step 1 for the next `⬜ pending` task, or see [After all tasks](#after-all-tasks) if none remain.
|
|
125
196
|
|
|
126
197
|
## Checkpoint review
|
|
127
198
|
|
|
@@ -199,6 +270,7 @@ When the user shares code review feedback (outside of a checkpoint pause):
|
|
|
199
270
|
2. Check git log — recent commits may reveal context
|
|
200
271
|
3. Ask the user — it's better to clarify than to guess wrong
|
|
201
272
|
4. If still stuck after asking, mark the task `❌ failed` with the reason in the progress file and move to the next task
|
|
273
|
+
5. **Check `docs/lessons.md`** — a previous lesson may be relevant to your current problem.
|
|
202
274
|
|
|
203
275
|
## After all tasks
|
|
204
276
|
|
|
@@ -35,12 +35,34 @@ Wait for the user to confirm before proceeding.
|
|
|
35
35
|
|
|
36
36
|
Each `mv` gracefully handles the case where no matching files exist (e.g., if the user skipped straight from brainstorm to finalize without executing tasks).
|
|
37
37
|
|
|
38
|
-
2. **
|
|
38
|
+
2. **Review lessons learned** — if `docs/lessons.md` exists, review it:
|
|
39
|
+
- Add any lessons from this session that were missed during execution
|
|
40
|
+
- Retire rules that no longer apply (remove the bullet)
|
|
41
|
+
- If no changes are needed, leave it as-is
|
|
42
|
+
|
|
43
|
+
If `docs/lessons.md` doesn't exist but lessons were learned this session, create it with the standard format:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# Lessons Learned
|
|
47
|
+
|
|
48
|
+
<!--
|
|
49
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
50
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
51
|
+
Retire rules that no longer apply during finalizing.
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
## Rules
|
|
55
|
+
|
|
56
|
+
- <rule 1>
|
|
57
|
+
- <rule 2>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. **Update documentation** — if the API or surface changed:
|
|
39
61
|
- Update README.md
|
|
40
62
|
- Update CHANGELOG.md
|
|
41
63
|
- Update any inline docs
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
4. **Choose a merge strategy** — ask the human which option they prefer:
|
|
44
66
|
|
|
45
67
|
1. **Create PR** — push and open a PR for external review:
|
|
46
68
|
```
|
|
@@ -87,7 +109,7 @@ Wait for the user to confirm before proceeding.
|
|
|
87
109
|
|
|
88
110
|
For options 2–4, confirm the detected parent branch with the human before proceeding.
|
|
89
111
|
|
|
90
|
-
|
|
112
|
+
5. **Clean up** — if a worktree was used, remove it:
|
|
91
113
|
```
|
|
92
114
|
git worktree remove ../<repo>-<feature-name>
|
|
93
115
|
```
|
|
@@ -9,7 +9,7 @@ You may only create or edit files under `docs/plans/`. Do not modify source code
|
|
|
9
9
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
|
-
1. **Check for a design doc** — look for `docs/plans/*-design.md`. If one exists, use it as the basis for the plan. If the design doc is incomplete, fill gaps by asking the human. If no design doc exists, ask the user to describe what they want to build and read relevant code.
|
|
12
|
+
1. **Check for a design doc** — look for `docs/plans/*-design.md`. If one exists, use it as the basis for the plan. If the design doc is incomplete, fill gaps by asking the human. If no design doc exists, ask the user to describe what they want to build and read relevant code. **Read `docs/lessons.md`** if it exists — incorporate known patterns into the task breakdown (e.g., if a lesson says "always run lint before commit," include that in relevant task instructions).
|
|
13
13
|
2. **Write the implementation plan** — break the design into tasks. Save to `docs/plans/YYYY-MM-DD-<topic>-implementation.md`. If the design is too large for ~15 tasks, flag this to the human and ask whether to reduce scope or proceed with the full plan.
|
|
14
14
|
3. **Present the plan** — show the complete plan to the human. Wait for approval before suggesting execution.
|
|
15
15
|
|