@ngockhoale/ukit 1.5.11 → 1.5.13

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.
@@ -865,6 +865,30 @@ items:
865
865
  packs:
866
866
  - core
867
867
 
868
+ - id: command-status-handoff
869
+ type: command
870
+ sourceTemplate: .claude/commands/ukit/status-handoff.md
871
+ targetPath: .claude/commands/ukit/status-handoff.md
872
+ requires:
873
+ - command-create-handoff
874
+ mergeStrategy: overwrite_with_backup
875
+ variables: []
876
+ enabledByDefault: true
877
+ packs:
878
+ - core
879
+
880
+ - id: command-abort-handoff
881
+ type: command
882
+ sourceTemplate: .claude/commands/ukit/abort-handoff.md
883
+ targetPath: .claude/commands/ukit/abort-handoff.md
884
+ requires:
885
+ - command-create-handoff
886
+ mergeStrategy: overwrite_with_backup
887
+ variables: []
888
+ enabledByDefault: true
889
+ packs:
890
+ - core
891
+
868
892
  - id: provider-compat-config
869
893
  type: config
870
894
  sourceTemplate: .claude/config/providers.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ukit",
3
- "version": "1.5.11",
3
+ "version": "1.5.13",
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",
@@ -12,11 +12,8 @@ Use the strongest model available — planning with a weak model produces weak t
12
12
  ## Inputs
13
13
 
14
14
  - Problem/feature description from the user.
15
- - **Pre-read context** (if provided in the prompt): compact summary of INDEX.md, ACTIVE.md, RULES.md, _TEMPLATE.md read by a lite agent. **Use it directly — do NOT re-read those files.**
16
- - If no pre-read context → read the files yourself (fallback for direct invocation):
17
- - `docs/AI_HANDOFF/INDEX.md` + `ACTIVE.md` (current state)
18
- - `docs/AI_HANDOFF/RULES.md` (PLAN.md format + Task Gate rules)
19
- - `docs/AI_HANDOFF/tasks/_TEMPLATE.md` (task file structure)
15
+ - **Pre-read context** (if provided): compact summary of INDEX.md, ACTIVE.md, RULES.md, _TEMPLATE.md. Use it directly — do NOT re-read those files.
16
+ - If no pre-read context → read the files yourself (fallback for direct invocation).
20
17
 
21
18
  ## Phase 1 — Write PLAN.md
22
19
 
@@ -25,11 +22,13 @@ Write all 6 sections to `docs/AI_HANDOFF/PLAN.md`:
25
22
  ```
26
23
  §1 Intent — what problem, what success looks like
27
24
  §2 Scope — in-scope / out-of-scope
25
+ CONSTRAINT: tasks in the same wave must not modify the same file.
26
+ If two tasks need the same file → make one depend on the other.
28
27
  §3 Approach — technical solution, trade-offs, alternatives rejected
29
28
  §4 Test Plan — happy path × N + ≥1 edge case + regression (if bugfix)
30
29
  table: | Type | Test Name | Expected |
31
30
  §5 Verification — exact shell commands executor will run
32
- §6 Acceptance — checklist of done criteria
31
+ §6 Acceptance — checklist of done criteria (prefer verifiable/command-based criteria)
33
32
  ```
34
33
 
35
34
  **§4 is non-negotiable.** No test plan = plan not ready.
@@ -43,32 +42,38 @@ Use `_TEMPLATE.md` structure (from pre-read context or file).
43
42
 
44
43
  | Field | Rule |
45
44
  |-------|------|
46
- | Target Files | Exact paths: `src/foo/bar.js`, `tests/foo/bar.test.js` |
47
- | Dependencies | `TASK-xxx` or `none` |
45
+ | Target Files | Exact paths — no two tasks in same wave share a file |
46
+ | Dependencies | `TASK-xxx` or `none` — wave order is inferred from this |
48
47
  | Test Cases | Type \| Test Name \| Expected — ≥1 happy + ≥1 edge case |
49
48
  | Test Files | Exact test file paths to create/modify |
50
49
  | Verification Commands | Runnable shell commands |
51
- | Acceptance Criteria | Checklist items |
50
+ | Acceptance Criteria | Verifiable checklist |
52
51
 
