maestro-flow 0.4.23 → 0.4.25

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 (120) hide show
  1. package/.agents/skills/maestro-impeccable/SKILL.md +5 -1
  2. package/.agents/skills/maestro-next/SKILL.md +7 -1
  3. package/.agents/skills/maestro-player/SKILL.md +9 -2
  4. package/.agents/skills/maestro-tools-execute/SKILL.md +4 -4
  5. package/.agents/skills/manage-codebase-rebuild/SKILL.md +4 -6
  6. package/.agents/skills/spec-load/SKILL.md +11 -4
  7. package/.agy/skills/maestro-impeccable/SKILL.md +5 -1
  8. package/.agy/skills/maestro-next/SKILL.md +7 -1
  9. package/.agy/skills/maestro-player/SKILL.md +9 -2
  10. package/.agy/skills/maestro-tools-execute/SKILL.md +4 -4
  11. package/.agy/skills/manage-codebase-rebuild/SKILL.md +4 -6
  12. package/.agy/skills/spec-load/SKILL.md +11 -4
  13. package/.claude/commands/maestro-impeccable.md +5 -1
  14. package/.claude/commands/maestro-next.md +7 -1
  15. package/.claude/commands/maestro-player.md +9 -2
  16. package/.claude/commands/maestro-tools-execute.md +4 -4
  17. package/.claude/commands/manage-codebase-rebuild.md +4 -6
  18. package/.claude/commands/spec-load.md +11 -4
  19. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -2
  20. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +96 -25
  21. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  22. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +7 -7
  23. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  24. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +1 -1
  25. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  26. package/dashboard/dist-server/dashboard/src/shared/constants.d.ts +1 -0
  27. package/dashboard/dist-server/dashboard/src/shared/constants.js +1 -0
  28. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  29. package/dashboard/dist-server/src/graph/types.d.ts +98 -0
  30. package/dashboard/dist-server/src/graph/types.js +19 -1
  31. package/dashboard/dist-server/src/graph/types.js.map +1 -1
  32. package/dist/src/commands/kg.d.ts.map +1 -1
  33. package/dist/src/commands/kg.js +345 -2
  34. package/dist/src/commands/kg.js.map +1 -1
  35. package/dist/src/commands/spec.d.ts.map +1 -1
  36. package/dist/src/commands/spec.js +82 -38
  37. package/dist/src/commands/spec.js.map +1 -1
  38. package/dist/src/graph/db/connection.d.ts +22 -0
  39. package/dist/src/graph/db/connection.d.ts.map +1 -0
  40. package/dist/src/graph/db/connection.js +113 -0
  41. package/dist/src/graph/db/connection.js.map +1 -0
  42. package/dist/src/graph/db/index.d.ts +4 -0
  43. package/dist/src/graph/db/index.d.ts.map +1 -0
  44. package/dist/src/graph/db/index.js +4 -0
  45. package/dist/src/graph/db/index.js.map +1 -0
  46. package/dist/src/graph/db/migrations.d.ts +5 -0
  47. package/dist/src/graph/db/migrations.d.ts.map +1 -0
  48. package/dist/src/graph/db/migrations.js +18 -0
  49. package/dist/src/graph/db/migrations.js.map +1 -0
  50. package/dist/src/graph/db/queries.d.ts +50 -0
  51. package/dist/src/graph/db/queries.d.ts.map +1 -0
  52. package/dist/src/graph/db/queries.js +313 -0
  53. package/dist/src/graph/db/queries.js.map +1 -0
  54. package/dist/src/graph/db/schema.sql +131 -0
  55. package/dist/src/graph/facade.d.ts +53 -0
  56. package/dist/src/graph/facade.d.ts.map +1 -0
  57. package/dist/src/graph/facade.js +172 -0
  58. package/dist/src/graph/facade.js.map +1 -0
  59. package/dist/src/graph/graph-queries.d.ts +24 -0
  60. package/dist/src/graph/graph-queries.d.ts.map +1 -0
  61. package/dist/src/graph/graph-queries.js +173 -0
  62. package/dist/src/graph/graph-queries.js.map +1 -0
  63. package/dist/src/graph/index.d.ts +8 -0
  64. package/dist/src/graph/index.d.ts.map +1 -1
  65. package/dist/src/graph/index.js +9 -0
  66. package/dist/src/graph/index.js.map +1 -1
  67. package/dist/src/graph/loader.d.ts +8 -0
  68. package/dist/src/graph/loader.d.ts.map +1 -1
  69. package/dist/src/graph/loader.js +20 -0
  70. package/dist/src/graph/loader.js.map +1 -1
  71. package/dist/src/graph/migration.d.ts +8 -0
  72. package/dist/src/graph/migration.d.ts.map +1 -0
  73. package/dist/src/graph/migration.js +134 -0
  74. package/dist/src/graph/migration.js.map +1 -0
  75. package/dist/src/graph/search/index.d.ts +4 -0
  76. package/dist/src/graph/search/index.d.ts.map +1 -0
  77. package/dist/src/graph/search/index.js +3 -0
  78. package/dist/src/graph/search/index.js.map +1 -0
  79. package/dist/src/graph/search/query-parser.d.ts +11 -0
  80. package/dist/src/graph/search/query-parser.d.ts.map +1 -0
  81. package/dist/src/graph/search/query-parser.js +111 -0
  82. package/dist/src/graph/search/query-parser.js.map +1 -0
  83. package/dist/src/graph/search/query-utils.d.ts +12 -0
  84. package/dist/src/graph/search/query-utils.d.ts.map +1 -0
  85. package/dist/src/graph/search/query-utils.js +184 -0
  86. package/dist/src/graph/search/query-utils.js.map +1 -0
  87. package/dist/src/graph/sync/content-hash.d.ts +7 -0
  88. package/dist/src/graph/sync/content-hash.d.ts.map +1 -0
  89. package/dist/src/graph/sync/content-hash.js +33 -0
  90. package/dist/src/graph/sync/content-hash.js.map +1 -0
  91. package/dist/src/graph/sync/incremental-sync.d.ts +23 -0
  92. package/dist/src/graph/sync/incremental-sync.d.ts.map +1 -0
  93. package/dist/src/graph/sync/incremental-sync.js +338 -0
  94. package/dist/src/graph/sync/incremental-sync.js.map +1 -0
  95. package/dist/src/graph/sync/index.d.ts +7 -0
  96. package/dist/src/graph/sync/index.d.ts.map +1 -0
  97. package/dist/src/graph/sync/index.js +5 -0
  98. package/dist/src/graph/sync/index.js.map +1 -0
  99. package/dist/src/graph/sync/watch-policy.d.ts +2 -0
  100. package/dist/src/graph/sync/watch-policy.d.ts.map +1 -0
  101. package/dist/src/graph/sync/watch-policy.js +38 -0
  102. package/dist/src/graph/sync/watch-policy.js.map +1 -0
  103. package/dist/src/graph/sync/watcher.d.ts +44 -0
  104. package/dist/src/graph/sync/watcher.d.ts.map +1 -0
  105. package/dist/src/graph/sync/watcher.js +153 -0
  106. package/dist/src/graph/sync/watcher.js.map +1 -0
  107. package/dist/src/graph/traversal.d.ts +37 -0
  108. package/dist/src/graph/traversal.d.ts.map +1 -0
  109. package/dist/src/graph/traversal.js +335 -0
  110. package/dist/src/graph/traversal.js.map +1 -0
  111. package/dist/src/graph/types.d.ts +98 -0
  112. package/dist/src/graph/types.d.ts.map +1 -1
  113. package/dist/src/graph/types.js +19 -1
  114. package/dist/src/graph/types.js.map +1 -1
  115. package/dist/src/utils/update-notices.js +11 -0
  116. package/dist/src/utils/update-notices.js.map +1 -1
  117. package/package.json +4 -2
  118. package/workflows/analyze.md +19 -13
  119. package/workflows/codebase-rebuild.md +18 -107
  120. package/workflows/execute.md +6 -5
