maestro-flow 0.4.2 → 0.4.3

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 (80) hide show
  1. package/.claude/commands/maestro-analyze.md +1 -1
  2. package/.claude/commands/maestro-brainstorm.md +1 -1
  3. package/.claude/commands/maestro-collab.md +1 -1
  4. package/.claude/commands/maestro-execute.md +10 -1
  5. package/.claude/commands/maestro-guard.md +101 -0
  6. package/.claude/commands/maestro-impeccable.md +1 -1
  7. package/.claude/commands/maestro-plan.md +15 -2
  8. package/.claude/commands/maestro-ralph-execute.md +9 -2
  9. package/.claude/commands/maestro-ralph.md +8 -1
  10. package/.claude/commands/maestro-verify.md +15 -1
  11. package/.claude/commands/quality-auto-test.md +1 -1
  12. package/.claude/commands/quality-debug.md +1 -1
  13. package/.claude/commands/quality-refactor.md +1 -1
  14. package/.claude/commands/quality-retrospective.md +1 -1
  15. package/.claude/commands/quality-review.md +15 -1
  16. package/.claude/commands/quality-test.md +1 -1
  17. package/.claude/commands/security-audit.md +154 -0
  18. package/.claude/skills/maestro-help/index/catalog.json +2 -0
  19. package/.codex/skills/maestro-analyze/SKILL.md +18 -1
  20. package/.codex/skills/maestro-brainstorm/SKILL.md +17 -4
  21. package/.codex/skills/maestro-collab/SKILL.md +7 -1
  22. package/.codex/skills/maestro-execute/SKILL.md +365 -348
  23. package/.codex/skills/maestro-guard/SKILL.md +97 -0
  24. package/.codex/skills/maestro-impeccable/SKILL.md +1 -1
  25. package/.codex/skills/maestro-plan/SKILL.md +66 -7
  26. package/.codex/skills/maestro-ralph/SKILL.md +1 -1
  27. package/.codex/skills/maestro-verify/SKILL.md +18 -1
  28. package/.codex/skills/quality-auto-test/SKILL.md +13 -3
  29. package/.codex/skills/quality-debug/SKILL.md +362 -346
  30. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  31. package/.codex/skills/quality-retrospective/SKILL.md +292 -292
  32. package/.codex/skills/quality-review/SKILL.md +374 -365
  33. package/.codex/skills/quality-test/SKILL.md +1 -1
  34. package/.codex/skills/security-audit/SKILL.md +154 -0
  35. package/bin/maestro-hook-runner.js +21 -1
  36. package/dashboard/dist-server/src/coordinator/output-parser.js +27 -0
  37. package/dashboard/dist-server/src/coordinator/output-parser.js.map +1 -1
  38. package/dist/src/commands/coordinate.d.ts.map +1 -1
  39. package/dist/src/commands/coordinate.js +2 -0
  40. package/dist/src/commands/coordinate.js.map +1 -1
  41. package/dist/src/commands/hooks.d.ts.map +1 -1
  42. package/dist/src/commands/hooks.js +39 -3
  43. package/dist/src/commands/hooks.js.map +1 -1
  44. package/dist/src/coordinator/output-parser.d.ts.map +1 -1
  45. package/dist/src/coordinator/output-parser.js +27 -0
  46. package/dist/src/coordinator/output-parser.js.map +1 -1
  47. package/dist/src/hooks/delegate-monitor.d.ts +1 -0
  48. package/dist/src/hooks/delegate-monitor.d.ts.map +1 -1
  49. package/dist/src/hooks/delegate-monitor.js +1 -1
  50. package/dist/src/hooks/delegate-monitor.js.map +1 -1
  51. package/dist/src/hooks/guards/workflow-guard.d.ts +15 -0
  52. package/dist/src/hooks/guards/workflow-guard.d.ts.map +1 -1
  53. package/dist/src/hooks/guards/workflow-guard.js +61 -1
  54. package/dist/src/hooks/guards/workflow-guard.js.map +1 -1
  55. package/dist/src/hooks/plugins/decision-log-plugin.d.ts +19 -0
  56. package/dist/src/hooks/plugins/decision-log-plugin.d.ts.map +1 -0
  57. package/dist/src/hooks/plugins/decision-log-plugin.js +28 -0
  58. package/dist/src/hooks/plugins/decision-log-plugin.js.map +1 -0
  59. package/dist/src/hooks/plugins/index.d.ts +2 -0
  60. package/dist/src/hooks/plugins/index.d.ts.map +1 -1
  61. package/dist/src/hooks/plugins/index.js +1 -0
  62. package/dist/src/hooks/plugins/index.js.map +1 -1
  63. package/dist/src/hooks/session-context.d.ts +1 -0
  64. package/dist/src/hooks/session-context.d.ts.map +1 -1
  65. package/dist/src/hooks/session-context.js +1 -1
  66. package/dist/src/hooks/session-context.js.map +1 -1
  67. package/dist/src/hooks/skill-context.d.ts +1 -0
  68. package/dist/src/hooks/skill-context.d.ts.map +1 -1
  69. package/dist/src/hooks/skill-context.js +1 -1
  70. package/dist/src/hooks/skill-context.js.map +1 -1
  71. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  72. package/dist/src/hooks/spec-injector.js +2 -0
  73. package/dist/src/hooks/spec-injector.js.map +1 -1
  74. package/package.json +1 -1
  75. package/workflows/debug.md +73 -0
  76. package/workflows/execute.md +27 -0
  77. package/workflows/plan.md +11 -0
  78. package/workflows/review.md +33 -1
  79. package/workflows/tdd.md +257 -0
  80. package/workflows/verify.md +57 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-analyze