53
52
  Missing any field → `needs_breakdown`. Never mark incomplete tasks `ready`.
54
53
 
55
- **Wave grouping:** Wave 1 = `dependencies: none`, Wave 2 = depends on Wave 1, etc. Document in ACTIVE.md.
54
+ **Wave logic (for your reference when splitting):**
55
+ - Wave 1 = tasks with `Dependencies: none`
56
+ - Wave 2 = tasks whose all deps are in Wave 1
57
+ - Chain: A → B → C runs as 3 sequential waves (1 task each, no parallelism)
58
+ - Independent: A, B, C (all `none`) runs as 1 wave, all parallel
56
59
 
57
60
  ## Phase 3 — Update state files
58
61
 
59
62
  **INDEX.md** row per task: `| TASK-001 | <name> | ready | none | - |`
60
63
 
61
- **ACTIVE.md** snapshot:
64
+ **ACTIVE.md** — store base branch + cycle info:
62
65
  ```
63
- Cycle: <ID> Date: <YYYY-MM-DD>
66
+ Cycle: <ID> Date: <YYYY-MM-DD> Base: <current HEAD branch>
64
67
  Goal: <1 sentence>
65
- Tasks: <N> total | Wave 1: TASK-001, TASK-002 | Wave 2: TASK-003
68
+ Tasks: <N> total
66
69
  Status: planning_done — ready for executor
67
70
  ```
71
+ Wave structure is NOT stored here — inferred from task `Dependencies` fields at runtime.
68
72
 
69
73
  ## Output
70
74
 
71
- - Task count + IDs, wave structure
75
+ - Task count + IDs
76
+ - Dependency graph (text form: TASK-001 → TASK-003, TASK-002 independent)
72
77
  - Any `needs_breakdown` tasks + reason
73
78
  - Next step: "Switch to Sonnet/unic-code → run `/ukit:implement-handoff`"
74
79
 
@@ -0,0 +1,59 @@
1
+ # /ukit:abort-handoff — Force Abandon Cycle (no archive)
2
+
3
+ **Role: CLEANUP**
4
+ **Tool: any**
5
+ **Model: lite model** (haiku · unic-lite)
6
+
7
+ **Use when:** plan is wrong from the root, or cycle is unrecoverable. Discards everything — no archive, no history entry.
8
+ **Different from `/ukit:clear-handoff`:** clear = "done, save it". abort = "throw it away".
9
+
10
+ ---
11
+
12
+ ## Step 1 — Confirm intent
13
+
14
+ Report the current state before doing anything:
15
+ ```
16
+ ⚠️ About to ABORT handoff cycle:
17
+ Cycle: <ID> Goal: <goal>
18
+ Tasks that will be lost: TASK-001 [in_progress], TASK-002 [ready], ...
19
+ Branch to delete: handoff/integration (task worktrees already cleaned up during implement)
20
+
21
+ This will NOT be archived. All uncommitted work in integration branch will be discarded.
22
+ Respond "confirm abort" to proceed.
23
+ ```
24
+
25
+ Wait for human to confirm. If not confirmed → stop.
26
+
27
+ ## Step 2 — Force remove all worktrees + branches
28
+
29
+ ```bash
30
+ # Remove task worktrees + branches
31
+ git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
32
+ name=$(basename $wt)
33
+ git worktree remove $wt --force
34
+ git branch -D handoff/$name 2>/dev/null
35
+ done
36
+
37
+ # Remove integration branch
38
+ git branch -D handoff/integration 2>/dev/null
39
+
40
+ git worktree prune
41
+ ```
42
+
43
+ ## Step 3 — Reset state files (no archive)
44
+
45
+ ```
46
+ PLAN.md → "# PLAN\n_(empty)_"
47
+ INDEX.md → empty table header only
48
+ ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
49
+ tasks/TASK-*.md → delete all (keep _TEMPLATE.md)
50
+ ```
51
+
52
+ ## Step 4 — Report
53
+
54
+ Cycle aborted. No archive written. Worktrees and branches removed. Ready for new cycle.
55
+
56
+ > Claude Code: spawn `ukit-small-task-maintainer` (haiku) with steps 1–4.
57
+ > Other tools: use lite model, follow steps above.
58
+
59
+ **Next:** `/ukit:create-handoff <new problem description>` (start fresh)
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Role: CLEANUP**
4
4
  **Tool: any**