@@ -147,7 +147,11 @@ Layer 1 did not match. Check for chain-level keywords — even if the prompt als
147
147
  | design system, tokens, design foundation, design infrastructure | foundation |
148
148
  | real-time, live, browser | live |
149
149
 
150
- Ambiguous + no `-y` → ask_user.
150
+ Ambiguous + no `-y`:
151
+
152
+ ask_user (single-select, header: "意图确认"):
153
+ - Options: top 2-3 matched chains from Layer 2 table, each with label = chain name, description = matched keywords
154
+ - Last option: **"直接构建"** — skip chain, route to Layer 3 craft
151
155
 
152
156
  ### Layer 3: Concrete build task → Direct craft
153
157
 
@@ -220,7 +220,13 @@ brainstorm → blueprint → init → analyze-macro → roadmap
220
220
  执行参数: <args>
221
221
  ```
222
222
 
223
- `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则 ask_user 提供:执行 top pick / 选备选 / 修改参数 / 取消。
223
+ `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则:
224
+
225
+ ask_user (single-select, header: "执行确认"):
226
+ - **执行推荐** (Recommended) — run top pick with shown args
227
+ - **选择备选** — pick from alternative commands
228
+ - **修改参数** — adjust args before executing
229
+ - **取消** — do nothing
224
230
 
225
231
  </presentation>
226
232
 
@@ -147,13 +147,20 @@ S_COMPLETE:
147
147
  - **skill/command**: `invoke_skill(skill, resolved_args)` → extract session_id, output_path, artifacts
148
148
  - **cli**: `shell(run_in_background: true)` → STOP, wait for callback → `maestro delegate output <id>`
149
149
  - **agent**: `delegate_subagent(subagent_type, resolved_args)`
150
- - **checkpoint**: write checkpoint snapshot. If auto_continue==false: ask_user (Continue/Pause/Abort)
150
+ - **checkpoint**: write checkpoint snapshot. If auto_continue==false:
151
+ ask_user (single-select, header: "Checkpoint"):
152
+ - **Continue** — proceed to next step
153
+ - **Pause** — save progress, exit (resume with `-c`)
154
+ - **Abort** — stop workflow
151
155
  4. Set step status="completed" (or "skipped"/"failed"), write status.json
152
156
 
153
157
  ### A_COMPLETE_SESSION
154
158
 
155
159
  Set status="completed", completed_at. Display summary: session, template, steps completed, context, per-step results, artifacts, session dir.
156
- ask_user: Keep session / Run again / Done.
160
+ ask_user (single-select, header: "完成"):
161
+ - **Keep session** — preserve artifacts for reference
162
+ - **Run again** — re-execute with same template
163
+ - **Done** — clean up and exit
157
164
 
158
165
  </actions>
159
166
 
@@ -73,10 +73,10 @@ maestro wiki load <knowhow-id>
73
73
 
74
74
  ### Step 3: Confirm Execution
75
75
 
76
- Ask user:
77
- - Execute steps as-is?
78
- - Adjust parameters/scope?
79
- - View only, do not execute?
76
+ ask_user (single-select, header: "执行方式"):
77
+ - **Execute as-is** (Recommended) — run all steps with current parameters
78
+ - **Adjust parameters** — modify scope or parameters before executing
79
+ - **View only** display steps without executing
80
80
 
81
81
  ### Step 4: Step-by-Step Execution
82
82
 
@@ -37,7 +37,7 @@ $ARGUMENTS -- optional flags.
37
37
  | Agent | Focus | Output file |
38
38
  |-------|-------|-------------|
39
39
  | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
40
- | Mapper 2 | **Architecture** -- produced by KG pipeline Step 14 (UA architecture-analyzer delegate); layers, module boundaries, data flow, entry points | `architecture.md` |
40
+ | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
41
41
  | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
42
42
  | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
43
43
 
@@ -45,9 +45,7 @@ $ARGUMENTS -- optional flags.
45
45
  - `.workflow/` -- must be initialized (project.md, state.json exist)
46
46
  - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
47
47
  - `.workflow/codebase/doc-index.json` -- generated documentation index
48
- - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by KG pipeline Steps 10–17 if UA vendor is installed)
49
-
50
- **UA vendor requirement:** The KG pipeline (Steps 10–17) requires the UA vendor at `~/.maestro/vendor/ua/understand-anything-plugin/`. If not installed, these steps are skipped automatically. Run `scripts/ua-vendor-setup.sh` to install.
48
+ - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by `maestro kg index`)
51
49
  </context>
52
50
 
53
51
  <execution>
@@ -81,8 +79,8 @@ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
81
79
  - [ ] All documentation files regenerated
82
80
  - [ ] state.json updated with rebuild timestamp
83
81
  - [ ] project.md Tech Stack section updated if changes detected
84
- - [ ] KG pipeline executed (if UA vendor installed)
85
- - [ ] knowledge-graph.json generated in .workflow/codebase/ (if UA vendor installed)
82
+ - [ ] KG pipeline executed (`maestro kg index`)
83
+ - [ ] knowledge-graph.json generated in .workflow/codebase/
86
84
  - [ ] KG nodes indexed as virtual wiki entries (automatic via WikiIndexer on next wiki access)
87
85
  - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
88
86
  - [ ] KG impact check available: `maestro kg diff-wiki` for future change impact analysis
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: spec-load
3
3
  description: Load specs and lessons for current context
4
- argument-hint: "[--category <category>] [--keyword <word>]"
4
+ argument-hint: "[--scope <scope>] [--category <category>] [--keyword <word>]"
5
5
  allowed-tools:
6
6
  - read_file
7
7
  - shell
@@ -11,8 +11,9 @@ allowed-tools:
11
11
  <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
12
12
 
13
13
  <purpose>
14
- Load relevant specs filtered by category (file-level) and/or keyword (entry-level).
14
+ Load relevant specs filtered by scope, category (file-level) and/or keyword (entry-level).
15
15
  Category-based loading: loads the category's primary doc in full + matching entries from other files.
16
+ By default, loads from both global (~/.maestro/specs/) and project (.workflow/specs/) layers.
16
17
  </purpose>
17
18
 
18
19
  <required_reading>
@@ -23,6 +24,11 @@ Category-based loading: loads the category's primary doc in full + matching entr
23
24
  $ARGUMENTS -- optional flags and keyword
24
25
 
25
26
  **Flags:**
27
+ - `--scope <scope>` — Load scope (default: global + project merged):
28
+ - `project`: project baseline only (.workflow/specs/)
29
+ - `global`: global + project merged (~/.maestro/specs/ + .workflow/specs/)
30
+ - `team`: project + team shared (.workflow/collab/specs/)
31
+ - `personal`: project + team + personal (requires uid)
26
32
  - `--category <category>` — Load by category: primary category doc (full) + cross-file entries with matching category attr. Categories: coding, arch, test, review, debug, learning, ui.
27
33
  - `--keyword <word>` — Filter by keyword within entries
28
34
 
@@ -40,7 +46,8 @@ $ARGUMENTS -- optional flags and keyword
40
46
 
41
47
  **Examples:**
42
48
  ```
