@ngockhoale/ukit 1.5.11 → 1.5.12

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.12",
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
+ Worktrees to delete: .worktrees/task-001, ...
20
+
21
+ This will NOT be archived. All work in worktrees 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,61 @@
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 worktrees + branches
29
31
 
30
32
  ```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
33
+ # Remove any remaining task worktrees (should already be gone after review, but be safe)
34
+ git worktree list | grep '.worktrees/task-' | awk '{print $1}' | while read wt; do
35
+ name=$(basename $wt)
36
+ git worktree remove $wt --force 2>/dev/null
37
+ git branch -D handoff/$name 2>/dev/null
38
+ done
39
+
40
+ # Remove integration branch if still exists
41
+ git branch -D handoff/integration 2>/dev/null
42
+
35
43
  git worktree prune
36
44
  ```
37
45
 
38
46
  ## Step 3 — Archive cycle
39
47
 
48
+ Read INDEX.md for cycle ID and task list.
40
49
  Write `docs/AI_HANDOFF/archive/cycle-NNN.md`:
41
50
  ```
42
- # Cycle NNN — <YYYY-MM-DD>
51
+ # Cycle NNN — <YYYY-MM-DD> Base: <BASE>
43
52
  ## Summary: <1 paragraph of what was accomplished>
44
53
  ## Tasks: <copy INDEX.md table>
45
54
  ```
46
- If `archive/` has > 3 files → delete oldest, append 1-line to `HISTORY.md`.
55
+ If `archive/` has > 3 files → delete oldest, append 1-line summary to `HISTORY.md`.
47
56
 
48
57
  ## Step 4 — Reset state files
49
58
 
50
59
  ```
51
- PLAN.md → "# PLAN\n_(empty)_"
52
- INDEX.md → empty table header only
53
- ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
60
+ PLAN.md → "# PLAN\n_(empty)_"
61
+ INDEX.md → empty table header only
62
+ ACTIVE.md → "# ACTIVE\n_(no active cycle)_"
54
63
  tasks/TASK-*.md → delete all (keep _TEMPLATE.md)
55
64
  ```
56
65
 
57
66
  ## Step 5 — Report
58
67
 
59
- Cycle NNN archived. X tasks completed. Worktrees removed. Ready for new cycle.
68
+ Cycle NNN archived. X tasks completed. Base was $BASE. Worktrees removed. Ready for new cycle.
60
69
 
61
70
  > Claude Code: spawn `ukit-small-task-maintainer` (haiku) with steps 1–5.
