maestro-flow 0.3.30 → 0.3.32

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.
Files changed (68) hide show
  1. package/.claude/agents/cli-explore-agent.md +1 -1
  2. package/.claude/agents/workflow-verifier.md +1 -1
  3. package/.claude/commands/maestro-ralph-execute.md +77 -48
  4. package/.claude/commands/maestro-ralph.md +32 -15
  5. package/.claude/commands/maestro.md +10 -11
  6. package/.claude/skills/team-quality-assurance/roles/executor/role.md +1 -1
  7. package/.codex/skills/maestro/SKILL.md +15 -5
  8. package/.codex/skills/maestro-analyze/SKILL.md +4 -0
  9. package/.codex/skills/maestro-execute/SKILL.md +5 -1
  10. package/.codex/skills/maestro-init/SKILL.md +7 -1
  11. package/.codex/skills/maestro-plan/SKILL.md +5 -0
  12. package/.codex/skills/maestro-ralph/SKILL.md +27 -15
  13. package/.codex/skills/maestro-ralph-execute/SKILL.md +30 -4
  14. package/.codex/skills/maestro-roadmap/SKILL.md +0 -1
  15. package/.codex/skills/maestro-verify/SKILL.md +1 -1
  16. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -2
  17. package/.codex/skills/spec-add/SKILL.md +2 -0
  18. package/.codex/skills/spec-setup/SKILL.md +2 -0
  19. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  20. package/dashboard/dist-server/src/hooks/constants.d.ts +0 -6
  21. package/dashboard/dist-server/src/hooks/constants.js +0 -7
  22. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  23. package/dist/src/commands/hooks.d.ts +1 -1
  24. package/dist/src/commands/hooks.d.ts.map +1 -1
  25. package/dist/src/commands/hooks.js +10 -21
  26. package/dist/src/commands/hooks.js.map +1 -1
  27. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  28. package/dist/src/commands/install-ui/InstallFlow.js +17 -4
  29. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  30. package/dist/src/commands/spec.d.ts.map +1 -1
  31. package/dist/src/commands/spec.js +96 -0
  32. package/dist/src/commands/spec.js.map +1 -1
  33. package/dist/src/hooks/constants.d.ts +0 -6
  34. package/dist/src/hooks/constants.d.ts.map +1 -1
  35. package/dist/src/hooks/constants.js +0 -7
  36. package/dist/src/hooks/constants.js.map +1 -1
  37. package/dist/src/hooks/coordinator-tracker.d.ts +14 -2
  38. package/dist/src/hooks/coordinator-tracker.d.ts.map +1 -1
  39. package/dist/src/hooks/coordinator-tracker.js +25 -6
  40. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  41. package/dist/src/hooks/index.d.ts +1 -2
  42. package/dist/src/hooks/index.d.ts.map +1 -1
  43. package/dist/src/hooks/index.js +1 -2
  44. package/dist/src/hooks/index.js.map +1 -1
  45. package/dist/src/hooks/skill-context.js +2 -2
  46. package/dist/src/hooks/skill-context.js.map +1 -1
  47. package/dist/src/hooks/statusline.d.ts.map +1 -1
  48. package/dist/src/hooks/statusline.js +29 -6
  49. package/dist/src/hooks/statusline.js.map +1 -1
  50. package/dist/src/i18n/locales/en.js +1 -1
  51. package/dist/src/i18n/locales/en.js.map +1 -1
  52. package/dist/src/i18n/locales/zh.js +1 -1
  53. package/dist/src/i18n/locales/zh.js.map +1 -1
  54. package/dist/src/tools/spec-writer.d.ts +24 -0
  55. package/dist/src/tools/spec-writer.d.ts.map +1 -0
  56. package/dist/src/tools/spec-writer.js +60 -0
  57. package/dist/src/tools/spec-writer.js.map +1 -0
  58. package/package.json +1 -1
  59. package/workflows/codebase-rebuild.md +6 -6
  60. package/workflows/init.md +10 -12
  61. package/workflows/maestro-chain-execute.md +6 -2
  62. package/workflows/maestro.md +27 -19
  63. package/workflows/plan.md +1 -1
  64. package/workflows/verify.md +1 -1
  65. package/dist/src/hooks/context-monitor.d.ts +0 -33
  66. package/dist/src/hooks/context-monitor.d.ts.map +0 -1
  67. package/dist/src/hooks/context-monitor.js +0 -128
  68. package/dist/src/hooks/context-monitor.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  # Workflow: maestro