43
- /spec-load --category coding # coding全文 + 跨文件coding条目
49
+ /spec-load --category coding # coding全文 + 跨文件coding条目 (global + project)
50
+ /spec-load --scope global --category arch # 明确包含全局 arch 规范
44
51
  /spec-load --category review # review-standards + quality-rules + 跨文件review条目
45
52
  /spec-load --category coding --keyword auth
46
53
  /spec-load --keyword auth
@@ -59,7 +66,7 @@ Follow '~/.maestro/workflows/specs-load.md' completely.
59
66
  <error_codes>
60
67
  | Code | Severity | Description | Stage |
61
68
  |------|----------|-------------|-------|
62
- | E001 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | detect_context |
69
+ | E001 | warning | `.workflow/specs/` not initialized -- run `/spec-setup` first (global specs still available) | detect_context |
63
70
  | W001 | warning | No matching specs found for keyword -- showing all specs in category instead | load_specs |
64
71
  </error_codes>
65
72
 
@@ -146,7 +146,11 @@ Layer 1 did not match. Check for chain-level keywords — even if the prompt als
146
146
  | design system, tokens, design foundation, design infrastructure | foundation |
147
147
  | real-time, live, browser | live |
148
148
 
149
- Ambiguous + no `-y` → ask_question.
149
+ Ambiguous + no `-y`:
150
+
151
+ ask_question (single-select, header: "意图确认"):
152
+ - Options: top 2-3 matched chains from Layer 2 table, each with label = chain name, description = matched keywords
153
+ - Last option: **"直接构建"** — skip chain, route to Layer 3 craft
150
154
 