3
- description: Multi-angle analysis with CLI-assisted exploration
3
+ description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
4
4
  argument-hint: "[phase|topic] [-y] [-c] [-q] [--gaps [ISS-ID]]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-brainstorm
3
- description: Brainstorm with auto pipeline or single-role analysis
3
+ description: Use when exploring ideas, evaluating approaches, or needing multi-perspective analysis before implementation
4
4
  argument-hint: "[topic|role-name] [--yes] [--count N] [--session ID] [--update] [--skip-questions] [--include-questions] [--style-skill PKG]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-collab
3
- description: Multi-CLI collaborative analysis -- fan-out to multiple CLI tools, cross-verify, synthesize
3
+ description: Use when a question needs cross-verification from multiple CLI tools or diverse analytical perspectives
4
4
  argument-hint: "\"<requirement>\" [--tools gemini,qwen,claude] [--mode analysis|write] [--rule <template>] [-y]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-execute
3
- description: Execute plan with parallel waves and atomic commits
3
+ description: Use when a confirmed plan is ready for implementation
4
4
  argument-hint: "[phase] [--auto-commit] [--method agent|cli|auto] [--executor <tool>] [--dir <path>] [-y]"
5
5
  allowed-tools:
6
6
  - Read
@@ -98,6 +98,15 @@ Next steps:
98
98
  /manage-status -- View project dashboard