2
2
 
3
3
  Intelligent coordinator that routes user intent to optimal command chain based on project state.
4
- Dual execution engines: **Skill()** (in-process, synchronous) and **CLI delegate** (via `maestro delegate`, async with role-based tool selection).
5
- Default `auto` mode selects engine based on chain complexity.
4
+ Two step types: **Skill** (in-process, synchronous) and **CLI** (via `maestro delegate`, async with role-based tool selection).
5
+ Default `auto` mode selects type based on step complexity. All execution dispatched to unified executor (`maestro-ralph-execute`).
6
6
 
7
7
  **Prerequisites:**
8
8
  - None for initial invocation (can bootstrap)
@@ -226,18 +226,18 @@ When executing issue chains, replace `{issue_id}` in step args with resolved ID.
226
226
  **If not `autoYes`:** Confirm with user — show numbered steps, offer: Execute / Execute from step N / Cancel.
227
227
  If user chooses "Execute from step N": set `$START_STEP = N` (used in 3f to set `current_step`).
228
228
 
229
- ### 3e: Step-level engine selection
229
+ ### 3e: Step-level type selection
230
230
 
231
- Engine is selected **per step**, not per chain. Pre-compute and write to each step's `engine` field in status.json (execution workflow reads this, does not re-compute).
231
+ Step type is selected **per step**, not per chain. Pre-compute and write to each step's `type` field in status.json (executor reads this, does not re-compute).
232
232
 
233
233
  ```
234
- If execMode is 'cli' or 'internal' → force that engine for all steps.
234
+ If execMode is 'cli' or 'internal' → force that type for all steps ("cli" or "skill").
235
235
  In 'auto' mode, select per step:
236
- CLI steps (heavy, context-isolated): maestro-plan, maestro-execute, maestro-analyze, maestro-brainstorm, maestro-roadmap, maestro-ui-design, quality-refactor
237
- Internal steps (everything else): current-session Skill() call — verify, review, test, debug, milestone-*, manage-*, spec-*, quick, etc.
236
+ CLI steps (heavy, context-isolated): maestro-plan, maestro-execute, maestro-analyze, maestro-brainstorm, maestro-roadmap, maestro-ui-design, quality-refactor → type: "cli"
237
+ Skill steps (everything else): current-session Skill() call — verify, review, test, debug, milestone-*, manage-*, spec-*, quick, etc. → type: "skill"
238
238
  ```
239
239
 
240
- **Trade-off:** CLI = context isolation + template prompts + gemini analysis. Internal = current-session Skill() call, direct visibility + synchronous + user can intervene.
240
+ **Trade-off:** CLI = context isolation + template prompts. Skill = current-session Skill() call, direct visibility + synchronous + user can intervene.
241
241
 
242
242
  ### 3f: Low-complexity fast path (before session creation)
243
243
 
@@ -262,17 +262,22 @@ Create session directory `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/` and wri
262
262
  "auto_mode": "{autoYes}",
263
263
  "exec_mode": "{execMode}",
264
264
  "cli_tool": "{cliTool}",
265
- "gemini_session_id": null,
266
- "step_analyses": [],
267
265
  "context": {
268
- "current_phase": "{resolved_phase}",
269
- "user_intent": "{original_intent}",
270
266
  "issue_id": "{resolved_issue_id or null}",
271
267
  "milestone_num": "{current_milestone_num or null}",
272
268
  "spec_session_id": null,
273
- "scratch_dir": null
269
+ "scratch_dir": null,
270
+ "plan_dir": null,
271
+ "analysis_dir": null,
272
+ "brainstorm_dir": null
274
273
  },