151
155
  ### Layer 3: Concrete build task → Direct craft
152
156
 
@@ -216,7 +216,13 @@ brainstorm → blueprint → init → analyze-macro → roadmap
216
216
  执行参数: <args>
217
217
  ```
218
218
 
219
- `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则 ask_question 提供:执行 top pick / 选备选 / 修改参数 / 取消。
219
+ `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则:
220
+
221
+ ask_question (single-select, header: "执行确认"):
222
+ - **执行推荐** (Recommended) — run top pick with shown args
223
+ - **选择备选** — pick from alternative commands
224
+ - **修改参数** — adjust args before executing
225
+ - **取消** — do nothing
220
226
 
221
227
  </presentation>
222
228
 
@@ -146,13 +146,20 @@ S_COMPLETE:
146
146
  - **skill/command**: `Skill(skill, resolved_args)` → extract session_id, output_path, artifacts
147
147
  - **cli**: `run_command(run_in_background: true)` → STOP, wait for callback → `maestro delegate output <id>`
148
148
  - **agent**: `invoke_subagent([{ TypeName: "<TypeName>", Role: "<Role>", Prompt: "<Prompt>", Workspace: "inherit" }])`
149
- - **checkpoint**: write checkpoint snapshot. If auto_continue==false: ask_question (Continue/Pause/Abort)
149
+ - **checkpoint**: write checkpoint snapshot. If auto_continue==false:
150
+ ask_question (single-select, header: "Checkpoint"):
151
+ - **Continue** — proceed to next step
152
+ - **Pause** — save progress, exit (resume with `-c`)
153
+ - **Abort** — stop workflow
150
154
  4. Set step status="completed" (or "skipped"/"failed"), write status.json
151
155
 
152
156
  ### A_COMPLETE_SESSION
153
157
 
154
158
  Set status="completed", completed_at. Display summary: session, template, steps completed, context, per-step results, artifacts, session dir.
155
- ask_question: Keep session / Run again / Done.
159
+ ask_question (single-select, header: "完成"):
160
+ - **Keep session** — preserve artifacts for reference
161
+ - **Run again** — re-execute with same template
162
+ - **Done** — clean up and exit
156
163
 
157
164
  </actions>
158
165
 
@@ -73,10 +73,10 @@ maestro wiki load <knowhow-id>
73
73
 
74
74
  ### Step 3: Confirm Execution
75
75
 
76
- Ask user:
77
- - Execute steps as-is?
78
- - Adjust parameters/scope?
79
- - View only, do not execute?
76
+ ask_question (single-select, header: "执行方式"):
77
+ - **Execute as-is** (Recommended) — run all steps with current parameters
78
+ - **Adjust parameters** — modify scope or parameters before executing
79
+ - **View only** display steps without executing
80
80
 
81
81
  ### Step 4: Step-by-Step Execution
82
82
 
@@ -37,7 +37,7 @@ $ARGUMENTS -- optional flags.
37
37
  | Agent | Focus | Output file |
38
38
  |-------|-------|-------------|
39
39
  | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
40
- | Mapper 2 | **Architecture** -- produced by KG pipeline Step 14 (UA architecture-analyzer delegate); layers, module boundaries, data flow, entry points | `architecture.md` |
40
+ | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
41
41
  | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
42
42
  | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
43
43
 
@@ -45,9 +45,7 @@ $ARGUMENTS -- optional flags.
45
45
  - `.workflow/` -- must be initialized (project.md, state.json exist)
46
46
  - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
47
47
  - `.workflow/codebase/doc-index.json` -- generated documentation index
48
- - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by KG pipeline Steps 10–17 if UA vendor is installed)
49
-
50
- **UA vendor requirement:** The KG pipeline (Steps 10–17) requires the UA vendor at `~/.maestro/vendor/ua/understand-anything-plugin/`. If not installed, these steps are skipped automatically. Run `scripts/ua-vendor-setup.sh` to install.
48
+ - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by `maestro kg index`)
51
49
  </context>
52
50
 
53
51
  <execution>
@@ -81,8 +79,8 @@ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
81
79
  - [ ] All documentation files regenerated
82
80
  - [ ] state.json updated with rebuild timestamp
83
81
  - [ ] project.md Tech Stack section updated if changes detected
84
- - [ ] KG pipeline executed (if UA vendor installed)
85
- - [ ] knowledge-graph.json generated in .workflow/codebase/ (if UA vendor installed)
82
+ - [ ] KG pipeline executed (`maestro kg index`)
83
+ - [ ] knowledge-graph.json generated in .workflow/codebase/
86
84
  - [ ] KG nodes indexed as virtual wiki entries (automatic via WikiIndexer on next wiki access)
87
85
  - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
88
86
  - [ ] KG impact check available: `maestro kg diff-wiki` for future change impact analysis
@@ -1,15 +1,16 @@
1
1
  ---
2
2
  name: spec-load
3
3
  description: Load specs and lessons for current context
4
- argument-hint: [--category <category>] [--keyword <word>]
4
+ argument-hint: [--scope <scope>] [--category <category>] [--keyword <word>]
5
5
  allowed-tools:
6
6
  - grep_search
7
7
  - run_command
8
8
  - view_file
9
9
  ---
10
10
  <purpose>
11
- Load relevant specs filtered by category (file-level) and/or keyword (entry-level).
11
+ Load relevant specs filtered by scope, category (file-level) and/or keyword (entry-level).
12
12
  Category-based loading: loads the category's primary doc in full + matching entries from other files.
13
+ By default, loads from both global (~/.maestro/specs/) and project (.workflow/specs/) layers.
13
14
  </purpose>
14
15
 
15
16
  <required_reading>
@@ -20,6 +21,11 @@ Category-based loading: loads the category's primary doc in full + matching entr
20
21
  $ARGUMENTS -- optional flags and keyword
21
22
 
22
23
  **Flags:**
24
+ - `--scope <scope>` — Load scope (default: global + project merged):
25
+ - `project`: project baseline only (.workflow/specs/)
26
+ - `global`: global + project merged (~/.maestro/specs/ + .workflow/specs/)
27
+ - `team`: project + team shared (.workflow/collab/specs/)
28
+ - `personal`: project + team + personal (requires uid)
23
29
  - `--category <category>` — Load by category: primary category doc (full) + cross-file entries with matching category attr. Categories: coding, arch, test, review, debug, learning, ui.
24
30
  - `--keyword <word>` — Filter by keyword within entries
25
31
 
@@ -37,7 +43,8 @@ $ARGUMENTS -- optional flags and keyword
37
43
 
38
44
  **Examples:**
39
45
  ```
