maestro-flow 0.3.3 → 0.3.5
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.
- package/.claude/commands/quality-business-test.md +110 -0
- package/.codex/skills/maestro-init/SKILL.md +167 -167
- package/.codex/skills/maestro-phase-add/SKILL.md +154 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +173 -173
- package/.codex/skills/maestro-verify/SKILL.md +566 -566
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +5 -5
- package/.codex/skills/manage-codebase-refresh/SKILL.md +5 -5
- package/.codex/skills/manage-issue/SKILL.md +7 -7
- package/.codex/skills/manage-issue-analyze/SKILL.md +7 -7
- package/.codex/skills/manage-issue-discover/SKILL.md +503 -503
- package/.codex/skills/manage-issue-execute/SKILL.md +9 -9
- package/.codex/skills/manage-issue-plan/SKILL.md +8 -8
- package/.codex/skills/manage-learn/SKILL.md +7 -7
- package/.codex/skills/manage-memory/SKILL.md +72 -72
- package/.codex/skills/manage-memory-capture/SKILL.md +86 -86
- package/.codex/skills/manage-status/SKILL.md +2 -2
- package/.codex/skills/quality-business-test/SKILL.md +223 -0
- package/.codex/skills/quality-debug/SKILL.md +5 -5
- package/.codex/skills/quality-integration-test/SKILL.md +544 -544
- package/.codex/skills/quality-refactor/SKILL.md +6 -6
- package/.codex/skills/quality-retrospective/SKILL.md +10 -10
- package/.codex/skills/quality-review/SKILL.md +408 -408
- package/.codex/skills/quality-sync/SKILL.md +6 -6
- package/.codex/skills/quality-test/SKILL.md +5 -5
- package/.codex/skills/quality-test-gen/SKILL.md +447 -447
- package/.codex/skills/spec-add/SKILL.md +5 -5
- package/.codex/skills/spec-load/SKILL.md +5 -5
- package/.codex/skills/spec-map/SKILL.md +5 -5
- package/.codex/skills/spec-setup/SKILL.md +2 -2
- package/chains/_intent-map.json +6 -0
- package/chains/_router.json +14 -0
- package/chains/full-lifecycle.json +15 -0
- package/chains/quality-loop.json +16 -1
- package/chains/singles/business-test.json +26 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.d.ts +4 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +47 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +16 -2
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +25 -9
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +3 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +78 -61
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/agents/cli-history-store.d.ts +14 -1
- package/dashboard/dist-server/src/agents/cli-history-store.js +24 -2
- package/dashboard/dist-server/src/agents/cli-history-store.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +142 -6
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +3 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +72 -46
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/agents/cli-history-store.d.ts +14 -1
- package/dist/src/agents/cli-history-store.d.ts.map +1 -1
- package/dist/src/agents/cli-history-store.js +24 -2
- package/dist/src/agents/cli-history-store.js.map +1 -1
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +65 -5
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +5 -2
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/mcp/delegate-channel-relay.d.ts.map +1 -1
- package/dist/src/mcp/delegate-channel-relay.js +7 -2
- package/dist/src/mcp/delegate-channel-relay.js.map +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/tools/index.d.ts +1 -6
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +1 -451
- package/dist/src/tools/index.js.map +1 -1
- package/package.json +3 -2
- package/templates/business-test-report.json +68 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quality-business-test
|
|
3
|
+
description: PRD-forward business testing with requirement traceability, fixture generation, and multi-layer execution
|
|
4
|
+
argument-hint: "<phase> [--spec SPEC-xxx] [--layer L1|L2|L3] [--gen-code] [--dry-run] [--re-run] [--auto]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Agent
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
<purpose>
|
|
16
|
+
Validate built features against PRD acceptance criteria through automated multi-layer business testing. Unlike quality-test (interactive UAT from code gaps) and quality-test-gen (generate tests from coverage gaps), this command starts from REQ-*.md acceptance criteria and works forward to verify business rules are satisfied.
|
|
17
|
+
|
|
18
|
+
Key mechanisms:
|
|
19
|
+
- **PRD-forward extraction**: Parse REQ-*.md acceptance criteria with RFC 2119 priority mapping
|
|
20
|
+
- **Three-tier fixture generation**: Schema-derived (valid/invalid/boundary), criteria-derived (expected outcomes), scenario-derived (multi-entity packs)
|
|
21
|
+
- **Progressive L1-L3 layers**: Interface Contract -> Business Rule -> Business Scenario (fail-fast on critical)
|
|
22
|
+
- **Generator-Critic loop**: Max 3 iterations per layer to distinguish test defects from code defects
|
|
23
|
+
- **Requirement traceability**: Every failure traces back to REQ-NNN:AC-N
|
|
24
|
+
- **Degraded mode**: Falls back to success_criteria + plan.json when no spec package exists
|
|
25
|
+
</purpose>
|
|
26
|
+
|
|
27
|
+
<required_reading>
|
|
28
|
+
@~/.maestro/workflows/business-test.md
|
|
29
|
+
</required_reading>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
Phase: $ARGUMENTS (required -- phase number)
|
|
33
|
+
|
|
34
|
+
**Flags:**
|
|
35
|
+
- `--spec SPEC-xxx` -- Explicit spec reference (default: auto-detect from index.json.spec_ref)
|
|
36
|
+
- `--layer L1|L2|L3` -- Run only specific layer (default: progressive L1->L2->L3)
|
|
37
|
+
- `--gen-code` -- Generate framework-specific test classes (JUnit/RestAssured, supertest/vitest, pytest/httpx)
|
|
38
|
+
- `--dry-run` -- Extract scenarios and fixtures only, don't execute
|
|
39
|
+
- `--re-run` -- Re-run only previously failed/blocked scenarios
|
|
40
|
+
- `--auto` -- Skip interactive confirmations
|
|
41
|
+
|
|
42
|
+
**Layer definitions:**
|
|
43
|
+
|
|
44
|
+
| Layer | Name | Tests | Source |
|
|
45
|
+
|-------|------|-------|--------|
|
|
46
|
+
| L1 | Interface Contract | Single endpoint request/response, input validation, schema compliance | Architecture API endpoints + REQ AC |
|
|
47
|
+
| L2 | Business Rule | Multi-step logic, state transitions, business constraints, edge cases | REQ acceptance criteria + NFR |
|
|
48
|
+
| L3 | Business Scenario | Full user flows, multi-service chains, error propagation | Epic user stories |
|
|
49
|
+
|
|
50
|
+
**Priority mapping (RFC 2119):**
|
|
51
|
+
|
|
52
|
+
| Keyword | Priority | Failure = |
|
|
53
|
+
|---------|----------|-----------|
|
|
54
|
+
| MUST / SHALL | critical | blocker |
|
|
55
|
+
| SHOULD / RECOMMENDED | high | major |
|
|
56
|
+
| MAY / OPTIONAL | medium | minor |
|
|
57
|
+
|
|
58
|
+
Context files:
|
|
59
|
+
- `.workflow/.spec/SPEC-xxx/requirements/REQ-*.md` -- Functional requirements + acceptance criteria
|
|
60
|
+
- `.workflow/.spec/SPEC-xxx/requirements/NFR-*.md` -- Non-functional requirements
|
|
61
|
+
- `.workflow/.spec/SPEC-xxx/architecture/_index.md` -- API endpoints, data model, state machines
|
|
62
|
+
- `.workflow/.spec/SPEC-xxx/epics/EPIC-*.md` -- User stories for E2E scenarios
|
|
63
|
+
- `.workflow/phases/{NN}-{slug}/index.json` -- Phase metadata, success_criteria
|
|
64
|
+
- `.workflow/phases/{NN}-{slug}/plan.json` -- Task overview (degraded mode)
|
|
65
|
+
- `.workflow/phases/{NN}-{slug}/verification.json` -- Cross-reference for must_haves
|
|
66
|
+
- `.workflow/phases/{NN}-{slug}/.tests/business/` -- Previous business test artifacts
|
|
67
|
+
</context>
|
|
68
|
+
|
|
69
|
+
<execution>
|
|
70
|
+
Follow '~/.maestro/workflows/business-test.md' completely.
|
|
71
|
+
|
|
72
|
+
**Next-step routing on completion:**
|
|
73
|
+
- All requirements verified → Skill({ skill: "maestro-phase-transition", args: "{phase}" })
|
|
74
|
+
- Failures found → Skill({ skill: "quality-debug", args: "--from-business-test {phase}" })
|
|
75
|
+
- Re-run all pass → Skill({ skill: "maestro-verify", args: "{phase}" })
|
|
76
|
+
- Low coverage → Skill({ skill: "quality-test-gen", args: "{phase}" })
|
|
77
|
+
- Need integration tests → Skill({ skill: "quality-integration-test", args: "{phase}" })
|
|
78
|
+
</execution>
|
|
79
|
+
|
|
80
|
+
<error_codes>
|
|
81
|
+
| Code | Severity | Condition | Recovery |
|
|
82
|
+
|------|----------|-----------|----------|
|
|
83
|
+
| E001 | error | Phase number required | Prompt user for phase number |
|
|
84
|
+
| E002 | error | Phase directory not found | Verify phase exists in .workflow/phases/ |
|
|
85
|
+
| E003 | error | No spec package AND no success_criteria (can't extract scenarios) | Run maestro-spec-generate or maestro-plan first |
|
|
86
|
+
| E004 | error | L1 critical failures block L2/L3 progression | Fix blockers first via quality-debug |
|
|
87
|
+
| W001 | warning | Degraded mode (no spec package, using success_criteria) | Consider running maestro-spec-generate for full coverage |
|
|
88
|
+
| W002 | warning | Some requirements have no testable acceptance criteria | Note in report, suggest spec refinement |
|
|
89
|
+
| W003 | warning | Generator-Critic loop exhausted (3 iterations) without full convergence | Accept current state, proceed with known defects |
|
|
90
|
+
| W004 | warning | Mock services not available for L3 scenarios | Skip L3 or run with --gen-code for TestContainers |
|
|
91
|
+
</error_codes>
|
|
92
|
+
|
|
93
|
+
<success_criteria>
|
|
94
|
+
- [ ] Phase resolved and spec package loaded (or degraded mode activated)
|
|
95
|
+
- [ ] Business test scenarios extracted from REQ acceptance criteria
|
|
96
|
+
- [ ] RFC 2119 keywords mapped to test priorities
|
|
97
|
+
- [ ] Test fixtures generated (valid/invalid/boundary per REQ data model)
|
|
98
|
+
- [ ] business-test-plan.json written with layer distribution
|
|
99
|
+
- [ ] User confirmed plan (or --auto skipped confirmation)
|
|
100
|
+
- [ ] Test code generated if --gen-code (framework-appropriate)
|
|
101
|
+
- [ ] L1 executed with Generator-Critic loop (max 3 iterations)
|
|
102
|
+
- [ ] L2 executed if no L1 critical failures
|
|
103
|
+
- [ ] L3 executed if no L2 critical failures
|
|
104
|
+
- [ ] Traceability matrix built (every result -> REQ-NNN:AC-N)
|
|
105
|
+
- [ ] business-test-report.json written with requirement_coverage
|
|
106
|
+
- [ ] business-test-summary.md written (human-readable)
|
|
107
|
+
- [ ] index.json updated with business_test section
|
|
108
|
+
- [ ] Issues auto-created for failures (ISS-* in issues.jsonl with req_ref)
|
|
109
|
+
- [ ] Next step routed based on results
|
|
110
|
+
</success_criteria>
|
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-init
|
|
3
|
-
description: Initialize project with auto state detection — creates .workflow/ directory, project.md, state.json, config.json, and specs/
|
|
4
|
-
argument-hint: "[--auto] [--from-brainstorm SESSION-ID]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Auto Mode
|
|
9
|
-
|
|
10
|
-
When `--auto`: After config questions, run research without further interaction. Expects idea document via @ reference.
|
|
11
|
-
|
|
12
|
-
# Maestro Init (Single Agent)
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
$maestro-init ""
|
|
18
|
-
$maestro-init "--auto"
|
|
19
|
-
$maestro-init "--from-brainstorm brainstorm-auth-20260318"
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Flags**:
|
|
23
|
-
- `--auto`: Skip interactive questioning; extract from provided document
|
|
24
|
-
- `--from-brainstorm SESSION-ID`: Import vision/goals/constraints from brainstorm guidance-specification.md
|
|
25
|
-
|
|
26
|
-
**Output**: `.workflow/` directory with project.md, state.json, config.json, specs/
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Overview
|
|
31
|
-
|
|
32
|
-
Sequential project setup skill. Detects project state (empty/code/existing), gathers project information through deep questioning or document extraction, then creates the `.workflow/` directory structure. No parallel agents — single sequential flow.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Implementation
|
|
37
|
-
|
|
38
|
-
### Step 1: Parse Arguments
|
|
39
|
-
|
|
40
|
-
Extract flags from arguments:
|
|
41
|
-
- `--auto` flag presence
|
|
42
|
-
- `--from-brainstorm SESSION-ID` value
|
|
43
|
-
- Remaining text as project description
|
|
44
|
-
|
|
45
|
-
### Step 2: Detect Project State
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Check existing state
|
|
49
|
-
ls .workflow/state.json 2>/dev/null
|
|
50
|
-
ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Classify as:
|
|
54
|
-
- **existing**: `.workflow/state.json` found — warn and exit (E002)
|
|
55
|
-
- **code**: Source files present but no `.workflow/` — onboarding existing codebase
|
|
56
|
-
- **empty**: Greenfield project
|
|
57
|
-
|
|
58
|
-
### Step 3: Gather Project Information
|
|
59
|
-
|
|
60
|
-
**If `--from-brainstorm`**:
|
|
61
|
-
- Read `.workflow/.brainstorm/{SESSION-ID}/guidance-specification.md`
|
|
62
|
-
- Extract: vision, goals, constraints, terminology, tech decisions
|
|
63
|
-
- Skip interactive questioning
|
|
64
|
-
|
|
65
|
-
**If `--auto`**:
|
|
66
|
-
- Extract project info from provided document/@ reference
|
|
67
|
-
- Minimal interactive questions (confirm core value only)
|
|
68
|
-
|
|
69
|
-
**Otherwise (interactive)**:
|
|
70
|
-
- Deep questioning flow:
|
|
71
|
-
1. What is the core value proposition?
|
|
72
|
-
2. Who are the target users?
|
|
73
|
-
3. What are the key requirements? (follow threads, don't rush)
|
|
74
|
-
4. What are known constraints/limitations?
|
|
75
|
-
5. What tech stack preferences exist?
|
|
76
|
-
- Follow each thread with clarifying questions until satisfied
|
|
77
|
-
|
|
78
|
-
### Step 4: Read Templates
|
|
79
|
-
|
|
80
|
-
Read the following templates:
|
|
81
|
-
- `~/.maestro/templates/project.md`
|
|
82
|
-
- `~/.maestro/templates/state.json`
|
|
83
|
-
- `~/.maestro/templates/config.json`
|
|
84
|
-
|
|
85
|
-
### Step 5: Create .workflow/ Structure
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
mkdir -p .workflow/specs .workflow/phases .workflow/scratch .workflow/codebase
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Step 6: Write project.md
|
|
92
|
-
|
|
93
|
-
Populate template with gathered information:
|
|
94
|
-
- Project name, core value proposition
|
|
95
|
-
- Requirements: Validated / Active / Out of Scope
|
|
96
|
-
- Key decisions and constraints
|
|
97
|
-
- Tech stack (detected or specified)
|
|
98
|
-
|
|
99
|
-
Write to `.workflow/project.md`.
|
|
100
|
-
|
|
101
|
-
### Step 7: Write state.json
|
|
102
|
-
|
|
103
|
-
Initialize state from template:
|
|
104
|
-
- `current_phase`: null
|
|
105
|
-
- `current_milestone`: null
|
|
106
|
-
- `status`: "initialized"
|
|
107
|
-
|
|
108
|
-
Write to `.workflow/state.json`.
|
|
109
|
-
|
|
110
|
-
### Step 8: Write config.json
|
|
111
|
-
|
|
112
|
-
Configuration questions (or defaults for --auto):
|
|
113
|
-
- Granularity: fine / medium / coarse
|
|
114
|
-
- Workflow agents: enable/disable optional agents
|
|
115
|
-
- Gate preferences: verification strictness
|
|
116
|
-
|
|
117
|
-
Write to `.workflow/config.json`.
|
|
118
|
-
|
|
119
|
-
### Step 9: Initialize specs/
|
|
120
|
-
|
|
121
|
-
Create convention files in `.workflow/specs/`:
|
|
122
|
-
- `conventions.md` — detected or specified coding conventions
|
|
123
|
-
- `learnings.md` — empty, populated during phase transitions
|
|
124
|
-
|
|
125
|
-
### Step 10: Completion Report
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
=== WORKFLOW INITIALIZED ===
|
|
129
|
-
Project: {project_name}
|
|
130
|
-
State: .workflow/state.json (active)
|
|
131
|
-
|
|
132
|
-
Created:
|
|
133
|
-
.workflow/project.md
|
|
134
|
-
.workflow/state.json
|
|
135
|
-
.workflow/config.json
|
|
136
|
-
.workflow/specs/
|
|
137
|
-
|
|
138
|
-
Next steps (choose one path to create roadmap):
|
|
139
|
-
$maestro-spec-generate "<idea>" -- Full spec package + roadmap (heavy)
|
|
140
|
-
$maestro-roadmap "<requirement>" -- Direct interactive roadmap (light)
|
|
141
|
-
|
|
142
|
-
Other commands:
|
|
143
|
-
$
|
|
144
|
-
$maestro-brainstorm "<topic>" -- Explore ideas first
|
|
145
|
-
$maestro-quick "<task>" -- Quick ad-hoc task
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Error Handling
|
|
151
|
-
|
|
152
|
-
| Code | Severity | Description | Recovery |
|
|
153
|
-
|------|----------|-------------|----------|
|
|
154
|
-
| E001 | error | No arguments when --auto requires document | Ask user for document reference |
|
|
155
|
-
| E002 | error | .workflow/ already exists | Show status, suggest manage-status |
|
|
156
|
-
| E003 | error | Brainstorm session not found | List available sessions |
|
|
157
|
-
| W001 | warning | Could not detect tech stack | Continue with manual input |
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Core Rules
|
|
162
|
-
|
|
163
|
-
1. **Never create roadmap** — init only creates .workflow/ structure; roadmap is a separate step
|
|
164
|
-
2. **Deep questioning over speed** — follow threads, ask clarifying questions (unless --auto)
|
|
165
|
-
3. **Detect, don't assume** — scan for existing files, package managers, frameworks before asking
|
|
166
|
-
4. **Templates are source of truth** — always read templates before writing files
|
|
167
|
-
5. **Idempotent check** — if .workflow/ exists, refuse to overwrite (E002)
|
|
1
|
+
---
|
|
2
|
+
name: maestro-init
|
|
3
|
+
description: Initialize project with auto state detection — creates .workflow/ directory, project.md, state.json, config.json, and specs/
|
|
4
|
+
argument-hint: "[--auto] [--from-brainstorm SESSION-ID]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Auto Mode
|
|
9
|
+
|
|
10
|
+
When `--auto`: After config questions, run research without further interaction. Expects idea document via @ reference.
|
|
11
|
+
|
|
12
|
+
# Maestro Init (Single Agent)
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$maestro-init ""
|
|
18
|
+
$maestro-init "--auto"
|
|
19
|
+
$maestro-init "--from-brainstorm brainstorm-auth-20260318"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Flags**:
|
|
23
|
+
- `--auto`: Skip interactive questioning; extract from provided document
|
|
24
|
+
- `--from-brainstorm SESSION-ID`: Import vision/goals/constraints from brainstorm guidance-specification.md
|
|
25
|
+
|
|
26
|
+
**Output**: `.workflow/` directory with project.md, state.json, config.json, specs/
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
Sequential project setup skill. Detects project state (empty/code/existing), gathers project information through deep questioning or document extraction, then creates the `.workflow/` directory structure. No parallel agents — single sequential flow.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Implementation
|
|
37
|
+
|
|
38
|
+
### Step 1: Parse Arguments
|
|
39
|
+
|
|
40
|
+
Extract flags from arguments:
|
|
41
|
+
- `--auto` flag presence
|
|
42
|
+
- `--from-brainstorm SESSION-ID` value
|
|
43
|
+
- Remaining text as project description
|
|
44
|
+
|
|
45
|
+
### Step 2: Detect Project State
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Check existing state
|
|
49
|
+
ls .workflow/state.json 2>/dev/null
|
|
50
|
+
ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Classify as:
|
|
54
|
+
- **existing**: `.workflow/state.json` found — warn and exit (E002)
|
|
55
|
+
- **code**: Source files present but no `.workflow/` — onboarding existing codebase
|
|
56
|
+
- **empty**: Greenfield project
|
|
57
|
+
|
|
58
|
+
### Step 3: Gather Project Information
|
|
59
|
+
|
|
60
|
+
**If `--from-brainstorm`**:
|
|
61
|
+
- Read `.workflow/.brainstorm/{SESSION-ID}/guidance-specification.md`
|
|
62
|
+
- Extract: vision, goals, constraints, terminology, tech decisions
|
|
63
|
+
- Skip interactive questioning
|
|
64
|
+
|
|
65
|
+
**If `--auto`**:
|
|
66
|
+
- Extract project info from provided document/@ reference
|
|
67
|
+
- Minimal interactive questions (confirm core value only)
|
|
68
|
+
|
|
69
|
+
**Otherwise (interactive)**:
|
|
70
|
+
- Deep questioning flow:
|
|
71
|
+
1. What is the core value proposition?
|
|
72
|
+
2. Who are the target users?
|
|
73
|
+
3. What are the key requirements? (follow threads, don't rush)
|
|
74
|
+
4. What are known constraints/limitations?
|
|
75
|
+
5. What tech stack preferences exist?
|
|
76
|
+
- Follow each thread with clarifying questions until satisfied
|
|
77
|
+
|
|
78
|
+
### Step 4: Read Templates
|
|
79
|
+
|
|
80
|
+
Read the following templates:
|
|
81
|
+
- `~/.maestro/templates/project.md`
|
|
82
|
+
- `~/.maestro/templates/state.json`
|
|
83
|
+
- `~/.maestro/templates/config.json`
|
|
84
|
+
|
|
85
|
+
### Step 5: Create .workflow/ Structure
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
mkdir -p .workflow/specs .workflow/phases .workflow/scratch .workflow/codebase
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 6: Write project.md
|
|
92
|
+
|
|
93
|
+
Populate template with gathered information:
|
|
94
|
+
- Project name, core value proposition
|
|
95
|
+
- Requirements: Validated / Active / Out of Scope
|
|
96
|
+
- Key decisions and constraints
|
|
97
|
+
- Tech stack (detected or specified)
|
|
98
|
+
|
|
99
|
+
Write to `.workflow/project.md`.
|
|
100
|
+
|
|
101
|
+
### Step 7: Write state.json
|
|
102
|
+
|
|
103
|
+
Initialize state from template:
|
|
104
|
+
- `current_phase`: null
|
|
105
|
+
- `current_milestone`: null
|
|
106
|
+
- `status`: "initialized"
|
|
107
|
+
|
|
108
|
+
Write to `.workflow/state.json`.
|
|
109
|
+
|
|
110
|
+
### Step 8: Write config.json
|
|
111
|
+
|
|
112
|
+
Configuration questions (or defaults for --auto):
|
|
113
|
+
- Granularity: fine / medium / coarse
|
|
114
|
+
- Workflow agents: enable/disable optional agents
|
|
115
|
+
- Gate preferences: verification strictness
|
|
116
|
+
|
|
117
|
+
Write to `.workflow/config.json`.
|
|
118
|
+
|
|
119
|
+
### Step 9: Initialize specs/
|
|
120
|
+
|
|
121
|
+
Create convention files in `.workflow/specs/`:
|
|
122
|
+
- `conventions.md` — detected or specified coding conventions
|
|
123
|
+
- `learnings.md` — empty, populated during phase transitions
|
|
124
|
+
|
|
125
|
+
### Step 10: Completion Report
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
=== WORKFLOW INITIALIZED ===
|
|
129
|
+
Project: {project_name}
|
|
130
|
+
State: .workflow/state.json (active)
|
|
131
|
+
|
|
132
|
+
Created:
|
|
133
|
+
.workflow/project.md
|
|
134
|
+
.workflow/state.json
|
|
135
|
+
.workflow/config.json
|
|
136
|
+
.workflow/specs/
|
|
137
|
+
|
|
138
|
+
Next steps (choose one path to create roadmap):
|
|
139
|
+
$maestro-spec-generate "<idea>" -- Full spec package + roadmap (heavy)
|
|
140
|
+
$maestro-roadmap "<requirement>" -- Direct interactive roadmap (light)
|
|
141
|
+
|
|
142
|
+
Other commands:
|
|
143
|
+
$manage-status -- View project dashboard
|
|
144
|
+
$maestro-brainstorm "<topic>" -- Explore ideas first
|
|
145
|
+
$maestro-quick "<task>" -- Quick ad-hoc task
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Error Handling
|
|
151
|
+
|
|
152
|
+
| Code | Severity | Description | Recovery |
|
|
153
|
+
|------|----------|-------------|----------|
|
|
154
|
+
| E001 | error | No arguments when --auto requires document | Ask user for document reference |
|
|
155
|
+
| E002 | error | .workflow/ already exists | Show status, suggest manage-status |
|
|
156
|
+
| E003 | error | Brainstorm session not found | List available sessions |
|
|
157
|
+
| W001 | warning | Could not detect tech stack | Continue with manual input |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Core Rules
|
|
162
|
+
|
|
163
|
+
1. **Never create roadmap** — init only creates .workflow/ structure; roadmap is a separate step
|
|
164
|
+
2. **Deep questioning over speed** — follow threads, ask clarifying questions (unless --auto)
|
|
165
|
+
3. **Detect, don't assume** — scan for existing files, package managers, frameworks before asking
|
|
166
|
+
4. **Templates are source of truth** — always read templates before writing files
|
|
167
|
+
5. **Idempotent check** — if .workflow/ exists, refuse to overwrite (E002)
|