5
- **Model: lite model** (haiku · unic-lite · cheapest available — this is just file ops)
5
+ **Model: lite model** (haiku · unic-lite · cheapest — this is file ops only)
6
6
 
7
7
  **HARD GATE: Will NOT clear if any task is not `done`.**
8
8
 
@@ -11,52 +11,64 @@
11
11
  ## Step 1 — Gate check (mandatory, cannot skip)
12
12
 
13
13
  Read `docs/AI_HANDOFF/INDEX.md`. List every task + status.
14
+ Read `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`.
14
15
 
15
- If ANY task has status ≠ `done` → **STOP**. Report and exit:
16
+ If ANY task status ≠ `done` → **STOP**. Report and exit:
16
17
 
17
18
  ```
18
19
  ⛔ Cannot clear — X task(s) not done:
19
- TASK-001 [pending_review] → run /ukit:review-handoff TASK-001
20
- TASK-003 [changes_requested] → run /ukit:implement-handoff TASK-003
21
- TASK-005 [ready] → run /ukit:implement-handoff TASK-005
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
22
24
 
23
25
  Fix all tasks first, then re-run /ukit:clear-handoff.
24
26
  ```
25
27
 
26
- Only proceed if ALL tasks are `done`.
28
+ Only continue if ALL tasks are `done`.
27
29
 
28
- ## Step 2 — Cleanup worktrees
30
+ ## Step 2 — Cleanup branches (safety net)
31
+
32
+ Task worktrees are deleted immediately during implement — none should remain.
33
+ This step is a safety net + integration branch cleanup:
29
34
 
30
35
  ```bash
31
- git worktree list | grep handoff/
32
- # For each .worktrees/task-xxx:
33
- git worktree remove .worktrees/task-xxx --force
34
- git branch -D handoff/task-xxx
36
+ # Safety net: remove any stray task worktrees (should already be gone)
37
+ git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
38
+ name=$(basename $wt)
39
+ git worktree remove $wt --force 2>/dev/null
40
+ git branch -D handoff/$name 2>/dev/null
41
+ done
42
+
43
+ # Integration branch cleanup (removed by review-handoff on success, but safety net here too)
44
+ git branch -D handoff/integration 2>/dev/null
45
+
35
46
  git worktree prune
36
47
  ```
37
48
 
38
49
  ## Step 3 — Archive cycle
39
50
 
51
+ Read INDEX.md for cycle ID and task list.
40
52
  Write `docs/AI_HANDOFF/archive/cycle-NNN.md`:
41
53
  ```
42
- # Cycle NNN — <YYYY-MM-DD>
54
+ # Cycle NNN — <YYYY-MM-DD> Base: <BASE>
43
55
  ## Summary: <1 paragraph of what was accomplished>
44
56
  ## Tasks: <copy INDEX.md table>
45
57
  ```
46
- If `archive/` has > 3 files → delete oldest, append 1-line to `HISTORY.md`.
58
+ If `archive/` has > 3 files → delete oldest, append 1-line summary to `HISTORY.md`.
47
59
 
48
60
  ## Step 4 — Reset state files
49
61
 
50
62
  ```
51
- PLAN.md → "# PLAN\n_(empty)_"
52
- INDEX.md → empty table header only
53
- ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
63
+ PLAN.md → "# PLAN\n_(empty)_"
64
+ INDEX.md → empty table header only
65
+ ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
54
66
  tasks/TASK-*.md → delete all (keep _TEMPLATE.md)
55
67
  ```
56
68
 
57
69
  ## Step 5 — Report
58
70
 
59
- Cycle NNN archived. X tasks completed. Worktrees removed. Ready for new cycle.
71
+ Cycle NNN archived. X tasks completed. Base was $BASE. Worktrees removed. Ready for new cycle.
60
72
 
61
73
  > Claude Code: spawn `ukit-small-task-maintainer` (haiku) with steps 1–5.
62
74
  > Other tools: use lite model, follow steps 1–5 above.
@@ -13,51 +13,64 @@ $ARGUMENTS
13
13
 
14
14
  ## Step 1 — Read context (lite model)