40
- /spec-load --category coding # coding全文 + 跨文件coding条目
46
+ /spec-load --category coding # coding全文 + 跨文件coding条目 (global + project)
47
+ /spec-load --scope global --category arch # 明确包含全局 arch 规范
41
48
  /spec-load --category review # review-standards + quality-rules + 跨文件review条目
42
49
  /spec-load --category coding --keyword auth
43
50
  /spec-load --keyword auth
@@ -56,7 +63,7 @@ Follow '~/.maestro/workflows/specs-load.md' completely.
56
63
  <error_codes>
57
64
  | Code | Severity | Description | Stage |
58
65
  |------|----------|-------------|-------|
59
- | E001 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | detect_context |
66
+ | E001 | warning | `.workflow/specs/` not initialized -- run `/spec-setup` first (global specs still available) | detect_context |
60
67
  | W001 | warning | No matching specs found for keyword -- showing all specs in category instead | load_specs |
61
68
  </error_codes>
62
69
 
@@ -145,7 +145,11 @@ Layer 1 did not match. Check for chain-level keywords — even if the prompt als
145
145
  | design system, tokens, design foundation, design infrastructure | foundation |
146
146
  | real-time, live, browser | live |
147
147
 
148
- Ambiguous + no `-y` → AskUserQuestion.
148
+ Ambiguous + no `-y`:
149
+
150
+ AskUserQuestion (single-select, header: "意图确认"):
151
+ - Options: top 2-3 matched chains from Layer 2 table, each with label = chain name, description = matched keywords
152
+ - Last option: **"直接构建"** — skip chain, route to Layer 3 craft
149
153
 