99
99
  ```
100
100
 
101
+ **Completion status:**
102
+ ```
103
+ --- COMPLETION STATUS ---
104
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY
105
+ CONCERNS: {failed_count} tasks failed (if any)
106
+ NEXT: /maestro-verify
107
+ --- END STATUS ---
108
+ ```
109
+
101
110
  If failed tasks exist, suggest /quality-debug for investigation.
102
111
  </execution>
103
112
 
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: maestro-guard
3
+ description: Manage editing boundary restrictions
4
+ argument-hint: "<on|off|status|allow <path>|deny <path>>"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ ---
11
+ <purpose>
12
+ Configure directory-level write boundaries enforced by the workflow-guard PreToolUse hook.
13
+ When enabled, Write and Edit tool calls targeting files outside allowed paths are blocked.
14
+
15
+ Subcommands:
16
+ - **on** — Enable path guard (defaults to `src/` if no paths configured)
17
+ - **off** — Disable path guard (preserves path list)
18
+ - **status** — Show current guard configuration
19
+ - **allow `<path>`** — Add a directory to the allowed paths list
20
+ - **deny `<path>`** — Switch to deny mode and add path to deny list
21
+ </purpose>
22
+
23
+ <context>
24
+ $ARGUMENTS — Parse subcommand and optional path argument.
25
+
26
+ **Config location:** `.workflow/config.json` → `guard` section
27
+
28
+ ```json
29
+ {
30
+ "guard": {
31
+ "enabled": false,
32
+ "mode": "allow",
33
+ "paths": []
34
+ }
35
+ }
36
+ ```
37
+
38
+ **Enforcement:** The `workflow-guard` hook (PreToolUse on Write/Edit) reads this config
39
+ and blocks operations targeting files outside boundaries. Requires hooks level >= `full`.
40
+ </context>
41
+
42
+ <execution>
43
+
44
+ **Step 1: Parse subcommand**
45
+
46
+ Extract from $ARGUMENTS:
47
+ - `on` / `off` / `status` / `allow <path>` / `deny <path>`
48
+ - If no subcommand, default to `status`
49
+
50
+ **Step 2: Read config**
51
+
52
+ Read `.workflow/config.json`. If file missing, initialize with empty guard section.
53
+
54
+ **Step 3: Execute subcommand**
55
+
56
+ **`status`:**
57
+ - Display: enabled/disabled, mode (allow/deny), paths list
58
+ - Check if workflow-guard hook is active (read `.claude/settings.json` for hook presence)
59
+ - If guard enabled but hook not active, warn: "⚠ PathGuard enabled but workflow-guard hook not installed. Run `maestro hooks level full` to activate."
60
+
61
+ **`on`:**
62
+ - Set `guard.enabled = true`
63
+ - If `guard.paths` is empty, set default: `["src/", "tests/", ".workflow/"]`
64
+ - Check hook level, warn if < full
65
+ - Write config
66
+
67
+ **`off`:**
68
+ - Set `guard.enabled = false`
69
+ - Preserve existing paths and mode
70
+ - Write config
71
+
72
+ **`allow <path>`:**
73
+ - Normalize path to forward slashes, ensure trailing slash for directories
74
+ - If `guard.mode` is `deny`, switch to `allow` and clear paths with warning
75
+ - Add path to `guard.paths` (deduplicate)
76
+ - Set `guard.enabled = true` if not already
77
+ - Write config
78
+
79
+ **`deny <path>`:**
80
+ - Normalize path to forward slashes
81
+ - Set `guard.mode = "deny"`
82
+ - Add path to `guard.paths` (deduplicate)
83
+ - Set `guard.enabled = true` if not already
84
+ - Write config
85
+
86
+ **Step 4: Confirm**
87
+
88
+ Display updated guard configuration.
89
+
90
+ </execution>
91
+
92
+ <error_codes>
93
+ - E001: `.workflow/config.json` not found and cannot be created (not a maestro project)
94
+ - W001: PathGuard enabled but workflow-guard hook not installed
95
+ </error_codes>
96
+
97
+ <success_criteria>
98
+ - [ ] Config read/written correctly
99
+ - [ ] Hook level warning displayed when applicable
100
+ - [ ] Updated configuration shown after changes
101
+ </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-impeccable
3
- description: Production-grade UI design 24 commands + chain orchestration with quality gates + design search
3
+ description: Use when designing, auditing, polishing, or improving frontend UI websites, dashboards, landing pages, components
4
4
  argument-hint: "<command|chain|intent> [target] [flags]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-plan
3
- description: Plan phase execution with exploration and verification
4
- argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [-y] [--gaps] [--dir <path>] [--revise [instructions]] [--check <plan-dir>]"
3
+ description: Use when creating, revising, or verifying an execution plan for a phase or task
4
+ argument-hint: "[phase] [--collab] [--spec SPEC-xxx] [-y] [--gaps] [--tdd] [--dir <path>] [--revise [instructions]] [--check <plan-dir>]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -122,6 +122,19 @@ Next steps:
122
122
  /maestro-plan {phase} -- Re-plan with modifications
123
123
  ```
124
124
 
125
+ **Completion status:**
126
+ ```
127
+ --- COMPLETION STATUS ---
128
+ STATUS: DONE|NEEDS_CONTEXT
129
+ CONCERNS: {description if applicable}
130
+ NEXT: /maestro-execute
131
+ --- END STATUS ---
132
+ ```
133
+
134
+ Status mapping:
135
+ - **DONE** — Plan created/revised and confirmed → NEXT: /maestro-execute
136
+ - **NEEDS_CONTEXT** — Ambiguous requirements, insufficient context to produce plan
137
+
125
138
  ### Mode: Revise / Check
126
139
 
127
140
  Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
@@ -180,8 +180,15 @@ Write enriched args back to status.json (resume-safe).
180
180
  - `PHASE: N` → session.phase
181
181
  - `scratch_dir: path` → context.scratch_dir
182
182
  - `SPEC-xxx` → context.spec_session_id
