@ngockhoale/ukit 1.5.16 → 1.5.18
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/manifests/platform.full.yaml +1 -0
- package/package.json +1 -1
- package/templates/.claude/commands/ukit/clear-handoff.md +32 -64
- package/templates/.claude/commands/ukit/implement-handoff.md +27 -3
- package/templates/.claude/commands/ukit/review-handoff.md +30 -22
- package/templates/CLAUDE.md +1 -1
package/package.json
CHANGED
|
@@ -1,82 +1,47 @@
|
|
|
1
|
-
# /ukit:clear-handoff —
|
|
1
|
+
# /ukit:clear-handoff — Emergency Reset
|
|
2
2
|
|
|
3
|
-
**Role: CLEANUP**
|
|
3
|
+
**Role: CLEANUP UTILITY**
|
|
4
4
|
**Tool: any**
|
|
5
|
-
**Model: lite model** (haiku · unic-lite · cheapest —
|
|
5
|
+
**Model: lite model** (haiku · unic-lite · cheapest — file ops + git cleanup only)
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**Use when:** handoff cycle is stuck, abandoned, or you want to wipe and start fresh.
|
|
8
|
+
**Not a step in the main process** — main flow is: create → implement → review.
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
## Step 1 —
|
|
12
|
-
|
|
13
|
-
Read `docs/AI_HANDOFF/INDEX.md`. List every task + status.
|
|
14
|
-
Read `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`.
|
|
15
|
-
|
|
16
|
-
If ANY task status ≠ `done` → **STOP**. Report and exit:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
⛔ Cannot clear — X task(s) not done:
|
|
20
|
-
TASK-001 [pending_review] → /ukit:review-handoff TASK-001
|
|
21
|
-
TASK-003 [changes_requested] → /ukit:implement-handoff TASK-003
|
|
22
|
-
TASK-005 [ready] → /ukit:implement-handoff TASK-005
|
|
23
|
-
TASK-006 [merge_conflict] → rebase handoff/task-006 on handoff/integration, re-run implement
|
|
24
|
-
|
|
25
|
-
Fix all tasks first, then re-run /ukit:clear-handoff.
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Only continue if ALL tasks are `done`.
|
|
29
|
-
|
|
30
|
-
## Step 2 — Merge + commit + push to $BASE
|
|
31
|
-
|
|
32
|
-
This is the **only step in the entire handoff that commits and pushes to the base branch.**
|
|
12
|
+
## Step 1 — Force-remove all handoff worktrees and branches
|
|
33
13
|
|
|
34
14
|
```bash
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
git
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# Merge integration branch (code changes from implement-handoff worktrees)
|
|
44
|
-
if git merge handoff/integration --no-ff -m "feat: complete handoff cycle"; then
|
|
45
|
-
git push origin $BASE
|
|
46
|
-
git branch -D handoff/integration
|
|
47
|
-
else
|
|
48
|
-
git merge --abort
|
|
49
|
-
echo "⛔ Merge conflict on handoff/integration → $BASE. Resolve manually, then re-run /ukit:clear-handoff."
|
|
50
|
-
exit 1
|
|
51
|
-
fi
|
|
52
|
-
```
|
|
15
|
+
# Remove task worktrees
|
|
16
|
+
git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
|
|
17
|
+
name=$(basename "$wt")
|
|
18
|
+
git worktree remove "$wt" --force 2>/dev/null
|
|
19
|
+
git branch -D "handoff/$name" 2>/dev/null
|
|
20
|
+
done
|
|
21
|
+
git worktree prune
|
|
53
22
|
|
|
54
|
-
|
|
23
|
+
# Remove integration branch if still exists
|
|
24
|
+
git branch -D handoff/integration 2>/dev/null || true
|
|
25
|
+
```
|
|
55
26
|
|
|
56
|
-
|
|
27
|
+
## Step 2 — Unstage any pending changes
|
|
57
28
|
|
|
58
29
|
```bash
|
|
59
|
-
git
|
|
60
|
-
name=$(basename $wt)
|
|
61
|
-
git worktree remove $wt --force 2>/dev/null
|
|
62
|
-
git branch -D handoff/$name 2>/dev/null
|
|
63
|
-
done
|
|
64
|
-
|
|
65
|
-
git worktree prune
|
|
30
|
+
git restore --staged . 2>/dev/null || true
|
|
66
31
|
```
|
|
67
32
|
|
|
68
|
-
## Step
|
|
33
|
+
## Step 3 — Archive whatever is done (best-effort)
|
|
69
34
|
|
|
70
|
-
Read INDEX.md for
|
|
71
|
-
Write `docs/AI_HANDOFF/archive/cycle-NNN.md
|
|
35
|
+
Read `docs/AI_HANDOFF/INDEX.md` for any tasks that were completed.
|
|
36
|
+
Write `docs/AI_HANDOFF/archive/cycle-NNN.md` (if there is anything worth archiving):
|
|
72
37
|
```
|
|
73
|
-
# Cycle NNN — <YYYY-MM-DD>
|
|
74
|
-
## Summary:
|
|
75
|
-
## Tasks: <copy INDEX.md table>
|
|
38
|
+
# Cycle NNN — <YYYY-MM-DD> — ABORTED
|
|
39
|
+
## Summary: cycle was cleared before completion
|
|
40
|
+
## Tasks: <copy INDEX.md table as-is>
|
|
76
41
|
```
|
|
77
42
|
If `archive/` has > 3 files → delete oldest, append 1-line summary to `HISTORY.md`.
|
|
78
43
|
|
|
79
|
-
## Step
|
|
44
|
+
## Step 4 — Reset state files
|
|
80
45
|
|
|
81
46
|
```
|
|
82
47
|
PLAN.md → "# PLAN\n_(empty)_"
|
|
@@ -85,11 +50,14 @@ ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
|
|
|
85
50
|
tasks/TASK-*.md → delete all (keep _TEMPLATE.md)
|
|
86
51
|
```
|
|
87
52
|
|
|
88
|
-
## Step
|
|
53
|
+
## Step 5 — Report
|
|
89
54
|
|
|
90
|
-
|
|
55
|
+
```
|
|
56
|
+
Cleared: X worktrees removed, Y branches deleted, staged changes unstaged.
|
|
57
|
+
Handoff docs reset. Ready for new cycle.
|
|
58
|
+
```
|
|
91
59
|
|
|
92
|
-
> Claude Code: spawn `ukit-small-task-maintainer` (haiku)
|
|
93
|
-
> Other tools:
|
|
60
|
+
> Claude Code: spawn `ukit-small-task-maintainer` (haiku).
|
|
61
|
+
> Other tools: lite model, follow steps 1–5.
|
|
94
62
|
|
|
95
63
|
**Next:** `/ukit:create-handoff <new problem description>`
|
|
@@ -115,14 +115,38 @@ git branch -D handoff/task-xxx
|
|
|
115
115
|
### 3d — Next wave
|
|
116
116
|
Branch new worktrees from `handoff/integration` (now includes Wave N). Repeat 3a–3c.
|
|
117
117
|
|
|
118
|
-
## Step 4 —
|
|
118
|
+
## Step 4 — Finalize: squash merge + cleanup
|
|
119
|
+
|
|
120
|
+
All waves complete. Bring all changes back to `$BASE` as a staged diff — no auto-commit.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
git checkout $BASE
|
|
124
|
+
|
|
125
|
+
# Stage all integration changes without committing
|
|
126
|
+
git merge --squash handoff/integration
|
|
127
|
+
|
|
128
|
+
# Delete integration branch
|
|
129
|
+
git branch -D handoff/integration
|
|
130
|
+
|
|
131
|
+
# Safety-net: remove any stray task worktrees/branches
|
|
132
|
+
git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
|
|
133
|
+
name=$(basename "$wt")
|
|
134
|
+
git worktree remove "$wt" --force 2>/dev/null
|
|
135
|
+
git branch -D "handoff/$name" 2>/dev/null
|
|
136
|
+
done
|
|
137
|
+
git worktree prune
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
All changes are now **staged on `$BASE`**. No branches or worktrees remain.
|
|
141
|
+
|
|
142
|
+
## Step 5 — Report
|
|
119
143
|
|
|
120
144
|
```
|
|
121
145
|
Wave summary:
|
|
122
146
|
Wave 1: TASK-001 [pending_review], TASK-002 [blocked]
|
|
123
147
|
Wave 2: TASK-003 [pending_review]
|
|
124
|
-
|
|
125
|
-
|
|
148
|
+
All branches and worktrees removed.
|
|
149
|
+
Staged diff on $BASE — ready for review.
|
|
126
150
|
```
|
|
127
151
|
|
|
128
152
|
**Next:** switch to strong model → `/ukit:review-handoff`
|
|
@@ -16,18 +16,19 @@ Read `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`.
|
|
|
16
16
|
Read `docs/AI_HANDOFF/INDEX.md` → collect `pending_review` tasks (or specific task).
|
|
17
17
|
If none → report and stop.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Verify we are on `$BASE` with staged changes from implement-handoff:
|
|
20
20
|
```bash
|
|
21
|
-
git
|
|
21
|
+
git status # should show staged changes, no handoff branches/worktrees
|
|
22
|
+
git diff --staged --stat # summary of everything implement-handoff merged
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
If `git diff --staged` is empty → implement-handoff was not completed. Stop and re-run it.
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
## Step 2 — Review the staged diff
|
|
27
28
|
|
|
28
29
|
### 2a — Model isolation check (always first)
|
|
29
30
|
|
|
30
|
-
Read `EXECUTOR_MODEL` from task file `## Executor Report`.
|
|
31
|
+
Read `EXECUTOR_MODEL` from each task file `## Executor Report`.
|
|
31
32
|
|
|
32
33
|
| Executor model | Your model | Action |
|
|
33
34
|
|----------------|------------|--------|
|
|
@@ -36,26 +37,24 @@ Read `EXECUTOR_MODEL` from task file `## Executor Report`.
|
|
|
36
37
|
| missing / blank | any | REFUSE → `changes_requested`: "EXECUTOR_MODEL missing — re-run implement" |
|
|
37
38
|
| "unknown" | present | proceed + NOTES: "executor model unverified — human confirm" |
|
|
38
39
|
|
|
39
|
-
### 2b — Re-run verification (on
|
|
40
|
+
### 2b — Re-run verification (on staged working tree)
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
|
-
|
|
43
|
-
<each command from task §Verification Commands>
|
|
43
|
+
<each command from §Verification Commands across all tasks>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
If any command fails → verdict: `critical_block`. Stop.
|
|
47
47
|
|
|
48
|
-
### 2c — Review diff
|
|
48
|
+
### 2c — Review unified diff
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
|
|
52
|
-
git show $COMMIT_SHA # what this task changed
|
|
53
|
-
git diff $COMMIT_SHA^..$COMMIT_SHA # same, as diff format
|
|
51
|
+
git diff --staged # full staged diff vs $BASE
|
|
54
52
|
```
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
Review as one unified diff — correctness, regression risk, security, edge cases, maintainability.
|
|
55
|
+
Cross-reference with each task's intent in `docs/AI_HANDOFF/tasks/TASK-xxx.md`.
|
|
57
56
|
|
|
58
|
-
### 2d — Append verdict to task file
|
|
57
|
+
### 2d — Append verdict to each task file
|
|
59
58
|
|
|
60
59
|
```
|
|
61
60
|
## Reviewer Verdict
|
|
@@ -80,17 +79,26 @@ Set `status = NEXT_STATUS_FOR_INDEX`. Orchestrator writes INDEX, not the reviewe
|
|
|
80
79
|
|
|
81
80
|
Update INDEX.md: all approved tasks → `done`.
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
Commit the staged changes:
|
|
83
|
+
```bash
|
|
84
|
+
git add docs/AI_HANDOFF/
|
|
85
|
+
git commit -m "feat: complete handoff cycle"
|
|
86
|
+
git push origin $BASE
|
|
87
|
+
```
|
|
84
88
|
|
|
85
89
|
Report:
|
|
86
|
-
|
|
87
90
|
```
|
|
88
|
-
✅ All tasks approved
|
|
89
|
-
|
|
91
|
+
✅ All tasks approved and committed to $BASE.
|
|
92
|
+
Handoff cycle complete.
|
|
90
93
|
```
|
|
91
94
|
|
|
92
95
|
**Any `changes_requested` or `critical_block`:**
|
|
93
|
-
|
|
96
|
+
|
|
97
|
+
Do NOT commit. Unstage all changes and re-open the cycle:
|
|
98
|
+
```bash
|
|
99
|
+
git restore --staged .
|
|
100
|
+
```
|
|
101
|
+
Report which tasks need fixes. Executor re-runs `/ukit:implement-handoff TASK-xxx`.
|
|
94
102
|
|
|
95
103
|
## Step 4 — Report
|
|
96
104
|
|
|
@@ -98,12 +106,12 @@ Keep `handoff/integration` open. Report which tasks need fixes.
|
|
|
98
106
|
Review summary:
|
|
99
107
|
TASK-001: approved
|
|
100
108
|
TASK-002: changes_requested — see §Discussion
|
|
101
|
-
|
|
109
|
+
Result: committed to $BASE | changes requested (staged reset, re-implement needed)
|
|
102
110
|
```
|
|
103
111
|
|
|
104
112
|
**Next:**
|
|
105
|
-
- All approved →
|
|
106
|
-
- Has fixes → executor re-runs `/ukit:implement-handoff TASK-xxx`
|
|
113
|
+
- All approved → done. Committed to `$BASE`.
|
|
114
|
+
- Has fixes → unstage (`git restore --staged .`) + executor re-runs `/ukit:implement-handoff TASK-xxx`
|
|
107
115
|
|
|
108
116
|
> Claude Code: spawn `code-reviewer` (opus) per task for 2a–2d. Orchestrator handles 1, 2e, 3.
|
|
109
117
|
> Other tools: strong model sequentially per task, same steps.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -66,7 +66,7 @@ For clearly non-code specialist lanes (docs-only, status, task queue), skip the
|
|
|
66
66
|
- **Do not ask normal contributors to run internal helper commands**; run them yourself or tell them to rerun `ukit install`.
|
|
67
67
|
- Do not ask normal contributors to memorize `ukit doctor`, `ukit diff`, `ukit uninstall`, or `ukit index ...` unless they explicitly need maintainer/debug help.
|
|
68
68
|
|
|
69
|
-
## UKit
|
|
69
|
+
## UKit v{{ukit.version}} Shared Runtime
|
|
70
70
|
|
|
71
71
|
- Shared runtime state lives in `.ukit/storage/`.
|
|
72
72
|
- Treat `.ukit/storage/config.json` as the source of runtime toggles for compact, token pipeline, router, memory, validation, and Safe Patch behavior.
|