work-kit-cli 0.2.1 → 0.2.2

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.
@@ -1,7 +1,7 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { readState, writeState, findWorktreeRoot, readStateMd } from "../state/store.js";
4
- import { isPhaseComplete } from "../engine/transitions.js";
4
+ import { isPhaseComplete, nextSubStageInPhase } from "../engine/transitions.js";
5
5
  import { checkLoopback } from "../engine/loopbacks.js";
6
6
  import { PHASE_ORDER } from "../config/phases.js";
7
7
  import { parseLocation, resetToLocation } from "../state/helpers.js";
@@ -117,6 +117,14 @@ export function completeCommand(target: string, outcome?: string, worktreeRoot?:
117
117
  };
118
118
  }
119
119
 
120
+ // Advance currentSubStage to the next pending sub-stage so the observer refreshes
121
+ const nextSS = nextSubStageInPhase(state, phase);
122
+ if (nextSS) {
123
+ state.currentSubStage = nextSS;
124
+ } else {
125
+ state.currentSubStage = null;
126
+ }
127
+
120
128
  writeState(root, state);
121
129
 
122
130
  return {
@@ -41,7 +41,7 @@ const WORKFLOW_MATRIX: Record<Classification, Record<string, InclusionRule>> = {
41
41
  "test/verify": "YES", "test/e2e": "skip", "test/validate": "YES",
42
42
  "review/self-review": "YES", "review/security": "skip", "review/performance": "skip",
43
43
  "review/compliance": "skip", "review/handoff": "YES",
44
- "deploy/merge": "optional", "deploy/monitor": "optional", "deploy/remediate": "optional",
44
+ "deploy/merge": "YES", "deploy/monitor": "optional", "deploy/remediate": "optional",
45
45
  "wrap-up/wrap-up": "YES",
46
46
  },
47
47
  "small-change": {
@@ -52,7 +52,7 @@ const WORKFLOW_MATRIX: Record<Classification, Record<string, InclusionRule>> = {
52
52
  "test/verify": "YES", "test/e2e": "skip", "test/validate": "skip",
53
53
  "review/self-review": "YES", "review/security": "skip", "review/performance": "skip",
54
54
  "review/compliance": "skip", "review/handoff": "YES",
55
- "deploy/merge": "optional", "deploy/monitor": "optional", "deploy/remediate": "optional",
55
+ "deploy/merge": "YES", "deploy/monitor": "optional", "deploy/remediate": "optional",
56
56
  "wrap-up/wrap-up": "YES",
57
57
  },
58
58
  refactor: {
@@ -63,7 +63,7 @@ const WORKFLOW_MATRIX: Record<Classification, Record<string, InclusionRule>> = {
63
63
  "test/verify": "YES", "test/e2e": "skip", "test/validate": "skip",
64
64
  "review/self-review": "YES", "review/security": "skip", "review/performance": "YES",
65
65
  "review/compliance": "skip", "review/handoff": "YES",
66
- "deploy/merge": "optional", "deploy/monitor": "optional", "deploy/remediate": "optional",
66
+ "deploy/merge": "YES", "deploy/monitor": "optional", "deploy/remediate": "optional",
67
67
  "wrap-up/wrap-up": "YES",
68
68
  },
69
69
  feature: {
@@ -74,7 +74,7 @@ const WORKFLOW_MATRIX: Record<Classification, Record<string, InclusionRule>> = {
74
74
  "test/verify": "YES", "test/e2e": "if UI", "test/validate": "YES",
75
75
  "review/self-review": "YES", "review/security": "YES", "review/performance": "skip",
76
76
  "review/compliance": "YES", "review/handoff": "YES",
77
- "deploy/merge": "optional", "deploy/monitor": "optional", "deploy/remediate": "optional",
77
+ "deploy/merge": "YES", "deploy/monitor": "optional", "deploy/remediate": "optional",
78
78
  "wrap-up/wrap-up": "YES",
79
79
  },
80
80
  "large-feature": {
@@ -85,7 +85,7 @@ const WORKFLOW_MATRIX: Record<Classification, Record<string, InclusionRule>> = {
85
85
  "test/verify": "YES", "test/e2e": "YES", "test/validate": "YES",
86
86
  "review/self-review": "YES", "review/security": "YES", "review/performance": "YES",
87
87
  "review/compliance": "YES", "review/handoff": "YES",
88
- "deploy/merge": "optional", "deploy/monitor": "optional", "deploy/remediate": "optional",
88
+ "deploy/merge": "YES", "deploy/monitor": "optional", "deploy/remediate": "optional",
89
89
  "wrap-up/wrap-up": "YES",
90
90
  },
91
91
  };
@@ -110,9 +110,7 @@ export function buildFullWorkflow(): WorkflowStep[] {
110
110
  const steps: WorkflowStep[] = [];
111
111
  for (const phase of PHASE_ORDER) {
112
112
  for (const subStage of SUBSTAGES_BY_PHASE[phase]) {
113
- // Deploy is optional by default
114
- const included = phase !== "deploy";
115
- steps.push({ phase, subStage, included });
113
+ steps.push({ phase, subStage, included: true });
116
114
  }
117
115
  }
118
116
  return steps;
@@ -144,16 +144,8 @@ function renderWorkItem(item: WorkItemView, innerWidth: number): string[] {
144
144
  const gap2 = Math.max(2, innerWidth - modePlainLen - timingPlainLen);
145
145
  lines.push(modeStr + " ".repeat(gap2) + timingText);
146
146
 
147
- // Line 3: progress bar with phase label + substage position
148
- let phaseLabel = "—";
149
- if (item.currentPhase) {
150
- phaseLabel = item.currentSubStage
151
- ? `${item.currentPhase}/${item.currentSubStage}`
152
- : item.currentPhase;
153
- if (item.currentSubStageIndex != null && item.currentPhaseTotal != null) {
154
- phaseLabel += ` (${item.currentSubStageIndex}/${item.currentPhaseTotal})`;
155
- }
156
- }
147
+ // Line 3: progress bar with phase label only (no sub-stage inline)
148
+ const phaseLabel = item.currentPhase || "—";
157
149
  const barMaxWidth = Math.max(20, Math.min(40, innerWidth - 30));
158
150
  lines.push(" " + renderProgressBar(
159
151
  item.progress.completed,
@@ -163,10 +155,19 @@ function renderWorkItem(item: WorkItemView, innerWidth: number): string[] {
163
155
  barMaxWidth
164
156
  ));
165
157
 
166
- // Line 4: phase indicators
158
+ // Line 4: phase indicators with sub-stage shown under current phase
167
159
  const phaseStrs = item.phases.map(p => `${p.name} ${phaseIndicator(p.status)}`);
168
160
  lines.push(" " + phaseStrs.join(" "));
169
161
 
162
+ // Line 5 (optional): current sub-stage detail under the phase line
163
+ if (item.currentSubStage && item.currentPhase) {
164
+ let subLabel = `↳ ${item.currentSubStage}`;
165
+ if (item.currentSubStageIndex != null && item.currentPhaseTotal != null) {
166
+ subLabel += ` (${item.currentSubStageIndex}/${item.currentPhaseTotal})`;
167
+ }
168
+ lines.push(" " + dim(subLabel));
169
+ }
170
+
170
171
  // Line 5 (optional): loopbacks
171
172
  if (item.loopbacks.count > 0) {
172
173
  const lb = item.loopbacks;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "work-kit-cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Structured development workflow for Claude Code. Two modes, 6 phases, 27 sub-stages.",
5
5
  "type": "module",
6
6
  "bin": {