183
- 3. Write status.json
184
- 4. Display: `[{index}/{total}] {skill} completed`
183
+ 3. Scan output for `--- COMPLETION STATUS ---` block. If found, parse and map:
184
+ - `STATUS: DONE` `step.status = "completed"`
185
+ - `STATUS: DONE_WITH_CONCERNS` → `step.status = "completed"`, `step.concerns = CONCERNS value`
186
+ - `STATUS: NEEDS_RETRY` → trigger retry: set `step.status = "pending"`, `step.retried = true` → S_HANDLE_FAIL
187
+ - `STATUS: BLOCKED` → `session.status = "paused"`, display blocker reason from CONCERNS
188
+ - `STATUS: NEEDS_CONTEXT` → `session.status = "paused"`, display context gap from CONCERNS
189
+ - If no `--- COMPLETION STATUS ---` block found → fall back to existing heuristic (backward compatible)
190
+ 4. Write status.json
191
+ 5. Display: `[{index}/{total}] ✓ {skill} completed`
185
192
 
186
193
  ### A_RETRY
187
194
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-ralph
3
- description: Adaptive lifecycle engine infer state, build command chain
3
+ description: Use when the optimal command sequence is unclear and needs automated state-based determination
4
4
  argument-hint: "[-y] \"intent\" | status | continue"
5
5
  allowed-tools:
6
6
  - Read
@@ -238,6 +238,13 @@ Build rules: start from position, skip completed, insert decision nodes with `{
238
238
  ```
239
239
  6. On callback: parse verdict; if parse fails → fallback STATUS="fix"
240
240
  7. Confidence adjustment: <60 + proceed → fix; >95 + fix + retry>0 → suggest proceed
241
+ 8. **Decision log**: Append to `{session_dir}/decisions.ndjson`:
242
+ ```json
243
+ { "id": "DEC-{timestamp}", "timestamp": "{ISO}", "source": "ralph",
244
+ "node_id": "{step.decision}", "type": "quality-gate",
245
+ "verdict": "{adjusted_verdict}", "confidence_score": {N},
246
+ "close_call": {N>=50 && N<=70}, "summary": "{REASON}" }
247
+ ```
241
248
 
242
249
  ### A_STRUCTURAL_EVALUATE
243
250
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-verify
3
- description: Verify goals with must-have checks and test coverage validation
3
+ description: Use after execution to verify goals are actually achieved with evidence-based structural checks
4
4
  argument-hint: "[phase] [--skip-tests] [--skip-antipattern] [--dir <path>]"
5
5
  allowed-tools:
6
6
  - Read
@@ -70,6 +70,20 @@ On confirm → `Skill("spec-add", "<category> <content>")`.
70
70
 
71
71
  **Gap-fix closure loop:**
72
72
  Gaps found → maestro-plan --gaps → maestro-execute → maestro-verify (re-run)
73
+
74
+ **Completion status:**
75
+ ```
76
+ --- COMPLETION STATUS ---
77
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY
78
+ CONCERNS: {description if applicable}
79
+ NEXT: /quality-review
80
+ --- END STATUS ---
81
+ ```
82
+
83
+ Status mapping:
84
+ - **DONE** — All checks pass, no gaps → NEXT: /quality-review
85
+ - **DONE_WITH_CONCERNS** — Gaps found (must-have failures or anti-pattern blockers) → NEXT: /maestro-execute (after /maestro-plan --gaps)
86
+ - **NEEDS_RETRY** — Verification could not complete (missing artifacts, corrupt data)
73
87
  </execution>
74
88
 
75
89
  <error_codes>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-auto-test
3
- description: Auto-generate and run tests from specs or coverage gaps
3
+ description: Use when test coverage needs automated expansion or existing tests need iterative convergence
4
4
  argument-hint: "<phase> [-y] [-c N] [--max-iter <N>] [--layer <L0-L3>] [--strategy <name>] [--dry-run] [--re-run]"
5
5
  allowed-tools:
6
6
  - spawn_agents_on_csv
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-debug
3
- description: Debug with parallel hypotheses and root cause analysis
3
+ description: Use when bugs, test failures, or unexpected behavior need systematic root cause investigation
4
4
  argument-hint: "[issue description] [--from-uat <phase>] [--parallel]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-refactor
3
- description: Reduce tech debt with reflection-driven iteration
3
+ description: Use when accumulated tech debt needs systematic identification and safe reduction
4
4
  argument-hint: "[<scope>]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-retrospective
3
- description: Phase retrospective with insight routing to specs and knowhow
3
+ description: Use after completing a phase to extract lessons, patterns, and improvement opportunities
4
4
  argument-hint: "[phase|N..M] [--lens technical|process|quality|decision] [--all] [--no-route] [--compare N] [-y]"
5
5
  allowed-tools:
6
6
  - Read
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-review
3
- description: Tiered code review with severity classification
3
+ description: Use after execution to evaluate code quality across correctness, security, performance, and architecture
4
4
  argument-hint: "<phase> [--level quick|standard|deep] [--dimensions security,architecture,...] [--skip-specs]"
5
5
  allowed-tools:
6
6
  - Read
@@ -87,6 +87,20 @@ Report format and next-step routing by verdict defined in workflow review.md Rep
87
87
  - PASS → `/quality-test {phase}`
88
88
  - WARN → `/quality-test {phase}` (proceed with caveats)
89
89
  - BLOCK → `/maestro-plan {phase} --gaps` (fix critical findings first)
90
+
91
+ **Completion status:**
92
+ ```
93
+ --- COMPLETION STATUS ---
94
+ STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY
95
+ CONCERNS: {description if applicable}
96
+ NEXT: /quality-refactor
97
+ --- END STATUS ---
98
+ ```
99
+
100
+ Status mapping:
101
+ - **DONE** — PASS verdict, no critical findings → NEXT: /quality-refactor
102
+ - **DONE_WITH_CONCERNS** — WARN verdict, issues found but non-blocking → NEXT: /maestro-verify
103
+ - **NEEDS_RETRY** — BLOCK verdict, critical findings require fix first
90
104
  </execution>
91
105
 
92
106
  <error_codes>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: quality-test
3
- description: Conversational UAT with auto-diagnosis and gap closure
3
+ description: Use when implementation needs user acceptance testing with interactive verification and gap closure
4
4
  argument-hint: "[phase] [--smoke] [--auto-fix]"
5
5
  allowed-tools:
6
6
  - Read
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: security-audit
3
+ description: OWASP Top 10 and STRIDE security auditing with supply chain analysis
4
+ argument-hint: "[quick|standard|deep] [--scope <path>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ - Agent
11
+ - AskUserQuestion
12
+ ---
13
+ <purpose>
14
+ Systematic security audit covering OWASP Top 10, dependency supply chain, secrets detection,
15
+ CI/CD pipeline review, and optional STRIDE threat modeling. Three tiers control depth vs speed.
16
+ </purpose>
17
+
18
+ <context>
19
+ $ARGUMENTS — Parse tier and scope:
20
+ - Tier: `quick` (default) | `standard` | `deep`
21
+ - `--scope <path>`: Limit scan to directory (default: project root)
22
+
23
+ **Tier coverage:**
24
+
25
+ | Tier | OWASP | Dependencies | Secrets | CI/CD | STRIDE | Git History |
26
+ |------|-------|-------------|---------|-------|--------|-------------|
27
+ | quick | ✓ | ✓ | — | — | — | — |
28
+ | standard | ✓ | ✓ | ✓ | ✓ | — | — |
29
+ | deep | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
30
+ </context>
31
+
32
+ <execution>
33
+
34
+ **Phase 1: Reconnaissance**
35
+
36
+ 1. Detect tech stack from package.json / go.mod / requirements.txt / Cargo.toml
37
+ 2. Identify entry points: HTTP handlers, API routes, CLI parsers, WebSocket handlers
38
+ 3. List authentication/authorization modules
39
+ 4. Map data flow: user input → processing → storage → output
40
+
41
+ **Phase 2: OWASP Top 10 Scan** (all tiers)
42
+
43
+ For each category, scan relevant source files:
44
+
45
+ | # | Category | What to check |
46
+ |---|----------|--------------|
47
+ | A01 | Broken Access Control | Missing auth middleware, direct object references, path traversal |
48
+ | A02 | Cryptographic Failures | Weak algorithms, hardcoded keys, missing TLS, plaintext storage |
49
+ | A03 | Injection | SQL concatenation, shell exec with user input, template injection |
50
+ | A04 | Insecure Design | Missing rate limits, no CSRF tokens, predictable tokens |
51
+ | A05 | Security Misconfiguration | Debug mode, default credentials, verbose errors, open CORS |
52
+ | A06 | Vulnerable Components | Known CVEs in dependencies |
53
+ | A07 | Auth Failures | Weak password rules, missing brute-force protection, session fixation |
54
+ | A08 | Data Integrity | Deserialization of untrusted data, unsigned updates |
55
+ | A09 | Logging Failures | Missing audit logs, logging sensitive data |
56
+ | A10 | SSRF | Unvalidated URLs in server-side requests |
57
+
58
+ Use `Grep` for pattern matching (e.g., `eval(`, `exec(`, `innerHTML`, `dangerouslySetInnerHTML`,
59
+ `sql.*\+.*req\.`, `process\.env` without validation).
60
+
61
+ **Phase 3: Dependency Audit** (all tiers)
62
+
63
+ ```bash
64
+ # Node.js
65
+ npm audit --json 2>/dev/null || true
66
+ # Check lockfile integrity
67
+ test -f package-lock.json && echo "lockfile present" || echo "WARNING: no lockfile"
68
+ ```
69
+
70
+ Check for:
71
+ - Known vulnerabilities (CVE references)
72
+ - Lockfile presence and integrity
73
+ - Typosquatting risk on critical dependencies (manually check suspicious names)
74
+
75
+ **Phase 4: Secrets Detection** (standard + deep)
76
+
77
+ ```bash
78
+ # Current codebase
79
+ grep -rn --include="*.ts" --include="*.js" --include="*.json" --include="*.env*" \
80
+ -E "(password|secret|api.?key|token|credential).*=.*['\"][^'\"]{8,}" . || true
81
+ ```
82
+
83
+ Check `.env.example` for leaked values. Check `.gitignore` for missing `.env` patterns.
84
+
85
+ **Phase 5: CI/CD Audit** (standard + deep)
86
+
87
+ Scan `.github/workflows/*.yml` for:
88
+ - Overly permissive `permissions:` (write-all, contents: write)
89
+ - Unpinned action versions (`uses: actions/checkout@main` vs `@v4.1.0`)
90
+ - Secrets in logs (missing `mask` or `add-mask`)
91
+ - Pull request trigger with `pull_request_target` (code injection risk)
92
+
93
+ **Phase 6: STRIDE Threat Modeling** (deep only)
94
+
95
+ For each critical module identified in Phase 1:
96
+
97
+ | Threat | Question |
98
+ |--------|----------|
99
+ | **S**poofing | Can identity be faked? Is auth per-request? |
100
+ | **T**ampering | Can data be modified in transit/storage? Integrity checks? |
101
+ | **R**epudiation | Are actions logged with user identity? |
102
+ | **I**nformation Disclosure | Can unauthorized data be accessed? |
103
+ | **D**enial of Service | Resource limits? Rate limiting? |
104
+ | **E**levation of Privilege | Can roles be escalated? Input validation on role fields? |
105
+
106
+ **Phase 7: Git History Archaeology** (deep only)
107
+
108
+ ```bash
109
+ # Search for previously committed secrets
110
+ git log --all --diff-filter=D --name-only --pretty=format: -- "*.env" "*.key" "*.pem" 2>/dev/null | head -20
111
+ git log -p --all -S "password" --since="1 year ago" -- "*.ts" "*.js" 2>/dev/null | head -50
112
+ ```
113
+
114
+ **Phase 8: Report**
115
+
116
+ Output severity matrix:
117
+
118
+ ```
119
+ === Security Audit ({tier}) ===
120
+
121
+ CRITICAL ({count}):
122
+ - [A03] SQL injection in {file}:{line} — {description}
123
+ Fix: {remediation}
124
+
125
+ HIGH ({count}):
126
+ ...
127
+
128
+ MEDIUM ({count}):
129
+ ...
130
+
131
+ LOW ({count}):
132
+ ...
133
+
134
+ Summary: {total} findings ({critical} critical, {high} high, {medium} medium, {low} low)
135
+ ```
136
+
137
+ Emit completion status:
138
+ ```
139
+ --- COMPLETION STATUS ---
140
+ STATUS: DONE|DONE_WITH_CONCERNS
141
+ CONCERNS: {count} critical findings require immediate action
142
+ NEXT: /quality-review
143
+ --- END STATUS ---
144
+ ```
145
+ </execution>
146
+
147
+ <success_criteria>
148
+ - [ ] Tech stack identified and entry points mapped
149
+ - [ ] OWASP Top 10 categories all checked (tier-appropriate)
150
+ - [ ] Dependency audit completed with CVE listing
151
+ - [ ] Severity matrix produced with file:line references
152
+ - [ ] Each finding includes remediation suggestion
153
+ - [ ] Completion status block emitted
154
+ </success_criteria>
@@ -23,6 +23,7 @@
23
23
  {"name": "maestro-milestone-complete", "command": "/maestro-milestone-complete", "category": "milestone", "description": "里程碑完成 — 归档里程碑并推进下一个", "source": "../../commands/maestro-milestone-complete.md"},
