maestro-flow 0.5.3 → 0.5.31

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 (259) hide show
  1. package/.agents/skills/learn-follow/SKILL.md +114 -114
  2. package/.agents/skills/learn-investigate/SKILL.md +138 -139
  3. package/.agents/skills/learn-second-opinion/SKILL.md +105 -109
  4. package/.agents/skills/maestro/SKILL.md +2 -10
  5. package/.agents/skills/maestro-amend/SKILL.md +152 -152
  6. package/.agents/skills/maestro-analyze/SKILL.md +201 -252
  7. package/.agents/skills/maestro-blueprint/SKILL.md +175 -190
  8. package/.agents/skills/maestro-brainstorm/SKILL.md +196 -200
  9. package/.agents/skills/maestro-collab/SKILL.md +159 -159
  10. package/.agents/skills/maestro-companion/SKILL.md +517 -517
  11. package/.agents/skills/maestro-composer/SKILL.md +173 -164
  12. package/.agents/skills/maestro-execute/SKILL.md +169 -170
  13. package/.agents/skills/maestro-fork/SKILL.md +97 -96
  14. package/.agents/skills/maestro-grill/SKILL.md +161 -162
  15. package/.agents/skills/maestro-guard/SKILL.md +93 -92
  16. package/.agents/skills/maestro-impeccable/SKILL.md +296 -253
  17. package/.agents/skills/maestro-init/SKILL.md +117 -118
  18. package/.agents/skills/maestro-merge/SKILL.md +73 -66
  19. package/.agents/skills/maestro-milestone-audit/SKILL.md +4 -10
  20. package/.agents/skills/maestro-milestone-complete/SKILL.md +6 -7
  21. package/.agents/skills/maestro-milestone-release/SKILL.md +122 -131
  22. package/.agents/skills/maestro-next/SKILL.md +241 -245
  23. package/.agents/skills/maestro-overlay/SKILL.md +176 -166
  24. package/.agents/skills/maestro-plan/SKILL.md +211 -197
  25. package/.agents/skills/maestro-player/SKILL.md +167 -167
  26. package/.agents/skills/maestro-quick/SKILL.md +69 -63
  27. package/.agents/skills/maestro-ralph/SKILL.md +2 -36
  28. package/.agents/skills/maestro-ralph-beta/SKILL.md +861 -872
  29. package/.agents/skills/maestro-ralph-execute/SKILL.md +234 -234
  30. package/.agents/skills/maestro-roadmap/SKILL.md +159 -172
  31. package/.agents/skills/maestro-swarm-workflow/SKILL.md +229 -250
  32. package/.agents/skills/maestro-tools-execute/SKILL.md +108 -103
  33. package/.agents/skills/maestro-tools-register/SKILL.md +148 -143
  34. package/.agents/skills/maestro-ui-codify/SKILL.md +103 -86
  35. package/.agents/skills/maestro-universal-workflow/SKILL.md +534 -547
  36. package/.agents/skills/maestro-update/SKILL.md +109 -106
  37. package/.agents/skills/manage-codebase-rebuild/SKILL.md +73 -71
  38. package/.agents/skills/manage-harvest/SKILL.md +83 -81
  39. package/.agents/skills/manage-issue/SKILL.md +59 -60
  40. package/.agents/skills/manage-issue-discover/SKILL.md +70 -68
  41. package/.agents/skills/manage-kg-extractors/SKILL.md +130 -0
  42. package/.agents/skills/manage-knowhow/SKILL.md +70 -66
  43. package/.agents/skills/manage-knowhow-capture/SKILL.md +79 -69
  44. package/.agents/skills/manage-knowledge-audit/SKILL.md +91 -74
  45. package/.agents/skills/manage-status/SKILL.md +52 -42
  46. package/.agents/skills/manage-wiki/SKILL.md +69 -58
  47. package/.agents/skills/odyssey-debug/SKILL.md +445 -459
  48. package/.agents/skills/odyssey-improve/SKILL.md +477 -491
  49. package/.agents/skills/odyssey-planex/SKILL.md +576 -587
  50. package/.agents/skills/odyssey-review-test-fix/SKILL.md +400 -413
  51. package/.agents/skills/odyssey-ui/SKILL.md +431 -448
  52. package/.agents/skills/quality-auto-test/SKILL.md +140 -123
  53. package/.agents/skills/quality-debug/SKILL.md +145 -106
  54. package/.agents/skills/quality-refactor/SKILL.md +91 -53
  55. package/.agents/skills/quality-retrospective/SKILL.md +109 -63
  56. package/.agents/skills/quality-review/SKILL.md +141 -114
  57. package/.agents/skills/quality-sync/SKILL.md +74 -38
  58. package/.agents/skills/quality-test/SKILL.md +133 -103
  59. package/.agents/skills/security-audit/SKILL.md +217 -166
  60. package/.agents/skills/spec-add/SKILL.md +66 -59
  61. package/.agents/skills/spec-load/SKILL.md +68 -68
  62. package/.agents/skills/spec-remove/SKILL.md +42 -42
  63. package/.agents/skills/spec-setup/SKILL.md +38 -41
  64. package/.agy/skills/learn-follow/SKILL.md +114 -114
  65. package/.agy/skills/learn-investigate/SKILL.md +138 -139
  66. package/.agy/skills/learn-second-opinion/SKILL.md +105 -109
  67. package/.agy/skills/maestro/SKILL.md +2 -10
  68. package/.agy/skills/maestro-amend/SKILL.md +152 -152
  69. package/.agy/skills/maestro-analyze/SKILL.md +201 -252
  70. package/.agy/skills/maestro-blueprint/SKILL.md +175 -190
  71. package/.agy/skills/maestro-brainstorm/SKILL.md +196 -200
  72. package/.agy/skills/maestro-collab/SKILL.md +159 -159
  73. package/.agy/skills/maestro-companion/SKILL.md +517 -517
  74. package/.agy/skills/maestro-composer/SKILL.md +173 -164
  75. package/.agy/skills/maestro-execute/SKILL.md +169 -170
  76. package/.agy/skills/maestro-fork/SKILL.md +97 -96
  77. package/.agy/skills/maestro-grill/SKILL.md +161 -162
  78. package/.agy/skills/maestro-guard/SKILL.md +93 -92
  79. package/.agy/skills/maestro-impeccable/SKILL.md +296 -253
  80. package/.agy/skills/maestro-init/SKILL.md +117 -118
  81. package/.agy/skills/maestro-merge/SKILL.md +73 -66
  82. package/.agy/skills/maestro-milestone-audit/SKILL.md +4 -10
  83. package/.agy/skills/maestro-milestone-complete/SKILL.md +6 -7
  84. package/.agy/skills/maestro-milestone-release/SKILL.md +122 -131
  85. package/.agy/skills/maestro-next/SKILL.md +241 -245
  86. package/.agy/skills/maestro-overlay/SKILL.md +176 -166
  87. package/.agy/skills/maestro-plan/SKILL.md +211 -197
  88. package/.agy/skills/maestro-player/SKILL.md +167 -167
  89. package/.agy/skills/maestro-quick/SKILL.md +69 -63
  90. package/.agy/skills/maestro-ralph/SKILL.md +2 -36
  91. package/.agy/skills/maestro-ralph-beta/SKILL.md +861 -872
  92. package/.agy/skills/maestro-ralph-execute/SKILL.md +234 -234
  93. package/.agy/skills/maestro-roadmap/SKILL.md +159 -172
  94. package/.agy/skills/maestro-swarm-workflow/SKILL.md +229 -250
  95. package/.agy/skills/maestro-tools-execute/SKILL.md +108 -103
  96. package/.agy/skills/maestro-tools-register/SKILL.md +148 -143
  97. package/.agy/skills/maestro-ui-codify/SKILL.md +103 -86
  98. package/.agy/skills/maestro-universal-workflow/SKILL.md +534 -547
  99. package/.agy/skills/maestro-update/SKILL.md +109 -106
  100. package/.agy/skills/manage-codebase-rebuild/SKILL.md +73 -71
  101. package/.agy/skills/manage-harvest/SKILL.md +83 -81
  102. package/.agy/skills/manage-issue/SKILL.md +59 -60
  103. package/.agy/skills/manage-issue-discover/SKILL.md +70 -68
  104. package/.agy/skills/manage-kg-extractors/SKILL.md +130 -0
  105. package/.agy/skills/manage-knowhow/SKILL.md +70 -66
  106. package/.agy/skills/manage-knowhow-capture/SKILL.md +79 -69
  107. package/.agy/skills/manage-knowledge-audit/SKILL.md +91 -74
  108. package/.agy/skills/manage-status/SKILL.md +52 -42
  109. package/.agy/skills/manage-wiki/SKILL.md +69 -58
  110. package/.agy/skills/odyssey-debug/SKILL.md +445 -459
  111. package/.agy/skills/odyssey-improve/SKILL.md +477 -491
  112. package/.agy/skills/odyssey-planex/SKILL.md +576 -587
  113. package/.agy/skills/odyssey-review-test-fix/SKILL.md +400 -413
  114. package/.agy/skills/odyssey-ui/SKILL.md +431 -448
  115. package/.agy/skills/quality-auto-test/SKILL.md +140 -123
  116. package/.agy/skills/quality-debug/SKILL.md +145 -106
  117. package/.agy/skills/quality-refactor/SKILL.md +91 -53
  118. package/.agy/skills/quality-retrospective/SKILL.md +109 -63
  119. package/.agy/skills/quality-review/SKILL.md +141 -114
  120. package/.agy/skills/quality-sync/SKILL.md +74 -38
  121. package/.agy/skills/quality-test/SKILL.md +133 -103
  122. package/.agy/skills/security-audit/SKILL.md +217 -166
  123. package/.agy/skills/spec-add/SKILL.md +66 -59
  124. package/.agy/skills/spec-load/SKILL.md +68 -68
  125. package/.agy/skills/spec-remove/SKILL.md +42 -42
  126. package/.agy/skills/spec-setup/SKILL.md +38 -41
  127. package/.claude/commands/learn-follow.md +127 -127
  128. package/.claude/commands/learn-investigate.md +151 -152
  129. package/.claude/commands/learn-second-opinion.md +118 -122
  130. package/.claude/commands/maestro-amend.md +164 -164
  131. package/.claude/commands/maestro-analyze.md +215 -266
  132. package/.claude/commands/maestro-blueprint.md +189 -204
  133. package/.claude/commands/maestro-brainstorm.md +209 -213
  134. package/.claude/commands/maestro-collab.md +172 -172
  135. package/.claude/commands/maestro-companion.md +531 -531
  136. package/.claude/commands/maestro-composer.md +188 -179
  137. package/.claude/commands/maestro-execute.md +183 -184
  138. package/.claude/commands/maestro-fork.md +111 -110
  139. package/.claude/commands/maestro-grill.md +175 -176
  140. package/.claude/commands/maestro-guard.md +103 -102
  141. package/.claude/commands/maestro-impeccable.md +311 -268
  142. package/.claude/commands/maestro-init.md +130 -131
  143. package/.claude/commands/maestro-merge.md +87 -80
  144. package/.claude/commands/maestro-milestone-audit.md +4 -10
  145. package/.claude/commands/maestro-milestone-complete.md +6 -7
  146. package/.claude/commands/maestro-milestone-release.md +136 -145
  147. package/.claude/commands/maestro-next.md +253 -257
  148. package/.claude/commands/maestro-overlay.md +188 -178
  149. package/.claude/commands/maestro-plan.md +225 -211
  150. package/.claude/commands/maestro-player.md +182 -182
  151. package/.claude/commands/maestro-quick.md +83 -77
  152. package/.claude/commands/maestro-ralph-beta.md +875 -886
  153. package/.claude/commands/maestro-ralph-execute.md +247 -247
  154. package/.claude/commands/maestro-ralph.md +2 -36
  155. package/.claude/commands/maestro-roadmap.md +173 -186
  156. package/.claude/commands/maestro-swarm-workflow.md +243 -264
  157. package/.claude/commands/maestro-tools-execute.md +122 -117
  158. package/.claude/commands/maestro-tools-register.md +162 -157
  159. package/.claude/commands/maestro-ui-codify.md +117 -100
  160. package/.claude/commands/maestro-universal-workflow.md +548 -561
  161. package/.claude/commands/maestro-update.md +122 -119
  162. package/.claude/commands/maestro.md +2 -10
  163. package/.claude/commands/manage-codebase-rebuild.md +87 -85
  164. package/.claude/commands/manage-harvest.md +97 -95
  165. package/.claude/commands/manage-issue-discover.md +83 -81
  166. package/.claude/commands/manage-issue.md +72 -73
  167. package/.claude/commands/manage-kg-extractors.md +128 -0
  168. package/.claude/commands/manage-knowhow-capture.md +92 -82
  169. package/.claude/commands/manage-knowhow.md +83 -79
  170. package/.claude/commands/manage-knowledge-audit.md +105 -88
  171. package/.claude/commands/manage-status.md +62 -52
  172. package/.claude/commands/manage-wiki.md +82 -71
  173. package/.claude/commands/odyssey-debug.md +459 -473
  174. package/.claude/commands/odyssey-improve.md +491 -505
  175. package/.claude/commands/odyssey-planex.md +590 -601
  176. package/.claude/commands/odyssey-review-test-fix.md +414 -427
  177. package/.claude/commands/odyssey-ui.md +445 -462
  178. package/.claude/commands/quality-auto-test.md +153 -136
  179. package/.claude/commands/quality-debug.md +159 -120
  180. package/.claude/commands/quality-refactor.md +105 -67
  181. package/.claude/commands/quality-retrospective.md +123 -77
  182. package/.claude/commands/quality-review.md +155 -128
  183. package/.claude/commands/quality-sync.md +88 -52
  184. package/.claude/commands/quality-test.md +147 -117
  185. package/.claude/commands/security-audit.md +230 -179
  186. package/.claude/commands/spec-add.md +77 -70
  187. package/.claude/commands/spec-load.md +78 -78
  188. package/.claude/commands/spec-remove.md +55 -55
  189. package/.claude/commands/spec-setup.md +49 -52
  190. package/dist/src/cli.js +1 -1
  191. package/dist/src/cli.js.map +1 -1
  192. package/dist/src/commands/kg.d.ts.map +1 -1
  193. package/dist/src/commands/kg.js +11 -5
  194. package/dist/src/commands/kg.js.map +1 -1
  195. package/dist/src/graph/kg/extraction/code/code-extractor.d.ts +2 -0
  196. package/dist/src/graph/kg/extraction/code/code-extractor.d.ts.map +1 -1
  197. package/dist/src/graph/kg/extraction/code/code-extractor.js +32 -3
  198. package/dist/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  199. package/dist/src/graph/kg/extraction/code/plugin-engine.d.ts +35 -0
  200. package/dist/src/graph/kg/extraction/code/plugin-engine.d.ts.map +1 -0
  201. package/dist/src/graph/kg/extraction/code/plugin-engine.js +573 -0
  202. package/dist/src/graph/kg/extraction/code/plugin-engine.js.map +1 -0
  203. package/dist/src/graph/kg/extraction/code/plugin-types.d.ts +95 -0
  204. package/dist/src/graph/kg/extraction/code/plugin-types.d.ts.map +1 -0
  205. package/dist/src/graph/kg/extraction/code/plugin-types.js +5 -0
  206. package/dist/src/graph/kg/extraction/code/plugin-types.js.map +1 -0
  207. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  208. package/dist/src/graph/kg/extraction/orchestrator.js +17 -5
  209. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  210. package/dist/src/graph/kg/schema.sql +16 -11
  211. package/dist/src/graph/kg/surface/cli.d.ts.map +1 -1
  212. package/dist/src/graph/kg/surface/cli.js +153 -56
  213. package/dist/src/graph/kg/surface/cli.js.map +1 -1
  214. package/dist/src/hooks/workspace.d.ts +4 -2
  215. package/dist/src/hooks/workspace.d.ts.map +1 -1
  216. package/dist/src/hooks/workspace.js +6 -2
  217. package/dist/src/hooks/workspace.js.map +1 -1
  218. package/package.json +91 -91
  219. package/workflows/analyze.md +25 -49
  220. package/workflows/auto-test.md +699 -699
  221. package/workflows/blueprint.md +403 -431
  222. package/workflows/brainstorm.md +54 -195
  223. package/workflows/business-test.md +570 -570
  224. package/workflows/claude-instructions.md +23 -51
  225. package/workflows/codex-instructions.md +27 -77
  226. package/workflows/coding-philosophy.md +69 -69
  227. package/workflows/command-authoring.md +823 -823
  228. package/workflows/debug.md +43 -98
  229. package/workflows/delegate-usage.md +39 -241
  230. package/workflows/execute.md +4 -53
  231. package/workflows/grill.md +12 -56
  232. package/workflows/harvest.md +22 -68
  233. package/workflows/init.md +148 -148
  234. package/workflows/instruction-authoring-guide.md +97 -0
  235. package/workflows/issue-execute.md +110 -110
  236. package/workflows/issue-gaps-analyze.codex.md +260 -260
  237. package/workflows/issue-gaps-analyze.md +216 -216
  238. package/workflows/issue-plan.md +110 -110
  239. package/workflows/issue.md +338 -346
  240. package/workflows/knowhow.md +0 -32
  241. package/workflows/learn.md +277 -277
  242. package/workflows/maestro-chain-execute.md +20 -20
  243. package/workflows/refactor.md +22 -44
  244. package/workflows/retrospective.md +16 -65
  245. package/workflows/review.md +446 -486
  246. package/workflows/roadmap.md +35 -132
  247. package/workflows/skill-authoring.md +265 -265
  248. package/workflows/spec-generate.md +470 -470
  249. package/workflows/specs-remove.md +104 -104
  250. package/workflows/sync.md +11 -41
  251. package/workflows/test-gen.md +226 -226
  252. package/workflows/test.md +385 -475
  253. package/workflows/ui-design.md +391 -391
  254. package/workflows/ui-style.md +199 -199
  255. package/workflows/wiki-connect.md +151 -151
  256. package/workflows/wiki-digest.md +178 -178
  257. package/workflows/wiki-manage.md +109 -109
  258. package/workflows/cli-tools-usage.md +0 -252
  259. package/workflows/delegate-protocol.codex.md +0 -65
