@brainervirus/workit-cli 0.8.9 → 0.8.11
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.
|
@@ -20,48 +20,48 @@ This session is a handoff destination for a continued plan. The originating sess
|
|
|
20
20
|
## Hard gates
|
|
21
21
|
|
|
22
22
|
- The parent is coordinator-only: it does not edit product code or perform delegated exploration.
|
|
23
|
-
- Never use a worktree. Branch changes are in-place through `
|
|
24
|
-
- Working state, briefs, ledgers, and review diffs live only under gitignored `<SDD_DIR>` in `docs/<slug>/sdd/` and use `
|
|
23
|
+
- Never use a worktree. Branch changes are in-place through `workit_branch_setup` on `feature/*` or `bugfix/*`; never commit on protected branches.
|
|
24
|
+
- Working state, briefs, ledgers, and review diffs live only under gitignored `<SDD_DIR>` in `docs/<slug>/sdd/` and use `workit_sdd_*` tools.
|
|
25
25
|
- Use native `todowrite` for visible task state as well as the gitignored ledger.
|
|
26
26
|
- Use native `question` for branch/stash choices and guarded external mutations; call mutation tools only after approval with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
27
|
-
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `
|
|
28
|
-
- Delegated authority is direct-child-only: a worker is the session whose host `parentID` exactly equals the activating coordinator's recorded `coordinator_session_id`; missing, mismatched, or multi-owner lineage fails closed with `delegation_lineage_denied`, and nested `opencode` launches are denied during active delegated work. An authorized child receives only the compact worker contract (execute the supplied brief, follow TDD, land one contiguous non-empty commit range, report results) — never coordinator guidance, `wk-implement`, or ledger management; coordinator bookkeeping via `
|
|
29
|
-
- On Cursor, for every repository-scoped `
|
|
27
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workit_spec_approve` / `workit_plan_approve` / `workit_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
28
|
+
- Delegated authority is direct-child-only: a worker is the session whose host `parentID` exactly equals the activating coordinator's recorded `coordinator_session_id`; missing, mismatched, or multi-owner lineage fails closed with `delegation_lineage_denied`, and nested `opencode` launches are denied during active delegated work. An authorized child receives only the compact worker contract (execute the supplied brief, follow TDD, land one contiguous non-empty commit range, report results) — never coordinator guidance, `wk-implement`, or ledger management; coordinator bookkeeping via `workit_sdd_*` stays with the coordinator session.
|
|
29
|
+
- On Cursor, for every repository-scoped `workit_*` call, pass the active Cursor workspace as `workspace_root`; never rely on the MCP process default.
|
|
30
30
|
- Use native `task` with only the built-in `explore` and `general` agents.
|
|
31
31
|
|
|
32
32
|
## Flow gates (HARD)
|
|
33
33
|
|
|
34
34
|
- `wk-implement` refuses to run unless the plan is `approved` (flow.json) and the post-plan menu was presented.
|
|
35
35
|
- `wk-handoff` refuses to run unless both spec and plan are `approved`.
|
|
36
|
-
- Sequence is enforced by tools: `
|
|
36
|
+
- Sequence is enforced by tools: `workit_spec_approve`, `workit_plan_approve`, `workit_plan_menu` — never skip a step (the spec/plan self-review runs automatically inside the transition; only the final approval asks for your confirmation).
|
|
37
37
|
|
|
38
38
|
## Setup
|
|
39
39
|
|
|
40
|
-
0. Call `
|
|
41
|
-
1. Call `
|
|
42
|
-
2. Call `
|
|
40
|
+
0. Call `workit_docs_validate` with the linked spec/plan paths. Hard-fail on any error before todos or branch setup.
|
|
41
|
+
1. Call `workit_sdd_context` with `<PLAN_PATH>` and initialize `todowrite` from returned tasks.
|
|
42
|
+
2. Call `workit_plan_tasks`; cache each top-level task's `section_text`.
|
|
43
43
|
3. Mark IDs in `completed_task_ids` completed and never redispatch them.
|
|
44
|
-
4. Call `
|
|
44
|
+
4. Call `workit_resolve_branch`, then show the current branch, target branch, and stash behavior before any in-place checkout/setup mutation.
|
|
45
45
|
5. Always use `question`: for a clean tree ask whether to proceed or cancel; for a dirty tree add the stash choice and describe what will be stashed.
|
|
46
|
-
6. Call `
|
|
46
|
+
6. Call `workit_branch_setup` with `confirmed: true` only after approval.
|
|
47
47
|
|
|
48
48
|
## Remaining-task loop
|
|
49
49
|
|
|
50
50
|
For each top-level task absent from `completed_task_ids`:
|
|
51
51
|
|
|
52
52
|
1. Mark it `in_progress` with `todowrite`.
|
|
53
|
-
2. Create a working-state brief with `
|
|
53
|
+
2. Create a working-state brief with `workit_sdd_task_brief` and `confirmed: true`.
|
|
54
54
|
3. Delegate read-only discovery, when needed, to an `explore` agent. Delegate implementation to a fresh `general` agent. Product changes follow TDD.
|
|
55
|
-
4. Create a working-state diff with `
|
|
55
|
+
4. Create a working-state diff with `workit_sdd_review_package` and `confirmed: true`.
|
|
56
56
|
5. Delegate spec-compliance review and code-quality review to separate `general` agents.
|
|
57
|
-
6. **Blocking** findings (Critical, Important, or spec-compliance) may trigger at most **two** fix+re-review rounds per task. **Advisory** findings (Minor, style, YAGNI, taste) never pause the loop — append them with `
|
|
58
|
-
7. Append the validated ledger entry with `
|
|
57
|
+
6. **Blocking** findings (Critical, Important, or spec-compliance) may trigger at most **two** fix+re-review rounds per task. **Advisory** findings (Minor, style, YAGNI, taste) never pause the loop — append them with `workit_sdd_append_advisory` (`--task <id> --text <text>`, `confirmed: true`) instead of an unrestricted file edit.
|
|
58
|
+
7. Append the validated ledger entry with `workit_sdd_append_progress` and `confirmed: true`; mark the todo completed.
|
|
59
59
|
|
|
60
60
|
## Final gate
|
|
61
61
|
|
|
62
|
-
Run a separate full-branch code review, then `
|
|
62
|
+
Run a separate full-branch code review, then `workit_verify`. Present the full `<SDD_DIR>/advisories.md` roll-up once, then use native `question` so the user can choose which advisory items to fix, discuss, or discard. Report exact check results and never infer success. Use `workit_git_context` for a commit preview and load `wk-commit` through `skill` for an approved commit. If working state contains a stash reference, preview reapplication through `question`, then call `workit_branch_setup` with `confirmed: true` after approval.
|
|
63
63
|
|
|
64
|
-
**Mandatory:** end the run by calling `
|
|
64
|
+
**Mandatory:** end the run by calling `workit_plan_complete` (OpenCode/Cursor) or the CLI `workit flow complete` (CLI host) after the final task once the SDD ledger is complete (all task IDs appended) and `workit_verify` passes — a complete ledger and green verification are the tool's gates. Never finish the run while the plan is still `active`.
|
|
65
65
|
|
|
66
66
|
## Task order
|
|
67
67
|
|
|
@@ -70,4 +70,4 @@ Run a separate full-branch code review, then `workflow_verify`. Present the full
|
|
|
70
70
|
## Quality gate (HARD)
|
|
71
71
|
|
|
72
72
|
- Specs/plans are written from `templates/spec-template.md` / `templates/plan-template.md`.
|
|
73
|
-
- After `
|
|
73
|
+
- After `workit_docs_validate`, surface `quality` findings (spec scan). Hard findings (missing required section, missing CA-XX) block task start unless the user explicitly waives them. Warnings are advisory.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## Global Constraints
|
|
11
11
|
|
|
12
12
|
- Each task lands exactly one contiguous non-empty commit range (`base..head`): fix rounds append commits to that range and never rewrite/amend an active review range; each progress line records the task's real base..head shas.
|
|
13
|
-
- The final task ends execution with `
|
|
13
|
+
- The final task ends execution with `workit_plan_complete` (or the CLI `workit flow complete`) once the SDD ledger is complete and repository verification passes — a run never finishes while the plan is still `active`.
|
|
14
14
|
- <project-wide requirements, one line each>
|
|
15
15
|
|
|
16
16
|
---
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
## Architecture
|
|
18
18
|
|
|
19
|
-
<!-- REQUIRED if this spec has flows or architecture: render a mermaid diagram (
|
|
19
|
+
<!-- REQUIRED if this spec has flows or architecture: render a mermaid diagram (workit_present_flow). -->
|
|
20
20
|
```mermaid
|
|
21
21
|
flowchart TD
|
|
22
22
|
A[Start] --> B[Step]
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
<!-- REQUIRED if this spec touches UI: render an ASCII wireframe (
|
|
25
|
+
<!-- REQUIRED if this spec touches UI: render an ASCII wireframe (workit_present_ascii). -->
|
|
26
26
|
```text
|
|
27
27
|
┌──────────────┐
|
|
28
28
|
│ Header │
|
|
@@ -27,31 +27,31 @@ Plans require:
|
|
|
27
27
|
|
|
28
28
|
`bugfix/<slug>` is also valid. Never use `main`, `develop`, `master`, or `prod`. Use plain backtick paths. Top-level headings are exactly `### Task N: Title`; steps use `- [ ] **Step N:** ...`; task headings never appear inside fences.
|
|
29
29
|
|
|
30
|
-
Before writing **Branch:** into a new spec or plan, call `
|
|
30
|
+
Before writing **Branch:** into a new spec or plan, call `workit_docs_branch` and write the returned `branch` verbatim. When `action` is `keep`, use the current feature/bugfix branch. When `action` is `create_from_develop` or `create_from_base`, create the branch only through `workit_branch_setup`; it uses the configured workspace/global target branch.
|
|
31
31
|
|
|
32
32
|
## Execution and handoff
|
|
33
33
|
|
|
34
34
|
- Implementation uses `wk-implement` and subagent-driven development, with native `todowrite` and `task`.
|
|
35
35
|
- Commits use `wk-commit` after its native `question` confirmation.
|
|
36
|
-
- Continuation uses `wk-handoff`, whose `
|
|
37
|
-
- Never use worktrees. Resolve the declared branch with `
|
|
38
|
-
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `
|
|
39
|
-
- Keep all SDD state under the gitignored `docs/<slug>/sdd/`; use `
|
|
40
|
-
- After implementation, use `question` before an approved stash reapply through `
|
|
36
|
+
- Continuation uses `wk-handoff`, whose `workit_handoff_session` creates and seeds the OpenCode session automatically.
|
|
37
|
+
- Never use worktrees. Resolve the declared branch with `workit_resolve_branch`, preview dirty-tree stash choices with `question`, and apply an approved in-place checkout through `workit_branch_setup` with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
38
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workit_spec_approve` / `workit_plan_approve` / `workit_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
39
|
+
- Keep all SDD state under the gitignored `docs/<slug>/sdd/`; use `workit_sdd_context` and the registered `workit_sdd_*` tools.
|
|
40
|
+
- After implementation, use `question` before an approved stash reapply through `workit_branch_setup` with `confirmed: true`.
|
|
41
41
|
|
|
42
42
|
## YouTrack content
|
|
43
43
|
|
|
44
|
-
Chat follows the user's language. YouTrack task comments are Spanish (`es-CL`) and use `
|
|
44
|
+
Chat follows the user's language. YouTrack task comments are Spanish (`es-CL`) and use `workit_youtrack_draft` followed by reviewed `workit_youtrack_post` with `confirmed: true`. Preserve the user's paragraph voice; do not inject commits, file paths, or robotic bullet reports.
|
|
45
45
|
|
|
46
46
|
## Final self-check
|
|
47
47
|
|
|
48
|
-
Before handoff, call `
|
|
48
|
+
Before handoff, call `workit_docs_validate` on the linked spec/plan pair. Hard-fail on any error; never offer execution when validation fails.
|
|
49
49
|
|
|
50
50
|
Before handoff, verify the saved spec path, plan path, declared branch, top-level task numbering, and workflow-managed SDD directory through the registered read-only workflow tools. Report structured failures; never infer success.
|
|
51
51
|
|
|
52
52
|
## Post-plan execution choice
|
|
53
53
|
|
|
54
|
-
After saving a plan, call `
|
|
54
|
+
After saving a plan, call `workit_docs_validate` on the spec/plan pair. On failure, stop and fix docs — do not offer execution.
|
|
55
55
|
|
|
56
56
|
On success, use native `question` / Cursor `AskQuestion` with exactly these options (no stay, no A/B/C prose duplicate):
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ On success, use native `question` / Cursor `AskQuestion` with exactly these opti
|
|
|
62
62
|
5. Review plan first
|
|
63
63
|
6. Change model first
|
|
64
64
|
|
|
65
|
-
`Change model first` is display-only deferral: it ends the turn without calling `
|
|
65
|
+
`Change model first` is display-only deferral: it ends the turn without calling `workit_plan_menu` and re-presents the menu on the next turn. Every other choice must call `workit_plan_menu` immediately after the answer and before any skill, branch question, mutation, or handoff.
|
|
66
66
|
|
|
67
67
|
Never emit Superpowers text beginning “Two execution options”.
|
|
68
68
|
|
package/dist/index.js
CHANGED
|
@@ -47589,7 +47589,7 @@ var readFlowStrict = (root, slug) => {
|
|
|
47589
47589
|
const file = flowPath(root, slug);
|
|
47590
47590
|
const rel = path18.posix.join("docs", slug, "sdd", "flow.json");
|
|
47591
47591
|
if (!existsSync14(file)) {
|
|
47592
|
-
return err2("flow_not_activated", `flow not activated for ${slug} — run
|
|
47592
|
+
return err2("flow_not_activated", `flow not activated for ${slug} — run workit_flow_status first`);
|
|
47593
47593
|
}
|
|
47594
47594
|
let text;
|
|
47595
47595
|
try {
|
|
@@ -48294,13 +48294,13 @@ var assertSddControlGates = (root, slug, opts = {}, ctx) => {
|
|
|
48294
48294
|
return effective;
|
|
48295
48295
|
const state = effective.state;
|
|
48296
48296
|
if (state.spec.status !== "approved") {
|
|
48297
|
-
return err2("spec_not_approved", `spec not approved (status: ${state.spec.status}). Run
|
|
48297
|
+
return err2("spec_not_approved", `spec not approved (status: ${state.spec.status}). Run workit_spec_approve after the user's approval.`);
|
|
48298
48298
|
}
|
|
48299
48299
|
if (state.plan.status !== "approved") {
|
|
48300
|
-
return err2("plan_not_approved", `plan not approved (status: ${state.plan.status}). Run
|
|
48300
|
+
return err2("plan_not_approved", `plan not approved (status: ${state.plan.status}). Run workit_plan_approve after the user's approval.`);
|
|
48301
48301
|
}
|
|
48302
48302
|
if (opts.requireMenu && !state.menu.presented) {
|
|
48303
|
-
return err2("menu_not_presented", "post-plan menu not presented. Record the native question answer with
|
|
48303
|
+
return err2("menu_not_presented", "post-plan menu not presented. Record the native question answer with workit_plan_menu.");
|
|
48304
48304
|
}
|
|
48305
48305
|
if (opts.requireDocs) {
|
|
48306
48306
|
const validated = docsValidate({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit interactive setup wizard (Ink TUI)",
|
|
6
6
|
"keywords": [
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"typecheck": "tsc --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@brainervirus/workit-core": "^0.8.
|
|
38
|
-
"@brainervirus/workit-cursor": "^0.8.
|
|
39
|
-
"@brainervirus/workit-opencode": "^0.8.
|
|
37
|
+
"@brainervirus/workit-core": "^0.8.11",
|
|
38
|
+
"@brainervirus/workit-cursor": "^0.8.11",
|
|
39
|
+
"@brainervirus/workit-opencode": "^0.8.11",
|
|
40
40
|
"@inkjs/ui": "2.0.0",
|
|
41
41
|
"ink": "7.1.1",
|
|
42
42
|
"react": "19.2.8"
|