24
24
  {"name": "maestro-milestone-release", "command": "/maestro-milestone-release", "category": "milestone", "description": "里程碑发布 — 生成发布说明和变更日志", "source": "../../commands/maestro-milestone-release.md"},
25
25
  {"name": "maestro-composer", "command": "/maestro-composer", "category": "core", "description": "编排器 — compose + play 工作流组合执行", "source": "../../commands/maestro-composer.md"},
26
+ {"name": "maestro-guard", "command": "/maestro-guard", "category": "core", "description": "编辑边界治理", "source": "../../commands/maestro-guard.md"},
26
27
  {"name": "maestro-player", "command": "/maestro-player", "category": "core", "description": "播放器 — 执行已编排的工作流", "source": "../../commands/maestro-player.md"},
27
28
  {"name": "maestro-ralph", "command": "/maestro-ralph", "category": "ralph", "description": "Ralph 引擎 — 自适应生命周期决策节点管理", "source": "../../commands/maestro-ralph.md"},
28
29
  {"name": "maestro-ralph-execute", "command": "/maestro-ralph-execute", "category": "ralph", "description": "Ralph 执行 — 运行自适应决策链", "source": "../../commands/maestro-ralph-execute.md"},
@@ -45,6 +46,7 @@
45
46
  {"name": "quality-review", "command": "/quality-review", "category": "quality", "description": "代码审查 — 多维度代码质量检查", "source": "../../commands/quality-review.md"},
46
47
  {"name": "quality-auto-test", "command": "/quality-auto-test", "category": "quality", "description": "自动测试 — 智能路由 spec/gap/code 测试", "source": "../../commands/quality-auto-test.md"},
47
48
  {"name": "quality-test", "command": "/quality-test", "category": "quality", "description": "业务测试 — 会话式 UAT 验证", "source": "../../commands/quality-test.md"},
49
+ {"name": "security-audit", "command": "/security-audit", "category": "quality", "description": "OWASP/STRIDE 安全审计", "source": "../../commands/security-audit.md"},
48
50
  {"name": "quality-debug", "command": "/quality-debug", "category": "quality", "description": "质量调试 — 诊断测试失败并提供修复方案", "source": "../../commands/quality-debug.md"},
49
51
  {"name": "quality-refactor", "command": "/quality-refactor", "category": "quality", "description": "代码重构 — 结构优化和模式改进", "source": "../../commands/quality-refactor.md"},
50
52
  {"name": "quality-sync", "command": "/quality-sync", "category": "quality", "description": "质量同步 — 跨 Phase 质量状态对齐", "source": "../../commands/quality-sync.md"},
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-analyze
3
- description: Multi-angle analysis with CLI-assisted exploration
3
+ description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
4
4
  argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase|topic> [-q|--quick] [--gaps [ISS-ID]]\""
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
6
  ---
@@ -158,6 +158,17 @@ Gray area detection: domain-aware (things users SEE/CALL/RUN/READ), phase-specif
158
158
  4. Spec enrichment: Locked decisions -> `maestro spec add arch`; code patterns -> `maestro spec add coding`
159
159
  5. Register artifact in state.json (type: analyze)
160
160
  6. Copy outputs to scratchDir, display summary
161
+ 7. **Next-step routing**:
162
+
163
+ | Scope | Condition | Next |
164
+ |-------|-----------|------|
165
+ | Phase/Milestone | Go + UI work needed | `$maestro-impeccable build {target}` |
166
+ | Phase/Milestone | Go + ready to plan | `$maestro-plan` or `$maestro-plan {phase}` |
167
+ | Phase/Milestone | No-Go | `$maestro-brainstorm {topic}` |
168
+ | Adhoc/Standalone | Ready to plan | `$maestro-plan --dir {scratch_dir}` |
169
+ | Adhoc/Standalone | Need more exploration | `$maestro-analyze {topic} --continue` |
170
+ | Gaps | Issues analyzed | `$maestro-plan --gaps` |
171
+ | Gaps | Need more context | `$maestro-analyze --gaps {ISS-ID}` |
161
172
 
162
173
  </actions>
163
174
 
@@ -192,9 +203,15 @@ Protocol: read before analysis, append-only, dedup by type+key.
192
203
  <success_criteria>
193
204
  - [ ] All waves executed in order (or skipped per mode)
194
205
  - [ ] context.md produced (all modes); analysis.md + conclusions.json (full mode)
