maestro-flow 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.codex/skills/manage-codebase-rebuild/SKILL.md +405 -405
  2. package/.codex/skills/manage-codebase-refresh/SKILL.md +82 -82
  3. package/.codex/skills/manage-issue/SKILL.md +65 -65
  4. package/.codex/skills/manage-status/SKILL.md +89 -89
  5. package/.codex/skills/quality-debug/SKILL.md +413 -413
  6. package/.codex/skills/quality-refactor/SKILL.md +191 -191
  7. package/.codex/skills/quality-sync/SKILL.md +89 -89
  8. package/.codex/skills/quality-test/SKILL.md +198 -198
  9. package/.codex/skills/spec-add/SKILL.md +79 -79
  10. package/.codex/skills/spec-load/SKILL.md +75 -75
  11. package/.codex/skills/spec-map/SKILL.md +182 -182
  12. package/.codex/skills/spec-setup/SKILL.md +76 -76
  13. package/.codex/skills/team-coordinate/SKILL.md +7 -7
  14. package/.codex/skills/team-coordinate/roles/coordinator/role.md +1 -1
  15. package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -2
  16. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +2 -2
  17. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  18. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +2 -2
  19. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +1 -1
  20. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +2 -2
  21. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  22. package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +1 -1
  23. package/.codex/skills/team-quality-assurance/SKILL.md +2 -2
  24. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +2 -2
  25. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  26. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -2
  27. package/.codex/skills/team-review/SKILL.md +2 -2
  28. package/.codex/skills/team-review/roles/coordinator/role.md +2 -2
  29. package/.codex/skills/team-review/roles/reviewer/role.md +2 -2
  30. package/.codex/skills/team-review/roles/scanner/role.md +1 -1
  31. package/.codex/skills/team-tech-debt/SKILL.md +2 -2
  32. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +1 -1
  33. package/.codex/skills/team-tech-debt/roles/executor/role.md +1 -1
  34. package/.codex/skills/team-tech-debt/roles/scanner/role.md +2 -2
  35. package/.codex/skills/team-tech-debt/roles/validator/role.md +1 -1
  36. package/.codex/skills/team-testing/SKILL.md +2 -2
  37. package/.codex/skills/team-testing/roles/coordinator/role.md +2 -2
  38. package/.codex/skills/team-testing/roles/executor/role.md +2 -2
  39. package/.codex/skills/team-testing/roles/generator/role.md +2 -2
  40. package/README.md +43 -4
  41. package/dist/agents/dashboard-bridge.d.ts +5 -0
  42. package/dist/agents/dashboard-bridge.d.ts.map +1 -1
  43. package/dist/agents/dashboard-bridge.js +13 -0
  44. package/dist/agents/dashboard-bridge.js.map +1 -1
  45. package/dist/agents/parallel-cli-runner.d.ts +42 -0
  46. package/dist/agents/parallel-cli-runner.d.ts.map +1 -0
  47. package/dist/agents/parallel-cli-runner.js +200 -0
  48. package/dist/agents/parallel-cli-runner.js.map +1 -0
  49. package/dist/agents/terminal-adapter.d.ts +94 -0
  50. package/dist/agents/terminal-adapter.d.ts.map +1 -0
  51. package/dist/agents/terminal-adapter.js +132 -0
  52. package/dist/agents/terminal-adapter.js.map +1 -0
  53. package/dist/agents/terminal-backend.d.ts +53 -0
  54. package/dist/agents/terminal-backend.d.ts.map +1 -0
  55. package/dist/agents/terminal-backend.js +286 -0
  56. package/dist/agents/terminal-backend.js.map +1 -0
  57. package/dist/cli.js +4 -0
  58. package/dist/cli.js.map +1 -1
  59. package/dist/commands/coordinate.d.ts.map +1 -1
  60. package/dist/commands/coordinate.js +14 -5
  61. package/dist/commands/coordinate.js.map +1 -1
  62. package/dist/commands/delegate.d.ts +3 -0
  63. package/dist/commands/delegate.d.ts.map +1 -0
  64. package/dist/commands/delegate.js +142 -0
  65. package/dist/commands/delegate.js.map +1 -0
  66. package/dist/commands/msg.d.ts +3 -0
  67. package/dist/commands/msg.d.ts.map +1 -0
  68. package/dist/commands/msg.js +110 -0
  69. package/dist/commands/msg.js.map +1 -0
  70. package/dist/coordinator/graph-types.d.ts +17 -0
  71. package/dist/coordinator/graph-types.d.ts.map +1 -1
  72. package/dist/coordinator/graph-walker.d.ts +3 -1
  73. package/dist/coordinator/graph-walker.d.ts.map +1 -1
  74. package/dist/coordinator/graph-walker.js +147 -8
  75. package/dist/coordinator/graph-walker.js.map +1 -1
  76. package/dist/coordinator/index.d.ts +2 -0
  77. package/dist/coordinator/index.d.ts.map +1 -1
  78. package/dist/coordinator/index.js +1 -0
  79. package/dist/coordinator/index.js.map +1 -1
  80. package/dist/coordinator/parallel-executor.d.ts +24 -0
  81. package/dist/coordinator/parallel-executor.d.ts.map +1 -0
  82. package/dist/coordinator/parallel-executor.js +43 -0
  83. package/dist/coordinator/parallel-executor.js.map +1 -0
  84. package/package.json +4 -2
  85. package/templates/cli/prompts/rules-tech-rules-agent-prompt.txt +89 -89
  86. package/templates/cli/prompts/workflow-codex-feasibility-validation.txt +176 -176
  87. package/templates/cli/prompts/workflow-gemini-solution-design.txt +131 -131
  88. package/templates/cli/prompts/workflow-skill-index.txt +224 -224
  89. package/templates/cli/protocols/analysis-protocol.md +2 -2
  90. package/templates/cli/protocols/write-protocol.md +2 -2
  91. package/workflows/memory.md +2 -2
  92. package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +0 -512