15
15
 
16
- Use the lightest/cheapest model available. Read and summarize:
16
+ Use the lightest model available. Read and summarize:
17
17
 
18
18
  1. `docs/AI_HANDOFF/INDEX.md` → current tasks + statuses (or "empty")
19
19
  2. `docs/AI_HANDOFF/ACTIVE.md` → active cycle info (or "no active cycle")
20
20
  3. `docs/AI_HANDOFF/RULES.md` → PLAN.md 6-section format + Task Gate required fields
21
21
  4. `docs/AI_HANDOFF/tasks/_TEMPLATE.md` → task file structure
22
22
 
23
- Return a compact summary. Do NOT write anything yet.
23
+ Return compact summary. Do NOT write anything yet.
24
24
 
25
- > Claude Code: spawn `ukit-small-task-maintainer` (haiku) with the above prompt.
26
- > Other tools: switch to your lite model, run the above steps, keep the summary in context.
25
+ > Claude Code: spawn `ukit-small-task-maintainer` (haiku).
26
+ > Other tools: switch to lite model, run above, keep summary in context.
27
27
 
28
28
  ---
29
29
 
30
30
  ## Step 2 — Write plan + tasks (strong model)
31
31
 
32
- Switch to strongest model. Using the summary from Step 1 (do NOT re-read files):
32
+ Switch to strongest model. Use Step 1 summary — do NOT re-read files.
33
33
 
34
34
  1. If INDEX.md has undone tasks → warn human: continue old cycle or start fresh?
35
35
 
36
- 2. Write `docs/AI_HANDOFF/PLAN.md` — all 6 sections mandatory:
36
+ 2. Resolve base branch:
37
+ ```bash
38
+ BASE=$(git symbolic-ref --short HEAD)
39
+ ```
40
+
41
+ 3. Write `docs/AI_HANDOFF/PLAN.md` — all 6 sections mandatory:
37
42
  - §1 Intent — problem + success definition
38
- - §2 Scope — in / out of scope
43
+ - §2 Scope — in / out of scope. **Add a constraint**: same-wave tasks must not modify the same file (prevents merge conflicts). If two tasks need the same file, make one depend on the other.
39
44
  - §3 Approach — solution, trade-offs, alternatives rejected
40
45
  - §4 Test Plan — happy path + ≥1 edge case + regression if bugfix (non-negotiable)
41
46
  - §5 Verification — exact shell commands executor will run
42
- - §6 Acceptance — done checklist
47
+ - §6 Acceptance — done checklist (prefer verifiable criteria with commands)
43
48
 
44
- 3. Create `docs/AI_HANDOFF/tasks/TASK-001.md`, `TASK-002.md`... from `_TEMPLATE.md`
49
+ 4. Create `docs/AI_HANDOFF/tasks/TASK-001.md`, `TASK-002.md`... from `_TEMPLATE.md`
45
50
  Every task MUST have:
46
- - Target Files (exact paths)
47
- - Dependencies (`TASK-xxx` or `none`)
51
+ - Target Files (exact paths — no two tasks in same wave share a file)
52
+ - Dependencies (`TASK-xxx` or `none` — wave structure inferred from this, not stored separately)
48
53
  - Test Cases (Type | Name | Expected — ≥1 happy + ≥1 edge case)
49
54
  - Test Files (exact paths)
50
55
  - Verification Commands (runnable shell commands)
51
- - Acceptance Criteria (checklist)
56
+ - Acceptance Criteria (verifiable checklist)
52
57
  Missing any field → status: `needs_breakdown`, never `ready`
53
58
 
54
- 4. Update `INDEX.md` — one row per task, `status=ready`
55
- 5. Update `ACTIVE.md` — cycle snapshot + wave structure (Wave 1 = no deps, Wave 2 = depends on Wave 1...)
59
+ 5. Update `INDEX.md` — one row per task, `status=ready`
60
+
61
+ 6. Update `ACTIVE.md`:
62
+ ```
63
+ Cycle: <ID> Date: <YYYY-MM-DD> Base: <BASE>
64
+ Goal: <1 sentence>
65
+ Tasks: <N> total
66
+ Status: planning_done — ready for executor
67
+ ```
68
+ Note: wave structure is inferred from task Dependencies fields — not stored here.
56
69
 