150
154
  ### Layer 3: Concrete build task → Direct craft
151
155
 
@@ -218,7 +218,13 @@ brainstorm → blueprint → init → analyze-macro → roadmap
218
218
  执行参数: <args>
219
219
  ```
220
220
 
221
- `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则 AskUserQuestion 提供:执行 top pick / 选备选 / 修改参数 / 取消。
221
+ `--dry-run` 展示后结束;`-y` 直接 S_EXECUTE;否则:
222
+
223
+ AskUserQuestion (single-select, header: "执行确认"):
224
+ - **执行推荐** (Recommended) — run top pick with shown args
225
+ - **选择备选** — pick from alternative commands
226
+ - **修改参数** — adjust args before executing
227
+ - **取消** — do nothing
222
228
 
223
229
  </presentation>
224
230
 
@@ -145,13 +145,20 @@ S_COMPLETE:
145
145
  - **skill/command**: `Skill(skill, resolved_args)` → extract session_id, output_path, artifacts
146
146
  - **cli**: `Bash(run_in_background: true)` → STOP, wait for callback → `maestro delegate output <id>`
147
147
  - **agent**: `Agent(subagent_type, resolved_args)`
148
- - **checkpoint**: write checkpoint snapshot. If auto_continue==false: AskUserQuestion (Continue/Pause/Abort)
148
+ - **checkpoint**: write checkpoint snapshot. If auto_continue==false:
149
+ AskUserQuestion (single-select, header: "Checkpoint"):
150
+ - **Continue** — proceed to next step
151
+ - **Pause** — save progress, exit (resume with `-c`)
152
+ - **Abort** — stop workflow
149
153
  4. Set step status="completed" (or "skipped"/"failed"), write status.json
