maestro-flow 0.3.2 → 0.3.4

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 (187) hide show
  1. package/.claude/CLAUDE.md +2 -2
  2. package/.claude/agents/cli-explore-agent.md +1 -1
  3. package/.claude/agents/team-worker.md +237 -237
  4. package/.claude/commands/maestro-coordinate.md +65 -65
  5. package/.claude/commands/maestro-link-coordinate.md +71 -71
  6. package/.claude/commands/manage-issue-execute.md +73 -73
  7. package/.claude/commands/quality-business-test.md +110 -0
  8. package/.claude/skills/team-coordinate/SKILL.md +266 -266
  9. package/.claude/skills/team-lifecycle-v4/SKILL.md +209 -209
  10. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +94 -94
  11. package/.claude/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -62
  12. package/.claude/skills/team-lifecycle-v4/roles/planner/role.md +85 -85
  13. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +95 -95
  14. package/.claude/skills/team-quality-assurance/SKILL.md +147 -147
  15. package/.claude/skills/team-quality-assurance/roles/scout/role.md +75 -75
  16. package/.claude/skills/team-review/SKILL.md +147 -147
  17. package/.claude/skills/team-review/roles/reviewer/role.md +68 -68
  18. package/.claude/skills/team-review/roles/scanner/role.md +79 -79
  19. package/.claude/skills/team-tech-debt/SKILL.md +128 -128
  20. package/.claude/skills/team-tech-debt/roles/executor/role.md +76 -76
  21. package/.claude/skills/team-tech-debt/roles/scanner/role.md +90 -90
  22. package/.claude/skills/team-tech-debt/roles/validator/role.md +78 -78
  23. package/.claude/skills/team-testing/SKILL.md +143 -143
  24. package/.claude/skills/team-testing/roles/executor/role.md +99 -99
  25. package/.claude/skills/team-testing/roles/generator/role.md +98 -98
  26. package/.codex/skills/maestro-coordinate/SKILL.md +1 -1
  27. package/.codex/skills/manage-issue-analyze/SKILL.md +3 -3
  28. package/.codex/skills/manage-issue-execute/SKILL.md +4 -4
  29. package/.codex/skills/manage-issue-plan/SKILL.md +2 -2
  30. package/.codex/skills/quality-business-test/SKILL.md +223 -0
  31. package/.codex/skills/team-coordinate/SKILL.md +7 -7
  32. package/.codex/skills/team-coordinate/roles/coordinator/role.md +1 -1
  33. package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -2
  34. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +2 -2
  35. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  36. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +2 -2
  37. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +1 -1
  38. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +2 -2
  39. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  40. package/.codex/skills/team-quality-assurance/SKILL.md +2 -2
  41. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +2 -2
  42. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -2
  43. package/.codex/skills/team-review/SKILL.md +2 -2
  44. package/.codex/skills/team-review/roles/coordinator/role.md +2 -2
  45. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  46. package/.codex/skills/team-review/roles/scanner/role.md +1 -1
  47. package/.codex/skills/team-tech-debt/SKILL.md +2 -2
  48. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +1 -1
  49. package/.codex/skills/team-tech-debt/roles/executor/role.md +1 -1
  50. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  51. package/.codex/skills/team-tech-debt/roles/validator/role.md +1 -1
  52. package/.codex/skills/team-testing/SKILL.md +2 -2
  53. package/.codex/skills/team-testing/roles/coordinator/role.md +2 -2
  54. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  55. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  56. package/README.md +31 -2
  57. package/README.zh-CN.md +23 -1
  58. package/chains/_intent-map.json +6 -0
  59. package/chains/_router.json +14 -0
  60. package/chains/full-lifecycle.json +15 -0
  61. package/chains/quality-loop.json +16 -1
  62. package/chains/singles/business-test.json +26 -0
  63. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +16 -2
  64. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +25 -9
  67. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  68. package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +3 -0
  69. package/dashboard/dist-server/src/agents/cli-agent-runner.js +78 -61
  70. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  71. package/dashboard/dist-server/src/agents/cli-history-store.d.ts +14 -1
  72. package/dashboard/dist-server/src/agents/cli-history-store.js +24 -2
  73. package/dashboard/dist-server/src/agents/cli-history-store.js.map +1 -1
  74. package/dashboard/dist-server/src/commands/delegate.js +142 -6
  75. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  76. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  77. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  78. package/dist/src/agents/cli-agent-runner.js +78 -61
  79. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  80. package/dist/src/agents/cli-history-store.d.ts +14 -1
  81. package/dist/src/agents/cli-history-store.d.ts.map +1 -1
  82. package/dist/src/agents/cli-history-store.js +24 -2
  83. package/dist/src/agents/cli-history-store.js.map +1 -1
  84. package/dist/src/commands/delegate.d.ts.map +1 -1
  85. package/dist/src/commands/delegate.js +142 -6
  86. package/dist/src/commands/delegate.js.map +1 -1
  87. package/dist/src/commands/hooks.d.ts +15 -0
  88. package/dist/src/commands/hooks.d.ts.map +1 -1
  89. package/dist/src/commands/hooks.js +29 -2
  90. package/dist/src/commands/hooks.js.map +1 -1
  91. package/dist/src/commands/install-backend.d.ts +15 -0
  92. package/dist/src/commands/install-backend.d.ts.map +1 -1
  93. package/dist/src/commands/install-backend.js +67 -0
  94. package/dist/src/commands/install-backend.js.map +1 -1
  95. package/dist/src/commands/install-ui/BackupConfig.d.ts +6 -4
  96. package/dist/src/commands/install-ui/BackupConfig.d.ts.map +1 -1
  97. package/dist/src/commands/install-ui/BackupConfig.js +39 -12
  98. package/dist/src/commands/install-ui/BackupConfig.js.map +1 -1
  99. package/dist/src/commands/install-ui/ConfigPanel.d.ts.map +1 -1
  100. package/dist/src/commands/install-ui/ConfigPanel.js +1 -1
  101. package/dist/src/commands/install-ui/ConfigPanel.js.map +1 -1
  102. package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -0
  103. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  104. package/dist/src/commands/install-ui/InstallConfirm.js +5 -1
  105. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  106. package/dist/src/commands/install-ui/InstallExecution.d.ts +2 -0
  107. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  108. package/dist/src/commands/install-ui/InstallExecution.js +30 -5
  109. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  110. package/dist/src/commands/install-ui/InstallFlow.d.ts +1 -1
  111. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  112. package/dist/src/commands/install-ui/InstallFlow.js +31 -6
  113. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  114. package/dist/src/commands/install-ui/InstallHub.d.ts +5 -0
  115. package/dist/src/commands/install-ui/InstallHub.d.ts.map +1 -1
  116. package/dist/src/commands/install-ui/InstallHub.js +24 -0
  117. package/dist/src/commands/install-ui/InstallHub.js.map +1 -1
  118. package/dist/src/commands/install-ui/InstallResult.d.ts.map +1 -1
  119. package/dist/src/commands/install-ui/InstallResult.js +1 -1
  120. package/dist/src/commands/install-ui/InstallResult.js.map +1 -1
  121. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +9 -0
  122. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -0
  123. package/dist/src/commands/install-ui/StatuslineConfig.js +13 -0
  124. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -0
  125. package/dist/src/commands/install-ui/index.d.ts +1 -1
  126. package/dist/src/commands/install-ui/index.d.ts.map +1 -1
  127. package/dist/src/commands/install-ui/types.d.ts +6 -0
  128. package/dist/src/commands/install-ui/types.d.ts.map +1 -1
  129. package/dist/src/commands/install-ui/types.js +3 -0
  130. package/dist/src/commands/install-ui/types.js.map +1 -1
  131. package/dist/src/commands/install.d.ts.map +1 -1
  132. package/dist/src/commands/install.js +6 -1
  133. package/dist/src/commands/install.js.map +1 -1
  134. package/dist/src/commands/overlay.d.ts.map +1 -1
  135. package/dist/src/commands/overlay.js +45 -1
  136. package/dist/src/commands/overlay.js.map +1 -1
  137. package/dist/src/commands/team.d.ts +10 -0
  138. package/dist/src/commands/team.d.ts.map +1 -1
  139. package/dist/src/commands/team.js +436 -42
  140. package/dist/src/commands/team.js.map +1 -1
  141. package/dist/src/core/manifest.d.ts.map +1 -1
  142. package/dist/src/core/manifest.js +58 -0
  143. package/dist/src/core/manifest.js.map +1 -1
  144. package/dist/src/core/overlay/applier.d.ts +4 -0
  145. package/dist/src/core/overlay/applier.d.ts.map +1 -1
  146. package/dist/src/core/overlay/applier.js.map +1 -1
  147. package/dist/src/hooks/delegate-monitor.js +1 -1
  148. package/dist/src/hooks/delegate-monitor.js.map +1 -1
  149. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  150. package/dist/src/hooks/plugins/spec-injection-plugin.js +17 -1
  151. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  152. package/dist/src/hooks/spec-injector.d.ts +2 -1
  153. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  154. package/dist/src/hooks/spec-injector.js +19 -2
  155. package/dist/src/hooks/spec-injector.js.map +1 -1
  156. package/dist/src/hooks/team-monitor.d.ts.map +1 -1
  157. package/dist/src/hooks/team-monitor.js +17 -0
  158. package/dist/src/hooks/team-monitor.js.map +1 -1
  159. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  160. package/dist/src/i18n/locales/en.js +25 -1
  161. package/dist/src/i18n/locales/en.js.map +1 -1
  162. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  163. package/dist/src/i18n/locales/zh.js +25 -1
  164. package/dist/src/i18n/locales/zh.js.map +1 -1
  165. package/dist/src/i18n/types.d.ts +22 -0
  166. package/dist/src/i18n/types.d.ts.map +1 -1
  167. package/dist/src/mcp/delegate-channel-relay.d.ts.map +1 -1
  168. package/dist/src/mcp/delegate-channel-relay.js +9 -9
  169. package/dist/src/mcp/delegate-channel-relay.js.map +1 -1
  170. package/dist/src/tools/index.d.ts.map +1 -1
  171. package/dist/src/tools/index.js +11 -2
  172. package/dist/src/tools/index.js.map +1 -1
  173. package/dist/src/tools/namespace-guard.d.ts +37 -0
  174. package/dist/src/tools/namespace-guard.d.ts.map +1 -0
  175. package/dist/src/tools/namespace-guard.js +126 -0
  176. package/dist/src/tools/namespace-guard.js.map +1 -0
  177. package/dist/src/tools/spec-loader.d.ts +17 -1
  178. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  179. package/dist/src/tools/spec-loader.js +71 -13
  180. package/dist/src/tools/spec-loader.js.map +1 -1
  181. package/dist/src/tools/team-members.d.ts +16 -0
  182. package/dist/src/tools/team-members.d.ts.map +1 -1
  183. package/dist/src/tools/team-members.js +31 -0
  184. package/dist/src/tools/team-members.js.map +1 -1
  185. package/package.json +2 -2
  186. package/templates/business-test-report.json +68 -0
  187. package/workflows/delegate-usage.md +330 -0