@@ -1,75 +1,75 @@
1
- ---
2
- name: maestro-spec-load
3
- description: Load relevant specs for current context, optionally filtered by category or keyword
4
- argument-hint: "[--category <type>] [keyword]"
5
- allowed-tools: Read, Bash, Glob, Grep
6
- ---
7
-
8
- # Spec Load
9
-
10
- ## Usage
11
-
12
- ```bash
13
- $maestro-spec-load
14
- $maestro-spec-load "--category execution"
15
- $maestro-spec-load "authentication"
16
- $maestro-spec-load "--category debug error handling"
17
- ```
18
-
19
- **Flags**: `--category <type>` filters by spec category. Optional keyword searches within loaded files.
20
-
21
- ---
22
-
23
- ## Implementation
24
-
25
- ### Step 1: Validate Specs Directory
26
-
27
- ```bash
28
- test -d .workflow/specs || exit 1 # E001: not initialized
29
- ```
30
-
31
- ### Step 2: Parse Arguments
32
-
33
- Extract optional `--category` flag and keyword from arguments.
34
-
35
- **Category-to-file mapping:**
36
-
37
- | Category | Files Loaded |
38
- |----------|-------------|
39
- | `general` | `learnings.md` |
40
- | `planning` | `architecture-constraints.md` |
41
- | `execution` | `coding-conventions.md`, `quality-rules.md` |
42
- | `debug` | `debug-notes.md` |
43
- | `test` | `test-conventions.md` |
44
- | `review` | `review-standards.md` |
45
- | `validation` | `validation-rules.md` |
46
- | `all` (default) | All spec files |
47
-
48
- ### Step 3: Load Files
49
-
50
- Read the spec files matching the category filter.
51
- If no files exist for the category, fall back to loading all specs.
52
-
53
- ### Step 4: Apply Keyword Filter
54
-
55
- If a keyword is provided, search within loaded files for matching sections using grep.
56
- Return only matching sections with file:line references.
57
- If no matches found, show all content in the category (W001).
58
-
59
- ### Step 5: Display Results
60
-
61
- ```
62
- === SPECS: {category} ===
63
- {For each file}
64
- --- {filename} ---
65
- {content or matching sections}
66
- ```
67
-
68
- ---
69
-
70
- ## Error Handling
71
-
72
- | Code | Severity | Description |
73
- |------|----------|-------------|
74
- | E001 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
75
- | W001 | warning | No matching specs for keyword -- showing all in category |
1
+ ---
2
+ name: maestro-spec-load
3
+ description: Load relevant specs for current context, optionally filtered by category or keyword
4
+ argument-hint: "[--category <type>] [keyword]"
5
+ allowed-tools: Read, Bash, Glob, Grep
6
+ ---
7
+
8
+ # Spec Load
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ $maestro-spec-load
14
+ $maestro-spec-load "--category execution"
15
+ $maestro-spec-load "authentication"
16
+ $maestro-spec-load "--category debug error handling"
17
+ ```
18
+
19
+ **Flags**: `--category <type>` filters by spec category. Optional keyword searches within loaded files.
20
+
21
+ ---
22
+
23
+ ## Implementation
24
+
25
+ ### Step 1: Validate Specs Directory
26
+
27
+ ```bash
28
+ test -d .workflow/specs || exit 1 # E001: not initialized
29
+ ```
30
+
31
+ ### Step 2: Parse Arguments
32
+
33
+ Extract optional `--category` flag and keyword from arguments.
34
+
35
+ **Category-to-file mapping:**
36
+
37
+ | Category | Files Loaded |
38
+ |----------|-------------|
39
+ | `general` | `learnings.md` |
40
+ | `planning` | `architecture-constraints.md` |
41
+ | `execution` | `coding-conventions.md`, `quality-rules.md` |
42
+ | `debug` | `debug-notes.md` |
43
+ | `test` | `test-conventions.md` |
44
+ | `review` | `review-standards.md` |
45
+ | `validation` | `validation-rules.md` |
46
+ | `all` (default) | All spec files |
47
+
48
+ ### Step 3: Load Files
49
+
50
+ Read the spec files matching the category filter.
51
+ If no files exist for the category, fall back to loading all specs.
52
+
53
+ ### Step 4: Apply Keyword Filter
54
+
55
+ If a keyword is provided, search within loaded files for matching sections using grep.
56
+ Return only matching sections with file:line references.
57
+ If no matches found, show all content in the category (W001).
58
+
59
+ ### Step 5: Display Results
60
+
61
+ ```
62
+ === SPECS: {category} ===
63
+ {For each file}
64
+ --- {filename} ---
65
+ {content or matching sections}
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Error Handling
71
+
72
+ | Code | Severity | Description |
73
+ |------|----------|-------------|
74
+ | E001 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
75
+ | W001 | warning | No matching specs for keyword -- showing all in category |
@@ -1,182 +1,182 @@
1
- ---
2
- name: maestro-spec-map
3
- description: Analyze codebase with 4 parallel mapper agents via CSV wave pipeline. Produces .workflow/codebase/ documents for tech-stack, architecture, features, and cross-cutting concerns.
4
- argument-hint: "[-y|--yes] [-c|--concurrency 4] [--continue] \"[focus area]\""
5
- allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- ---
7
-
8
- ## Auto Mode
9
-
10
- When `--yes` or `-y`: Auto-confirm mapper assignment, skip validation.
11
-
12
- # Maestro Spec Map (CSV Wave)
13
-
14
- ## Usage
15
-
16
- ```bash
17
- $maestro-spec-map ""
18
- $maestro-spec-map "auth"
19
- $maestro-spec-map -c 4 "api layer"
20
- $maestro-spec-map --continue "map-auth-20260318"
21
- ```
22
-
23
- **Flags**:
24
- - `-y, --yes`: Skip all confirmations
25
- - `-c, --concurrency N`: Max concurrent agents (default: 4)
26
- - `--continue`: Resume existing session
27
-
28
- **Output**: `.workflow/codebase/` (tech-stack.md, architecture.md, features.md, concerns.md)
29
-
30
- ---
31
-
32
- ## Overview
33
-
34
- Single-wave parallel execution — 4 independent mapper agents each analyze a different codebase dimension. No dependencies between tasks, maximum parallelism.
35
-
36
- **Topology**: Independent Parallel (single wave)
37
-
38
- ```
39
- ┌──────────────────────────────────────────────────────┐
40
- │ CODEBASE MAPPER WORKFLOW │
41
- ├──────────────────────────────────────────────────────┤
42
- │ │
43
- │ Phase 1: Setup → CSV │
44
- │ ├─ Detect focus area from arguments │
45
- │ ├─ Generate tasks.csv with 4 mapper tasks │
46
- │ └─ All tasks wave 1 (no dependencies) │
47
- │ │
48
- │ Phase 2: Wave Execution (Single Wave) │
49
- │ ├─ Wave 1: All 4 mappers run concurrently │
50
- │ │ ├─ Tech Stack mapper │
51
- │ │ ├─ Architecture mapper │
52
- │ │ ├─ Features mapper │
53
- │ │ └─ Cross-cutting Concerns mapper │
54
- │ └─ discoveries.ndjson shared (append-only) │
55
- │ │
56
- │ Phase 3: Results → .workflow/codebase/ │
57
- │ ├─ Write output files from agent findings │
58
- │ ├─ Generate context.md summary │
59
- │ └─ Display completion report │
60
- │ │
61
- └──────────────────────────────────────────────────────┘
62
- ```
63
-
64
- ---
65
-
66
- ## CSV Schema
67
-
68
- ### tasks.csv
69
-
70
- ```csv
71
- id,title,description,focus_area,output_file,deps,context_from,wave,status,findings,error
72
- "1","Tech Stack Analysis","Analyze languages, frameworks, dependencies, build system, package managers, runtime configuration. Scan package.json, build configs, CI/CD files.","full","tech-stack.md","","","1","","",""
73
- "2","Architecture Analysis","Analyze project structure, module boundaries, layer architecture, data flow patterns, entry points, API surface. Map directory tree and import graph.","full","architecture.md","","","1","","",""
74
- "3","Features Analysis","Inventory user-facing capabilities, API endpoints, CLI commands, UI components, background jobs, integrations. Map to source locations.","full","features.md","","","1","","",""
75
- "4","Cross-cutting Concerns","Analyze error handling patterns, logging strategy, authentication/authorization, configuration management, testing approach, observability.","full","concerns.md","","","1","","",""
76
- ```
77
-
78
- **Columns**:
79
-
80
- | Column | Phase | Description |
81
- |--------|-------|-------------|
82
- | `id` | Input | Mapper identifier |
83
- | `title` | Input | Mapper dimension title |
84
- | `description` | Input | Detailed analysis instructions |
85
- | `focus_area` | Input | Focus scope (full or specific area) |
86
- | `output_file` | Input | Target output filename in .workflow/codebase/ |
87
- | `deps` | Input | Empty (all independent) |
88
- | `context_from` | Input | Empty (no cross-task context) |
89
- | `wave` | Computed | Always 1 (single wave) |
90
- | `status` | Output | pending/completed/failed/skipped |
91
- | `findings` | Output | Analysis summary (max 500 chars) |
92
- | `error` | Output | Error if failed |
93
-
94
- ---
95
-
96
- ## Implementation
97
-
98
- ### Session Initialization
99
-
100
- ```javascript
101
- const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
102
- const focusArea = $ARGUMENTS.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '').trim() || 'full'
103
- const dateStr = new Date(Date.now() + 8*60*60*1000).toISOString().substring(0,10).replace(/-/g,'')
104
- const sessionId = `map-${focusArea.substring(0,20)}-${dateStr}`
105
- const sessionFolder = `.workflow/.csv-wave/${sessionId}`
106
-
107
- Bash(`mkdir -p ${sessionFolder}`)
108
- Bash(`mkdir -p .workflow/codebase`)
109
- ```
110
-
111
- ### Phase 1: Generate tasks.csv
112
-
113
- Generate 4 mapper rows. If focus_area is specified, scope descriptions to that area.
114
-
115
- ### Phase 2: Wave Execution
116
-
117
- Single wave — all 4 mappers run concurrently:
118
-
119
- ```javascript
120
- spawn_agents_on_csv({
121
- csv_path: `${sessionFolder}/wave-1.csv`,
122
- id_column: "id",
123
- instruction: buildMapperInstruction(sessionFolder, focusArea),
124
- max_concurrency: 4,
125
- max_runtime_seconds: 600,
126
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
127
- output_schema: {
128
- type: "object",
129
- properties: {
130
- id: { type: "string" },
131
- status: { type: "string", enum: ["completed", "failed"] },
132
- findings: { type: "string" },
133
- error: { type: "string" }
134
- },
135
- required: ["id", "status", "findings"]
136
- }
137
- })
138
- ```
139
-
140
- ### Phase 3: Write Output Files
141
-
142
- 1. Read each agent's findings from results
143
- 2. Write to `.workflow/codebase/{output_file}`
144
- 3. Generate context.md summary
145
- 4. Display report
146
-
147
- ---
148
-
149
- ## Shared Discovery Board Protocol
150
-
151
- Discovery types particularly valuable for mapper agents:
152
-
153
- | Type | Dedup Key | Data Schema |
154
- |------|-----------|-------------|
155
- | `tech_stack` | singleton | `{framework, language, tools[]}` |
156
- | `code_pattern` | `data.name` | `{name, file, description}` |
157
- | `integration_point` | `data.file` | `{file, description, exports[]}` |
158
- | `convention` | singleton | `{naming, imports, formatting}` |
159
-
160
- Mappers share discoveries so other mappers can skip redundant exploration (e.g., if tech-stack mapper discovers the framework, features mapper can focus on feature-level analysis).
161
-
162
- ---
163
-
164
- ## Error Handling
165
-
166
- | Error | Resolution |
167
- |-------|------------|
168
- | No source files found | Abort: "No source files in project" |
169
- | Mapper agent timeout | Mark failed, continue with other mappers |
170
- | Mapper agent failed | Mark failed, output partial results |
171
- | .workflow/codebase/ exists | Prompt: refresh/skip/merge (auto-refresh with -y) |
172
-
173
- ---
174
-
175
- ## Core Rules
176
-
177
- 1. **Start Immediately**: Initialize session, generate CSV, execute
178
- 2. **CSV is Source of Truth**: tasks.csv holds all mapper state
179
- 3. **Discovery Board is Append-Only**: Mappers share findings
180
- 4. **Partial Results OK**: If 3/4 mappers succeed, still write available docs
181
- 5. **Focus Area Scoping**: When focus is specified, descriptions narrow to that area
182
- 6. **DO NOT STOP**: Execute until all mappers complete or fail
1
+ ---
2
+ name: maestro-spec-map
3
+ description: Analyze codebase with 4 parallel mapper agents via CSV wave pipeline. Produces .workflow/codebase/ documents for tech-stack, architecture, features, and cross-cutting concerns.
4
+ argument-hint: "[-y|--yes] [-c|--concurrency 4] [--continue] \"[focus area]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ ## Auto Mode
9
+
10
+ When `--yes` or `-y`: Auto-confirm mapper assignment, skip validation.
11
+
12
+ # Maestro Spec Map (CSV Wave)
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ $maestro-spec-map ""
18
+ $maestro-spec-map "auth"
19
+ $maestro-spec-map -c 4 "api layer"
20
+ $maestro-spec-map --continue "map-auth-20260318"
21
+ ```
22
+
23
+ **Flags**:
24
+ - `-y, --yes`: Skip all confirmations
25
+ - `-c, --concurrency N`: Max concurrent agents (default: 4)
26
+ - `--continue`: Resume existing session
27
+
28
+ **Output**: `.workflow/codebase/` (tech-stack.md, architecture.md, features.md, concerns.md)
29
+
30
+ ---
31
+
32
+ ## Overview
33
+
34
+ Single-wave parallel execution — 4 independent mapper agents each analyze a different codebase dimension. No dependencies between tasks, maximum parallelism.
35
+
36
+ **Topology**: Independent Parallel (single wave)
37
+
38
+ ```
39
+ ┌──────────────────────────────────────────────────────┐
40
+ │ CODEBASE MAPPER WORKFLOW │
41
+ ├──────────────────────────────────────────────────────┤
42
+ │ │
43
+ │ Phase 1: Setup → CSV │
44
+ │ ├─ Detect focus area from arguments │
45
+ │ ├─ Generate tasks.csv with 4 mapper tasks │
46
+ │ └─ All tasks wave 1 (no dependencies) │
47
+ │ │
48
+ │ Phase 2: Wave Execution (Single Wave) │
49
+ │ ├─ Wave 1: All 4 mappers run concurrently │
50
+ │ │ ├─ Tech Stack mapper │
51
+ │ │ ├─ Architecture mapper │
52
+ │ │ ├─ Features mapper │
53
+ │ │ └─ Cross-cutting Concerns mapper │
54
+ │ └─ discoveries.ndjson shared (append-only) │
55
+ │ │
56
+ │ Phase 3: Results → .workflow/codebase/ │
57
+ │ ├─ Write output files from agent findings │
58
+ │ ├─ Generate context.md summary │
59
+ │ └─ Display completion report │
60
+ │ │
61
+ └──────────────────────────────────────────────────────┘
62
+ ```
63
+
64
+ ---
65
+
66
+ ## CSV Schema
67
+
68
+ ### tasks.csv
69
+
70
+ ```csv
71
+ id,title,description,focus_area,output_file,deps,context_from,wave,status,findings,error
72
+ "1","Tech Stack Analysis","Analyze languages, frameworks, dependencies, build system, package managers, runtime configuration. Scan package.json, build configs, CI/CD files.","full","tech-stack.md","","","1","","",""
73
+ "2","Architecture Analysis","Analyze project structure, module boundaries, layer architecture, data flow patterns, entry points, API surface. Map directory tree and import graph.","full","architecture.md","","","1","","",""
74
+ "3","Features Analysis","Inventory user-facing capabilities, API endpoints, CLI commands, UI components, background jobs, integrations. Map to source locations.","full","features.md","","","1","","",""
75
+ "4","Cross-cutting Concerns","Analyze error handling patterns, logging strategy, authentication/authorization, configuration management, testing approach, observability.","full","concerns.md","","","1","","",""
76
+ ```
77
+
78
+ **Columns**:
79
+
80
+ | Column | Phase | Description |
81
+ |--------|-------|-------------|
82
+ | `id` | Input | Mapper identifier |
83
+ | `title` | Input | Mapper dimension title |
84
+ | `description` | Input | Detailed analysis instructions |
85
+ | `focus_area` | Input | Focus scope (full or specific area) |
86
+ | `output_file` | Input | Target output filename in .workflow/codebase/ |
87
+ | `deps` | Input | Empty (all independent) |
88
+ | `context_from` | Input | Empty (no cross-task context) |
89
+ | `wave` | Computed | Always 1 (single wave) |
90
+ | `status` | Output | pending/completed/failed/skipped |
91
+ | `findings` | Output | Analysis summary (max 500 chars) |
92
+ | `error` | Output | Error if failed |
93
+
94
+ ---
95
+
96
+ ## Implementation
97
+
98
+ ### Session Initialization
99
+
100
+ ```javascript
101
+ const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
102
+ const focusArea = $ARGUMENTS.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '').trim() || 'full'
103
+ const dateStr = new Date(Date.now() + 8*60*60*1000).toISOString().substring(0,10).replace(/-/g,'')
104
+ const sessionId = `map-${focusArea.substring(0,20)}-${dateStr}`
105
+ const sessionFolder = `.workflow/.csv-wave/${sessionId}`
106
+
107
+ Bash(`mkdir -p ${sessionFolder}`)
108
+ Bash(`mkdir -p .workflow/codebase`)
109
+ ```
110
+
111
+ ### Phase 1: Generate tasks.csv
112
+
113
+ Generate 4 mapper rows. If focus_area is specified, scope descriptions to that area.
114
+
115
+ ### Phase 2: Wave Execution
116
+
117
+ Single wave — all 4 mappers run concurrently:
118
+
119
+ ```javascript
120
+ spawn_agents_on_csv({
121
+ csv_path: `${sessionFolder}/wave-1.csv`,
122
+ id_column: "id",
123
+ instruction: buildMapperInstruction(sessionFolder, focusArea),
124
+ max_concurrency: 4,
125
+ max_runtime_seconds: 600,
126
+ output_csv_path: `${sessionFolder}/wave-1-results.csv`,
127
+ output_schema: {
128
+ type: "object",
129
+ properties: {
130
+ id: { type: "string" },
131
+ status: { type: "string", enum: ["completed", "failed"] },
132
+ findings: { type: "string" },
133
+ error: { type: "string" }
134
+ },
135
+ required: ["id", "status", "findings"]
136
+ }
137
+ })
138
+ ```
139
+
140
+ ### Phase 3: Write Output Files
141
+
142
+ 1. Read each agent's findings from results
143
+ 2. Write to `.workflow/codebase/{output_file}`
144
+ 3. Generate context.md summary
145
+ 4. Display report
146
+
147
+ ---
148
+
149
+ ## Shared Discovery Board Protocol
150
+
151
+ Discovery types particularly valuable for mapper agents:
152
+
153
+ | Type | Dedup Key | Data Schema |
154
+ |------|-----------|-------------|
155
+ | `tech_stack` | singleton | `{framework, language, tools[]}` |
156
+ | `code_pattern` | `data.name` | `{name, file, description}` |
157
+ | `integration_point` | `data.file` | `{file, description, exports[]}` |
158
+ | `convention` | singleton | `{naming, imports, formatting}` |
159
+
160
+ Mappers share discoveries so other mappers can skip redundant exploration (e.g., if tech-stack mapper discovers the framework, features mapper can focus on feature-level analysis).
161
+
162
+ ---
163
+
164
+ ## Error Handling
165
+
166
+ | Error | Resolution |
167
+ |-------|------------|
168
+ | No source files found | Abort: "No source files in project" |
169
+ | Mapper agent timeout | Mark failed, continue with other mappers |
170
+ | Mapper agent failed | Mark failed, output partial results |
171
+ | .workflow/codebase/ exists | Prompt: refresh/skip/merge (auto-refresh with -y) |
172
+
173
+ ---
174
+
175
+ ## Core Rules
176
+
177
+ 1. **Start Immediately**: Initialize session, generate CSV, execute
178
+ 2. **CSV is Source of Truth**: tasks.csv holds all mapper state
179
+ 3. **Discovery Board is Append-Only**: Mappers share findings
180
+ 4. **Partial Results OK**: If 3/4 mappers succeed, still write available docs
181
+ 5. **Focus Area Scoping**: When focus is specified, descriptions narrow to that area
182
+ 6. **DO NOT STOP**: Execute until all mappers complete or fail
@@ -1,76 +1,76 @@
1
- ---
2
- name: maestro-spec-setup
3
- description: Initialize project specs by scanning codebase for conventions and tech stack
4
- argument-hint: ""
5
- allowed-tools: Read, Write, Bash, Glob, Grep
6
- ---
7
-
8
- # Spec Setup
9
-
10
- ## Usage
11
-
12
- ```bash
13
- $maestro-spec-setup
14
- ```
15
-
16
- No arguments. Scans the codebase and generates spec files in `.workflow/specs/`.
17
-
18
- ---
19
-
20
- ## Implementation
21
-
22
- ### Step 1: Validate Preconditions
23
-
24
- ```bash
25
- test -d .workflow || exit 1 # E001: not initialized
26
- ```
27
-
28
- Verify project contains source files to scan (E002 if empty).
29
-
30
- ### Step 2: Scan Codebase
31
-
32
- Detect conventions and tech stack by scanning:
33
- - Package files (`package.json`, `Cargo.toml`, `go.mod`, etc.)
34
- - Config files (`.eslintrc`, `tsconfig.json`, `.prettierrc`, etc.)
35
- - Source structure (directories, naming patterns, import style)
36
- - Test patterns (framework, naming, location)
37
-
38
- ### Step 3: Generate Spec Files
39
-
40
- Create `.workflow/specs/` directory and write:
41
-
42
- 1. **`coding-conventions.md`** -- Detected naming, import, formatting patterns
43
- 2. **`architecture-constraints.md`** -- Structural rules, layer boundaries
44
- 3. **`quality-rules.md`** -- Linting, testing, coverage requirements
45
- 4. **`learnings.md`** -- Initialized with format instructions for future entries
46
-
47
- ### Step 4: Generate Tech Profile
48
-
49
- Read template from `~/.maestro/templates/project-tech.json` if available.
50
- Write `.workflow/project-tech.json` with detected tech stack:
51
- - Language, framework, build system, test framework
52
- - Key dependencies, module system, TypeScript config
53
-
54
- ### Step 5: Display Report
55
-
56
- ```
57
- === SPEC SETUP COMPLETE ===
58
- Created:
59
- - .workflow/specs/coding-conventions.md
60
- - .workflow/specs/architecture-constraints.md
61
- - .workflow/specs/quality-rules.md
62
- - .workflow/specs/learnings.md
63
- - .workflow/project-tech.json
64
-
65
- Next: Run Skill({ skill: "spec-add", args: "<type> <content>" }) to add entries
66
- ```
67
-
68
- ---
69
-
70
- ## Error Handling
71
-
72
- | Code | Severity | Description |
73
- |------|----------|-------------|
74
- | E001 | fatal | `.workflow/` not initialized -- run `Skill({ skill: "maestro-init" })` first |
75
- | E002 | fatal | No source files found in project |
76
- | W001 | warning | Convention detection uncertain -- marked `[UNCERTAIN]` |
1
+ ---
2
+ name: maestro-spec-setup
3
+ description: Initialize project specs by scanning codebase for conventions and tech stack
4
+ argument-hint: ""
5
+ allowed-tools: Read, Write, Bash, Glob, Grep
6
+ ---
7
+
8
+ # Spec Setup
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ $maestro-spec-setup
14
+ ```
15
+
16
+ No arguments. Scans the codebase and generates spec files in `.workflow/specs/`.
17
+
18
+ ---
19
+
20
+ ## Implementation
21
+
22
+ ### Step 1: Validate Preconditions
23
+
24
+ ```bash
25
+ test -d .workflow || exit 1 # E001: not initialized
26
+ ```
27
+
28
+ Verify project contains source files to scan (E002 if empty).
29
+
30
+ ### Step 2: Scan Codebase
31
+
32
+ Detect conventions and tech stack by scanning:
33
+ - Package files (`package.json`, `Cargo.toml`, `go.mod`, etc.)
34
+ - Config files (`.eslintrc`, `tsconfig.json`, `.prettierrc`, etc.)
35
+ - Source structure (directories, naming patterns, import style)
36
+ - Test patterns (framework, naming, location)
37
+
38
+ ### Step 3: Generate Spec Files
39
+
40
+ Create `.workflow/specs/` directory and write:
41
+
42
+ 1. **`coding-conventions.md`** -- Detected naming, import, formatting patterns
43
+ 2. **`architecture-constraints.md`** -- Structural rules, layer boundaries
44
+ 3. **`quality-rules.md`** -- Linting, testing, coverage requirements
45
+ 4. **`learnings.md`** -- Initialized with format instructions for future entries
46
+
47
+ ### Step 4: Generate Tech Profile
48
+
49
+ Read template from `~/.maestro/templates/project-tech.json` if available.
50
+ Write `.workflow/project-tech.json` with detected tech stack:
51
+ - Language, framework, build system, test framework
52
+ - Key dependencies, module system, TypeScript config
53
+
54
+ ### Step 5: Display Report
55
+
56
+ ```
57
+ === SPEC SETUP COMPLETE ===
58
+ Created:
59
+ - .workflow/specs/coding-conventions.md
60
+ - .workflow/specs/architecture-constraints.md
61
+ - .workflow/specs/quality-rules.md
62
+ - .workflow/specs/learnings.md
63
+ - .workflow/project-tech.json
64
+
65
+ Next: Run Skill({ skill: "spec-add", args: "<type> <content>" }) to add entries
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Error Handling
71
+
72
+ | Code | Severity | Description |
73
+ |------|----------|-------------|
74
+ | E001 | fatal | `.workflow/` not initialized -- run `Skill({ skill: "maestro-init" })` first |
75
+ | E002 | fatal | No source files found in project |
76
+ | W001 | warning | Convention detection uncertain -- marked `[UNCERTAIN]` |