57
- 6. Report: task IDs, wave map, any `needs_breakdown` + reason
70
+ 7. Report: task IDs, dependency graph, any `needs_breakdown` + reason
58
71
 
59
- > Claude Code: spawn `handoff-planner` (opus) with Step 1 summary + problem injected.
60
- > Other tools: switch to strong model, execute steps 1–6 above.
72
+ > Claude Code: spawn `handoff-planner` (opus) with Step 1 summary + problem.
73
+ > Other tools: switch to strong model, execute steps 1–7 above.
61
74
 
62
75
  ---
63
76
 
@@ -1,8 +1,8 @@
1
1
  # /ukit:implement-handoff — Phase 3: Execute
2
2
 
3
- **Role: EXECUTOR**
3
+ **Role: EXECUTOR (orchestrated)**
4
4
  **Tool: any** (Claude Code / Codex / Antigravity / Kilo / OpenCode — your choice)
5
- **Model: code model** (Sonnet · unic-code · cheap-smart available)
5
+ **Model: code model** (Sonnet · unic-code · cheap-smart)
6
6
 
7
7
  ## Target (optional)
8
8
  $ARGUMENTS
@@ -10,47 +10,119 @@ _Empty = all `ready` tasks. Or: "TASK-001" for a specific task._
10
10
 
11
11
  ---
12
12
 
