work-kit-cli 0.2.3 → 0.2.4

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.
@@ -95,9 +95,10 @@ export function initCommand(options: {
95
95
  mode: "full" | "auto";
96
96
  description: string;
97
97
  classification?: Classification;
98
+ gated?: boolean;
98
99
  worktreeRoot?: string;
99
100
  }): Action {
100
- const { mode, description, classification } = options;
101
+ const { mode, description, classification, gated } = options;
101
102
  const worktreeRoot = options.worktreeRoot || process.cwd();
102
103
 
103
104
  // Guard: don't overwrite existing state
@@ -156,6 +157,7 @@ export function initCommand(options: {
156
157
  branch,
157
158
  started: new Date().toISOString(),
158
159
  mode: modeLabel,
160
+ ...(gated && { gated: true }),
159
161
  ...(classification && { classification }),
160
162
  status: "in-progress",
161
163
  currentPhase: firstPhase,
@@ -104,13 +104,25 @@ describe("determineNextStep", () => {
104
104
  assert.equal(step.subStage, "clarify");
105
105
  });
106
106
 
107
- it("returns wait-for-user when current phase is complete", () => {
107
+ it("auto-proceeds to next phase by default when current phase is complete", () => {
108
108
  const state = makeState();
109
109
  state.currentPhase = "plan";
110
110
  for (const ss of Object.values(state.phases.plan.subStages)) {
111
111
  ss.status = "completed";
112
112
  }
113
113
  const step = determineNextStep(state);
114
+ assert.equal(step.type, "phase-boundary");
115
+ assert.equal(step.phase, "build");
116
+ });
117
+
118
+ it("returns wait-for-user when gated and current phase is complete", () => {
119
+ const state = makeState();
120
+ state.gated = true;
121
+ state.currentPhase = "plan";
122
+ for (const ss of Object.values(state.phases.plan.subStages)) {
123
+ ss.status = "completed";
124
+ }
125
+ const step = determineNextStep(state);
114
126
  assert.equal(step.type, "wait-for-user");
115
127
  assert.equal(step.phase, "build");
116
128
  });
@@ -75,12 +75,16 @@ export function determineNextStep(state: WorkKitState): NextStep {
75
75
  for (const phase of remainingPhases) {
76
76
  const ps = state.phases[phase];
77
77
  if (ps.status !== "skipped") {
78
- // Phase boundary — wait for user confirmation before crossing
79
- return {
80
- type: "wait-for-user",
81
- phase,
82
- message: `${currentPhase} phase complete. Ready to start ${phase}. Proceed?`,
83
- };
78
+ if (state.gated) {
79
+ // Gated mode — wait for user confirmation before crossing
80
+ return {
81
+ type: "wait-for-user",
82
+ phase,
83
+ message: `${currentPhase} phase complete. Ready to start ${phase}. Proceed?`,
84
+ };
85
+ }
86
+ // Default — auto-proceed to next phase
87
+ return { type: "phase-boundary", phase, message: `${currentPhase} complete → starting ${phase}` };
84
88
  }
85
89
  }
86
90
 
package/cli/src/index.ts CHANGED
@@ -39,6 +39,7 @@ program
39
39
  .requiredOption("--mode <mode>", "Workflow mode: full or auto")
40
40
  .requiredOption("--description <text>", "Description of the work")
41
41
  .option("--classification <type>", "Work classification (auto mode): bug-fix, small-change, refactor, feature, large-feature")
42
+ .option("--gated", "Wait for user approval between phases (default: auto-proceed)")
42
43
  .option("--worktree-root <path>", "Override worktree root directory")
43
44
  .action((opts) => {
44
45
  try {
@@ -46,6 +47,7 @@ program
46
47
  mode: opts.mode as "full" | "auto",
47
48
  description: opts.description,
48
49
  classification: opts.classification as Classification | undefined,
50
+ gated: opts.gated || false,
49
51
  worktreeRoot: opts.worktreeRoot,
50
52
  });
51
53
  console.log(JSON.stringify(result, null, 2));
@@ -81,6 +81,7 @@ export interface WorkKitState {
81
81
  branch: string;
82
82
  started: string;
83
83
  mode: "full-kit" | "auto-kit";
84
+ gated?: boolean;
84
85
  classification?: Classification;
85
86
  status: "in-progress" | "paused" | "completed" | "failed";
86
87
  currentPhase: PhaseName | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "work-kit-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Structured development workflow for Claude Code. Two modes, 6 phases, 27 sub-stages.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -97,6 +97,7 @@ The table is a guide, not a rigid rule. Adjust based on the actual request:
97
97
  cd worktrees/<slug>
98
98
  npx work-kit-cli init --mode auto --description "<description>" --classification <classification>
99
99
  ```
100
+ If the user requested gated mode (manual approval between phases), add `--gated`.
100
101
  2. Show the workflow to the user: `npx work-kit-cli workflow`
101
102
  3. User can adjust: `npx work-kit-cli workflow --add review/security` or `npx work-kit-cli workflow --remove test/e2e`
102
103
  4. **Wait for approval** — user can add/remove steps before proceeding
@@ -216,5 +217,5 @@ Run **Wrap-up** — read `.claude/skills/wk-wrap-up/SKILL.md` and follow its ins
216
217
 
217
218
  - **Always work inside the worktree directory** — `cd worktrees/<slug>` before running any commands
218
219
  - **Commit state after each phase boundary** — `git add .work-kit/ && git commit -m "work-kit: complete <phase>"`
219
- - **Human stays in control** — stop between phases, don't auto-proceed
220
+ - **Auto-proceed by default** — phases flow continuously unless `--gated` was passed at init, in which case stop between phases for user approval
220
221
  - **One feature per session** — each session handles a single feature. To work on multiple features in parallel, use separate terminal sessions
@@ -39,6 +39,7 @@ Do not proceed until `doctor` reports all checks passed.
39
39
  cd worktrees/<slug>
40
40
  npx work-kit-cli init --mode full --description "<description>"
41
41
  ```
42
+ If the user requested gated mode (manual approval between phases), add `--gated`.
42
43
  2. Parse the JSON response and follow the action
43
44
  3. Continue with the execution loop below
44
45
 
@@ -62,7 +63,7 @@ The CLI manages all state transitions, prerequisites, and loopbacks. Follow this
62
63
  3. Follow the action type:
63
64
  - **`spawn_agent`**: Use the Agent tool with the provided `agentPrompt`. Pass `skillFile` path for reference. After the agent completes: `npx work-kit-cli complete <phase>/<sub-stage> --outcome <outcome>`
64
65
  - **`spawn_parallel_agents`**: Spawn all agents in the `agents` array in parallel using the Agent tool. Wait for all to complete. Then spawn `thenSequential` if provided. After all complete: `npx work-kit-cli complete <onComplete target>`
65
- - **`wait_for_user`**: Report the message to the user and stop. Wait for them to say "proceed" before running `npx work-kit-cli next` again.
66
+ - **`wait_for_user`**: Report the message to the user and stop. Wait for them to say "proceed" before running `npx work-kit-cli next` again. (Only appears in `--gated` mode.)
66
67
  - **`loopback`**: Report the loopback to the user, then run `npx work-kit-cli next` to continue from the target.
67
68
  - **`complete`**: Done — run wrap-up if not already done.
68
69
  - **`error`**: Report the error and suggestion to the user. Stop.
@@ -197,5 +198,5 @@ Run **Wrap-up** — read `.claude/skills/wk-wrap-up/SKILL.md` and follow its ins
197
198
  - **Always work inside the worktree directory** — `cd worktrees/<slug>` before running any commands
198
199
  - **Commit state after each phase** — `git add .work-kit/ && git commit -m "work-kit: complete <phase>"`
199
200
  - **Don't skip phases** — even if a phase seems unnecessary, run it and let it determine "nothing to do"
200
- - **Human stays in control** — stop between phases, don't auto-proceed
201
+ - **Auto-proceed by default** — phases flow continuously unless `--gated` was passed at init, in which case stop between phases for user approval
201
202
  - **One feature per session** — each session handles a single feature. To work on multiple features in parallel, use separate terminal sessions