@ngockhoale/ukit 1.5.17 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ukit",
3
- "version": "1.5.17",
3
+ "version": "1.5.18",
4
4
  "description": "Install/update an index-first AI workspace for Claude Code, Antigravity, OpenAI Codex, and OpenCode.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,82 +1,47 @@
1
- # /ukit:clear-handoff — Archive + Reset
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 — this is file ops only)
5
+ **Model: lite model** (haiku · unic-lite · cheapest — file ops + git cleanup only)
6
6
 
7
- **HARD GATE: Will NOT clear if any task is not `done`.**
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 — Gate check (mandatory, cannot skip)
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
- git checkout $BASE
36
-
37
- # Stage handoff planning docs (written to workspace during create-handoff, never committed yet)
38
- git add docs/AI_HANDOFF/
39
- if ! git diff --staged --quiet; then
40
- git commit -m "docs(handoff): add cycle planning artifacts"
41
- fi
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
- ## Step 3 — Cleanup stray worktrees (safety net)
23
+ # Remove integration branch if still exists
24
+ git branch -D handoff/integration 2>/dev/null || true
25
+ ```
55
26
 
56
- Task worktrees are deleted immediately during implement — none should remain. Safety net only:
27
+ ## Step 2 — Unstage any pending changes
57
28
 
58
29
  ```bash
59
- git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
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 4 — Archive cycle
33
+ ## Step 3 — Archive whatever is done (best-effort)
69
34
 
70
- Read INDEX.md for cycle ID and task list.
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> Base: <BASE>
74
- ## Summary: <1 paragraph of what was accomplished>
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 5 — Reset state files
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 6 — Report
53
+ ## Step 5 — Report
89
54
 
90
- Cycle NNN merged + pushed to $BASE. X tasks completed. Worktrees removed. Ready for new cycle.
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) with steps 1–6.
93
- > Other tools: use lite model, follow steps 1–6 above.
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 — Report
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
- Merge conflicts: none | TASK-xxx (needs rebase)
125
- No worktrees remaining.
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
- Checkout integration branch for verification:
19
+ Verify we are on `$BASE` with staged changes from implement-handoff:
20
20
  ```bash
21
- git checkout handoff/integration
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
- ## Step 2 — Review each task (sequential — no parallel to avoid INDEX race)
25
+ If `git diff --staged` is empty → implement-handoff was not completed. Stop and re-run it.
25
26
 
26
- For each task:
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 integration branch, no worktree needed)
40
+ ### 2b — Re-run verification (on staged working tree)
40
41
 
41
42
  ```bash
42
- # Already on handoff/integration from Step 1
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 (per task, using COMMIT_SHA from Executor Report)
48
+ ### 2c — Review unified diff
49
49
 
50
50
  ```bash
51
- COMMIT_SHA=<from Executor Report>
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
- Check: correctness, regression risk, security, edge cases, maintainability.
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
- **STOP. Do not commit, do not push, do not merge.** Only `docs/AI_HANDOFF/` was touched during this entire cycle. The merge + commit + push happens exclusively in `/ukit:clear-handoff`.
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. Cycle ready to finalize.
89
- Run: /ukit:clear-handoff
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
- Keep `handoff/integration` open. Report which tasks need fixes.
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
- Integration: ready for clear-handoff | pending (fix TASK-002 first)
109
+ Result: committed to $BASE | changes requested (staged reset, re-implement needed)
102
110
  ```
103
111
 
104
112
  **Next:**
105
- - All approved → `/ukit:clear-handoff` (does the merge + commit + push)
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.