13
- 1. Read `docs/AI_HANDOFF/INDEX.md`
14
- - Collect all tasks with status `ready` (or specific task from $ARGUMENTS)
15
- - If none → report and stop
16
-
17
- 2. Group into waves by dependency:
18
- - Wave 1: `dependencies: none` or all deps already `done`
19
- - Wave 2+: depends on previous wave
20
-
21
- 3. For each wave — run tasks **in parallel** (one agent/session per task):
22
-
23
- **Each task executor does:**
24
-
25
- ```
26
- Worktree (isolated per task):
27
- git worktree add -b handoff/task-xxx .worktrees/task-xxx
28
- (omit -b if branch already exists)
29
-
30
- TDD — mandatory:
31
- 1. Read §Test Cases from task file
32
- 2. Write tests → run → confirm RED
33
- 3. Implement → run → confirm GREEN
34
- 4. Run §Verification Commands → paste full output
35
-
36
- Executor Report (append to task file):
37
- ## Executor Report
38
- EXECUTOR_TOOL: <tool name>
39
- EXECUTOR_MODEL: <exact model ID — must be honest, reviewer will check>
40
- Verification Output: <paste>
41
- Status: PASS | FAIL
42
-
43
- Update INDEX.md: status → pending_review
44
-
45
- If FAIL → fix in same worktree before updating status.
46
- Never mark pending_review while tests still fail.
47
- ```
48
-
49
- > Claude Code: spawn `feature-implementer` agent per task (parallel).
50
- > Other tools: open each task in a separate session/tab with code model, follow steps above.
51
-
52
- 4. Wait for all tasks in wave → run next wave if any
53
-
54
- 5. Report: PASS/FAIL per task, worktrees created, blockers
13
+ ## Step 1 — Setup
14
+
15
+ Read `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`.
16
+ Read `docs/AI_HANDOFF/INDEX.md` → collect `ready` tasks (or specific task from $ARGUMENTS).
17
+ If no ready tasks → report and stop.
18
+
19
+ Create integration branch (once per cycle, skip if already exists):
20
+ ```bash
21
+ git branch handoff/integration $BASE 2>/dev/null || echo "already exists"
22
+ ```
23
+
24
+ ## Step 2 — Build wave groups
25
+
26
+ Read each `tasks/TASK-xxx.md` for `Dependencies` field:
27
+ - Wave 1: `Dependencies: none` (or all deps already `done`)
28
+ - Wave N+1: all deps are in Wave N or earlier
29
+ - Chain A→B→C = 3 waves of 1 task each (sequential, no parallel)
30
+ - Independent A, B, C = 1 wave of 3 tasks (parallel)
31
+
32
+ ## Step 3 — Execute wave by wave
33
+
34
+ For each wave:
35
+
36
+ ### 3a — Create worktrees (from `handoff/integration`)
37
+ ```bash
38
+ git worktree add -b handoff/task-xxx .worktrees/task-xxx handoff/integration
39
+ # (omit -b if branch already exists)
40
+ ```
41
+
42
+ ### 3b — Run tasks in parallel (one agent/session per task)
43
+
44
+ Each executor does independently in its own worktree:
45
+
46
+ ```
47
+ Read docs/AI_HANDOFF/tasks/TASK-xxx.md
48
+
49
+ TDD — mandatory:
50
+ 1. Write tests from §Test Cases
51
+ cd .worktrees/task-xxx && <test command>
52
+ Confirm RED (immediately GREEN → test is wrong — flag this)
53
+ 2. Implement → run → confirm GREEN
54
+ 3. Run §Verification Commands inside the worktree:
55
+ cd .worktrees/task-xxx && <each verification command>
56
+ Paste full output.
57
+
58
+ Commit in worktree:
59
+ git -C .worktrees/task-xxx add -A
60
+ git -C .worktrees/task-xxx commit -m "feat(TASK-xxx): <intent>"
61
+ COMMIT_SHA=$(git -C .worktrees/task-xxx rev-parse HEAD)
62
+
63
+ Executor Report (append to task file — do NOT touch INDEX.md):
64
+ ## Executor Report
65
+ EXECUTOR_TOOL: <tool>
66
+ EXECUTOR_MODEL: <exact model ID — mandatory>
67
+ EXECUTOR_SUBAGENT: <name or "-">
68
+ COMMIT_SHA: <sha>
69
+ Verification Output: <paste>
70
+ Status: PASS | FAIL
71
+ Note: <issues or "none">
72
+ ```
73
+
74
+ > Claude Code: spawn `feature-implementer` agents in parallel (one per task).
75
+ > Other tools: open each task in separate session with code model.
76
+
77
+ ### 3c — Orchestrator: merge + IMMEDIATELY delete worktree
78
+
79
+ For each task that reported back:
80
+
81
+ **PASS + EXECUTOR_MODEL present:**
82
+ ```bash
83
+ git checkout handoff/integration
84
+ if git merge handoff/task-xxx --no-ff -m "feat(TASK-xxx)" 2>/dev/null; then
85
+ # Delete worktree and branch immediately — no lingering
86
+ git worktree remove .worktrees/task-xxx --force
87
+ git branch -D handoff/task-xxx
88
+ # update INDEX.md: status → pending_review
89
+ else
90
+ git merge --abort
91
+ git worktree remove .worktrees/task-xxx --force
92
+ git branch -D handoff/task-xxx
93
+ # update INDEX.md: status → merge_conflict
94
+ # append to §Discussion: conflict with <previously merged tasks>
95
+ fi
96
+ ```
97
+
98
+ **FAIL:**
99
+ ```bash
100
+ git worktree remove .worktrees/task-xxx --force
101
+ git branch -D handoff/task-xxx
102
+ # update INDEX.md: status → blocked
103
+ ```
104
+
105
+ **EXECUTOR_MODEL missing:**
106
+ ```bash
107
+ git worktree remove .worktrees/task-xxx --force
108
+ git branch -D handoff/task-xxx
109
+ # update INDEX.md: status → needs_executor_report
110
+ ```
111
+
112
+ **Orchestrator writes INDEX.md** — agents never touch INDEX directly.
113
+ **Worktrees are always deleted immediately** — no exceptions.
114
+
115
+ ### 3d — Next wave
116
+ Branch new worktrees from `handoff/integration` (now includes Wave N). Repeat 3a–3c.
117
+
118
+ ## Step 4 — Report
119
+
120
+ ```
121
+ Wave summary:
122
+ Wave 1: TASK-001 [pending_review], TASK-002 [blocked]
123
+ Wave 2: TASK-003 [pending_review]
124
+ Merge conflicts: none | TASK-xxx (needs rebase)
125
+ No worktrees remaining.
126
+ ```
55
127
 
56
128
  **Next:** switch to strong model → `/ukit:review-handoff`
@@ -10,63 +10,99 @@ _Empty = all `pending_review` tasks. Or: "TASK-001" for a specific task._
10
10
 
11
11
  ---
12
12
 
