@tianhai/pi-workflow-kit 0.12.0 → 0.13.2
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-migrate-earendil-works-design.md +39 -0
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-implementation.md +45 -0
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-progress.md +10 -0
- package/extensions/workflow-guard.ts +1 -1
- package/package.json +3 -4
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/executing-tasks/SKILL.md +41 -7
- 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,39 @@
|
|
|
1
|
+
# Migrate from @mariozechner to @earendil-works
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
pi has moved from `@mariozechner` to `@earendil-works` on GitHub and npm. The old `@mariozechner/pi-coding-agent@0.73.1` is deprecated. This package has two unused peer deps (`pi-ai`, `pi-tui`) that should be cleaned up.
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
### 1. `extensions/workflow-guard.ts` — update import
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
-import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
13
|
+
+import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. `package.json` — update peerDependencies
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
- "@mariozechner/pi-ai": "*",
|
|
21
|
+
- "@mariozechner/pi-coding-agent": "*",
|
|
22
|
+
- "@mariozechner/pi-tui": "*",
|
|
23
|
+
+ "@earendil-works/pi-coding-agent": "*",
|
|
24
|
+
"@sinclair/typebox": "*"
|
|
25
|
+
},
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Rename `pi-coding-agent` to `@earendil-works/pi-coding-agent`
|
|
29
|
+
- Remove `@mariozechner/pi-ai` (unused)
|
|
30
|
+
- Remove `@mariozechner/pi-tui` (unused)
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
- `ExtensionAPI` is exported identically from both old and new packages (same export map, same `.d.ts` path)
|
|
35
|
+
- No other imports from `@mariozechner/*` exist in the codebase
|
|
36
|
+
|
|
37
|
+
## Impact
|
|
38
|
+
|
|
39
|
+
Users on old `@mariozechner/pi-coding-agent` will get a peer dependency resolution error — they must update pi. The old package is explicitly deprecated pointing to the new one.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Implementation Plan: Migrate from @mariozechner to @earendil-works
|
|
2
|
+
|
|
3
|
+
## Task 1: Update package scope and clean up peer dependencies
|
|
4
|
+
|
|
5
|
+
<!-- tdd: trivial -->
|
|
6
|
+
<!-- checkpoint: done -->
|
|
7
|
+
|
|
8
|
+
Migrate the sole import and peerDependencies from `@mariozechner/*` to `@earendil-works/pi-coding-agent`, dropping the two unused deps (`pi-ai`, `pi-tui`).
|
|
9
|
+
|
|
10
|
+
### Files to modify
|
|
11
|
+
|
|
12
|
+
1. **`extensions/workflow-guard.ts`** — line 2:
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
-import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
16
|
+
+import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. **`package.json`** — `peerDependencies`:
|
|
20
|
+
|
|
21
|
+
```diff
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
- "@mariozechner/pi-ai": "*",
|
|
24
|
+
- "@mariozechner/pi-coding-agent": "*",
|
|
25
|
+
- "@mariozechner/pi-tui": "*",
|
|
26
|
+
+ "@earendil-works/pi-coding-agent": "*",
|
|
27
|
+
"@sinclair/typebox": "*"
|
|
28
|
+
},
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Verify
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
grep -r "@mariozechner" extensions/ package.json
|
|
35
|
+
# Expected: no output
|
|
36
|
+
|
|
37
|
+
npm run check
|
|
38
|
+
# Expected: passes (lint + tests)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Commit
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
chore: migrate from @mariozechner to @earendil-works, drop unused peer deps
|
|
45
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Progress: Migrate from @mariozechner to @earendil-works
|
|
2
|
+
|
|
3
|
+
Plan: docs/plans/2026-05-08-migrate-earendil-works-implementation.md
|
|
4
|
+
Branch: migrate-earendil-works
|
|
5
|
+
Started: 2026-05-08T00:00:00Z
|
|
6
|
+
Last updated: 2026-05-08T00:02:00Z
|
|
7
|
+
|
|
8
|
+
| # | Status | Task | Commit |
|
|
9
|
+
|---|--------|------|--------|
|
|
10
|
+
| 1 | ✅ done | Update package scope and clean up peer dependencies (checkpoint: done) | 0a29af0 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tianhai/pi-workflow-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Enforce structured brainstorm→plan→execute→finalize workflow with TDD discipline in AI coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -40,13 +40,12 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@mariozechner/pi-coding-agent": "*",
|
|
45
|
-
"@mariozechner/pi-tui": "*",
|
|
43
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
46
44
|
"@sinclair/typebox": "*"
|
|
47
45
|
},
|
|
48
46
|
"devDependencies": {
|
|
49
47
|
"@biomejs/biome": "^2.3.15",
|
|
48
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
50
49
|
"vitest": "^4.0.18"
|
|
51
50
|
}
|
|
52
51
|
}
|
|
@@ -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
|
|
|
@@ -63,7 +63,24 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
|
|
|
63
63
|
Then run: /skill:executing-tasks
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
e. **
|
|
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.
|
|
67
84
|
|
|
68
85
|
4. **If branch was chosen — continue with execution:**
|
|
69
86
|
|
|
@@ -132,7 +149,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
|
|
|
132
149
|
For each task the agent works on:
|
|
133
150
|
|
|
134
151
|
1. **Mark in-progress** — update the progress file: `🔄 in-progress`
|
|
135
|
-
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.
|
|
136
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.
|
|
137
154
|
4. **Run the test** — confirm it fails (new-feature) or passes (modifying-tested-code). Fix if needed.
|
|
138
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.
|
|
@@ -146,10 +163,26 @@ For each task the agent works on:
|
|
|
146
163
|
- **Seam discipline** — don't introduce abstraction unless something actually varies across it. One adapter = hypothetical seam. Two adapters = real seam
|
|
147
164
|
|
|
148
165
|
Run tests after each refactor step. Never refactor while tests are failing.
|
|
149
|
-
10.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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:
|
|
153
186
|
```
|
|
154
187
|
✅ Tasks N-M done (commits: abc, def)
|
|
155
188
|
Progress: X/Y tasks done
|
|
@@ -159,7 +192,7 @@ For each task the agent works on:
|
|
|
159
192
|
(or just say "continue" to keep going here)
|
|
160
193
|
```
|
|
161
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".
|
|
162
|
-
|
|
195
|
+
15. **Loop** — go back to step 1 for the next `⬜ pending` task, or see [After all tasks](#after-all-tasks) if none remain.
|
|
163
196
|
|
|
164
197
|
## Checkpoint review
|
|
165
198
|
|
|
@@ -237,6 +270,7 @@ When the user shares code review feedback (outside of a checkpoint pause):
|
|
|
237
270
|
2. Check git log — recent commits may reveal context
|
|
238
271
|
3. Ask the user — it's better to clarify than to guess wrong
|
|
239
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.
|
|
240
274
|
|
|
241
275
|
## After all tasks
|
|
242
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
|
|