150
154
 
151
155
  ### A_COMPLETE_SESSION
152
156
 
153
157
  Set status="completed", completed_at. Display summary: session, template, steps completed, context, per-step results, artifacts, session dir.
154
- AskUserQuestion: Keep session / Run again / Done.
158
+ AskUserQuestion (single-select, header: "完成"):
159
+ - **Keep session** — preserve artifacts for reference
160
+ - **Run again** — re-execute with same template
161
+ - **Done** — clean up and exit
155
162
 
156
163
  </actions>
157
164
 
@@ -71,10 +71,10 @@ maestro wiki load <knowhow-id>
71
71
 
72
72
  ### Step 3: Confirm Execution
73
73
 
74
- Ask user:
75
- - Execute steps as-is?
76
- - Adjust parameters/scope?
77
- - View only, do not execute?
74
+ AskUserQuestion (single-select, header: "执行方式"):
75
+ - **Execute as-is** (Recommended) — run all steps with current parameters
76
+ - **Adjust parameters** — modify scope or parameters before executing
77
+ - **View only** display steps without executing
78
78
 
79
79
  ### Step 4: Step-by-Step Execution
80
80
 
@@ -35,7 +35,7 @@ $ARGUMENTS -- optional flags.
35
35
  | Agent | Focus | Output file |
36
36
  |-------|-------|-------------|
37
37
  | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
38
- | Mapper 2 | **Architecture** -- produced by KG pipeline Step 14 (UA architecture-analyzer delegate); layers, module boundaries, data flow, entry points | `architecture.md` |
38
+ | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
39
39
  | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
40
40
  | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
41
41
 
@@ -43,9 +43,7 @@ $ARGUMENTS -- optional flags.
43
43
  - `.workflow/` -- must be initialized (project.md, state.json exist)
44
44
  - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
45
45
  - `.workflow/codebase/doc-index.json` -- generated documentation index
46
- - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by KG pipeline Steps 10–17 if UA vendor is installed)
47
-
48
- **UA vendor requirement:** The KG pipeline (Steps 10–17) requires the UA vendor at `~/.maestro/vendor/ua/understand-anything-plugin/`. If not installed, these steps are skipped automatically. Run `scripts/ua-vendor-setup.sh` to install.
46
+ - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by `maestro kg index`)
49
47
  </context>
50
48
 
51
49
  <execution>
@@ -79,8 +77,8 @@ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
79
77
  - [ ] All documentation files regenerated
80
78
  - [ ] state.json updated with rebuild timestamp
81
79
  - [ ] project.md Tech Stack section updated if changes detected
82
- - [ ] KG pipeline executed (if UA vendor installed)
83
- - [ ] knowledge-graph.json generated in .workflow/codebase/ (if UA vendor installed)
80
+ - [ ] KG pipeline executed (`maestro kg index`)
81
+ - [ ] knowledge-graph.json generated in .workflow/codebase/
84
82
  - [ ] KG nodes indexed as virtual wiki entries (automatic via WikiIndexer on next wiki access)
85
83
  - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