62
71
  > 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,100 @@ _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>` (the branch set at plan time).
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 "integration branch already exists"
22
+ ```
23
+
24
+ ## Step 2 — Build wave groups
25
+
26
+ Wave structure is inferred from task `Dependencies` fields — read each `tasks/TASK-xxx.md`:
27
+ - Wave 1: tasks where `Dependencies: none` (or all deps already `done`)
28
+ - Wave 2: tasks whose deps are all in Wave 1
29
+ - Wave N+1: tasks whose deps are all in Wave N or earlier
30
+
31
+ ## Step 3 — Execute wave by wave
32
+
33
+ For each wave:
34
+
35
+ ### 3a — Create worktrees (branch from `handoff/integration`)
36
+ ```bash
37
+ # For each task in this wave:
38
+ git worktree add -b handoff/task-xxx .worktrees/task-xxx handoff/integration
39
+ # (omit -b if branch already exists; worktrees stay open until review-handoff cleans up)
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
+ Run: cd .worktrees/task-xxx && <test command>
52
+ Confirm RED (if immediately GREEN → test is wrong or feature already exists — flag this)
53
+ 2. Implement → run → confirm GREEN
54
+ 3. Run §Verification Commands from INSIDE the worktree:
55
+ cd .worktrees/task-xxx && <each verification command>
56
+ Paste full output.
57
+
58
+ Commit in worktree (required before reporting):
59
+ git -C .worktrees/task-xxx add -A
60
+ git -C .worktrees/task-xxx commit -m "feat(TASK-xxx): <intent from task §1>"
61
+
62
+ Executor Report (append to task file — do NOT touch INDEX.md):
63
+ ## Executor Report
64
+ EXECUTOR_TOOL: <tool name>
65
+ EXECUTOR_MODEL: <exact model ID — mandatory, reviewer will refuse if missing>
66
+ EXECUTOR_SUBAGENT: <subagent name or "-">
67
+ Verification Output: <paste>
68
+ Status: PASS | FAIL
69
+ Note: <any issues, or "none">
70
+ ```
71
+
72
+ > Claude Code: spawn `feature-implementer` agents in parallel (one per task).
73
+ > Other tools: open each task in a separate session with code model.
74
+
75
+ ### 3c — After all tasks in wave report back (orchestrator)
76
+
77
+ For each task:
78
+ - If `Status: PASS` AND `EXECUTOR_MODEL` present → merge into integration:
79
+ ```bash
80
+ if git merge handoff/task-xxx --no-ff -m "wave-merge(TASK-xxx)" --no-commit 2>/dev/null; then
81
+ git commit -m "wave-merge(TASK-xxx)"
82
+ # update INDEX.md: status → pending_review
83
+ else
84
+ git merge --abort
85
+ # update INDEX.md: status → merge_conflict
86
+ # append to task §Discussion: "merge_conflict with <previously merged tasks in this wave>"
87
+ # report to human: rebase handoff/task-xxx on handoff/integration, re-run
88
+ fi
89
+ ```
90
+ - If `Status: FAIL` → update INDEX.md: status → `blocked`
91
+ - If `EXECUTOR_MODEL` missing → update INDEX.md: status → `needs_executor_report`; do not set pending_review
92
+
93
+ **Orchestrator writes INDEX.md** — agents never touch INDEX directly.
94
+
95
+ ### 3d — Next wave
96
+ Branch new wave worktrees from `handoff/integration` (which now includes Wave N's code).
97
+ Repeat 3a–3c.
98
+
99
+ ## Step 4 — Report
100
+
101
+ ```
102
+ Wave summary:
103
+ Wave 1: TASK-001 [pending_review], TASK-002 [blocked]
104
+ Wave 2: TASK-003 [pending_review]
105
+ Merge conflicts: none | TASK-xxx (needs rebase)
106
+ Worktrees open: .worktrees/task-001, .worktrees/task-003
107
+ ```
55
108
 
56
109
  **Next:** switch to strong model → `/ukit:review-handoff`
@@ -10,63 +10,108 @@ _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
+ ## Step 2 — Review each task
20
+
21
+ **IMPORTANT: run tasks sequentially (not parallel) to avoid INDEX.md race conditions.**
22
+
23
+ For each task:
24
+
25
+ ### 2a — Model isolation check (do this first, always)
26
+
27
+ Read `EXECUTOR_MODEL` from `## Executor Report` in task file.
28
+
29
+ | Executor model | Your model | Action |
30
+ |----------------|------------|--------|
31
+ | present, ≠ yours | present | proceed |
32
+ | present, == yours | present | REFUSE → `changes_requested`: "reviewer model must differ from executor" |
33
+ | missing / blank | any | REFUSE → `changes_requested`: "EXECUTOR_MODEL not reported — executor must re-run and fill in" |
34
+ | "unknown" | present | proceed, add NOTES: "executor model unverified — human confirm before merge" |
35
+
36
+ ### 2b — Re-run verification (in the worktree, not main)
37
+
38
+ ```bash
39
+ # Run INSIDE the task's worktree — not from root:
40
+ cd .worktrees/task-xxx
41
+ <each command from §Verification Commands>
42
+ ```
43
+
44
+ If any command fails → verdict: `critical_block`. Stop — do not review code.
45
+
46
+ ### 2c — Review diff
47
+
48
+ ```bash
49
+ # What this task added on top of its wave base:
50
+ BASE_OF_TASK=$(git merge-base handoff/integration handoff/task-xxx)
51
+ git diff $BASE_OF_TASK..handoff/task-xxx
52
+ ```
53
+
54
+ Check: correctness, regression risk, security, edge cases, maintainability.
55
+
56
+ ### 2d — Append verdict to task file
57
+
58
+ ```
59
+ ## Reviewer Verdict
60
+ VERDICT: approved | approved_minor | changes_requested | critical_block
61
+ REVIEWER_MODEL: <your exact model ID>
62
+ EXECUTOR_MODEL: <from Executor Report>
63
+ VERIFICATION_RERUN: PASS | FAIL
64
+ FINDINGS:
65
+ critical: <file:line — what fails> | none
66
+ important: <file:line — risk> | none
67
+ minor: <style/naming> | none
68
+ NEXT_STATUS_FOR_INDEX: approved | approved_minor | changes_requested | critical_block
69
+ ```
70
+
71
+ ### 2e — Orchestrator updates INDEX.md
72
+
73
+ Set `status = NEXT_STATUS_FOR_INDEX` for this task.
74
+ (Reviewer writes verdict to task file; orchestrator writes INDEX — same principle as implement.)
75
+
76
+ ## Step 3 — After all tasks reviewed: handle integration
77
+
78
+ **Only if all tasks are `approved` or `approved_minor`:**
79
+
80
+ ```bash
81
+ # Merge integration → BASE (single merge, one clean history entry)
82
+ git checkout $BASE
83
+ if git merge handoff/integration --no-ff -m "feat: handoff cycle complete"; then
84
+ # Cleanup all task worktrees + branches
85
+ for task in $(git worktree list | grep '.worktrees/task-' | awk '{print $1}'); do
86
+ name=$(basename $task)
87
+ git worktree remove $task --force
88
+ git branch -d handoff/$name 2>/dev/null || git branch -D handoff/$name
89
+ done
90
+ git branch -d handoff/integration
91
+ # INDEX.md: all approved tasks → done
92
+ else
93
+ git merge --abort
94
+ # Report: unexpected conflict on integration→BASE merge. Human must resolve manually.
95
+ fi
96
+ ```
97
+
98
+ **If any task has `changes_requested` or `critical_block`:**
99
+ Keep all worktrees and integration branch open.
100
+ Report which tasks need fixes.
101
+
102
+ ## Step 4 — Report
103
+
104
+ ```
105
+ Review summary:
106
+ TASK-001: approved — merged
107
+ TASK-002: changes_requested — see §Discussion
108
+ Integration: pending (TASK-002 needs fix first)
109
+ Worktrees remaining: .worktrees/task-002
110
+ ```
69
111
 
70
112
  **Next:**
71
- - All done → `/ukit:clear-handoff`
72
- - Has fixes → executor runs `/ukit:implement-handoff TASK-xxx`
113
+ - All approved + merged → `/ukit:clear-handoff`
114
+ - Has fixes → executor re-runs `/ukit:implement-handoff TASK-xxx`
115
+
116
+ > Claude Code: spawn `code-reviewer` agent (opus) per task for Steps 2a–2e. Orchestrator handles Steps 1, 2e (INDEX write), and Step 3.
117
+ > Other tools: use 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.