13
- 1. Read `docs/AI_HANDOFF/INDEX.md`
14
- - Collect tasks with status `pending_review` (or specific task from $ARGUMENTS)
15
- - If none → report and stop
16
-
17
- 2. For each task — **MUST use a different model than the executor**:
18
-
19
- ```
20
- Read task file: docs/AI_HANDOFF/tasks/TASK-xxx.md
21
-
22
- Model isolation check (first thing):
23
- Read EXECUTOR_MODEL from Executor Report
24
- → REFUSE if your model == EXECUTOR_MODEL (or either is unknown)
25
- → This is non-negotiable. Same model reviewing its own work defeats the quality gate.
26
-
27
- Re-run §Verification Commands fresh:
28
- → Do NOT trust executor's output. Run them yourself.
29
- → If FAIL → verdict: critical_block. Stop.
30
-
31
- Review diff:
32
- git -C .worktrees/task-xxx diff main
33
- Check: correctness, regression risk, security, edge cases, maintainability
34
-
35
- Append ## Reviewer Verdict to task file:
36
- VERDICT: approved | approved_minor | changes_requested | critical_block
37
- REVIEWER_MODEL: <your model>
38
- EXECUTOR_MODEL: <from report>
39
- VERIFICATION_RERUN: PASS | FAIL
40
- FINDINGS:
41
- critical: ...
42
- important: ...
43
- minor: ...
44
- NEXT_STATUS_FOR_INDEX: <status>
45
-
46
- Update INDEX.md: status = NEXT_STATUS_FOR_INDEX
47
- ```
48
-
49
- > Claude Code: spawn `code-reviewer` agent (opus) per task.
50
- > Other tools: switch to strong model (different from executor), follow steps above per task.
51
-
52
- 3. After each verdict:
53
-
54
- **approved / approved_minor →** merge + cleanup:
55
- ```bash
56
- git merge handoff/task-xxx --no-ff -m "feat: merge TASK-xxx"
57
- git worktree remove .worktrees/task-xxx
58
- git branch -d handoff/task-xxx
59
- # INDEX.md: status → done
60
- ```
61
-
62
- **changes_requested / critical_block →** keep worktree for executor to fix:
63
- ```
64
- Write findings in §Discussion of task file
65
- # INDEX.md: status → changes_requested | critical_block
66
- ```
67
-
68
- 4. Report: merged tasks, tasks needing fixes, remaining worktrees
13
+ ## Step 1 — Setup
14
+
15
+ Read `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`.
16
+ Read `docs/AI_HANDOFF/INDEX.md` → collect `pending_review` tasks (or specific task).
17
+ If none → report and stop.
18
+
19
+ Checkout integration branch for verification:
20
+ ```bash
21
+ git checkout handoff/integration
22
+ ```
23
+
24
+ ## Step 2 — Review each task (sequential — no parallel to avoid INDEX race)
25
+
26
+ For each task:
27
+
28
+ ### 2a — Model isolation check (always first)
29
+
30
+ Read `EXECUTOR_MODEL` from task file `## Executor Report`.
31
+
32
+ | Executor model | Your model | Action |
33
+ |----------------|------------|--------|
34
+ | present, ≠ yours | present | proceed |
35
+ | present, == yours | present | REFUSE → `changes_requested`: "reviewer ≠ executor required" |
36
+ | missing / blank | any | REFUSE → `changes_requested`: "EXECUTOR_MODEL missing — re-run implement" |
37
+ | "unknown" | present | proceed + NOTES: "executor model unverified — human confirm" |
38
+
39
+ ### 2b — Re-run verification (on integration branch, no worktree needed)
40
+
41
+ ```bash
42
+ # Already on handoff/integration from Step 1
43
+ <each command from task §Verification Commands>
44
+ ```
45
+
46
+ If any command fails → verdict: `critical_block`. Stop.
47
+
48
+ ### 2c — Review diff (per task, using COMMIT_SHA from Executor Report)
49
+
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
54
+ ```
55
+
56
+ Check: correctness, regression risk, security, edge cases, maintainability.
57
+
58
+ ### 2d — Append verdict to task file
59
+
60
+ ```
61
+ ## Reviewer Verdict
62
+ VERDICT: approved | approved_minor | changes_requested | critical_block
63
+ REVIEWER_MODEL: <your exact model ID>
64
+ EXECUTOR_MODEL: <from Executor Report>
65
+ VERIFICATION_RERUN: PASS | FAIL
66
+ FINDINGS:
67
+ critical: <file:line — what fails> | none
68
+ important: <file:line — risk> | none
69
+ minor: <style/naming> | none
70
+ NEXT_STATUS_FOR_INDEX: <status>
71
+ ```
72
+
73
+ ### 2e — Orchestrator updates INDEX.md
74
+
75
+ Set `status = NEXT_STATUS_FOR_INDEX`. Orchestrator writes INDEX, not the reviewer.
76
+
77
+ ## Step 3 — After all tasks reviewed
78
+
79
+ **All `approved` or `approved_minor`:**
80
+ ```bash
81
+ git checkout $BASE
82
+ if git merge handoff/integration --no-ff -m "feat: handoff cycle complete"; then
83
+ git branch -D handoff/integration
84
+ # INDEX.md: all approved tasks → done
85
+ else
86
+ git merge --abort
87
+ # Report: conflict on integration→BASE. Human must resolve manually.
88
+ fi
89
+ ```
90
+
91
+ **Any `changes_requested` or `critical_block`:**
92
+ Keep `handoff/integration` open for next implement round. Report which tasks need fixes.
93
+
94
+ ## Step 4 — Report
95
+
96
+ ```
97
+ Review summary:
98
+ TASK-001: approved — merged into BASE
99
+ TASK-002: changes_requested — see §Discussion
100
+ Integration: merged to BASE | pending (fix TASK-002 first)
101
+ ```
69
102
 
70
103
  **Next:**
71
104
  - All done → `/ukit:clear-handoff`
72
- - Has fixes → executor runs `/ukit:implement-handoff TASK-xxx`
105
+ - Has fixes → executor re-runs `/ukit:implement-handoff TASK-xxx`
106
+
107
+ > Claude Code: spawn `code-reviewer` (opus) per task for 2a–2d. Orchestrator handles 1, 2e, 3.
108
+ > Other tools: strong model sequentially per task, same steps.
@@ -0,0 +1,49 @@
1
+ # /ukit:status-handoff — Dashboard (read-only)
2
+
3
+ **Role: OBSERVER**
4
+ **Tool: any**
5
+ **Model: lite model** (haiku · unic-lite — read-only, no writes)
6
+
7
+ ---
8
+
9
+ Read and display current handoff state. Do NOT modify any files.
10
+
11
+ ## Read
12
+
13
+ 1. `docs/AI_HANDOFF/ACTIVE.md` → cycle ID, goal, base branch
14
+ 2. `docs/AI_HANDOFF/INDEX.md` → all tasks + statuses
15
+ 3. `git worktree list` → open worktrees
16
+ 4. `git branch | grep handoff/` → open handoff branches
17
+
18
+ ## Report
19
+
20
+ ```
21
+ ━━━ Handoff Status ━━━━━━━━━━━━━━━━━━━━━━━━
22
+ Cycle: <ID> Base: <branch> Date: <date>
23
+ Goal: <goal>
24
+
25
+ Tasks:
26
+ ✅ done TASK-001 <name>
27
+ 🔄 pending_review TASK-002 <name>
28
+ 🔧 in_progress TASK-003 <name>
29
+ 🔴 blocked TASK-004 <name>
30
+ ⏳ ready TASK-005 <name>
31
+
32
+ Summary: X done / Y pending_review / Z in_progress / ... / N total
33
+
34
+ Worktrees open:
35
+ .worktrees/task-002 [handoff/task-002]
36
+ .worktrees/task-003 [handoff/task-003]
37
+
38
+ Integration branch: handoff/integration [exists | not created yet]
39
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
40
+
41
+ Next action:
42
+ pending_review tasks → /ukit:review-handoff
43
+ ready tasks → /ukit:implement-handoff
44
+ all done → /ukit:clear-handoff
45
+ no active cycle → /ukit:create-handoff <description>
46
+ ```
47
+
48
+ > Claude Code: spawn `ukit-small-task-maintainer` (haiku) with the above prompt.
49
+ > Other tools: use lite model, run the reads above, format the report.