206
+ - [ ] context.md contains all decisions classified as Locked/Free/Deferred
207
+ - [ ] Decision Recording Protocol applied to all decisions
195
208
  - [ ] Confidence scored per dimension with factor-based model (full mode)
209
+ - [ ] Readiness gate checked before synthesis (wave 3)
210
+ - [ ] Pressure pass completed ≥ 1 time on highest-risk dimension before synthesis
196
211
  - [ ] Deferred items auto-created as issues
212
+ - [ ] Scope creep redirected to Deferred section
197
213
  - [ ] Artifact registered in state.json
198
214
  - [ ] discoveries.ndjson append-only throughout
215
+ - [ ] Next step routed (plan for Go, brainstorm for No-Go, plan --gaps for Gaps)
199
216
  </success_criteria>
200
217
  </output>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-brainstorm
3
- description: Brainstorm with auto pipeline or single-role analysis
3
+ description: Use when exploring ideas, evaluating approaches, or needing multi-perspective analysis before implementation
4
4
  argument-hint: "[topic] [-y|--yes] [-c|--concurrency N] [--continue] [--count N] [--skip-questions]"
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
@@ -17,6 +17,11 @@ $ARGUMENTS — topic text and optional flags.
17
17
 
18
18
  **9 valid roles**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
19
19
 
20
+ ### Pre-load specs
21
+ 1. **Architecture specs**: `maestro spec load --category arch` — load architecture constraints as context for multi-role analysis (roles respect documented decisions).
22
+ 2. **Role Knowledge**: `maestro wiki list --category arch` → identify relevant entries → `maestro wiki load <id1> [id2...]`
23
+ 3. Both optional — proceed without if unavailable.
24
+
20
25
  **Session**: `.workflow/.csv-wave/{YYYYMMDD}-brainstorm-{slug}/`
21
26
  **Output**: tasks.csv, results.csv, discoveries.ndjson, context.md, `.brainstorming/` (guidance-specification.md, feature-index.json, synthesis-changelog.md, feature-specs/, {role}/analysis*.md)
22
27
  </context>
@@ -139,8 +144,16 @@ Protocol: read before analysis, append-only, dedup by type+key.
139
144
 
140
145
  <success_criteria>
141
146
  - [ ] 3 waves executed: guidance → parallel roles → synthesis
142
- - [ ] guidance-specification.md + role analyses + synthesis artifacts produced
143
- - [ ] feature-index.json + context.md generated
147
+ - [ ] guidance-specification.md with RFC 2119 keywords, terminology, non-goals, feature decomposition
148
+ - [ ] Role analysis files for each selected NON-UI role
149
+ - [ ] If ui-designer selected: DESIGN.md established via impeccable explore; analysis.md with UX analysis
150
+ - [ ] Feature specs in `.brainstorming/feature-specs/` or synthesis-specification.md
151
+ - [ ] UI-bearing feature specs reference DESIGN.md for visual constraints
152
+ - [ ] feature-index.json + synthesis-changelog.md + context.md generated
153
+ - [ ] All user decisions captured with Decision Recording Protocol
154
+ - [ ] Confidence scored per role and after cross-role analysis
155
+ - [ ] Readiness gate checked before spec generation (wave 3)
156
+ - [ ] Pressure pass completed on at least 1 feature spec
144
157
  - [ ] discoveries.ndjson append-only throughout
145
- - [ ] Confidence scored, conflict quality gate evaluated
158
+ - [ ] Conflict quality gate: >3 UNRESOLVED → warn
146
159
  </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: maestro-collab
3
- description: Multi-CLI collaborative analysis -- fan-out to multiple CLI tools, cross-verify, synthesize
3
+ description: Use when a question needs cross-verification from multiple CLI tools or diverse analytical perspectives
4
4
  argument-hint: "\"<requirement>\" [--tools gemini,qwen,claude] [--mode analysis|write] [--rule <template>] [-y]"
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
@@ -216,3 +216,9 @@ Protocol: read before analysis, append-only, dedup by type+key.
216
216
  - [ ] CLB artifact registered, outputs copied to scratchDir
217
217
  - [ ] Partial degradation: continued if 1+ tools succeeded
218
218
  </success_criteria>
219
+
220
+ <next_step_routing>
221
+ - Deep feasibility analysis → `$maestro-analyze "{topic}"`
222
+ - Plan from conclusions → `$maestro-plan --dir {dir}`
223
+ - Expand exploration → `$maestro-brainstorm "{topic}"`
224
+ </next_step_routing>