@torka/claude-workflows 0.1.0 → 0.3.0
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/README.md +34 -105
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/completion-summary-implement-epic-with-subagents.md +103 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01-init.md +228 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01b-continue.md +298 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01c-new.md +434 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-02-orchestrate.md +437 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-03-complete.md +473 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/templates/epic-completion-report.md +62 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/validation/checklist.md +121 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow-plan-implement-epic-with-subagents.md +758 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow.md +101 -0
- package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow.yaml +87 -0
- package/examples/settings.local.example.json +0 -39
- package/install.js +15 -12
- package/package.json +3 -12
- package/skills/designer-founder/steps/step-01-context.md +171 -0
- package/skills/designer-founder/steps/step-01b-continue.md +75 -0
- package/skills/designer-founder/steps/step-02-scope.md +198 -0
- package/skills/designer-founder/steps/step-03-design.md +168 -0
- package/skills/designer-founder/steps/step-04-artifacts.md +292 -0
- package/skills/designer-founder/templates/component-strategy.md +35 -0
- package/skills/designer-founder/templates/design-brief.md +26 -0
- package/skills/designer-founder/templates/layouts.md +41 -0
- package/skills/designer-founder/templates/user-journeys.md +32 -0
- package/skills/designer-founder/tools/conversion.md +275 -0
- package/skills/designer-founder/tools/direct-mapping.md +222 -0
- package/skills/designer-founder/tools/magicpatterns.md +193 -0
- package/skills/designer-founder/tools/superdesign-assets/generate-theme.ts +193 -0
- package/skills/designer-founder/tools/superdesign-assets/superdesign-agent-instructions.md +375 -0
- package/skills/designer-founder/tools/superdesign.md +167 -0
- package/skills/designer-founder/tools/wireframe.md +181 -0
- package/skills/designer-founder/workflow.md +85 -0
- package/uninstall.js +97 -8
- package/hooks/auto_approve_safe.py +0 -261
- package/hooks/auto_approve_safe.rules.json +0 -134
- package/scripts/context-monitor.py +0 -175
package/README.md
CHANGED
|
@@ -9,8 +9,7 @@ Claude Code workflow helpers for epic automation, git management, and developer
|
|
|
9
9
|
| **Git Cleanup & Merge** | Intelligent branch management, PR creation, CI monitoring | Yes |
|
|
10
10
|
| **Parallelization Analysis** | Identify which epics can run in parallel with Git worktrees | Yes |
|
|
11
11
|
| **Agent Creator** | Design and deploy custom Claude Code agents | Yes |
|
|
12
|
-
| **
|
|
13
|
-
| **Context Monitor** | Real-time context usage status line | Yes |
|
|
12
|
+
| **Designer-Founder** | Transform ideas into dev-ready frontend artifacts | Yes |
|
|
14
13
|
| **Epic Orchestration** | Automate multi-story epic execution with sub-agents | Requires BMAD |
|
|
15
14
|
| **Code Review Agent** | Principal-level code review automation | Requires BMM |
|
|
16
15
|
| **Story Prep Agent** | Convert requirements to developer-ready specs | Requires BMM |
|
|
@@ -35,45 +34,14 @@ The installer automatically copies files to your `.claude/` directory:
|
|
|
35
34
|
|
|
36
35
|
## Post-Installation Setup
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Copy the hooks configuration from `examples/settings.local.example.json` to your `.claude/settings.local.json`.
|
|
41
|
-
|
|
42
|
-
**Auto-approve hook** (auto-approves safe commands):
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"hooks": {
|
|
47
|
-
"PreToolUse": [
|
|
48
|
-
{
|
|
49
|
-
"matcher": "Bash|Read|Grep|Glob|Write|Edit|MultiEdit",
|
|
50
|
-
"hooks": [
|
|
51
|
-
{
|
|
52
|
-
"type": "command",
|
|
53
|
-
"command": "python3 .claude/scripts/auto_approve_safe.py"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 2. Configure Status Line (optional)
|
|
37
|
+
After installation, try running one of the commands to test:
|
|
63
38
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"statusLine": {
|
|
69
|
-
"type": "command",
|
|
70
|
-
"command": "python3 .claude/scripts/context-monitor.py"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
39
|
+
```bash
|
|
40
|
+
/git-cleanup-and-merge
|
|
41
|
+
/plan-parallelization
|
|
42
|
+
/designer-founder
|
|
73
43
|
```
|
|
74
44
|
|
|
75
|
-
This shows a real-time context usage bar with percentage and warnings.
|
|
76
|
-
|
|
77
45
|
## Usage
|
|
78
46
|
|
|
79
47
|
### Commands
|
|
@@ -150,44 +118,22 @@ Design and deploy custom Claude Code agents:
|
|
|
150
118
|
/agent-creator
|
|
151
119
|
```
|
|
152
120
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
#### `auto_approve_safe.py`
|
|
156
|
-
|
|
157
|
-
PreToolUse hook that auto-approves safe commands:
|
|
158
|
-
- **Allowed**: Read-only commands, tests, linting, git status/diff/log
|
|
159
|
-
- **Denied**: Dangerous commands (sudo, rm -rf, etc.)
|
|
160
|
-
- **Prompted**: Everything else defers to normal permissions
|
|
161
|
-
|
|
162
|
-
Customize rules in `.claude/scripts/auto_approve_safe.rules.json`:
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
{
|
|
166
|
-
"allow_patterns": [
|
|
167
|
-
"^npm test",
|
|
168
|
-
"^git status"
|
|
169
|
-
],
|
|
170
|
-
"deny_patterns": [
|
|
171
|
-
"^sudo",
|
|
172
|
-
"rm.*-rf"
|
|
173
|
-
],
|
|
174
|
-
"sensitive_paths": [
|
|
175
|
-
"\\.env$",
|
|
176
|
-
"credentials"
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
```
|
|
121
|
+
#### `/designer-founder`
|
|
180
122
|
|
|
181
|
-
|
|
123
|
+
Transform design ideas into production-ready frontend artifacts:
|
|
124
|
+
- UI/UX design workflow optimized for solo developers
|
|
125
|
+
- Component-first approach using shadcn/ui + Tailwind CSS
|
|
126
|
+
- Multiple design tools: wireframes, MagicPatterns, SuperDesign
|
|
127
|
+
- Dev-ready output: component strategies, layouts, user journeys
|
|
182
128
|
|
|
183
|
-
|
|
129
|
+
**Philosophy:**
|
|
130
|
+
- Library-first: Start from "what existing component can I use?"
|
|
131
|
+
- Decision-focused: Capture choices, not specifications
|
|
132
|
+
- Speed over perfection: Working prototype beats perfect mockup
|
|
184
133
|
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
- Git branch
|
|
189
|
-
- Context usage bar with percentage
|
|
190
|
-
- Warnings at 75%, 90%, 95% usage
|
|
134
|
+
```
|
|
135
|
+
/designer-founder
|
|
136
|
+
```
|
|
191
137
|
|
|
192
138
|
## Dependencies
|
|
193
139
|
|
|
@@ -203,8 +149,7 @@ Some components require the [BMAD Method](https://github.com/bmad-method) workfl
|
|
|
203
149
|
- `/git-cleanup-and-merge`
|
|
204
150
|
- `/plan-parallelization`
|
|
205
151
|
- `/agent-creator` skill
|
|
206
|
-
- `
|
|
207
|
-
- `context-monitor` status line
|
|
152
|
+
- `/designer-founder` skill
|
|
208
153
|
|
|
209
154
|
## File Structure
|
|
210
155
|
|
|
@@ -219,17 +164,18 @@ After installation, files are placed in:
|
|
|
219
164
|
├── agents/
|
|
220
165
|
│ ├── principal-code-reviewer.md
|
|
221
166
|
│ └── story-prep-master.md
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
│
|
|
225
|
-
│
|
|
226
|
-
│
|
|
227
|
-
│
|
|
228
|
-
│
|
|
229
|
-
└──
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
167
|
+
└── skills/
|
|
168
|
+
├── agent-creator/
|
|
169
|
+
│ ├── SKILL.md
|
|
170
|
+
│ ├── REGISTRY.yaml
|
|
171
|
+
│ ├── STORY-AGENT-TEMPLATE.md
|
|
172
|
+
│ ├── NON-STORY-AGENT-TEMPLATE.md
|
|
173
|
+
│ └── COMMUNITY-REPOS.md
|
|
174
|
+
└── designer-founder/
|
|
175
|
+
├── workflow.md
|
|
176
|
+
├── steps/
|
|
177
|
+
├── templates/
|
|
178
|
+
└── tools/
|
|
233
179
|
```
|
|
234
180
|
|
|
235
181
|
## Uninstallation
|
|
@@ -248,27 +194,11 @@ rm -rf .claude/commands/implement-epic-with-subagents.md \
|
|
|
248
194
|
.claude/agents/principal-code-reviewer.md \
|
|
249
195
|
.claude/agents/story-prep-master.md \
|
|
250
196
|
.claude/skills/agent-creator \
|
|
251
|
-
.claude/
|
|
252
|
-
.claude/scripts/auto_approve_safe.rules.json \
|
|
253
|
-
.claude/scripts/context-monitor.py
|
|
197
|
+
.claude/skills/designer-founder
|
|
254
198
|
```
|
|
255
199
|
|
|
256
|
-
**Note**: Your `settings.local.json` is not modified—you may want to manually remove hook/statusLine configurations.
|
|
257
|
-
|
|
258
200
|
## Customization
|
|
259
201
|
|
|
260
|
-
### Extending Auto-Approve Rules
|
|
261
|
-
|
|
262
|
-
Edit `.claude/scripts/auto_approve_safe.rules.json`:
|
|
263
|
-
|
|
264
|
-
```json
|
|
265
|
-
{
|
|
266
|
-
"allow_patterns": [
|
|
267
|
-
"^your-custom-command"
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
```
|
|
271
|
-
|
|
272
202
|
### Creating Custom Agents
|
|
273
203
|
|
|
274
204
|
Use the `/agent-creator` skill to create project-specific agents:
|
|
@@ -294,6 +224,5 @@ Varun Torka
|
|
|
294
224
|
|
|
295
225
|
## Links
|
|
296
226
|
|
|
297
|
-
- [GitHub Repository](https://github.com/varuntorka/vt-claude-workflows)
|
|
298
|
-
- [Issue Tracker](https://github.com/varuntorka/vt-claude-workflows/issues)
|
|
299
227
|
- [Claude Code Documentation](https://code.claude.com/docs)
|
|
228
|
+
- [npm Package](https://www.npmjs.com/package/@torka/claude-workflows)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
workflowName: implement-epic-with-subagents
|
|
3
|
+
creationDate: 2026-01-04
|
|
4
|
+
module: bmm
|
|
5
|
+
phase: 4-implementation
|
|
6
|
+
status: COMPLETE
|
|
7
|
+
stepsCompleted: [1, 2, 3, 4, 5, 6, 7, 8, 9]
|
|
8
|
+
reviewPassed: true
|
|
9
|
+
reviewDate: 2026-01-04
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Workflow Creation Summary
|
|
13
|
+
|
|
14
|
+
## Workflow Information
|
|
15
|
+
|
|
16
|
+
- **Name:** implement-epic-with-subagents
|
|
17
|
+
- **Module:** bmm (BMAD Method Module)
|
|
18
|
+
- **Phase:** 4-implementation
|
|
19
|
+
- **Created:** 2026-01-04
|
|
20
|
+
- **Location:** `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/`
|
|
21
|
+
- **Target Installation:** `_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents/`
|
|
22
|
+
|
|
23
|
+
## Purpose
|
|
24
|
+
|
|
25
|
+
Automate entire epic execution by orchestrating sub-agents to execute all stories sequentially, with minimal human intervention.
|
|
26
|
+
|
|
27
|
+
## Generated Files
|
|
28
|
+
|
|
29
|
+
### Workflow Configuration
|
|
30
|
+
- `workflow.yaml` - Main workflow configuration
|
|
31
|
+
|
|
32
|
+
### Step Files
|
|
33
|
+
- `steps/step-01-init.md` - Epic initialization and prerequisite validation
|
|
34
|
+
- `steps/step-01b-continue.md` - Session resumption and state recovery
|
|
35
|
+
- `steps/step-02-orchestrate.md` - Main orchestration loop (story execution)
|
|
36
|
+
- `steps/step-03-complete.md` - Completion and report generation
|
|
37
|
+
|
|
38
|
+
### Templates
|
|
39
|
+
- `templates/epic-completion-report.md` - Epic completion report template
|
|
40
|
+
|
|
41
|
+
### Validation
|
|
42
|
+
- `validation/checklist.md` - Pre-execution validation checklist
|
|
43
|
+
|
|
44
|
+
## Quick Start Guide
|
|
45
|
+
|
|
46
|
+
### 1. Install the Workflow
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cp -r _bmad-output/bmb-creations/workflows/implement-epic-with-subagents _bmad/bmm/workflows/4-implementation/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Create Required Agents
|
|
53
|
+
|
|
54
|
+
Before running, ensure these agents exist:
|
|
55
|
+
- `.claude/agents/story-prep-master.md`
|
|
56
|
+
- `.claude/agents/quality-gate-verifier.md`
|
|
57
|
+
- `.claude/agents/principal-code-reviewer.md`
|
|
58
|
+
|
|
59
|
+
### 3. Optional: Create Specialist Dev Agents
|
|
60
|
+
|
|
61
|
+
Populate `.claude/agents/vt-bmad-dev-agents/` with specialist agents for automatic agent selection based on story requirements.
|
|
62
|
+
|
|
63
|
+
### 4. Run the Workflow
|
|
64
|
+
|
|
65
|
+
The workflow will:
|
|
66
|
+
1. Load and parse the epic file
|
|
67
|
+
2. For each story: create → develop → quality gate → code review → git commit
|
|
68
|
+
3. Update sprint-status.yaml throughout
|
|
69
|
+
4. Generate completion report
|
|
70
|
+
|
|
71
|
+
## Key Features
|
|
72
|
+
|
|
73
|
+
- **Autonomous Execution:** Runs with minimal human intervention
|
|
74
|
+
- **Smart Agent Selection:** Automatically picks specialist dev agents based on story content
|
|
75
|
+
- **Quality Gate:** Independent verification via quality-gate-verifier agent
|
|
76
|
+
- **Resume Capability:** Sidecar file enables session recovery
|
|
77
|
+
- **Auto-Commit:** Git commits after each story completion
|
|
78
|
+
|
|
79
|
+
## Failure Handling
|
|
80
|
+
|
|
81
|
+
| Failure Type | Action |
|
|
82
|
+
|--------------|--------|
|
|
83
|
+
| Simple (lint, types) | Auto-retry up to 3 attempts |
|
|
84
|
+
| Moderate (test failures) | Agent attempts fix, escalate after 2 failures |
|
|
85
|
+
| Complex (architectural) | Stop immediately, escalate with context |
|
|
86
|
+
|
|
87
|
+
## Next Steps
|
|
88
|
+
|
|
89
|
+
1. **Install to bmm module** - Copy to final location
|
|
90
|
+
2. **Create quality-gate-verifier agent** - Required for quality gate phase
|
|
91
|
+
3. **Optionally create specialist agents** - For automatic agent matching
|
|
92
|
+
4. **Test with small epic** - Validate workflow before full use
|
|
93
|
+
5. **Configure Context-7 MCP** - Required for documentation access
|
|
94
|
+
|
|
95
|
+
## Dependencies
|
|
96
|
+
|
|
97
|
+
| Dependency | Status | Notes |
|
|
98
|
+
|------------|--------|-------|
|
|
99
|
+
| Context-7 MCP | Required | Must be configured |
|
|
100
|
+
| Playwright MCP | Optional | Use if available |
|
|
101
|
+
| story-prep-master | Required | Create if not exists |
|
|
102
|
+
| quality-gate-verifier | Required | Create if not exists |
|
|
103
|
+
| principal-code-reviewer | Required | Create if not exists |
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-01-init'
|
|
3
|
+
description: 'Entry router - detect context and route to appropriate initialization path'
|
|
4
|
+
|
|
5
|
+
# Path Definitions
|
|
6
|
+
workflow_path: '{project-root}/_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents'
|
|
7
|
+
|
|
8
|
+
# File References
|
|
9
|
+
thisStepFile: '{workflow_path}/steps/step-01-init.md'
|
|
10
|
+
continueFile: '{workflow_path}/steps/step-01b-continue.md'
|
|
11
|
+
newSetupFile: '{workflow_path}/steps/step-01c-new.md'
|
|
12
|
+
workflowFile: '{workflow_path}/workflow.md'
|
|
13
|
+
|
|
14
|
+
# State files
|
|
15
|
+
sidecarFolder: '{output_folder}/epic-executions'
|
|
16
|
+
sprintStatus: '{implementation_artifacts}/sprint-status.yaml'
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Step 1: Entry Router
|
|
20
|
+
|
|
21
|
+
## STEP GOAL:
|
|
22
|
+
|
|
23
|
+
To detect the execution context (worktree vs main repo), discover any existing epic execution state, and route to the appropriate next step.
|
|
24
|
+
|
|
25
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
26
|
+
|
|
27
|
+
### Universal Rules:
|
|
28
|
+
|
|
29
|
+
- 🛑 NEVER skip detection steps
|
|
30
|
+
- 📖 CRITICAL: Read the complete step file before taking any action
|
|
31
|
+
- 📋 YOU ARE A ROUTER, not an executor
|
|
32
|
+
|
|
33
|
+
### Role Reinforcement:
|
|
34
|
+
|
|
35
|
+
- ✅ You are an Epic Execution Orchestrator
|
|
36
|
+
- ✅ This step ONLY detects context and routes
|
|
37
|
+
- ✅ All initialization logic is in step-01c
|
|
38
|
+
- ✅ All continuation logic is in step-01b
|
|
39
|
+
|
|
40
|
+
### Step-Specific Rules:
|
|
41
|
+
|
|
42
|
+
- 🎯 Focus ONLY on detection and routing
|
|
43
|
+
- 🚫 FORBIDDEN to start epic setup in this step
|
|
44
|
+
- 🚫 FORBIDDEN to start story execution in this step
|
|
45
|
+
- 🚪 ROUTE to appropriate step based on detection results
|
|
46
|
+
|
|
47
|
+
## DETECTION SEQUENCE:
|
|
48
|
+
|
|
49
|
+
### 1. Detect Worktree Context
|
|
50
|
+
|
|
51
|
+
Execute git commands to determine if running in a worktree:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
|
|
55
|
+
GIT_COMMON=$(git rev-parse --git-common-dir 2>/dev/null)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Interpretation:**
|
|
59
|
+
- If `$GIT_DIR` != `$GIT_COMMON` → Running in a WORKTREE
|
|
60
|
+
- If `$GIT_DIR` == `$GIT_COMMON` → Running in MAIN REPO
|
|
61
|
+
|
|
62
|
+
**Store context:**
|
|
63
|
+
```
|
|
64
|
+
is_worktree: true | false
|
|
65
|
+
current_path: $(pwd)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. Discover Sidecar Files
|
|
69
|
+
|
|
70
|
+
Scan for existing epic execution state files:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ls -la {sidecarFolder}/epic-*-state.yaml 2>/dev/null
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**For each sidecar found, extract:**
|
|
77
|
+
- Epic number (from filename pattern)
|
|
78
|
+
- `current_phase` value
|
|
79
|
+
- `worktree_config.worktree_path` (if present)
|
|
80
|
+
- `stories_pending` count
|
|
81
|
+
|
|
82
|
+
**Build sidecar list:**
|
|
83
|
+
```
|
|
84
|
+
sidecars_found:
|
|
85
|
+
- file: "epic-2-state.yaml"
|
|
86
|
+
epic_number: 2
|
|
87
|
+
phase: "executing"
|
|
88
|
+
worktree_path: "/path/to/worktree" | null
|
|
89
|
+
pending_stories: 5
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 3. Route Decision
|
|
93
|
+
|
|
94
|
+
Based on detection results, determine the appropriate path:
|
|
95
|
+
|
|
96
|
+
#### Scenario A: In Worktree with Matching Sidecar
|
|
97
|
+
|
|
98
|
+
**Conditions:**
|
|
99
|
+
- `is_worktree` = true
|
|
100
|
+
- Found sidecar where `worktree_config.worktree_path` == `current_path`
|
|
101
|
+
- Sidecar has `stories_pending` > 0
|
|
102
|
+
|
|
103
|
+
**Action:** Route to `{continueFile}` with matched sidecar
|
|
104
|
+
|
|
105
|
+
**Display:**
|
|
106
|
+
```
|
|
107
|
+
Detected: Running in worktree for Epic {N}
|
|
108
|
+
Found matching execution state with {X} stories pending.
|
|
109
|
+
|
|
110
|
+
Routing to continuation...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
→ Load, read entire file, then execute `{continueFile}`
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
#### Scenario B: In Worktree, Awaiting Session Restart
|
|
118
|
+
|
|
119
|
+
**Conditions:**
|
|
120
|
+
- `is_worktree` = true
|
|
121
|
+
- Found sidecar where `worktree_config.worktree_path` == `current_path`
|
|
122
|
+
- Sidecar has `current_phase` = "awaiting_session_restart"
|
|
123
|
+
|
|
124
|
+
**Action:** Update sidecar phase to "executing", route to orchestration
|
|
125
|
+
|
|
126
|
+
**Display:**
|
|
127
|
+
```
|
|
128
|
+
Detected: Fresh session in worktree for Epic {N}
|
|
129
|
+
Setup was completed in previous session.
|
|
130
|
+
|
|
131
|
+
Ready to begin story execution...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
→ Update sidecar: `current_phase: "executing"`
|
|
135
|
+
→ Load, read entire file, then execute step-02-orchestrate.md
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
#### Scenario C: In Worktree, No Matching Sidecar
|
|
140
|
+
|
|
141
|
+
**Conditions:**
|
|
142
|
+
- `is_worktree` = true
|
|
143
|
+
- No sidecar matches `current_path`
|
|
144
|
+
|
|
145
|
+
**Action:** Error state - worktree exists but no state found
|
|
146
|
+
|
|
147
|
+
**Display:**
|
|
148
|
+
```
|
|
149
|
+
⚠️ Warning: Running in a worktree but no matching execution state found.
|
|
150
|
+
|
|
151
|
+
This worktree may have been created manually or state was lost.
|
|
152
|
+
|
|
153
|
+
Options:
|
|
154
|
+
[N] Start new epic setup (will use this worktree)
|
|
155
|
+
[X] Exit and investigate
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
- IF N: Route to `{newSetupFile}` (skip worktree creation, use current)
|
|
159
|
+
- IF X: EXIT workflow
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
#### Scenario D: In Main Repo with Pending Sidecars
|
|
164
|
+
|
|
165
|
+
**Conditions:**
|
|
166
|
+
- `is_worktree` = false
|
|
167
|
+
- Found sidecars with `stories_pending` > 0
|
|
168
|
+
|
|
169
|
+
**Action:** Show existing executions, ask user intent
|
|
170
|
+
|
|
171
|
+
**Display:**
|
|
172
|
+
```
|
|
173
|
+
Found existing epic execution(s):
|
|
174
|
+
|
|
175
|
+
Epic 2: "Auth Experience" - 5 stories pending
|
|
176
|
+
└─ Worktree: ../vt-saas-template-epic-2-auth/
|
|
177
|
+
Epic 3: "User Onboarding" - 7 stories pending (main repo)
|
|
178
|
+
|
|
179
|
+
Options:
|
|
180
|
+
[1] Continue Epic 2 (requires: cd ../vt-saas-template-epic-2-auth/)
|
|
181
|
+
[2] Continue Epic 3
|
|
182
|
+
[N] Start NEW epic execution
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- IF number selected for worktree epic: Display cd command and exit
|
|
186
|
+
- IF number selected for main repo epic: Route to `{continueFile}`
|
|
187
|
+
- IF N: Route to `{newSetupFile}`
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
#### Scenario E: In Main Repo, No Active Sidecars
|
|
192
|
+
|
|
193
|
+
**Conditions:**
|
|
194
|
+
- `is_worktree` = false
|
|
195
|
+
- No sidecars found OR all sidecars have `current_phase` = "complete"
|
|
196
|
+
|
|
197
|
+
**Action:** Fresh start - route to new epic setup
|
|
198
|
+
|
|
199
|
+
**Display:**
|
|
200
|
+
```
|
|
201
|
+
Welcome to the Epic Execution Orchestrator!
|
|
202
|
+
|
|
203
|
+
No active epic executions found.
|
|
204
|
+
Starting new epic setup...
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
→ Load, read entire file, then execute `{newSetupFile}`
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
212
|
+
|
|
213
|
+
### ✅ SUCCESS:
|
|
214
|
+
|
|
215
|
+
- Correctly detected worktree vs main repo context
|
|
216
|
+
- Found and parsed all existing sidecar files
|
|
217
|
+
- Routed to appropriate step based on scenario
|
|
218
|
+
- User given clear options when multiple paths exist
|
|
219
|
+
|
|
220
|
+
### ❌ SYSTEM FAILURE:
|
|
221
|
+
|
|
222
|
+
- Starting epic setup directly (that's step-01c's job)
|
|
223
|
+
- Starting continuation directly (that's step-01b's job)
|
|
224
|
+
- Not detecting worktree context
|
|
225
|
+
- Not scanning for existing sidecars
|
|
226
|
+
- Making assumptions without detection
|
|
227
|
+
|
|
228
|
+
**Master Rule:** This step ONLY detects and routes. All execution logic belongs in subsequent steps.
|