86
84
  - [ ] KG impact check available: `maestro kg diff-wiki` for future change impact analysis
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: spec-load
3
3
  description: Load specs and lessons for current context
4
- argument-hint: "[--category <category>] [--keyword <word>]"
4
+ argument-hint: "[--scope <scope>] [--category <category>] [--keyword <word>]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
@@ -9,8 +9,9 @@ allowed-tools:
9
9
  - Grep
10
10
  ---
11
11
  <purpose>
12
- Load relevant specs filtered by category (file-level) and/or keyword (entry-level).
12
+ Load relevant specs filtered by scope, category (file-level) and/or keyword (entry-level).
13
13
  Category-based loading: loads the category's primary doc in full + matching entries from other files.
14
+ By default, loads from both global (~/.maestro/specs/) and project (.workflow/specs/) layers.
14
15
  </purpose>
15
16
 
16
17
  <required_reading>
@@ -21,6 +22,11 @@ Category-based loading: loads the category's primary doc in full + matching entr
21
22
  $ARGUMENTS -- optional flags and keyword
22
23
 
23
24
  **Flags:**
25
+ - `--scope <scope>` — Load scope (default: global + project merged):
26
+ - `project`: project baseline only (.workflow/specs/)
27
+ - `global`: global + project merged (~/.maestro/specs/ + .workflow/specs/)
28
+ - `team`: project + team shared (.workflow/collab/specs/)
29
+ - `personal`: project + team + personal (requires uid)
24
30
  - `--category <category>` — Load by category: primary category doc (full) + cross-file entries with matching category attr. Categories: coding, arch, test, review, debug, learning, ui.
25
31
  - `--keyword <word>` — Filter by keyword within entries
26
32
 
@@ -38,7 +44,8 @@ $ARGUMENTS -- optional flags and keyword
38
44
 
39
45
  **Examples:**
40
46
  ```
41
- /spec-load --category coding # coding全文 + 跨文件coding条目
47
+ /spec-load --category coding # coding全文 + 跨文件coding条目 (global + project)
48
+ /spec-load --scope global --category arch # 明确包含全局 arch 规范
42
49
  /spec-load --category review # review-standards + quality-rules + 跨文件review条目
43
50
  /spec-load --category coding --keyword auth
44
51
  /spec-load --keyword auth
@@ -57,7 +64,7 @@ Follow '~/.maestro/workflows/specs-load.md' completely.
57
64
  <error_codes>
58
65
  | Code | Severity | Description | Stage |
59
66
  |------|----------|-------------|-------|
60
- | E001 | fatal | `.workflow/specs/` not initialized -- run `/spec-setup` first | detect_context |
67
+ | E001 | warning | `.workflow/specs/` not initialized -- run `/spec-setup` first (global specs still available) | detect_context |
61
68
  | W001 | warning | No matching specs found for keyword -- showing all specs in category instead | load_specs |
62
69
  </error_codes>
63
70
 
@@ -153,9 +153,9 @@ Single wave generates `wave-1.csv`. No `prev_context` needed (all tasks independ
153
153
  | `tech-registry/{slug}.md` | Per-component documentation |
154
154
  | `feature-maps/_index.md` | Feature index table |
155
155
  | `feature-maps/{slug}.md` | Per-feature documentation |
156
- | `knowledge-graph.json` | UA Knowledge Graph: nodes, edges, layers, tour (if UA vendor installed) |
156
+ | `knowledge-graph.json` | Knowledge Graph: nodes, edges, layers, tour (generated by `maestro kg index`) |
157
157
 
158
- **Wiki Integration**: After rebuild, KG nodes are automatically indexed as virtual wiki entries (type: knowhow, virtualKind: ua-kg-node/ua-kg-layer/ua-kg-tour-step) on next `maestro wiki` access. Verify with `maestro wiki list --keyword kg`. Use `maestro kg diff-wiki` for future change impact analysis.
158
+ **Wiki Integration**: After rebuild, KG nodes are automatically indexed as virtual wiki entries (type: knowhow, virtualKind: kg-node/kg-layer/kg-tour-step) on next `maestro wiki` access. Verify with `maestro wiki list --keyword kg`. Use `maestro kg diff-wiki` for future change impact analysis.
159
159
 
160
160
  ### Session Structure
161
161