275
- "steps": [{ "index": 0, "skill": "{chainMap[].cmd}", "args": "{chainMap[].args}", "engine": "{cli|internal from 3e}", "status": "pending", "started_at": null, "completed_at": null }],
274
+ "source": "maestro",
275
+ "updated_at": "{ISO timestamp}",
276
+ "milestone": null,
277
+ "lifecycle_position": null,
278
+ "target": null,
279
+ "waves": [],
280
+ "steps": [{ "index": 0, "skill": "{chainMap[].cmd}", "args": "{chainMap[].args}", "type": "{cli|skill from 3e}", "status": "pending", "started_at": null, "completed_at": null, "error": null }],
276
281
  "current_step": "{$START_STEP or 0}",
277
282
  "status": "running"
278
283
  }
@@ -290,12 +295,15 @@ const todos = steps.map((step, i) => ({
290
295
  TodoWrite({ todos });
291
296
  ```
292
297
 
293
- ## Step 4: Dispatch to execution workflow
298
+ ## Step 4: Dispatch to unified executor
294
299
 
295
300
  status.json already created in Step 3g, TodoWrite initialized in Step 3h.
296
301
 
297
- 1. Read `~/.maestro/workflows/maestro-chain-execute.md`
298
- 2. Follow it with `$SESSION_PATH` = session directory from Step 3g
302
+ ```
303
+ Skill({ skill: "maestro-ralph-execute" })
304
+ ```
305
+
306
+ The unified executor discovers the latest running session from `.workflow/.maestro/*/status.json` and executes steps sequentially. For maestro sessions (source: "maestro"), there are no decision nodes — execution is purely sequential.
299
307
 
300
308
  ---
301
309
 
@@ -484,8 +492,8 @@ detectNextAction(state):
484
492
  1. **Semantic Routing** — LLM-native `action × object` extraction; disambiguates "问题" by context
485
493
  2. **State-Aware** — Reads `.workflow/state.json` before routing
486
494
  3. **Quality Gates** — Issue chains auto-include review; `issue-full` is default for issue execution
487
- 4. **Per-Step Engine** — Each step independently selects internal or CLI. Heavy steps (plan, execute, analyze, brainstorm) → CLI for context isolation. Observable steps (verify, review, test, debug, manage-*) → internal (current-session Skill()) for direct visibility. `--exec cli|internal` forces all steps.
488
- 5. **CLI Analysis Chain** — Gemini evaluates each CLI step's output, generates `next_step_hints` via `{{ANALYSIS_HINTS}}`. Internal steps skip analysis (output already visible). Sessions chained via `--resume`
495
+ 4. **Per-Step Type** — Each step independently typed as `"skill"` or `"cli"`. Heavy steps (plan, execute, analyze, brainstorm) → CLI for context isolation. Observable steps (verify, review, test, debug, manage-*) → Skill (current-session) for direct visibility. `--exec cli|internal` forces all steps.
496
+ 5. **Unified Executor** — All execution dispatched to `maestro-ralph-execute`, which handles both maestro (static chain) and ralph (adaptive chain with decision nodes) sessions.
489
497
  6. **Phase Propagation** — Auto-detects and passes phase numbers to downstream commands
490
498
  7. **Auto Mode** — `-y` propagates through chain, skipping all confirmations
491
499
  8. **Resumable** — Session state in `.workflow/.maestro/` enables `-c` resume
package/workflows/plan.md CHANGED
@@ -70,7 +70,7 @@ default → Create Mode: P1 → P2 → P3 → P4 → P4.5 → P5
70
70
  - Read `${CONTEXT_DIR}/context.md` if exists, else warn (no upstream analyze)
71
71
 
72
72
  2. **Load spec reference** (if `--spec` flag or index.json has spec_ref)
73
- - Read from `.workflow/task-specs/${spec_ref}/`: spec-summary.md, requirements/_index.md, epics/_index.md
73
+ - Read from `.workflow/.spec/${spec_ref}/`: spec-summary.md, requirements/_index.md, epics/_index.md
74
74
 
75
75
  3. **Load project specs**
76
76
  ```
@@ -42,7 +42,7 @@ Milestone mode creates output dir: .workflow/scratch/verify-{milestone_slug}-{da
42
42
  ## V0: Load Project Specs
43
43
 
44
44
  ```
45
- specs_content = maestro spec load --category validation
45
+ specs_content = maestro spec load --category quality
46
46
  ```
47
47
 
48
48
  Pass specs_content to verifier agent as quality standards context.
@@ -1,33 +0,0 @@
1
- /**
2
- * Maestro Context Monitor — PostToolUse Hook
3
- *
4
- * Reads bridge file written by statusline hook, injects warnings
5
- * into agent context when usage is high.
6
- *
7
- * Bridge file: /tmp/maestro-ctx-{session_id}.json
8
- *
9
- * Thresholds:
10
- * WARNING (remaining <= 35%) — wrap up current task
11
- * CRITICAL (remaining <= 25%) — stop and inform user
12
- *
13
- * Debounce: 5 tool calls between warnings; severity escalation bypasses it.
14
- */
15
- interface MonitorInput {
16
- session_id?: string;
17
- cwd?: string;
18
- }
19
- interface HookOutput {
20
- hookSpecificOutput: {
21
- hookEventName: string;
22
- additionalContext: string;
23
- };
24
- }
25
- /**
26
- * Evaluate context metrics and return a warning if thresholds are crossed.
27
- * Returns null if no warning needed.
28
- */
29
- export declare function evaluateContext(data: MonitorInput): HookOutput | null;
30
- /** Entry point — reads stdin JSON, writes hook output to stdout */
31
- export declare function runContextMonitor(): void;
32
- export {};
33
- //# sourceMappingURL=context-monitor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-monitor.d.ts","sourceRoot":"","sources":["../../../src/hooks/context-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAcD,UAAU,UAAU;IAClB,kBAAkB,EAAE;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAiCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,IAAI,CA8DrE;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,IAAI,IAAI,CAmBxC"}
@@ -1,128 +0,0 @@
1
- /**
2
- * Maestro Context Monitor — PostToolUse Hook
3
- *
4
- * Reads bridge file written by statusline hook, injects warnings
5
- * into agent context when usage is high.
6
- *
7
- * Bridge file: /tmp/maestro-ctx-{session_id}.json
8
- *
9
- * Thresholds:
10
- * WARNING (remaining <= 35%) — wrap up current task
11
- * CRITICAL (remaining <= 25%) — stop and inform user
12
- *
13
- * Debounce: 5 tool calls between warnings; severity escalation bypasses it.
14
- */
15
- import { readFileSync, existsSync, writeFileSync } from 'node:fs';
16
- import { join } from 'node:path';
17
- import { tmpdir } from 'node:os';
18
- import { WARNING_THRESHOLD, CRITICAL_THRESHOLD, STALE_SECONDS, DEBOUNCE_CALLS, BRIDGE_PREFIX, } from './constants.js';
19
- import { resolveWorkspace } from './workspace.js';
20
- import { isAutoMode } from './auto-mode.js';
21
- /** Build the warning message based on severity, workflow presence, and auto mode */
22
- function buildMessage(usedPct, remaining, isCritical, hasWorkflow, autoMode) {
23
- // Auto mode (-y): never instruct the model to stop — let the chain finish
24
- if (autoMode) {
25
- return isCritical
26
- ? `CONTEXT CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
27
- 'Finish current chain step. Progress tracked in status.json. ' +
28
- 'Chain can resume with /maestro -c in a new session.'
29
- : `CONTEXT WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
30
- 'Finish current chain step, then stop chain. Resume with /maestro -c.';
31
- }
32
- if (isCritical) {
33
- return hasWorkflow
34
- ? `CONTEXT CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
35
- 'Context is nearly exhausted. Do NOT start new complex work. ' +
36
- 'State is tracked in .workflow/state.json. Inform the user so they can ' +
37
- 'decide how to proceed (e.g. /maestro -c or pause).'
38
- : `CONTEXT CRITICAL: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
39
- 'Context is nearly exhausted. Inform the user that context is low and ask how they ' +
40
- 'want to proceed. Do NOT autonomously save state or write handoff files unless asked.';
41
- }
42
- return hasWorkflow
43
- ? `CONTEXT WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
44
- 'Context is getting limited. Avoid starting new complex work. ' +
45
- 'If between plan steps, inform the user so they can prepare to pause.'
46
- : `CONTEXT WARNING: Usage at ${usedPct}%. Remaining: ${remaining}%. ` +
47
- 'Be aware that context is getting limited. Avoid unnecessary exploration or ' +
48
- 'starting new complex work.';
49
- }
50
- /**
51
- * Evaluate context metrics and return a warning if thresholds are crossed.
52
- * Returns null if no warning needed.
53
- */
54
- export function evaluateContext(data) {
55
- const sessionId = data.session_id;
56
- if (!sessionId)
57
- return null;
58
- const tmp = tmpdir();
59
- const metricsPath = join(tmp, `${BRIDGE_PREFIX}${sessionId}.json`);
60
- if (!existsSync(metricsPath))
61
- return null;
62
- const metrics = JSON.parse(readFileSync(metricsPath, 'utf8'));
63
- const now = Math.floor(Date.now() / 1000);
64
- // Stale check
65
- if (metrics.timestamp && (now - metrics.timestamp) > STALE_SECONDS)
66
- return null;
67
- const { remaining_percentage: remaining, used_pct: usedPct } = metrics;
68
- // Below threshold — no warning
69
- if (remaining > WARNING_THRESHOLD)
70
- return null;
71
- // --- Debounce ---
72
- const warnPath = join(tmp, `${BRIDGE_PREFIX}${sessionId}-warned.json`);
73
- let warnData = { callsSinceWarn: 0, lastLevel: null };
74
- let firstWarn = true;
75
- if (existsSync(warnPath)) {
76
- try {
77
- warnData = JSON.parse(readFileSync(warnPath, 'utf8'));
78
- firstWarn = false;
79
- }
80
- catch {
81
- // Corrupted — reset
82
- }
83
- }
84
- warnData.callsSinceWarn = (warnData.callsSinceWarn || 0) + 1;
85
- const isCritical = remaining <= CRITICAL_THRESHOLD;
86
- const currentLevel = isCritical ? 'critical' : 'warning';
87
- const severityEscalated = currentLevel === 'critical' && warnData.lastLevel === 'warning';
88
- if (!firstWarn && warnData.callsSinceWarn < DEBOUNCE_CALLS && !severityEscalated) {
89
- writeFileSync(warnPath, JSON.stringify(warnData));
90
- return null;
91
- }
92
- // Reset debounce
93
- warnData.callsSinceWarn = 0;
94
- warnData.lastLevel = currentLevel;
95
- writeFileSync(warnPath, JSON.stringify(warnData));
96
- // Detect maestro workflow state via workspace resolver
97
- const hasWorkflow = resolveWorkspace(data) !== null;
98
- const autoMode = hasWorkflow && isAutoMode(data);
99
- const message = buildMessage(usedPct, remaining, isCritical, hasWorkflow, autoMode);
100
- return {
101
- hookSpecificOutput: {
102
- hookEventName: 'PostToolUse',
103
- additionalContext: message,
104
- },
105
- };
106
- }
107
- /** Entry point — reads stdin JSON, writes hook output to stdout */
108
- export function runContextMonitor() {
109
- let input = '';
110
- const timeout = setTimeout(() => process.exit(0), 3000);
111
- process.stdin.setEncoding('utf8');
112
- process.stdin.on('data', (chunk) => (input += chunk));
113
- process.stdin.on('end', () => {
114
- clearTimeout(timeout);
115
- try {
116
- const data = JSON.parse(input);
117
- const result = evaluateContext(data);
118
- if (result) {
119
- process.stdout.write(JSON.stringify(result));
120
- }
121
- }
122
- catch {
123
- // Silent fail — never block tool execution
124
- process.exit(0);
125
- }
126
- });
127
- }
128
- //# sourceMappingURL=context-monitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-monitor.js","sourceRoot":"","sources":["../../../src/hooks/context-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACl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