@@ -1,109 +1,109 @@
1
- # Wiki Manage Workflow
2
-
3
- Unified wiki knowledge graph management — health monitoring, interactive search, orphan cleanup, and graph statistics.
4
-
5
- Complements `wiki-connect.md` (link discovery) and `wiki-digest.md` (synthesis) with day-to-day operational tooling.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
-
11
- - `.workflow/` initialized
12
- - Wiki entries exist
13
- - `maestro wiki` CLI available
14
-
15
- ---
16
-
17
- ## Argument Shape
18
-
19
- ```
20
- /manage-wiki → health dashboard (default)
21
- /manage-wiki health → health dashboard
22
- /manage-wiki search auth → search for "auth" with follow-up actions
23
- /manage-wiki cleanup → find orphans, broken links, stale entries
24
- /manage-wiki cleanup --fix → auto-fix issues
25
- /manage-wiki stats → graph statistics
26
- /manage-wiki stats --type spec → spec-only statistics
27
- ```
28
-
29
- | Flag | Effect |
30
- |------|--------|
31
- | `--type <type>` | Filter: spec, knowhow, note, issue |
32
- | `--fix` | Auto-fix issues during cleanup |
33
- | `--json` | JSON output |
34
-
35
- ---
36
-
37
- ## Subcommand: health (default)
38
-
39
- ### Step 1: Gather Data
40
-
41
- Run in parallel: `maestro wiki health`, `list --json`, `orphans`, `hubs --top 5`.
42
-
43
- ### Step 2: Render Dashboard
44
-
45
- Display: health score, entry counts by type, broken links, orphan count, top hubs. Include health status message and quick-action commands (`/wiki-connect --fix`, `/wiki-digest`, `/manage-wiki cleanup --fix`, `maestro wiki graph`).
46
-
47
- > **Scope split (complementary, not conflicting):** `/wiki-connect --fix` repairs/augments `related` links between existing entries (no deletion). `/manage-wiki cleanup --fix` deletes/flags orphans and removes broken-link entries from frontmatter. Run `wiki-connect` first to maximize link recovery, then `cleanup` to handle the true residual orphans.
48
-
49
- ---
50
-
51
- ## Subcommand: search <query>
52
-
53
- ### Step 1: Execute Search
54
-
55
- ```bash
56
- maestro wiki search "<query>" --json
57
- ```
58
-
59
- ### Step 2: Display Results
60
-
61
- Show table of results (ID, type, title, tags) with action hints: `maestro wiki get <id>`, `backlinks <id>`, `/learn-follow <id>`, `/wiki-connect --scope <type>`.
62
-
63
- ### Step 3: Interactive Follow-up
64
-
65
- If not `--json`: offer to view an entry by number selection.
66
-
67
- ---
68
-
69
- ## Subcommand: cleanup
70
-
71
- ### Step 1: Scan Issues
72
-
73
- Gather baseline via `maestro wiki health`, `orphans --json`, `graph`.
74
-
75
- ### Step 2: Categorize Issues
76
-
77
- | Issue Type | Detection | Auto-fix Action |
78
- |-----------|-----------|----------------|
79
- | Broken links | Forward link target doesn't exist | Remove broken link from frontmatter |
80
- | Orphans | No in/out links | Suggest connections via BM25 title match |
81
- | Stale entries | No updates in 90+ days, status=draft | Flag for review |
82
- | Empty body | Entry exists but body is empty/placeholder | Flag for review |
83
-
84
- ### Step 3: Display Issues
85
-
86
- Show baseline health, issue counts by type, and entry-level details.
87
-
88
- ### Step 4: Apply Fixes (--fix only)
89
-
90
- Broken links: remove from frontmatter via `maestro wiki update`. Orphans: mini wiki-connect (BM25 + tag match). Stale/empty: flag only (no auto-delete).
91
-
92
- Report: fixed count, remaining count, health delta.
93
-
94
- ---
95
-
96
- ## Subcommand: stats
97
-
98
- ### Step 1: Gather Data
99
-
100
- ```bash
101
- maestro wiki list --json
102
- ```
103
-
104
- ### Step 2: Compute & Display Statistics
105
-
106
- Compute: type distribution (count/%), top 20 tags, category distribution (specs), connectivity (avg in/out-degree, max hub), growth (entries/week).
107
-
108
- Display as bar charts and summary tables.
109
-
1
+ # Wiki Manage Workflow
2
+
3
+ Unified wiki knowledge graph management — health monitoring, interactive search, orphan cleanup, and graph statistics.
4
+
5
+ Complements `wiki-connect.md` (link discovery) and `wiki-digest.md` (synthesis) with day-to-day operational tooling.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+
11
+ - `.workflow/` initialized
12
+ - Wiki entries exist
13
+ - `maestro wiki` CLI available
14
+
15
+ ---
16
+
17
+ ## Argument Shape
18
+
19
+ ```
20
+ /manage-wiki → health dashboard (default)
21
+ /manage-wiki health → health dashboard
22
+ /manage-wiki search auth → search for "auth" with follow-up actions
23
+ /manage-wiki cleanup → find orphans, broken links, stale entries
24
+ /manage-wiki cleanup --fix → auto-fix issues
25
+ /manage-wiki stats → graph statistics
26
+ /manage-wiki stats --type spec → spec-only statistics
27
+ ```
28
+
29
+ | Flag | Effect |
30
+ |------|--------|
31
+ | `--type <type>` | Filter: spec, knowhow, note, issue |
32
+ | `--fix` | Auto-fix issues during cleanup |
33
+ | `--json` | JSON output |
34
+
35
+ ---
36
+
37
+ ## Subcommand: health (default)
38
+
39
+ ### Step 1: Gather Data
40
+
41
+ Run in parallel: `maestro wiki health`, `list --json`, `orphans`, `hubs --top 5`.
42
+
43
+ ### Step 2: Render Dashboard
44
+
45
+ Display: health score, entry counts by type, broken links, orphan count, top hubs. Include health status message and quick-action commands (`/wiki-connect --fix`, `/wiki-digest`, `/manage-wiki cleanup --fix`, `maestro wiki graph`).
46
+
47
+ > **Scope split (complementary, not conflicting):** `/wiki-connect --fix` repairs/augments `related` links between existing entries (no deletion). `/manage-wiki cleanup --fix` deletes/flags orphans and removes broken-link entries from frontmatter. Run `wiki-connect` first to maximize link recovery, then `cleanup` to handle the true residual orphans.
48
+
49
+ ---
50
+
51
+ ## Subcommand: search <query>
52
+
53
+ ### Step 1: Execute Search
54
+
55
+ ```bash
56
+ maestro wiki search "<query>" --json
57
+ ```
58
+
59
+ ### Step 2: Display Results
60
+
61
+ Show table of results (ID, type, title, tags) with action hints: `maestro wiki get <id>`, `backlinks <id>`, `/learn-follow <id>`, `/wiki-connect --scope <type>`.
62
+
63
+ ### Step 3: Interactive Follow-up
64
+
65
+ If not `--json`: offer to view an entry by number selection.
66
+
67
+ ---
68
+
69
+ ## Subcommand: cleanup
70
+
71
+ ### Step 1: Scan Issues
72
+
73
+ Gather baseline via `maestro wiki health`, `orphans --json`, `graph`.
74
+
75
+ ### Step 2: Categorize Issues
76
+
77
+ | Issue Type | Detection | Auto-fix Action |
78
+ |-----------|-----------|----------------|
79
+ | Broken links | Forward link target doesn't exist | Remove broken link from frontmatter |
80
+ | Orphans | No in/out links | Suggest connections via BM25 title match |
81
+ | Stale entries | No updates in 90+ days, status=draft | Flag for review |
82
+ | Empty body | Entry exists but body is empty/placeholder | Flag for review |
83
+
84
+ ### Step 3: Display Issues
85
+
86
+ Show baseline health, issue counts by type, and entry-level details.
87
+
88
+ ### Step 4: Apply Fixes (--fix only)
89
+
90
+ Broken links: remove from frontmatter via `maestro wiki update`. Orphans: mini wiki-connect (BM25 + tag match). Stale/empty: flag only (no auto-delete).
91
+
92
+ Report: fixed count, remaining count, health delta.
93
+
94
+ ---
95
+
96
+ ## Subcommand: stats
97
+
98
+ ### Step 1: Gather Data
99
+
100
+ ```bash
101
+ maestro wiki list --json
102
+ ```
103
+
104
+ ### Step 2: Compute & Display Statistics
105
+
106
+ Compute: type distribution (count/%), top 20 tags, category distribution (specs), connectivity (avg in/out-degree, max hub), growth (entries/week).
107
+
108
+ Display as bar charts and summary tables.
109
+
@@ -1,252 +0,0 @@
1
- # Delegate Execution Specification
2
-
3
- <purpose>
4
- Unified reference for `maestro delegate` — synchronous task delegation with broker-managed lifecycle, message injection, and MCP notifications.
5
- </purpose>
6
-
7
- **References**: `~/.maestro/cli-tools.json` (tool config), `~/.maestro/templates/cli/` (protocol + prompt templates)
8
-
9
- ---
10
-
11
- ## 1. Quick Reference
12
-
13
- <context>
14
-
15
- ### Command Syntax
16
-
17
- ```bash
18
- maestro delegate "<PROMPT>" [options]
19
- ```
20
-
21
- ### Options
22
-
23
- | Option | Description | Default |
24
- |--------|-------------|---------|
25
- | `--to <tool>` | Explicit tool: gemini, qwen, codex, claude, opencode | First enabled in config |
26
- | `--role <role>` | Capability role: analyze, explore, review, implement, plan, brainstorm, research | — (resolves via config) |
27
- | `--mode <mode>` | `analysis` (read-only) or `write` (create/modify/delete) | `analysis` |
28
- | `--model <model>` | Model override | Tool's `primaryModel` |
29
- | `--cd <dir>` | Working directory | Current directory |
30
- | `--includeDirs <dirs>` | Additional directories (comma-separated) | — |
31
- | `--rule <template>` | Load protocol + prompt template | — (optional) |
32
- | `--id <id>` | Execution ID | Auto: `{prefix}-{HHmmss}-{rand4}` |
33
- | `--resume [id]` | Resume session (last if no id, comma-separated for merge) | — |
34
- | `--backend <type>` | Adapter backend: `direct` or `terminal` (tmux/wezterm) | `direct` |
35
-
36
- ### Tool Resolution Priority
37
-
38
- 1. `--to <tool>` — explicit tool selection (highest priority)
39
- 2. `--role <role>` — capability-based auto-selection via config
40
- 3. No flag — first enabled tool in config
41
-
42
- ### Caller Decision Rule
43
-
44
- - **User names a tool** (e.g. "用 gemini 分析", "ask codex") → **must use `--to <tool>`**
45
- - **User names a capability** (e.g. "分析一下", "review this") → use `--role <role>` or omit
46
- - **Never use `--role` when user has explicitly named a tool** — `--role` may route to a different tool
47
-
48
- ### Role-Based Tool Selection
49
-
50
- Roles map to tools via `cli-tools.json` configuration:
51
- - User-defined roles in `roles` section override built-in defaults
52
- - Workspace `.maestro/cli-tools.json` overrides global `~/.maestro/cli-tools.json`
53
- - Built-in roles: `analyze`, `explore`, `review`, `implement`, `plan`, `brainstorm`, `research`
54
-
55
- ### Mode Definition (Authoritative)
56
-
57
- | Mode | Permission | Auto-Invoke Safe | Use For |
58
- |------|-----------|------------------|---------|
59
- | `analysis` | Read-only | Yes | Review, exploration, diagnosis, architecture analysis |
60
- | `write` | Create/Modify/Delete | No — requires explicit intent | Implementation, bug fixes, refactoring |
61
-
62
- > `--mode` is the **authoritative** permission control. The `MODE:` field inside prompt text is a hint for the agent — both should be consistent, but `--mode` governs actual behavior.
63
- </context>
64
-
65
- ---
66
-
67
- ## 2. Configuration
68
-
69
- <context>
70
-
71
- ### Config File: `~/.maestro/cli-tools.json`
72
-
73
- | Field | Description |
74
- |-------|-------------|
75
- | `enabled` | Tool availability |
76
- | `primaryModel` | Default model |
77
- | `secondaryModel` | Fallback model |
78
- | `tags` | Capability tags (for caller-side routing) |
79
- | `type` | `builtin` / `cli-wrapper` / `api-endpoint` |
80
-
81
- > `api-endpoint` tools support **analysis only** — no file write capability.
82
-
83
- ### Supported Tools
84
-
85
- | Tool | Agent Type | Adapter |
86
- |------|-----------|---------|
87
- | `gemini` | gemini | StreamJsonAdapter |
88
- | `qwen` | qwen | StreamJsonAdapter |
89
- | `codex` | codex | CodexCliAdapter |
90
- | `claude` | claude-code | ClaudeCodeAdapter |
91
- | `opencode` | opencode | OpenCodeAdapter |
92
-
93
- ### Tool Selection
94
-
95
- 1. Explicit `--to` specified → use it (validate enabled)
96
- 2. No `--to` → first enabled tool in config order
97
-
98
- ### Fallback Chain
99
-
100
- Primary model fails → `secondaryModel` → next enabled tool → first enabled (default).
101
- </context>
102
-
103
- ---
104
-
105
- ## 3. Prompt Construction
106
-
107
- <context>
108
-
109
- ### Assembly Order
110
-
111
- `maestro delegate` builds the final prompt as:
112
-
113
- 1. **Mode protocol** — `~/.maestro/templates/cli/protocols/{mode}-protocol.md`
114
- 2. **User prompt** — the positional `"<PROMPT>"` value
115
- 3. **Rule template** — `~/.maestro/templates/cli/prompts/{rule}.txt` (if `--rule` specified)
116
-
117
- ### Prompt Template (6 Fields)
118
-
119
- ```
120
- PURPOSE: [goal] + [why] + [success criteria]
121
- TASK: [step 1] | [step 2] | [step 3]
122
- MODE: analysis|write
123
- CONTEXT: @[file patterns] | Memory: [prior work context]
124
- EXPECTED: [output format] + [quality criteria]
125
- CONSTRAINTS: [scope limits] | [special requirements]
126
- ```
127
-
128
- - **PURPOSE**: What + Why + Success. Not "Analyze code" but "Identify auth vulnerabilities; success = OWASP Top 10 covered"
129
- - **TASK**: Specific verbs. Not "Review code" but "Scan for SQL injection | Check XSS | Verify CSRF"
130
- - **MODE**: Must match `--mode` flag
131
- - **CONTEXT**: File scope + memory from prior work
132
- - **EXPECTED**: Deliverable format, not just "Report"
133
- - **CONSTRAINTS**: Task-specific limits (vs `--rule` which loads generic templates)
134
-
135
- ### CONTEXT: File Patterns + Directory
136
-
137
- - `@**/*` — all files in working directory (default)
138
- - `@src/**/*.ts` — scoped pattern
139
- - `@../shared/**/*` — sibling directory (**requires `--includeDirs`**)
140
-
141
- **Rule**: If CONTEXT uses `@../dir/**/*`, must add `--includeDirs ../dir`.
142
-
143
- ```bash
144
- # Cross-directory example
145
- maestro delegate "CONTEXT: @**/* @../shared/**/*" --to gemini --mode analysis \
146
- --cd "src/auth" --includeDirs "../shared"
147
- ```
148
-
149
- ### CONTEXT: Memory
150
-
151
- Include when building on previous work:
152
-
153
- ```
154
- Memory: Building on auth refactoring (commit abc123), implementing refresh tokens
155
- Memory: Integration with auth module, using shared error patterns
156
- ```
157
-
158
- ### --rule Templates
159
-
160
- **Universal**: `universal-rigorous-style`, `universal-creative-style`
161
-
162
- **Analysis**: `analysis-trace-code-execution`, `analysis-diagnose-bug-root-cause`, `analysis-analyze-code-patterns`, `analysis-analyze-technical-document`, `analysis-review-architecture`, `analysis-review-code-quality`, `analysis-analyze-performance`, `analysis-assess-security-risks`
163
-
164
- **Planning**: `planning-plan-architecture-design`, `planning-breakdown-task-steps`, `planning-design-component-spec`, `planning-plan-migration-strategy`
165
-
166
- **Development**: `development-implement-feature`, `development-refactor-codebase`, `development-generate-tests`, `development-implement-component-ui`, `development-debug-runtime-issues`
167
-
168
- ### Complete Example
169
-
170
- ```bash
171
- maestro delegate "PURPOSE: Identify OWASP Top 10 vulnerabilities in auth module; success = all critical/high documented with remediation
172
- TASK: Scan for injection flaws | Check auth bypass vectors | Evaluate session management | Assess data exposure
173
- MODE: analysis
174
- CONTEXT: @src/auth/**/* @src/middleware/auth.ts | Memory: Using bcrypt + JWT
175
- EXPECTED: Severity matrix, file:line references, remediation snippets, priority ranking
176
- CONSTRAINTS: Focus on authentication | Ignore test files
177
- " --to gemini --mode analysis --rule analysis-assess-security-risks --cd "src/auth"
178
- ```
179
- </context>
180
-
181
- ---
182
-
183
- ## 4. Execution
184
-
185
- <execution>
186
-
187
- ### Calling Convention
188
-
189
- `maestro delegate` runs synchronously. Status summary and output are **auto-appended** on completion — no manual `output` or `status` commands needed.
190
-
191
- **Always** use `run_in_background: true` and **end your response immediately**:
192
-
193
- ```
194
- Bash({ command: "maestro delegate \"...\" --to gemini --mode analysis", run_in_background: true })
195
- ```
196
-
197
- When the background callback arrives, the result is already included:
198
- ```
199
- [MAESTRO_EXEC_ID=gem-143022-a7f2] , at start
200
- [DELEGATE COMPLETED] gem-143022-a7f2 gemini/analysis ← status, on completion
201
- --- Output ---
202
- <actual output content> ← output, on completion
203
- ```
204
-
205
- **Rules:**
206
- - NEVER use foreground Bash for delegate calls
207
- - NEVER output text or tool calls after the `run_in_background` Bash call
208
- - When the callback arrives, output is already included — directly use it
209
-
210
- ### Execution ID
211
-
212
- ID prefix: gemini→`gem`, qwen→`qwn`, codex→`cdx`, claude→`cld`, opencode→`opc`
213
-
214
- ```bash
215
- maestro delegate "<PROMPT>" --to gemini --mode analysis # auto-ID: gem-143022-a7f2
216
- maestro delegate "<PROMPT>" --to gemini --mode write --id my-task-1 # custom ID
217
- ```
218
-
219
- ### Session Resume
220
-
221
- ```bash
222
- maestro delegate "<PROMPT>" --to gemini --resume # last session
223
- maestro delegate "<PROMPT>" --to gemini --mode write --resume <id> # specific
224
- maestro delegate "<PROMPT>" --to gemini --resume <id1>,<id2> # merge multiple
225
- ```
226
-
227
- Resume auto-assembles previous conversation context. Warning emitted when context exceeds 32KB.
228
- </execution>
229
-
230
- ---
231
-
232
- ## 5. Auto-Invoke Triggers
233
-
234
- <execution>
235
-
236
- Proactively invoke `maestro delegate` when these conditions are met — no user confirmation needed for `analysis` mode:
237
-
238
- | Trigger | Suggested Rule |
239
- |---------|---------------|
240
- | Self-repair fails (1+ attempts) | `analysis-diagnose-bug-root-cause` |
241
- | Ambiguous requirements | `planning-breakdown-task-steps` |
242
- | Architecture decisions needed | `planning-plan-architecture-design` |
243
- | Pattern uncertainty | `analysis-analyze-code-patterns` |
244
- | Critical/security code paths | `analysis-assess-security-risks` |
245
-
246
- ### Principles
247
-
248
- - Default `--mode analysis` (safe, read-only)
249
- - Wait for results before next action
250
- - User named a tool → `--to <tool>`; user didn't → `--role` or omit (see Caller Decision Rule)
251
- - Rule suggestions are guidelines — choose the best fit
252
- </execution>
@@ -1,65 +0,0 @@
1
- # Maestro Delegate Execution Protocol (Codex)
2
-
3
- `maestro delegate` is a long-running shell command (30s–5min+). All Codex agents MUST follow this polling protocol when executing delegate calls.
4
-
5
- ## Execution Steps
6
-
7
- ### Step 1: Start Delegate
8
-
9
- ```
10
- exec_command({
11
- cmd: `maestro delegate "<PROMPT>" [options]`,
12
- yield_time_ms: 30000,
13
- max_output_tokens: 6000
14
- })
15
- ```
16
-
17
- - `yield_time_ms: 30000` — wait up to 30s for initial output
18
- - If the command completes within yield time → result is final, proceed to Step 3
19
-
20
- ### Step 2: Poll Loop (if session_id returned)
21
-
22
- If `exec_command` returns `{ session_id: N, ... }` (command still running), enter poll loop:
23
-
24
- ```
25
- poll_interval = 15000 // start at 15s
26
-
27
- LOOP:
28
- result = write_stdin({
29
- session_id: <session_id>,
30
- chars: "",
31
- yield_time_ms: poll_interval,
32
- max_output_tokens: 6000
33
- })
34
-
35
- IF result indicates command completed → BREAK, proceed to Step 3
36
- IF result indicates command still running:
37
- poll_interval = min(poll_interval * 2, 60000) // backoff: 15s → 30s → 60s cap
38
- GOTO LOOP
39
- ```
40
-
41
- ### Step 3: Parse Result
42
-
43
- Extract the delegate output (assistant response) from the final result. Parse according to the caller's expected format (JSON, structured text, etc.).
44
-
45
- ## Invariants
46
-
47
- | Rule | Description |
48
- |------|-------------|
49
- | **NEVER skip polling** | Delegate output is required for workflow continuation. If session_id is returned, you MUST poll until completion. |
50
- | **NEVER abandon session** | Do not move to next workflow step while delegate is still running. |
51
- | **NEVER fire-and-forget** | Every delegate call must be awaited and its result consumed. |
52
- | **Increasing backoff** | Poll intervals: 15s → 30s → 60s (capped). Prevents unnecessary load. |
53
- | **Error still completes** | If output contains error/failed, still finish reading the full output before handling the error. |
54
- | **Timeout escalation** | If polling exceeds 5 minutes total, report as blocker but do NOT abandon — continue polling. |
55
-
56
- ## Quick Reference
57
-
58
- ```
59
- // Compact pattern for inline use:
60
- //
61
- // 1. exec_command({ cmd: `maestro delegate "..."`, yield_time_ms: 30000 })
62
- // 2. If session_id → poll write_stdin({ session_id, chars: "", yield_time_ms: 15000→60000 })
63
- // 3. Parse result after completion
64
- // ⚠️ MUST poll until completion — NEVER skip
65
- ```