@@ -1,128 +1,128 @@
1
- ---
2
- name: team-tech-debt
3
- description: Unified team skill for tech debt identification and remediation. Scans codebase for tech debt, assesses severity, plans and executes fixes with validation. Uses team-worker agent architecture with roles/ for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on "team tech debt".
4
- allowed-tools: Agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, TaskList, TaskGet, TaskUpdate, TaskCreate, TeamCreate, TeamDelete, SendMessage, mcp__ace-tool__search_context, mcp__ccw-tools__read_file, mcp__ccw-tools__write_file, mcp__ccw-tools__edit_file, mcp__ccw-tools__team_msg
5
- ---
6
-
7
- # Team Tech Debt
8
-
9
- Systematic tech debt governance: scan -> assess -> plan -> fix -> validate. Built on **team-worker agent architecture** — all worker roles share a single agent definition with role-specific Phase 2-4 loaded from `roles/<role>/role.md`.
10
-
11
- ## Architecture
12
-
13
- ```
14
- Skill(skill="team-tech-debt", args="task description")
15
- |
16
- SKILL.md (this file) = Router
17
- |
18
- +--------------+--------------+
19
- | |
20
- no --role flag --role <name>
21
- | |
22
- Coordinator Worker
23
- roles/coordinator/role.md roles/<name>/role.md
24
- |
25
- +-- analyze → dispatch → spawn workers → STOP
26
- |
27
- +-------+-------+-------+-------+
28
- v v v v v
29
- [team-worker agents, each loads roles/<role>/role.md]
30
- scanner assessor planner executor validator
31
- ```
32
-
33
- ## Role Registry
34
-
35
- | Role | Path | Prefix | Inner Loop |
36
- |------|------|--------|------------|
37
- | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
38
- | scanner | [roles/scanner/role.md](roles/scanner/role.md) | TDSCAN-* | false |
39
- | assessor | [roles/assessor/role.md](roles/assessor/role.md) | TDEVAL-* | false |
40
- | planner | [roles/planner/role.md](roles/planner/role.md) | TDPLAN-* | false |
41
- | executor | [roles/executor/role.md](roles/executor/role.md) | TDFIX-* | true |
42
- | validator | [roles/validator/role.md](roles/validator/role.md) | TDVAL-* | false |
43
-
44
- ## Role Router
45
-
46
- Parse `$ARGUMENTS`:
47
- - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
48
- - No `--role` → `@roles/coordinator/role.md`, execute entry router
49
-
50
- ## Shared Constants
51
-
52
- - **Session prefix**: `TD`
53
- - **Session path**: `.workflow/.team/TD-<slug>-<date>/`
54
- - **CLI tools**: `maestro cli --mode analysis` (read-only), `maestro cli --mode write` (modifications)
55
- - **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
56
- - **Max GC rounds**: 3
57
-
58
- ## Worker Spawn Template
59
-
60
- Coordinator spawns workers using this template:
61
-
62
- ```
63
- Agent({
64
- subagent_type: "team-worker",
65
- description: "Spawn <role> worker for <task-id>",
66
- team_name: "tech-debt",
67
- name: "<role>",
68
- run_in_background: true,
69
- prompt: `## Role Assignment
70
- role: <role>
71
- role_spec: <skill_root>/roles/<role>/role.md
72
- session: <session-folder>
73
- session_id: <session-id>
74
- team_name: tech-debt
75
- requirement: <task-description>
76
- inner_loop: <true|false>
77
-
78
- ## Progress Milestones
79
- session_id: <session-id>
80
- Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
81
- Report blockers immediately via team_msg type="blocker".
82
- Report completion via team_msg type="task_complete" after final SendMessage.
83
-
84
- Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
85
- Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
86
- })
87
- ```
88
-
89
- ## User Commands
90
-
91
- | Command | Action |
92
- |---------|--------|
93
- | `check` / `status` | View execution status graph |
94
- | `resume` / `continue` | Advance to next step |
95
- | `--mode=scan` | Run scan-only pipeline (TDSCAN + TDEVAL) |
96
- | `--mode=targeted` | Run targeted pipeline (TDPLAN + TDFIX + TDVAL) |
97
- | `--mode=remediate` | Run full pipeline (default) |
98
- | `-y` / `--yes` | Skip confirmations |
99
-
100
- ## Specs Reference
101
-
102
- - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
103
-
104
- ## Session Directory
105
-
106
- ```
107
- .workflow/.team/TD-<slug>-<date>/
108
- ├── .msg/
109
- │ ├── messages.jsonl # Team message bus
110
- │ └── meta.json # Pipeline config + role state snapshot
111
- ├── scan/ # Scanner output
112
- ├── assessment/ # Assessor output
113
- ├── plan/ # Planner output
114
- ├── fixes/ # Executor output
115
- ├── validation/ # Validator output
116
- └── wisdom/ # Cross-task knowledge
117
- ```
118
-
119
- ## Error Handling
120
-
121
- | Scenario | Resolution |
122
- |----------|------------|
123
- | Unknown command | Error with available command list |
124
- | Role not found | Error with role registry |
125
- | Session corruption | Attempt recovery, fallback to manual |
126
- | Fast-advance conflict | Coordinator reconciles on next callback |
127
- | Completion action fails | Default to Keep Active |
128
- | Scanner finds no debt | Report clean codebase, skip to summary |
1
+ ---
2
+ name: team-tech-debt
3
+ description: Unified team skill for tech debt identification and remediation. Scans codebase for tech debt, assesses severity, plans and executes fixes with validation. Uses team-worker agent architecture with roles/ for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on "team tech debt".
4
+ allowed-tools: Agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, TaskList, TaskGet, TaskUpdate, TaskCreate, TeamCreate, TeamDelete, SendMessage, mcp__ace-tool__search_context, mcp__ccw-tools__read_file, mcp__ccw-tools__write_file, mcp__ccw-tools__edit_file, mcp__ccw-tools__team_msg
5
+ ---
6
+
7
+ # Team Tech Debt
8
+
9
+ Systematic tech debt governance: scan -> assess -> plan -> fix -> validate. Built on **team-worker agent architecture** — all worker roles share a single agent definition with role-specific Phase 2-4 loaded from `roles/<role>/role.md`.
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ Skill(skill="team-tech-debt", args="task description")
15
+ |
16
+ SKILL.md (this file) = Router
17
+ |
18
+ +--------------+--------------+
19
+ | |
20
+ no --role flag --role <name>
21
+ | |
22
+ Coordinator Worker
23
+ roles/coordinator/role.md roles/<name>/role.md
24
+ |
25
+ +-- analyze → dispatch → spawn workers → STOP
26
+ |
27
+ +-------+-------+-------+-------+
28
+ v v v v v
29
+ [team-worker agents, each loads roles/<role>/role.md]
30
+ scanner assessor planner executor validator
31
+ ```
32
+
33
+ ## Role Registry
34
+
35
+ | Role | Path | Prefix | Inner Loop |
36
+ |------|------|--------|------------|
37
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
38
+ | scanner | [roles/scanner/role.md](roles/scanner/role.md) | TDSCAN-* | false |
39
+ | assessor | [roles/assessor/role.md](roles/assessor/role.md) | TDEVAL-* | false |
40
+ | planner | [roles/planner/role.md](roles/planner/role.md) | TDPLAN-* | false |
41
+ | executor | [roles/executor/role.md](roles/executor/role.md) | TDFIX-* | true |
42
+ | validator | [roles/validator/role.md](roles/validator/role.md) | TDVAL-* | false |
43
+
44
+ ## Role Router
45
+
46
+ Parse `$ARGUMENTS`:
47
+ - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
48
+ - No `--role` → `@roles/coordinator/role.md`, execute entry router
49
+
50
+ ## Shared Constants
51
+
52
+ - **Session prefix**: `TD`
53
+ - **Session path**: `.workflow/.team/TD-<slug>-<date>/`
54
+ - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
55
+ - **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
56
+ - **Max GC rounds**: 3
57
+
58
+ ## Worker Spawn Template
59
+
60
+ Coordinator spawns workers using this template:
61
+
62
+ ```
63
+ Agent({
64
+ subagent_type: "team-worker",
65
+ description: "Spawn <role> worker for <task-id>",
66
+ team_name: "tech-debt",
67
+ name: "<role>",
68
+ run_in_background: true,
69
+ prompt: `## Role Assignment
70
+ role: <role>
71
+ role_spec: <skill_root>/roles/<role>/role.md
72
+ session: <session-folder>
73
+ session_id: <session-id>
74
+ team_name: tech-debt
75
+ requirement: <task-description>
76
+ inner_loop: <true|false>
77
+
78
+ ## Progress Milestones
79
+ session_id: <session-id>
80
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
81
+ Report blockers immediately via team_msg type="blocker".
82
+ Report completion via team_msg type="task_complete" after final SendMessage.
83
+
84
+ Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
85
+ Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
86
+ })
87
+ ```
88
+
89
+ ## User Commands
90
+
91
+ | Command | Action |
92
+ |---------|--------|
93
+ | `check` / `status` | View execution status graph |
94
+ | `resume` / `continue` | Advance to next step |
95
+ | `--mode=scan` | Run scan-only pipeline (TDSCAN + TDEVAL) |
96
+ | `--mode=targeted` | Run targeted pipeline (TDPLAN + TDFIX + TDVAL) |
97
+ | `--mode=remediate` | Run full pipeline (default) |
98
+ | `-y` / `--yes` | Skip confirmations |
99
+
100
+ ## Specs Reference
101
+
102
+ - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
103
+
104
+ ## Session Directory
105
+
106
+ ```
107
+ .workflow/.team/TD-<slug>-<date>/
108
+ ├── .msg/
109
+ │ ├── messages.jsonl # Team message bus
110
+ │ └── meta.json # Pipeline config + role state snapshot
111
+ ├── scan/ # Scanner output
112
+ ├── assessment/ # Assessor output
113
+ ├── plan/ # Planner output
114
+ ├── fixes/ # Executor output
115
+ ├── validation/ # Validator output
116
+ └── wisdom/ # Cross-task knowledge
117
+ ```
118
+
119
+ ## Error Handling
120
+
121
+ | Scenario | Resolution |
122
+ |----------|------------|
123
+ | Unknown command | Error with available command list |
124
+ | Role not found | Error with role registry |
125
+ | Session corruption | Attempt recovery, fallback to manual |
126
+ | Fast-advance conflict | Coordinator reconciles on next callback |
127
+ | Completion action fails | Default to Keep Active |
128
+ | Scanner finds no debt | Report clean codebase, skip to summary |
@@ -1,76 +1,76 @@
1
- ---
2
- role: executor
3
- prefix: TDFIX
4
- inner_loop: true
5
- message_types: [state_update]
6
- ---
7
-
8
- # Tech Debt Executor
9
-
10
- Debt cleanup executor. Apply remediation plan actions in worktree: refactor code, update dependencies, add tests, add documentation. Batch-delegate to CLI tools, self-validate after each batch.
11
-
12
- ## Phase 2: Load Remediation Plan
13
-
14
- | Input | Source | Required |
15
- |-------|--------|----------|
16
- | Session path | task description (regex: `session:\s*(.+)`) | Yes |
17
- | .msg/meta.json | <session>/.msg/meta.json | Yes |
18
- | Remediation plan | <session>/plan/remediation-plan.json | Yes |
19
- | Worktree info | meta.json:worktree.path, worktree.branch | Yes |
20
- | Context accumulator | From prior TDFIX tasks (inner loop) | Yes (inner loop) |
21
-
22
- 1. Extract session path from task description
23
- 2. Read .msg/meta.json for worktree path and branch
24
- 3. Read remediation-plan.json, extract all actions from plan phases
25
- 4. Group actions by type: refactor, restructure, add-tests, update-deps, add-docs
26
- 5. Split large groups (> 10 items) into sub-batches of 10
27
- 6. For inner loop (fix-verify cycle): load context_accumulator from prior TDFIX tasks, parse review/validation feedback for specific issues
28
-
29
- **Batch order**: refactor -> update-deps -> add-tests -> add-docs -> restructure
30
-
31
- ## Phase 3: Execute Fixes
32
-
33
- For each batch, use CLI tool for implementation:
34
-
35
- **Worktree constraint**: ALL file operations and commands must execute within worktree path. Use `cd "<worktree-path>" && ...` prefix for all Bash commands.
36
-
37
- **Per-batch delegation**:
38
-
39
- ```bash
40
- maestro cli -p "PURPOSE: Apply tech debt fixes in batch; success = all items fixed without breaking changes
41
- TASK: <batch-type-specific-tasks>
42
- MODE: write
43
- CONTEXT: @<worktree-path>/**/* | Memory: Remediation plan context
44
- EXPECTED: Code changes that fix debt items, maintain backward compatibility, pass existing tests
45
- CONSTRAINTS: Minimal changes only | No new features | No suppressions | Read files before modifying
46
- Batch type: <refactor|update-deps|add-tests|add-docs|restructure>
47
- Items: <list-of-items-with-file-paths-and-descriptions>" --tool gemini --mode write --cd "<worktree-path>"
48
- ```
49
-
50
- Wait for CLI completion before proceeding to next batch.
51
-
52
- **Fix Results Tracking**:
53
-
54
- | Field | Description |
55
- |-------|-------------|
56
- | items_fixed | Count of successfully fixed items |
57
- | items_failed | Count of failed items |
58
- | items_remaining | Remaining items count |
59
- | batches_completed | Completed batch count |
60
- | files_modified | Array of modified file paths |
61
- | errors | Array of error messages |
62
-
63
- After each batch, verify file modifications via `git diff --name-only` in worktree.
64
-
65
- ## Phase 4: Self-Validation
66
-
67
- All commands in worktree:
68
-
69
- | Check | Command | Pass Criteria |
70
- |-------|---------|---------------|
71
- | Syntax | `tsc --noEmit` or `python -m py_compile` | No new errors |
72
- | Lint | `eslint --no-error-on-unmatched-pattern` | No new errors |
73
-
74
- Write `<session>/fixes/fix-log.json` with fix results. Update .msg/meta.json with `fix_results`.
75
-
76
- Append to context_accumulator for next TDFIX task (inner loop): files modified, fixes applied, validation results, discovered caveats.
1
+ ---
2
+ role: executor
3
+ prefix: TDFIX
4
+ inner_loop: true
5
+ message_types: [state_update]
6
+ ---
7
+
8
+ # Tech Debt Executor
9
+
10
+ Debt cleanup executor. Apply remediation plan actions in worktree: refactor code, update dependencies, add tests, add documentation. Batch-delegate to CLI tools, self-validate after each batch.
11
+
12
+ ## Phase 2: Load Remediation Plan
13
+
14
+ | Input | Source | Required |
15
+ |-------|--------|----------|
16
+ | Session path | task description (regex: `session:\s*(.+)`) | Yes |
17
+ | .msg/meta.json | <session>/.msg/meta.json | Yes |
18
+ | Remediation plan | <session>/plan/remediation-plan.json | Yes |
19
+ | Worktree info | meta.json:worktree.path, worktree.branch | Yes |
20
+ | Context accumulator | From prior TDFIX tasks (inner loop) | Yes (inner loop) |
21
+
22
+ 1. Extract session path from task description
23
+ 2. Read .msg/meta.json for worktree path and branch
24
+ 3. Read remediation-plan.json, extract all actions from plan phases
25
+ 4. Group actions by type: refactor, restructure, add-tests, update-deps, add-docs
26
+ 5. Split large groups (> 10 items) into sub-batches of 10
27
+ 6. For inner loop (fix-verify cycle): load context_accumulator from prior TDFIX tasks, parse review/validation feedback for specific issues
28
+
29
+ **Batch order**: refactor -> update-deps -> add-tests -> add-docs -> restructure
30
+
31
+ ## Phase 3: Execute Fixes
32
+
33
+ For each batch, use CLI tool for implementation:
34
+
35
+ **Worktree constraint**: ALL file operations and commands must execute within worktree path. Use `cd "<worktree-path>" && ...` prefix for all Bash commands.
36
+
37
+ **Per-batch delegation**:
38
+
39
+ ```bash
40
+ maestro delegate "PURPOSE: Apply tech debt fixes in batch; success = all items fixed without breaking changes
41
+ TASK: <batch-type-specific-tasks>
42
+ MODE: write
43
+ CONTEXT: @<worktree-path>/**/* | Memory: Remediation plan context
44
+ EXPECTED: Code changes that fix debt items, maintain backward compatibility, pass existing tests
45
+ CONSTRAINTS: Minimal changes only | No new features | No suppressions | Read files before modifying
46
+ Batch type: <refactor|update-deps|add-tests|add-docs|restructure>
47
+ Items: <list-of-items-with-file-paths-and-descriptions>" --tool gemini --mode write --cd "<worktree-path>"
48
+ ```
49
+
50
+ Wait for CLI completion before proceeding to next batch.
51
+
52
+ **Fix Results Tracking**:
53
+
54
+ | Field | Description |
55
+ |-------|-------------|
56
+ | items_fixed | Count of successfully fixed items |
57
+ | items_failed | Count of failed items |
58
+ | items_remaining | Remaining items count |
59
+ | batches_completed | Completed batch count |
60
+ | files_modified | Array of modified file paths |
61
+ | errors | Array of error messages |
62
+
63
+ After each batch, verify file modifications via `git diff --name-only` in worktree.
64
+
65
+ ## Phase 4: Self-Validation
66
+
67
+ All commands in worktree:
68
+
69
+ | Check | Command | Pass Criteria |
70
+ |-------|---------|---------------|
71
+ | Syntax | `tsc --noEmit` or `python -m py_compile` | No new errors |
72
+ | Lint | `eslint --no-error-on-unmatched-pattern` | No new errors |
73
+
74
+ Write `<session>/fixes/fix-log.json` with fix results. Update .msg/meta.json with `fix_results`.
75
+
76
+ Append to context_accumulator for next TDFIX task (inner loop): files modified, fixes applied, validation results, discovered caveats.
@@ -1,90 +1,90 @@
1
- ---
2
- role: scanner
3
- prefix: TDSCAN
4
- inner_loop: false
5
- message_types: [state_update]
6
- ---
7
-
8
- # Tech Debt Scanner
9
-
10
- Multi-dimension tech debt scanner. Scan codebase across 5 dimensions (code, architecture, testing, dependency, documentation), produce structured debt inventory with severity rankings.
11
-
12
- ## Phase 2: Context & Environment Detection
13
-
14
- | Input | Source | Required |
15
- |-------|--------|----------|
16
- | Scan scope | task description (regex: `scope:\s*(.+)`) | No (default: `**/*`) |
17
- | Session path | task description (regex: `session:\s*(.+)`) | Yes |
18
- | .msg/meta.json | <session>/.msg/meta.json | Yes |
19
-
20
- 1. Extract session path and scan scope from task description
21
- 2. Load debug specs: Run `ccw spec load --category debug` for known issues, workarounds, and root-cause notes
22
- 3. Read .msg/meta.json for team context
23
- 3. Detect project type and framework:
24
-
25
- | Signal File | Project Type |
26
- |-------------|-------------|
27
- | package.json + React/Vue/Angular | Frontend Node |
28
- | package.json + Express/Fastify/NestJS | Backend Node |
29
- | pyproject.toml / requirements.txt | Python |
30
- | go.mod | Go |
31
- | No detection | Generic |
32
-
33
- 4. Determine scan dimensions (default: code, architecture, testing, dependency, documentation)
34
- 5. Detect perspectives from task description:
35
-
36
- | Condition | Perspective |
37
- |-----------|-------------|
38
- | `security\|auth\|inject\|xss` | security |
39
- | `performance\|speed\|optimize` | performance |
40
- | `quality\|clean\|maintain\|debt` | code-quality |
41
- | `architect\|pattern\|structure` | architecture |
42
- | Default | code-quality + architecture |
43
-
44
- 6. Assess complexity:
45
-
46
- | Score | Complexity | Strategy |
47
- |-------|------------|----------|
48
- | >= 4 | High | Triple Fan-out: CLI explore + CLI 5 dimensions + multi-perspective Gemini |
49
- | 2-3 | Medium | Dual Fan-out: CLI explore + CLI 3 dimensions |
50
- | 0-1 | Low | Inline: ACE search + Grep |
51
-
52
- ## Phase 3: Multi-Dimension Scan
53
-
54
- **Low Complexity** (inline):
55
- - Use `mcp__ace-tool__search_context` for code smells, TODO/FIXME, deprecated APIs, complex functions, dead code, missing tests
56
- - Classify findings into dimensions
57
-
58
- **Medium/High Complexity** (Fan-out):
59
- - Fan-out A: CLI exploration (structure, patterns, dependencies angles) via `maestro cli --tool gemini --mode analysis`
60
- - Fan-out B: CLI dimension analysis (parallel gemini per dimension -- code, architecture, testing, dependency, documentation)
61
- - Fan-out C (High only): Multi-perspective Gemini analysis (security, performance, code-quality, architecture)
62
- - Fan-in: Merge results, cross-deduplicate by file:line, boost severity for multi-source findings
63
-
64
- **Standardize each finding**:
65
-
66
- | Field | Description |
67
- |-------|-------------|
68
- | `id` | `TD-NNN` (sequential) |
69
- | `dimension` | code, architecture, testing, dependency, documentation |
70
- | `severity` | critical, high, medium, low |
71
- | `file` | File path |
72
- | `line` | Line number |
73
- | `description` | Issue description |
74
- | `suggestion` | Fix suggestion |
75
- | `estimated_effort` | small, medium, large, unknown |
76
-
77
- ### Tech Profile Scan
78
-
79
- After multi-dimension scan, emit context-aware trigger signals (based on detected codebase characteristics):
80
-
81
- 1. Check debt dimensions → signals (`legacy_patterns`, `test_gap`, `perf_sensitive`)
82
- 2. Check detected patterns → risk signals (`sql_detected`, `auth_detected`, `scaling_concern`, `injection_risk`)
83
- 3. Include `tech_profile` in Phase 5 state_update data
84
-
85
- ## Phase 4: Aggregate & Save
86
-
87
- 1. Deduplicate findings across Fan-out layers (file:line key), merge cross-references
88
- 2. Sort by severity (cross-referenced items boosted)
89
- 3. Write `<session>/scan/debt-inventory.json` with scan_date, dimensions, total_items, by_dimension, by_severity, items
90
- 4. Update .msg/meta.json with `debt_inventory` array and `debt_score_before` count
1
+ ---
2
+ role: scanner
3
+ prefix: TDSCAN
4
+ inner_loop: false
5
+ message_types: [state_update]
6
+ ---
7
+
8
+ # Tech Debt Scanner
9
+
10
+ Multi-dimension tech debt scanner. Scan codebase across 5 dimensions (code, architecture, testing, dependency, documentation), produce structured debt inventory with severity rankings.
11
+
12
+ ## Phase 2: Context & Environment Detection
13
+
14
+ | Input | Source | Required |
15
+ |-------|--------|----------|
16
+ | Scan scope | task description (regex: `scope:\s*(.+)`) | No (default: `**/*`) |
17
+ | Session path | task description (regex: `session:\s*(.+)`) | Yes |
18
+ | .msg/meta.json | <session>/.msg/meta.json | Yes |
19
+
20
+ 1. Extract session path and scan scope from task description
21
+ 2. Load debug specs: Run `ccw spec load --category debug` for known issues, workarounds, and root-cause notes
22
+ 3. Read .msg/meta.json for team context
23
+ 3. Detect project type and framework:
24
+
25
+ | Signal File | Project Type |
26
+ |-------------|-------------|
27
+ | package.json + React/Vue/Angular | Frontend Node |
28
+ | package.json + Express/Fastify/NestJS | Backend Node |
29
+ | pyproject.toml / requirements.txt | Python |
30
+ | go.mod | Go |
31
+ | No detection | Generic |
32
+
33
+ 4. Determine scan dimensions (default: code, architecture, testing, dependency, documentation)
34
+ 5. Detect perspectives from task description:
35
+
36
+ | Condition | Perspective |
37
+ |-----------|-------------|
38
+ | `security\|auth\|inject\|xss` | security |
39
+ | `performance\|speed\|optimize` | performance |
40
+ | `quality\|clean\|maintain\|debt` | code-quality |
41
+ | `architect\|pattern\|structure` | architecture |
42
+ | Default | code-quality + architecture |
43
+
44
+ 6. Assess complexity:
45
+
46
+ | Score | Complexity | Strategy |
47
+ |-------|------------|----------|
48
+ | >= 4 | High | Triple Fan-out: CLI explore + CLI 5 dimensions + multi-perspective Gemini |
49
+ | 2-3 | Medium | Dual Fan-out: CLI explore + CLI 3 dimensions |
50
+ | 0-1 | Low | Inline: ACE search + Grep |
51
+
52
+ ## Phase 3: Multi-Dimension Scan
53
+
54
+ **Low Complexity** (inline):
55
+ - Use `mcp__ace-tool__search_context` for code smells, TODO/FIXME, deprecated APIs, complex functions, dead code, missing tests
56
+ - Classify findings into dimensions
57
+
58
+ **Medium/High Complexity** (Fan-out):
59
+ - Fan-out A: CLI exploration (structure, patterns, dependencies angles) via `maestro delegate --to gemini --mode analysis`
60
+ - Fan-out B: CLI dimension analysis (parallel gemini per dimension -- code, architecture, testing, dependency, documentation)
61
+ - Fan-out C (High only): Multi-perspective Gemini analysis (security, performance, code-quality, architecture)
62
+ - Fan-in: Merge results, cross-deduplicate by file:line, boost severity for multi-source findings
63
+
64
+ **Standardize each finding**:
65
+
66
+ | Field | Description |
67
+ |-------|-------------|
68
+ | `id` | `TD-NNN` (sequential) |
69
+ | `dimension` | code, architecture, testing, dependency, documentation |
70
+ | `severity` | critical, high, medium, low |
71
+ | `file` | File path |
72
+ | `line` | Line number |
73
+ | `description` | Issue description |
74
+ | `suggestion` | Fix suggestion |
75
+ | `estimated_effort` | small, medium, large, unknown |
76
+
77
+ ### Tech Profile Scan
78
+
79
+ After multi-dimension scan, emit context-aware trigger signals (based on detected codebase characteristics):
80
+
81
+ 1. Check debt dimensions → signals (`legacy_patterns`, `test_gap`, `perf_sensitive`)
82
+ 2. Check detected patterns → risk signals (`sql_detected`, `auth_detected`, `scaling_concern`, `injection_risk`)
83
+ 3. Include `tech_profile` in Phase 5 state_update data
84
+
85
+ ## Phase 4: Aggregate & Save
86
+
87
+ 1. Deduplicate findings across Fan-out layers (file:line key), merge cross-references
88
+ 2. Sort by severity (cross-referenced items boosted)
89
+ 3. Write `<session>/scan/debt-inventory.json` with scan_date, dimensions, total_items, by_dimension, by_severity, items
90
+ 4. Update .msg/meta.json with `debt_inventory` array and `debt_score_before` count