@ngockhoale/ukit 2.1.4 → 2.2.1
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/CHANGELOG.md +44 -0
- package/README.md +7 -4
- package/manifests/platform.full.yaml +113 -24
- package/package.json +4 -3
- package/src/cli/adapters.js +47 -21
- package/src/cli/index.js +2 -2
- package/src/core/applyPlan.js +5 -2
- package/src/core/ensureGitignore.js +2 -0
- package/src/core/runInstallPipeline.js +19 -0
- package/src/core/runtimeConfig.js +12 -2
- package/src/core/status.js +3 -1
- package/src/core/uninstall.js +16 -0
- package/src/index/routeCatalog.js +1 -1
- package/src/index/taskRouting.js +9 -2
- package/src/manifest/selectItems.js +11 -5
- package/templates/.claude/agents/code-reviewer.md +42 -1
- package/templates/.claude/commands/ukit/handoff-create.md +6 -4
- package/templates/.claude/commands/ukit/handoff-fullstack.md +12 -10
- package/templates/.claude/commands/ukit/handoff-implement.md +4 -2
- package/templates/.claude/commands/ukit/handoff-review.md +4 -2
- package/templates/.claude/ukit/index/route-catalog.mjs +1 -1
- package/templates/.claude/ukit/index/unic-gateway.mjs +46 -7
- package/templates/.codex/README.md +1 -1
- package/templates/.gitignore +2 -0
- package/templates/.omp/AGENTS.md +9 -0
- package/templates/.omp/README.md +96 -0
- package/templates/.omp/RULES.md +34 -0
- package/templates/.omp/agents/bug-debugger.md +85 -0
- package/templates/.omp/agents/code-reviewer.md +197 -0
- package/templates/.omp/agents/feature-implementer.md +123 -0
- package/templates/.omp/agents/handoff-planner.md +210 -0
- package/templates/.omp/agents/ukit-small-task-maintainer.md +72 -0
- package/templates/.omp/agents/ukit-vision-analyst.md +100 -0
- package/templates/.omp/config.yml +88 -0
- package/templates/.omp/hooks/pre/ukit-bridge.js +336 -0
- package/templates/AGENTS.md +2 -2
- package/templates/CLAUDE.md +8 -0
- package/templates/docs/PROJECT.md +1 -1
- package/templates/ukit/storage/config.json +18 -3
- package/templates/adapter-presets/antigravity/README.md +0 -22
- package/templates/adapter-presets/antigravity/rules.md +0 -49
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export const OPTIONAL_ADAPTER_ITEM_IDS = new Set([
|
|
2
|
-
'multi-antigravity-skills-link',
|
|
3
|
-
'multi-antigravity-ukit-link',
|
|
4
|
-
'multi-antigravity-rules',
|
|
5
|
-
'multi-antigravity-readme',
|
|
6
|
-
'multi-antigravity-agents-link',
|
|
7
2
|
'multi-codex-skills-link',
|
|
8
3
|
'multi-codex-ukit-link',
|
|
9
4
|
'multi-codex-readme',
|
|
@@ -11,6 +6,17 @@ export const OPTIONAL_ADAPTER_ITEM_IDS = new Set([
|
|
|
11
6
|
'multi-codex-settings-local',
|
|
12
7
|
'multi-codex-agents-link',
|
|
13
8
|
'multi-opencode-config',
|
|
9
|
+
'multi-omp-agents-md',
|
|
10
|
+
'multi-omp-rules',
|
|
11
|
+
'multi-omp-config',
|
|
12
|
+
'multi-omp-readme',
|
|
13
|
+
'multi-omp-hook-bridge',
|
|
14
|
+
'multi-omp-agent-bug-debugger',
|
|
15
|
+
'multi-omp-agent-code-reviewer',
|
|
16
|
+
'multi-omp-agent-feature-implementer',
|
|
17
|
+
'multi-omp-agent-handoff-planner',
|
|
18
|
+
'multi-omp-agent-ukit-small-task-maintainer',
|
|
19
|
+
'multi-omp-agent-ukit-vision-analyst',
|
|
14
20
|
]);
|
|
15
21
|
|
|
16
22
|
function resolveItemOrder(items) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
description: "Independent reviewer for handoff Phase 3,
|
|
3
|
+
description: "Independent reviewer for handoff Phase 3, for spec/plan documents, and for non-blocking sidecar diff review of daily-flow edits. For code (default): use after executor reports STATUS: DONE on a handoff task, MUST run with a model different from the executor (configured in .ukit/storage/config.json → handoff.reviewer.model, default unic-smart), produces a verdict: APPROVED | APPROVED-WITH-MINOR | CHANGES-REQUESTED | CRITICAL. For spec/plan documents (set REVIEW_TARGET_TYPE=spec or plan): reviews a docs/plans/*.md file for completeness/consistency/clarity/scope/YAGNI, produces Status: Approved | Issues Found. For sidecar diff review (set REVIEW_TARGET_TYPE=diff): reviews the current uncommitted git diff after a local-build/shared-edit task, runs in the background and never blocks the main task, produces STATUS: clean | issues-found."
|
|
4
4
|
model: opus # unic-smart
|
|
5
5
|
color: yellow
|
|
6
6
|
tools: ["Read", "Grep", "Glob", "Bash"]
|
|
@@ -14,6 +14,7 @@ You are the independent reviewer for UKit's handoff Quality Gate. Your model is
|
|
|
14
14
|
|
|
15
15
|
- `code` (default, if not specified) — reviewing a handoff task diff. Follow **Code Review** below, unchanged.
|
|
16
16
|
- `spec` | `plan` — reviewing a document (e.g. `docs/plans/*.md`), no diff/task file/executor report involved. Skip straight to **Spec/Plan Review** at the end of this file instead.
|
|
17
|
+
- `diff` — non-blocking sidecar review of the current uncommitted diff in the daily (non-handoff) flow. No task file/executor report/model-isolation check involved. Skip straight to **Sidecar Diff Review** at the end of this file instead.
|
|
17
18
|
|
|
18
19
|
## Code Review (REVIEW_TARGET_TYPE=code)
|
|
19
20
|
|
|
@@ -155,3 +156,43 @@ NOTES: [1-2 sentences if needed]
|
|
|
155
156
|
```
|
|
156
157
|
|
|
157
158
|
`<N>` = 1 + however many `### Round` entries already exist in the log (1 if this is the first review).
|
|
159
|
+
|
|
160
|
+
## Sidecar Diff Review (REVIEW_TARGET_TYPE=diff)
|
|
161
|
+
|
|
162
|
+
This mode exists so a weaker daily-flow executor model still gets a second pair of eyes,
|
|
163
|
+
without adding wait time to the main task. You are launched in the background right after
|
|
164
|
+
the main task already has write + verification evidence; the caller is not waiting on you.
|
|
165
|
+
|
|
166
|
+
### Inputs you expect
|
|
167
|
+
|
|
168
|
+
- No task file, no executor report, no model-isolation check. Just read the current uncommitted
|
|
169
|
+
diff yourself: `git diff` (and `git diff --stat` for an overview). If there is no diff, report
|
|
170
|
+
`STATUS: clean` with `FINDINGS: none` and stop.
|
|
171
|
+
|
|
172
|
+
### Review order
|
|
173
|
+
|
|
174
|
+
Apply the same lenses as Code Review's steps 2-6, scoped to what the diff actually touches:
|
|
175
|
+
|
|
176
|
+
1. **Correctness** — Does the diff do what it looks like it's trying to do? Wrong assumptions, stale refs, missing cases?
|
|
177
|
+
2. **Regression risk** — Any existing behavior/tests/contracts this plausibly breaks?
|
|
178
|
+
3. **Safety / security / data loss** — Destructive actions, auth/permission, path handling, unsafe shell/DB/file ops.
|
|
179
|
+
4. **Performance / scale** — Accidental N+1, repeated I/O, large scans in hot paths.
|
|
180
|
+
5. **Maintainability** — Duplicated logic, dead branches, misleading naming, drift between docs/tests/source.
|
|
181
|
+
|
|
182
|
+
Do not re-run the project's full verification suite here — this is an advisory pass, not a gate.
|
|
183
|
+
You may read files for context but this mode never edits anything.
|
|
184
|
+
|
|
185
|
+
### Output
|
|
186
|
+
|
|
187
|
+
Keep it short — this is a quick advisory pass, not a full verdict:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
STATUS: clean | issues-found
|
|
191
|
+
FINDINGS:
|
|
192
|
+
- file:line — what's wrong, why it matters
|
|
193
|
+
NOTES: [advisory only, non-blocking — 1 sentence if needed]
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
There is no task file or INDEX.md to update in this mode. Findings are advisory only: the main
|
|
197
|
+
task is not blocked on this review and may already be reported done by the time you finish.
|
|
198
|
+
Report back to the caller in a few lines; do not paste the full diff.
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# /ukit:handoff-create — Phase 1 + 2: Plan
|
|
2
2
|
|
|
3
3
|
**Role: PLANNER**
|
|
4
|
-
**Tool: any** (Claude Code / Codex /
|
|
4
|
+
**Tool: any** (Claude Code / Codex / omp / Kilo / OpenCode — your choice)
|
|
5
5
|
**Model split:**
|
|
6
6
|
- Read/understand → lite model (haiku · unic-lite · cheapest available)
|
|
7
7
|
- Write plan + tasks → strong model (Opus · unic-smart · strongest available)
|
|
8
8
|
|
|
9
|
+
> **omp model tiers:** the tiers above map to `.omp/config.yml`'s `modelRoles`, referenced from agent frontmatter as `@lite` / `@code` / `@smart`.
|
|
10
|
+
|
|
9
11
|
## Problem / feature
|
|
10
12
|
$ARGUMENTS
|
|
11
13
|
|
|
@@ -39,7 +41,7 @@ After the batched call, run Steps 1–2.5 to completion without further question
|
|
|
39
41
|
|
|
40
42
|
## Step 1 — Read context (lite model)
|
|
41
43
|
|
|
42
|
-
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"
|
|
44
|
+
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`). Do NOT read these files yourself in the current session — this step is contracted to the lite tier (haiku/unic-lite), which only the spawned agent's frontmatter model guarantees. Ask the agent to:
|
|
43
45
|
|
|
44
46
|
1. Read `docs/AI_HANDOFF/INDEX.md` → current tasks + statuses (or "empty")
|
|
45
47
|
2. Read `docs/AI_HANDOFF/ACTIVE.md` → active cycle info (or "no active cycle")
|
|
@@ -53,7 +55,7 @@ After the batched call, run Steps 1–2.5 to completion without further question
|
|
|
53
55
|
|
|
54
56
|
## Step 2 — Write plan + tasks (strong model)
|
|
55
57
|
|
|
56
|
-
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "handoff-planner"
|
|
58
|
+
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "handoff-planner"` (omp: the `task` tool with `agent: "handoff-planner"`), passing it the Step 1 summary and the problem/feature description. Do NOT write PLAN.md or task files yourself in the current session — this step is contracted to the strong tier (opus/unic-smart), which only the spawned agent's frontmatter model guarantees.
|
|
57
59
|
|
|
58
60
|
The planner agent does the following (use Step 1 summary — do NOT re-read files):
|
|
59
61
|
|
|
@@ -119,7 +121,7 @@ The planner agent does the following (use Step 1 summary — do NOT re-read file
|
|
|
119
121
|
Two independent strong-model passes shape the plan before any code is written — that gate is
|
|
120
122
|
intact. What it no longer does is hand a stalled plan back and wait.
|
|
121
123
|
|
|
122
|
-
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "code-reviewer"
|
|
124
|
+
**Claude Code — MANDATORY, do this before anything else:** call the Agent tool with `subagent_type: "code-reviewer"` (omp: the `task` tool with `agent: "code-reviewer"`), passing `REVIEW_TARGET_TYPE=plan` and the path to `docs/AI_HANDOFF/PLAN.md`. This MUST be a separate agent invocation from Step 2's `handoff-planner` call (fresh context) — same-session self-review defeats the purpose of an independent gate.
|
|
123
125
|
|
|
124
126
|
1. Reviewer reads `PLAN.md` only (no diff, no task files, no executor report), checks Completeness / Consistency / Clarity / Scope / YAGNI — see `.claude/agents/code-reviewer.md` → Spec/Plan Review — and appends its verdict to PLAN.md's `## Plan Review Log` (new round entry, prior rounds kept).
|
|
125
127
|
2. `Issues Found` → route back to Step 2: planner revises `PLAN.md` and the affected `TASK-xxx.md` files to address every finding, then re-submit for another Step 2.5 review (this becomes the next round). Do NOT commit or hand off to executor on `Issues Found`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# /ukit:handoff-fullstack — Full Pipeline: Plan → Implement → Review
|
|
2
2
|
|
|
3
3
|
**Role: ORCHESTRATOR**
|
|
4
|
-
**Tool: any** (Claude Code / Codex / Kilo / OpenCode — your choice)
|
|
4
|
+
**Tool: any** (Claude Code / Codex / omp / Kilo / OpenCode — your choice)
|
|
5
5
|
|
|
6
6
|
## Model Split
|
|
7
7
|
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
> Claude Code: spawn `ukit-small-task-maintainer` (haiku) for light steps; spawn `handoff-planner` (opus) for planning; spawn `feature-implementer` (sonnet) agents for implementation; spawn `code-reviewer` (opus) per task for review.
|
|
15
15
|
|
|
16
|
+
> **omp model tiers:** the tiers above map to `.omp/config.yml`'s `modelRoles`, referenced from agent frontmatter as `@lite` / `@code` / `@smart`.
|
|
17
|
+
|
|
16
18
|
---
|
|
17
19
|
|
|
18
20
|
## Problem / feature
|
|
@@ -86,7 +88,7 @@ Only when `RUN.md` is absent or `Phase: done` does `$ARGUMENTS` start a fresh cy
|
|
|
86
88
|
|
|
87
89
|
### P1 — Read context (lite model)
|
|
88
90
|
|
|
89
|
-
**Claude Code — MANDATORY, do this before anything else in P1:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"
|
|
91
|
+
**Claude Code — MANDATORY, do this before anything else in P1:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`). Do NOT read these files yourself in the current session — this step is contracted to the lite tier (haiku/unic-lite), which only the spawned agent's frontmatter model guarantees. Ask it to return a compact summary of:
|
|
90
92
|
|
|
91
93
|
1. `docs/AI_HANDOFF/INDEX.md` — current tasks + statuses (or "empty / no tasks")
|
|
92
94
|
2. `docs/AI_HANDOFF/ACTIVE.md` — active cycle info (or "no active cycle")
|
|
@@ -99,7 +101,7 @@ Return a compact summary. Do NOT write any files yet.
|
|
|
99
101
|
|
|
100
102
|
### P2 — Write PLAN.md + task files (strong model)
|
|
101
103
|
|
|
102
|
-
**Claude Code — MANDATORY, do this before anything else in P2:** call the Agent tool with `subagent_type: "handoff-planner"
|
|
104
|
+
**Claude Code — MANDATORY, do this before anything else in P2:** call the Agent tool with `subagent_type: "handoff-planner"` (omp: the `task` tool with `agent: "handoff-planner"`), passing it the P1 summary and `$ARGUMENTS`. Do NOT write PLAN.md or task files yourself in the current session — this step is contracted to the strong tier (opus/unic-smart), which only the spawned agent's frontmatter model guarantees.
|
|
103
105
|
|
|
104
106
|
The planner agent does the following (use P1 summary — do NOT re-read files):
|
|
105
107
|
|
|
@@ -160,7 +162,7 @@ The planner agent does the following (use P1 summary — do NOT re-read files):
|
|
|
160
162
|
The gate still does its job — two independent opus passes shape the plan before a line of code
|
|
161
163
|
is written. What it no longer does is hand a stalled plan back to a human who isn't there.
|
|
162
164
|
|
|
163
|
-
**Claude Code — MANDATORY, do this before anything else in P2.5:** call the Agent tool with `subagent_type: "code-reviewer"
|
|
165
|
+
**Claude Code — MANDATORY, do this before anything else in P2.5:** call the Agent tool with `subagent_type: "code-reviewer"` (omp: the `task` tool with `agent: "code-reviewer"`), passing `REVIEW_TARGET_TYPE=plan` and the path to `docs/AI_HANDOFF/PLAN.md`. This MUST be a separate agent invocation from P2's `handoff-planner` call (fresh context) — same-session self-review defeats the purpose of an independent gate.
|
|
164
166
|
|
|
165
167
|
1. Reviewer reads `PLAN.md` only (no diff, no task files, no executor report), checks Completeness / Consistency / Clarity / Scope / YAGNI — see `.claude/agents/code-reviewer.md` → Spec/Plan Review — and appends its verdict to PLAN.md's `## Plan Review Log` (new round entry, prior rounds kept).
|
|
166
168
|
2. `Issues Found` → route back to P2: `handoff-planner` revises `PLAN.md` and the affected `TASK-xxx.md` files to address every finding, then re-submit for one more P2.5 review round — subject to the loop cap above.
|
|
@@ -170,7 +172,7 @@ is written. What it no longer does is hand a stalled plan back to a human who is
|
|
|
170
172
|
|
|
171
173
|
### P3 — Commit the plan (lite model)
|
|
172
174
|
|
|
173
|
-
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` for this commit step (lite tier — haiku/unic-lite). Run:
|
|
175
|
+
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`) for this commit step (lite tier — haiku/unic-lite). Run:
|
|
174
176
|
```bash
|
|
175
177
|
git add docs/AI_HANDOFF/ && git commit -m "handoff: plan — <goal>"
|
|
176
178
|
```
|
|
@@ -185,7 +187,7 @@ Replace `<goal>` with the one-sentence goal from ACTIVE.md. This locks the plan
|
|
|
185
187
|
|
|
186
188
|
### I1 — Setup + verify (lite model)
|
|
187
189
|
|
|
188
|
-
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` for I1. Ask it to read:
|
|
190
|
+
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`) for I1. Ask it to read:
|
|
189
191
|
- `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`
|
|
190
192
|
- `docs/AI_HANDOFF/INDEX.md` → collect all `ready` tasks
|
|
191
193
|
|
|
@@ -234,7 +236,7 @@ leaves worktrees behind. Batching only ever narrows a wave, never reorders acros
|
|
|
234
236
|
|
|
235
237
|
### I3 — Execute wave by wave (code model agents)
|
|
236
238
|
|
|
237
|
-
**Claude Code — MANDATORY, do this before anything else in I3:** for each wave, call the Agent tool once per task **in the current batch** (in parallel, at most `handoff.maxParallelAgents`), each with `subagent_type: "feature-implementer"
|
|
239
|
+
**Claude Code — MANDATORY, do this before anything else in I3:** for each wave, call the Agent tool once per task **in the current batch** (in parallel, at most `handoff.maxParallelAgents`), each with `subagent_type: "feature-implementer"` (omp: the `task` tool with `agent: "feature-implementer"`, likewise invoked once per task in the batch, not once per wave). Do NOT implement the tasks yourself in the current session — this step is contracted to the code tier (sonnet/unic-code), which only the spawned agent's frontmatter model guarantees.
|
|
238
240
|
|
|
239
241
|
For each wave:
|
|
240
242
|
|
|
@@ -356,7 +358,7 @@ logs used to cost. That difference is what makes a multi-wave cycle finish in on
|
|
|
356
358
|
|
|
357
359
|
### I4 — Consolidate + update INDEX (lite model)
|
|
358
360
|
|
|
359
|
-
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` for I4. After all waves complete, ask it to:
|
|
361
|
+
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`) for I4. After all waves complete, ask it to:
|
|
360
362
|
|
|
361
363
|
1. Update `docs/AI_HANDOFF/INDEX.md`:
|
|
362
364
|
- PASS tasks → `pending_review`
|
|
@@ -376,7 +378,7 @@ logs used to cost. That difference is what makes a multi-wave cycle finish in on
|
|
|
376
378
|
|
|
377
379
|
### R1 — Setup (lite model)
|
|
378
380
|
|
|
379
|
-
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` for the R1 reads. Ask it to read:
|
|
381
|
+
**Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`) for the R1 reads. Ask it to read:
|
|
380
382
|
- `docs/AI_HANDOFF/ACTIVE.md` → get `Base: <BASE>`
|
|
381
383
|
- `docs/AI_HANDOFF/INDEX.md` → collect `pending_review` tasks
|
|
382
384
|
|
|
@@ -400,7 +402,7 @@ If that diff is empty → implement was not completed. Do not stop: re-enter Pha
|
|
|
400
402
|
|
|
401
403
|
**Batch the review set — mandatory.** Read `handoff.maxParallelAgents` from `.ukit/storage/config.json`. If more `pending_review` tasks exist than that, split into consecutive batches of at most that many; finish one batch's verdicts (R2–R4, appended to each task file) before starting the next.
|
|
402
404
|
|
|
403
|
-
**Claude Code — MANDATORY, do this before anything else in R2–R4:** for each batch, call the Agent tool once per `pending_review` task **in parallel** (at most `handoff.maxParallelAgents`), each with `subagent_type: "code-reviewer"
|
|
405
|
+
**Claude Code — MANDATORY, do this before anything else in R2–R4:** for each batch, call the Agent tool once per `pending_review` task **in parallel** (at most `handoff.maxParallelAgents`), each with `subagent_type: "code-reviewer"` (omp: the `task` tool with `agent: "code-reviewer"`, likewise invoked once per task in the batch, not once per wave). Reviewer agents only read the diff and append a verdict to their own task file — no worktree, no shared write target — so running them in parallel carries none of Phase 3's file-conflict risk. Do NOT review the diff yourself in the current session — this step is contracted to the strong tier (opus/unic-smart) and MUST differ from the executor's model, which only the spawned agent's frontmatter model guarantees.
|
|
404
406
|
|
|
405
407
|
The spawned reviewer agent reads `EXECUTOR_MODEL` from each task file `## Executor Report`:
|
|
406
408
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# /ukit:handoff-implement — Phase 3: Execute
|
|
2
2
|
|
|
3
3
|
**Role: EXECUTOR (orchestrated)**
|
|
4
|
-
**Tool: any** (Claude Code / Codex /
|
|
4
|
+
**Tool: any** (Claude Code / Codex / omp / Kilo / OpenCode — your choice)
|
|
5
5
|
**Model: code model** (Sonnet · unic-code · cheap-smart)
|
|
6
6
|
|
|
7
|
+
> **omp model tiers:** the tiers above map to `.omp/config.yml`'s `modelRoles`, referenced from agent frontmatter as `@lite` / `@code` / `@smart`.
|
|
8
|
+
|
|
7
9
|
## Target (optional)
|
|
8
10
|
$ARGUMENTS
|
|
9
11
|
_Empty = all `ready` tasks. Or: "TASK-001" for a specific task._
|
|
@@ -117,7 +119,7 @@ git worktree add -b handoff/task-xxx .worktrees/task-xxx $BASE
|
|
|
117
119
|
|
|
118
120
|
### 3b — Run tasks in parallel (one agent/session per task)
|
|
119
121
|
|
|
120
|
-
**Claude Code — MANDATORY, do this before anything else in this wave:** call the Agent tool once per task **in the current batch** (in parallel, at most `handoff.maxParallelAgents`), each with `subagent_type: "feature-implementer"
|
|
122
|
+
**Claude Code — MANDATORY, do this before anything else in this wave:** call the Agent tool once per task **in the current batch** (in parallel, at most `handoff.maxParallelAgents`), each with `subagent_type: "feature-implementer"` (omp: the `task` tool with `agent: "feature-implementer"`, likewise invoked once per task in the batch, not once per wave). Do NOT implement the tasks yourself in the current session — this step is contracted to the code tier (sonnet/unic-code), which only the spawned agent's frontmatter model guarantees.
|
|
121
123
|
|
|
122
124
|
Each spawned agent works independently in its own worktree — **NO git commit, NO git add**:
|
|
123
125
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# /ukit:handoff-review — Phase 4: Review
|
|
2
2
|
|
|
3
3
|
**Role: REVIEWER**
|
|
4
|
-
**Tool: any** (Claude Code / Codex /
|
|
4
|
+
**Tool: any** (Claude Code / Codex / omp / Kilo / OpenCode — your choice)
|
|
5
5
|
**Model: strong model, MUST differ from executor** (Opus · unic-smart · strongest available)
|
|
6
6
|
|
|
7
|
+
> **omp model tiers:** the tiers above map to `.omp/config.yml`'s `modelRoles`, referenced from agent frontmatter as `@lite` / `@code` / `@smart`.
|
|
8
|
+
|
|
7
9
|
## Target (optional)
|
|
8
10
|
$ARGUMENTS
|
|
9
11
|
_Empty = all `pending_review` tasks. Or: "TASK-001" for a specific task._
|
|
@@ -52,7 +54,7 @@ If that diff is empty → handoff-implement was not completed. Report which task
|
|
|
52
54
|
|
|
53
55
|
**Batch the review set — mandatory.** Read `handoff.maxParallelAgents` from `.ukit/storage/config.json`. If more `pending_review` tasks exist than that, split into consecutive batches of at most that many; finish one batch's verdicts (2a–2d, appended to each task file) before starting the next.
|
|
54
56
|
|
|
55
|
-
**Claude Code — MANDATORY, do this before anything else:** for each batch, call the Agent tool once per `pending_review` task **in parallel** (at most `handoff.maxParallelAgents`), each with `subagent_type: "code-reviewer"
|
|
57
|
+
**Claude Code — MANDATORY, do this before anything else:** for each batch, call the Agent tool once per `pending_review` task **in parallel** (at most `handoff.maxParallelAgents`), each with `subagent_type: "code-reviewer"` (omp: the `task` tool with `agent: "code-reviewer"`, likewise invoked once per task in the batch, not once per wave). Reviewer agents only read the diff and append a verdict to their own task file — no worktree, no shared write target — so running them in parallel carries none of Phase 3's file-conflict risk. Do NOT review the diff yourself in the current session — this step is contracted to the strong tier (opus/unic-smart) and MUST differ from the executor's model, which only the spawned agent's frontmatter model guarantees. Pass each agent: the task file path, the executor's report, and the diff.
|
|
56
58
|
|
|
57
59
|
The spawned reviewer agent performs 2a–2d below per task:
|
|
58
60
|
|
|
@@ -256,7 +256,7 @@ export const ROUTE_CATALOG = [
|
|
|
256
256
|
signals: [
|
|
257
257
|
{ type: 'prompt', regex: /\b(stale|refresh|cleanup|reinstall|maintenance|workspace drift|index freshness|out of date)\b/i, score: 4 },
|
|
258
258
|
{ type: 'command', regex: /\bukit install\b|\brefresh-index\.mjs\b|\bbuild-index\.mjs\b/i, score: 3 },
|
|
259
|
-
{ type: 'file', regex: /\.claude\/|\.codex\/|\.antigravity\//i, score: 1 },
|
|
259
|
+
{ type: 'file', regex: /\.claude\/|\.codex\/|\.antigravity\/|\.omp\//i, score: 1 },
|
|
260
260
|
],
|
|
261
261
|
},
|
|
262
262
|
{
|
|
@@ -13,14 +13,27 @@
|
|
|
13
13
|
* 1. process.env.ANTHROPIC_BASE_URL -> 'env'
|
|
14
14
|
* 2. project .claude/settings.json -> env.ANTHROPIC_BASE_URL -> 'claude-settings'
|
|
15
15
|
* 3. ~/.claude/settings.json -> env.ANTHROPIC_BASE_URL -> 'claude-settings'
|
|
16
|
+
* 4. process.env.OMP_BASE_URL (TASK-004, name unverified) -> 'omp-env'
|
|
17
|
+
* 5. project .omp/config.yml -> baseUrl (TASK-004, key unverified) -> 'omp-config'
|
|
16
18
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* Every probe here (including the two omp probes) is scoped to what changes the CALLING
|
|
20
|
+
* runtime's OWN outbound endpoint — same rule that already governs probes 1-3. Cross-tool
|
|
21
|
+
* configs are NOT probed. This module is only ever invoked from Claude Code / omp hooks
|
|
22
|
+
* (vision-router.sh, vision-gate.sh, route-task.mjs, and the omp bridge) to gate what THIS
|
|
23
|
+
* session does — a Codex `config.toml` `base_url`, a Kilo `secrets.json` endpoint, or an
|
|
24
|
+
* `OPENAI_BASE_URL` env var describe a completely different tool's outbound endpoint and say
|
|
25
|
+
* nothing about where Claude Code or omp itself is sending requests. Treating them as evidence
|
|
26
|
+
* produced permanent false positives (any machine with Codex/Kilo pointed at the UNIC gateway
|
|
27
|
+
* would report `unicMode: true` for every plain Claude Code session, deadlocking Edit/Write on
|
|
28
|
+
* any image-mentioning turn).
|
|
29
|
+
*
|
|
30
|
+
* Fail-safe direction (do not re-flip this): `unicMode` keeps BINARY semantics on every runtime
|
|
31
|
+
* — `unicMode = sources.length > 0`, default `false`. Inconclusive detection never resolves to
|
|
32
|
+
* `true`. The "assume UNIC when ambiguous" fail-safe some tools want belongs ONLY to the static
|
|
33
|
+
* `modelRoles` values TASK-003 writes unconditionally into `templates/.omp/config.yml`
|
|
34
|
+
* (`@vision: unic-vision`, no probe involved) — never to this module's boolean, because this
|
|
35
|
+
* module is shared by every runtime and flipping its default would make Codex/Kilo/OPENAI_BASE_URL
|
|
36
|
+
* sessions with zero omp/Claude signal start false-positively reporting UNIC mode.
|
|
24
37
|
*
|
|
25
38
|
* Contract: this module must NEVER throw and must NEVER exit non-zero, in any case (missing files,
|
|
26
39
|
* malformed JSON, unreadable paths, etc. all degrade to a clean "no hit").
|
|
@@ -38,6 +51,22 @@ import { fileURLToPath } from 'node:url';
|
|
|
38
51
|
const UNIC_TOKEN = 'unicjsc.com';
|
|
39
52
|
const VISION_MODEL_ALIAS = 'unic-vision';
|
|
40
53
|
|
|
54
|
+
// TODO(verify): omp's own base-URL env var name is a guess -- omp is not installed on this
|
|
55
|
+
// machine and no source/schema is vendored, so this has never been confirmed against a real
|
|
56
|
+
// omp runtime. Resolve via TASK-008's manual smoke test before treating this as confirmed.
|
|
57
|
+
const OMP_BASE_URL_ENV_VAR = 'OMP_BASE_URL';
|
|
58
|
+
|
|
59
|
+
// TODO(verify): the `.omp/config.yml` key path (`baseUrl`, top-level) is a guess for the same
|
|
60
|
+
// reason as OMP_BASE_URL_ENV_VAR above. Deliberately matched with a narrow anchored regex
|
|
61
|
+
// instead of importing the `yaml` package at runtime -- this file is installed into end-user
|
|
62
|
+
// projects via `ukit install` and must not risk depending on `yaml` being resolvable from a
|
|
63
|
+
// target project's own node_modules tree for a single-key check. This mirrors the codebase's
|
|
64
|
+
// own established precedent for the analogous Codex `config.toml` probe (see git history:
|
|
65
|
+
// CODEX_BASE_URL_UNIC_RE, pre-TASK-007), which rejected a TOML parser dependency for the same
|
|
66
|
+
// reason and documented the trade-off: a malformed/unexpected file just degrades to no hit,
|
|
67
|
+
// which fails safe rather than throwing.
|
|
68
|
+
const OMP_CONFIG_BASE_URL_UNIC_RE = /^\s*baseUrl\s*:\s*["']?[^"'\r\n#]*unicjsc\.com[^"'\r\n#]*["']?\s*(?:#.*)?$/m;
|
|
69
|
+
|
|
41
70
|
function safeReadFile(filePath) {
|
|
42
71
|
try {
|
|
43
72
|
return fs.readFileSync(filePath, 'utf8');
|
|
@@ -84,6 +113,14 @@ function probeClaudeSettings(filePath) {
|
|
|
84
113
|
return typeof value === 'string' && value.includes(UNIC_TOKEN);
|
|
85
114
|
}
|
|
86
115
|
|
|
116
|
+
// Narrow anchored regex probe (no YAML parsing) for the omp config file's `baseUrl` key. A
|
|
117
|
+
// missing file, unreadable path, or malformed YAML all degrade to "no hit" -- never throws.
|
|
118
|
+
function probeOmpConfig(filePath) {
|
|
119
|
+
const raw = safeReadFile(filePath);
|
|
120
|
+
if (raw == null) return false;
|
|
121
|
+
return OMP_CONFIG_BASE_URL_UNIC_RE.test(raw);
|
|
122
|
+
}
|
|
123
|
+
|
|
87
124
|
/**
|
|
88
125
|
* Checks whether the Codex model catalog exists and, if so, whether it lists `unic-vision`.
|
|
89
126
|
* A missing/unreadable/malformed catalog is never an error — it degrades to "unknown" and the
|
|
@@ -126,6 +163,8 @@ export function detectUnicGateway(options = {}) {
|
|
|
126
163
|
() => recordHit(probeEnvVar('ANTHROPIC_BASE_URL'), 'env'),
|
|
127
164
|
() => recordHit(probeClaudeSettings(path.join(rootDir, '.claude', 'settings.json')), 'claude-settings'),
|
|
128
165
|
() => recordHit(probeClaudeSettings(path.join(homeDir, '.claude', 'settings.json')), 'claude-settings'),
|
|
166
|
+
() => recordHit(probeEnvVar(OMP_BASE_URL_ENV_VAR), 'omp-env'),
|
|
167
|
+
() => recordHit(probeOmpConfig(path.join(rootDir, '.omp', 'config.yml')), 'omp-config'),
|
|
129
168
|
];
|
|
130
169
|
for (const probe of probes) {
|
|
131
170
|
try {
|
|
@@ -8,7 +8,7 @@ Auto-generated by UKit for OpenAI Codex.
|
|
|
8
8
|
## Core UKit Rule
|
|
9
9
|
|
|
10
10
|
- Human-facing workflow should optimize for one remembered command: `ukit install`.
|
|
11
|
-
- After install, normal work should feel natural inside **Claude/Codex/OpenCode
|
|
11
|
+
- After install, normal work should feel natural inside **Claude/Codex/OpenCode/omp**.
|
|
12
12
|
- **Quality first, then speed, then token discipline**: do not waste reads, logs, or repeated helper output.
|
|
13
13
|
- **Never stop after read-only steps.** For implement/apply/fix requests, continue to actual Edit/Write and verification in the same turn.
|
|
14
14
|
|
package/templates/.gitignore
CHANGED
|
@@ -46,9 +46,11 @@ Thumbs.db
|
|
|
46
46
|
.claude/ukit/permission-usage.json
|
|
47
47
|
.claude/ukit/permission-audit.log
|
|
48
48
|
.cache/
|
|
49
|
+
# legacy: Antigravity adapter removed in v2.2.0; leftovers must stay ignored
|
|
49
50
|
.antigravity/
|
|
50
51
|
.claude/
|
|
51
52
|
.codex/
|
|
53
|
+
.omp/
|
|
52
54
|
.ukit/
|
|
53
55
|
opencode.json
|
|
54
56
|
AGENTS.md
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# .omp/AGENTS.md — thin import, not a copy
|
|
2
|
+
|
|
3
|
+
This file exists only so omp's native `.omp/AGENTS.md` provider (priority 100) does not shadow the
|
|
4
|
+
project-root `AGENTS.md` (agents-md provider, priority 10) with duplicated content. omp resolves `@`
|
|
5
|
+
imports relative to this file's own directory, so the single import line below pulls in the real,
|
|
6
|
+
single-source-of-truth project instructions from the repo root. Do not inline root `AGENTS.md`'s body
|
|
7
|
+
here — that would make root `AGENTS.md` stop loading on omp and let the two drift silently.
|
|
8
|
+
|
|
9
|
+
@../AGENTS.md
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# omp (Oh My Pi) adapter — {{project.name}}
|
|
2
|
+
|
|
3
|
+
UKit installs this workspace so that [omp](https://omp.sh) gets the same guardrails, agents and
|
|
4
|
+
context that Claude Code gets — without a second copy of the logic to keep in sync.
|
|
5
|
+
|
|
6
|
+
Stack: {{project.stack}} · package manager: `{{runtime.packageManager}}`
|
|
7
|
+
|
|
8
|
+
## What `ukit install` puts here
|
|
9
|
+
|
|
10
|
+
Eleven files, all managed by UKit. Re-running `ukit install` overwrites them and keeps a backup of
|
|
11
|
+
whatever was there before, so local edits are never silently lost — they move, they do not vanish.
|
|
12
|
+
|
|
13
|
+
| Path | What it is |
|
|
14
|
+
|------|------------|
|
|
15
|
+
| `.omp/AGENTS.md` | Thin context entry point. Imports the root `AGENTS.md` (`@../AGENTS.md`) rather than duplicating it. |
|
|
16
|
+
| `.omp/RULES.md` | Sticky hard rules that must survive compaction. |
|
|
17
|
+
| `.omp/config.yml` | Model roles, tool approval policy, dangerous-command patterns, memory and compact settings. |
|
|
18
|
+
| `.omp/README.md` | This file. |
|
|
19
|
+
| `.omp/hooks/pre/ukit-bridge.js` | Translates omp events into Claude Code hook payloads and runs the real `.claude/hooks/*.sh` scripts. |
|
|
20
|
+
| `.omp/agents/bug-debugger.md` | Debugging lane. |
|
|
21
|
+
| `.omp/agents/code-reviewer.md` | Independent review lane. |
|
|
22
|
+
| `.omp/agents/feature-implementer.md` | Implementation lane. |
|
|
23
|
+
| `.omp/agents/handoff-planner.md` | Handoff planning lane. |
|
|
24
|
+
| `.omp/agents/ukit-small-task-maintainer.md` | Low-risk chores lane. |
|
|
25
|
+
| `.omp/agents/ukit-vision-analyst.md` | The only lane allowed to interpret images. |
|
|
26
|
+
|
|
27
|
+
## Model roles
|
|
28
|
+
|
|
29
|
+
`.omp/config.yml` defines four roles. Agent frontmatter references them as `@lite` / `@code` /
|
|
30
|
+
`@smart` / `@vision`, so retargeting a whole tier is a one-line edit in one file.
|
|
31
|
+
|
|
32
|
+
| Role | Default model | Agents using it |
|
|
33
|
+
|------|---------------|-----------------|
|
|
34
|
+
| `lite` | `unic-lite` | `ukit-small-task-maintainer` |
|
|
35
|
+
| `code` | `unic-code` | `feature-implementer`, `bug-debugger` |
|
|
36
|
+
| `smart` | `unic-smart` | `handoff-planner`, `code-reviewer` |
|
|
37
|
+
| `vision` | `unic-vision` | `ukit-vision-analyst` |
|
|
38
|
+
|
|
39
|
+
These are **literal model names on the UNIC gateway, not aliases**, and they ship as the installed
|
|
40
|
+
default. If this project does not run against UNIC, a maintainer swaps the three cost tiers for the
|
|
41
|
+
values in `orchestration.modelTiers[*].claudeModel` in `.ukit/storage/config.json`.
|
|
42
|
+
|
|
43
|
+
`vision` is the exception and stays `unic-vision` either way: it is a *capability* lane, not a cost
|
|
44
|
+
tier. `unic-code` and `unic-smart` cannot read images on this gateway, so substituting one of them
|
|
45
|
+
would not downgrade image analysis — it would silently produce guesses.
|
|
46
|
+
|
|
47
|
+
## The six agents are shared with Claude Code
|
|
48
|
+
|
|
49
|
+
The agent names here are verbatim the same as the ones under `.claude/agents/`, so the same
|
|
50
|
+
instruction ("hand this to the code reviewer") routes to the same role on either runtime.
|
|
51
|
+
|
|
52
|
+
What differs is only the frontmatter contract: omp reads task agents from `.omp/agents/` and
|
|
53
|
+
deliberately skips `.claude/agents/*.md`, and its model field takes a `@role` reference instead of a
|
|
54
|
+
model id. The prompt bodies are ported, not rewritten.
|
|
55
|
+
|
|
56
|
+
## The hook bridge
|
|
57
|
+
|
|
58
|
+
`.omp/hooks/pre/ukit-bridge.js` does not reimplement any guardrail. It maps an omp event to the
|
|
59
|
+
matching Claude Code hook payload and executes the existing shell script under `.claude/hooks/`.
|
|
60
|
+
One source of truth, two runtimes — fix a hook once and both runtimes get the fix.
|
|
61
|
+
|
|
62
|
+
Two things worth knowing:
|
|
63
|
+
|
|
64
|
+
**Tool names are mapped explicitly, never guessed.** omp's write surface is `edit`, `write` *and*
|
|
65
|
+
`ast_edit`; all three map to the `Edit` group, or `ast_edit` would slip past `protect-files.sh` and
|
|
66
|
+
`vision-gate.sh`. `eval` maps to `Bash` so it still hits `block-dangerous.sh`. Anything not in the
|
|
67
|
+
table maps to nothing and runs zero scripts — it never falls back to `Bash` or `Edit`.
|
|
68
|
+
|
|
69
|
+
**Failure direction is per-script, transcribed from each script's own header — not a blanket rule.**
|
|
70
|
+
|
|
71
|
+
- *Fail closed* (a crash or non-zero exit blocks the action): `protect-files.sh`,
|
|
72
|
+
`stale-spec-guard.sh`, `handoff-model-guard.sh`, `vision-gate.sh`, `context-hardcap-gate.sh`,
|
|
73
|
+
`block-dangerous.sh`, `verification-guard.sh`. These are gates; a broken gate must not open.
|
|
74
|
+
- *Fail open* (a crash logs a warning and the action proceeds): the advisory scripts —
|
|
75
|
+
routing, backups, output compression, context reinjection, pressure reset, handoff resume.
|
|
76
|
+
These improve a session; none of them should be able to halt one.
|
|
77
|
+
|
|
78
|
+
## Why there is no `.omp/skills/` or `.omp/commands/`
|
|
79
|
+
|
|
80
|
+
Their absence is deliberate, not an oversight — and if you "fix" it, a test will fail on purpose.
|
|
81
|
+
|
|
82
|
+
omp discovers capabilities from several providers in priority order, and its `claude` provider
|
|
83
|
+
already reads `.claude/skills/` and `.claude/commands/` directly. A copy or symlink under `.omp/`
|
|
84
|
+
would register at higher (native) priority, win deduplication, and give you a second location to
|
|
85
|
+
keep in sync for exactly zero new capability.
|
|
86
|
+
|
|
87
|
+
`.omp/agents/` is the one case that *must* be real files, because omp explicitly does not read
|
|
88
|
+
`.claude/agents/*.md`.
|
|
89
|
+
|
|
90
|
+
## Installing / removing
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
ukit install --tools=omp # or --tools=oh-my-pi
|
|
94
|
+
ukit install # installs every adapter, omp included
|
|
95
|
+
ukit uninstall # removes the paths listed above
|
|
96
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# .omp/RULES.md — sticky always-apply rules
|
|
2
|
+
|
|
3
|
+
omp re-attaches this file near every turn from its native location (`.omp/RULES.md` only, never a
|
|
4
|
+
copy elsewhere). It carries the always-apply subset of root `CLAUDE.md` that omp's claude provider
|
|
5
|
+
cannot see — that provider only reads `~/.claude/CLAUDE.md` and `<cwd>/.claude/CLAUDE.md`, never root
|
|
6
|
+
`CLAUDE.md`. Keep this short: every line here is a per-turn tax.
|
|
7
|
+
|
|
8
|
+
## 1. Execution Contract
|
|
9
|
+
|
|
10
|
+
For implement/apply/fix requests, continue until the actual edit is made or a real blocker is found.
|
|
11
|
+
Do not stop after a read-only inspection step (read/grep/glob/search).
|
|
12
|
+
|
|
13
|
+
## 2. No "done" after read-only
|
|
14
|
+
|
|
15
|
+
Never say "done", "applied", or "fixed" after a read-only step. Completion wording requires concrete
|
|
16
|
+
edit/write evidence in the current turn, plus verification when the change is risky.
|
|
17
|
+
|
|
18
|
+
## 3. Index-first loop
|
|
19
|
+
|
|
20
|
+
Check `.cache/index/` freshness first. Then run
|
|
21
|
+
`node .claude/ukit/index/query-index.mjs "<error|symbol|path>"` and open only the top 1-3 suspect
|
|
22
|
+
files before widening further. These node scripts work unchanged under omp.
|
|
23
|
+
|
|
24
|
+
## 4. Safe Patch
|
|
25
|
+
|
|
26
|
+
Prefer unique current-file anchors over line numbers or stale pasted blocks. Never silently merge a
|
|
27
|
+
stale spec — re-read current source and confirm before applying. Preserve existing BOM and line
|
|
28
|
+
endings.
|
|
29
|
+
|
|
30
|
+
## Model roles (see `.omp/config.yml`)
|
|
31
|
+
|
|
32
|
+
`modelRoles` ships UNIC gateway names as the default. A maintainer on a non-UNIC omp provider edits
|
|
33
|
+
only the three cost-tier values — `lite`, `code`, `smart` — never `vision`, which stays `unic-vision`
|
|
34
|
+
because it is a capability lane, not a cost tier.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bug-debugger
|
|
3
|
+
description: "Debugging specialist for reproducible errors, failing tests, and unexpected behavior. Use proactively when investigation will involve noisy logs, stack traces, or a self-contained reproduce-trace-fix-verify loop. Do not use for trivial obvious fixes or broad architecture ideation."
|
|
4
|
+
model: "@code"
|
|
5
|
+
tools: ["read","grep","glob","bash","edit","ast_edit"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Systematic debugging — understand before fixing.
|
|
9
|
+
|
|
10
|
+
**Two modes:**
|
|
11
|
+
- **Daily/ad-hoc** (DEFAULT): bug not coming from `docs/AI_HANDOFF/` → reproduce → fix → verify (no mandatory regression test if no pre-existing coverage; original lightweight flow).
|
|
12
|
+
- **Handoff mode**: bug task lives in `docs/AI_HANDOFF/tasks/TASK-xxx.md` → activate Quality Gate: regression-test-first → green → reviewer.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### 1. Reproduce (required)
|
|
17
|
+
|
|
18
|
+
- Run the failing command/action.
|
|
19
|
+
- Capture exact error message and stack trace.
|
|
20
|
+
- If not reproducible → document conditions and ask user.
|
|
21
|
+
|
|
22
|
+
### 2. Trace Root Cause
|
|
23
|
+
|
|
24
|
+
- Read error location and surrounding code.
|
|
25
|
+
- Trace data flow: input → processing → failure point.
|
|
26
|
+
- Identify: logic / state / integration error?
|
|
27
|
+
|
|
28
|
+
### 3. Regression Test First (RED) — Handoff mode
|
|
29
|
+
|
|
30
|
+
- Write a regression test that reproduces the bug as a failing test.
|
|
31
|
+
- Run it: must FAIL with the original error/signature.
|
|
32
|
+
- If you truly cannot write a regression test (pure UI glitch, env-only issue), document why and attach a manual repro script.
|
|
33
|
+
- **Daily mode**: write a regression test only if the file already has tests; otherwise rely on the original repro command for verification.
|
|
34
|
+
|
|
35
|
+
### 4. Fix (GREEN)
|
|
36
|
+
|
|
37
|
+
- Apply smallest reliable fix at the root cause.
|
|
38
|
+
- Do NOT patch symptoms — fix the cause.
|
|
39
|
+
- Re-run the regression test: must PASS.
|
|
40
|
+
|
|
41
|
+
### 5. Verify
|
|
42
|
+
|
|
43
|
+
- Re-run the original failing command → must pass.
|
|
44
|
+
- Run related tests: `yarn test [relevant-file]`.
|
|
45
|
+
- If shared code touched, run wider suite.
|
|
46
|
+
- Check no regression in adjacent functionality.
|
|
47
|
+
|
|
48
|
+
### 6. Report
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
STATUS: DONE | BLOCKED | PARTIAL
|
|
52
|
+
EXECUTOR_TOOL: [claude-code | kilo-code | codex | opencode | other]
|
|
53
|
+
EXECUTOR_MODEL: [exact model name you are running as. "unknown" if you cannot tell.]
|
|
54
|
+
EXECUTOR_SUBAGENT: [subagent name within your host, if any, else "-"]
|
|
55
|
+
SUMMARY: [1-2 sentences — root cause and fix]
|
|
56
|
+
ROOT_CAUSE: [what caused the bug]
|
|
57
|
+
REGRESSION_TEST:
|
|
58
|
+
file: [path]
|
|
59
|
+
red_before: [exact error captured]
|
|
60
|
+
green_after: [pass output line]
|
|
61
|
+
FILES_CHANGED:
|
|
62
|
+
- [file path]: [what changed]
|
|
63
|
+
VERIFICATION:
|
|
64
|
+
command: [exact command]
|
|
65
|
+
result: [N pass / M fail / exit code]
|
|
66
|
+
ISSUES: [any remaining risks or edge cases, or "none"]
|
|
67
|
+
HANDOFF_TO_REVIEWER: yes | no — reason
|
|
68
|
+
NEXT: [follow-up needed, or "ready for review"]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 7. Trigger Reviewer — Handoff mode ONLY
|
|
72
|
+
|
|
73
|
+
Daily mode: skip. Handoff mode: set task status `pending_review` in `INDEX.md`; a reviewer session (model from `handoff.reviewer.model`, MUST differ from this debugger's model) will pick it up.
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
|
|
77
|
+
- **Iron law (Handoff mode):** no `DONE` without (a) regression test passing and (b) original failing command passing, both in this turn.
|
|
78
|
+
- **Daily mode:** original — original failing command must pass; regression test optional unless prior coverage exists.
|
|
79
|
+
- Don't patch blindly — confirm root cause with evidence.
|
|
80
|
+
- For bug triage, use graduated doc budget:
|
|
81
|
+
- obvious/simple bug: `docs/MEMORY.md` only
|
|
82
|
+
- non-trivial bug: `docs/MEMORY.md` + `docs/PROJECT.md` + `docs/CODE_MAP.md`
|
|
83
|
+
- read `docs/WORKLOG.md` only recent relevant entries
|
|
84
|
+
- Keep fix scope minimal — no drive-by refactors.
|
|
85
|
+
- If root cause is unclear after 5 minutes of tracing → ask user for more context.
|