@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.
Files changed (36) hide show
  1. package/README.md +34 -105
  2. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/completion-summary-implement-epic-with-subagents.md +103 -0
  3. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01-init.md +228 -0
  4. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01b-continue.md +298 -0
  5. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01c-new.md +434 -0
  6. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-02-orchestrate.md +437 -0
  7. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-03-complete.md +473 -0
  8. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/templates/epic-completion-report.md +62 -0
  9. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/validation/checklist.md +121 -0
  10. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow-plan-implement-epic-with-subagents.md +758 -0
  11. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow.md +101 -0
  12. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/workflow.yaml +87 -0
  13. package/examples/settings.local.example.json +0 -39
  14. package/install.js +15 -12
  15. package/package.json +3 -12
  16. package/skills/designer-founder/steps/step-01-context.md +171 -0
  17. package/skills/designer-founder/steps/step-01b-continue.md +75 -0
  18. package/skills/designer-founder/steps/step-02-scope.md +198 -0
  19. package/skills/designer-founder/steps/step-03-design.md +168 -0
  20. package/skills/designer-founder/steps/step-04-artifacts.md +292 -0
  21. package/skills/designer-founder/templates/component-strategy.md +35 -0
  22. package/skills/designer-founder/templates/design-brief.md +26 -0
  23. package/skills/designer-founder/templates/layouts.md +41 -0
  24. package/skills/designer-founder/templates/user-journeys.md +32 -0
  25. package/skills/designer-founder/tools/conversion.md +275 -0
  26. package/skills/designer-founder/tools/direct-mapping.md +222 -0
  27. package/skills/designer-founder/tools/magicpatterns.md +193 -0
  28. package/skills/designer-founder/tools/superdesign-assets/generate-theme.ts +193 -0
  29. package/skills/designer-founder/tools/superdesign-assets/superdesign-agent-instructions.md +375 -0
  30. package/skills/designer-founder/tools/superdesign.md +167 -0
  31. package/skills/designer-founder/tools/wireframe.md +181 -0
  32. package/skills/designer-founder/workflow.md +85 -0
  33. package/uninstall.js +97 -8
  34. package/hooks/auto_approve_safe.py +0 -261
  35. package/hooks/auto_approve_safe.rules.json +0 -134
  36. package/scripts/context-monitor.py +0 -175
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: implement-epic-with-subagents
3
+ description: "Automate entire epic execution by orchestrating sub-agents to execute all stories sequentially with minimal human intervention"
4
+ web_bundle: true
5
+ ---
6
+
7
+ # Implement Epic with Sub-Agents
8
+
9
+ **Goal:** Automate entire epic execution by orchestrating specialized sub-agents to implement all stories sequentially, with minimal human intervention. This workflow coordinates story preparation, development, quality verification, and code review agents to complete an epic autonomously. Supports optional git worktree isolation for parallel development.
10
+
11
+ **Your Role:** In addition to your name, communication_style, and persona, you are also an Epic Execution Orchestrator collaborating with developers and project managers. This is a partnership, not a client-vendor relationship. You bring multi-agent coordination expertise, state management, and failure handling capabilities, while the user brings their epic file, project context, and decision authority for escalations. Work together as equals.
12
+
13
+ > **Meta-Workflow Notice:** This is an autonomous orchestration workflow designed for minimal human intervention during execution. Unlike standard BMAD workflows that use frequent user checkpoints, this workflow operates autonomously once initiated, only pausing for critical escalations or failures. This is an intentional design choice for the meta-workflow/orchestrator pattern.
14
+
15
+ ---
16
+
17
+ ## WORKFLOW ARCHITECTURE
18
+
19
+ This uses **step-file architecture** with autonomous execution patterns:
20
+
21
+ ### Core Principles
22
+
23
+ - **Micro-file Design**: Each step is a self-contained instruction file that is part of an overall workflow that must be followed exactly
24
+ - **Just-In-Time Loading**: Only the current step file is in memory - never load future step files until directed
25
+ - **Sequential Enforcement**: Sequence within step files must be completed in order, no skipping or optimization allowed
26
+ - **State Tracking**: Document progress in epic-specific sidecar state files (`epic-{N}-state.yaml`) for execution tracking and resumption
27
+ - **Append-Only Building**: Build completion reports by appending content as directed to output files
28
+
29
+ ### Step Processing Rules
30
+
31
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
32
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
33
+ 3. **WAIT FOR INPUT**: At initialization and escalation points, halt and wait for user input
34
+ 4. **CHECK CONTINUATION**: Proceed to next step only when current step logic completes
35
+ 5. **SAVE STATE**: Update sidecar state file before transitioning between steps or phases
36
+ 6. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
37
+
38
+ ### Critical Rules (NO EXCEPTIONS)
39
+
40
+ - **NEVER** load multiple step files simultaneously
41
+ - **ALWAYS** read entire step file before execution
42
+ - **NEVER** skip steps or optimize the sequence
43
+ - **ALWAYS** update sidecar state after every phase completion
44
+ - **ALWAYS** follow the exact instructions in the step file
45
+ - **ALWAYS** halt at escalation points and wait for user input
46
+ - **NEVER** proceed after quality gate failure without retry or escalation
47
+
48
+ ### Autonomous Execution Pattern
49
+
50
+ This workflow uses an **autonomous loop pattern** in step-02-orchestrate:
51
+ - Stories are processed sequentially without user confirmation between stories
52
+ - User intervention occurs only at: initialization, failures, escalations, and completion
53
+ - Progress is reported after each story completion
54
+ - State is persisted to allow resumption if interrupted
55
+
56
+ ---
57
+
58
+ ## INITIALIZATION SEQUENCE
59
+
60
+ ### 1. Configuration Loading
61
+
62
+ Load and read full config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
63
+
64
+ - `output_folder`, `user_name`, `communication_language`, `document_output_language`, `implementation_artifacts`
65
+
66
+ Additional configuration is available in `workflow.yaml` including:
67
+ - Agent references (story-prep, quality-gate, code-reviewer, specialists)
68
+ - Execution settings (coverage threshold, max retries, auto-commit)
69
+ - Input/output file paths
70
+
71
+ ### 2. First Step Execution
72
+
73
+ Load, read the full file and then execute `{workflow_path}/steps/step-01-init.md` to begin the workflow.
74
+
75
+ If a sidecar state file exists with pending work, step-01 will automatically route to `step-01b-continue.md` for resumption.
76
+
77
+ ---
78
+
79
+ ## WORKFLOW STEPS
80
+
81
+ | Step | File | Purpose |
82
+ |------|------|---------|
83
+ | 1 | step-01-init.md | Entry router - detect context (worktree/main), discover sidecars, route to appropriate step |
84
+ | 1b | step-01b-continue.md | Resume from previous session using sidecar state |
85
+ | 1c | step-01c-new.md | New epic setup - mode selection, worktree creation, prerequisites, agent creation |
86
+ | 2 | step-02-orchestrate.md | Main autonomous loop - execute all stories with sub-agents |
87
+ | 3 | step-03-complete.md | Generate completion report, create PR, handle worktree cleanup |
88
+
89
+ ---
90
+
91
+ ## AGENT COORDINATION
92
+
93
+ This workflow orchestrates three specialized agents per story:
94
+
95
+ | Agent | Purpose | Handoff |
96
+ |-------|---------|---------|
97
+ | **story-prep-master** | Create developer-ready story file from epic | Story file path |
98
+ | **specialist/dev agent** | Implement story with tests (TDD) | Files changed, coverage, test results |
99
+ | **principal-code-reviewer** | Code review, quality assessment, auto-fixes | Approval status, findings |
100
+
101
+ Each agent receives fresh context and returns structured handoff messages for orchestration.
@@ -0,0 +1,87 @@
1
+ name: implement-epic-with-subagents
2
+ description: "Automate entire epic execution by orchestrating sub-agents to execute all stories sequentially with minimal human intervention"
3
+ author: "BMad"
4
+ web_bundle: true
5
+
6
+ # Critical variables from config
7
+ config_source: "{project-root}/_bmad/bmm/config.yaml"
8
+ output_folder: "{config_source}:output_folder"
9
+ user_name: "{config_source}:user_name"
10
+ communication_language: "{config_source}:communication_language"
11
+ document_output_language: "{config_source}:document_output_language"
12
+ implementation_artifacts: "{config_source}:implementation_artifacts"
13
+ date: system-generated
14
+
15
+ # Workflow components
16
+ installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents"
17
+ workflow_file: "{installed_path}/workflow.yaml"
18
+ first_step: "{installed_path}/steps/step-01-init.md"
19
+
20
+ # Input files
21
+ epic_file: "" # User provides or auto-discover
22
+ sprint_status: "{implementation_artifacts}/sprint-status.yaml"
23
+ project_context: "**/project-context.md"
24
+
25
+ # Output files (legacy - kept for reference, see sidecar_folder below)
26
+ # sidecar_file: "{output_folder}/epic-execution-state.yaml" # DEPRECATED
27
+ completion_report: "{output_folder}/epic-reports/epic-completion-{epic_name}-{date}.md"
28
+
29
+ # Agent references
30
+ story_prep_agent: ".claude/agents/story-prep-master.md"
31
+ code_review_agent: ".claude/agents/principal-code-reviewer.md"
32
+ specialist_agents_folder: ".claude/agents/vt-bmad-dev-agents/"
33
+ fallback_dev_agent: "_bmad/bmm/agents/dev.md"
34
+
35
+ # Execution configuration
36
+ coverage_threshold: 80
37
+ max_retries: 3
38
+ auto_commit: true
39
+
40
+ # Git workflow settings
41
+ feature_branch_prefix: "feature/epic-"
42
+ auto_create_branch: true
43
+ base_branch: "main"
44
+
45
+ # Agent creation settings
46
+ agent_creator_skill: ".claude/skills/agent-creator/SKILL.md"
47
+ specialist_agents_created: [] # Populated by init step
48
+
49
+ # PR settings
50
+ auto_create_pr: true
51
+ pr_base_branch: "main"
52
+
53
+ # Retrospective settings
54
+ retrospective_workflow: "_bmad/bmm/workflows/4-implementation/retrospective"
55
+
56
+ standalone: true
57
+
58
+ # ═══════════════════════════════════════════
59
+ # WORKTREE CONFIGURATION
60
+ # ═══════════════════════════════════════════
61
+
62
+ # Worktree mode: "ask" | "always" | "never"
63
+ # ask - Prompt user each time (default)
64
+ # always - Always use worktree, skip prompt
65
+ # never - Never use worktree, classic behavior
66
+ worktree_mode: "ask"
67
+
68
+ # Directory pattern for worktrees (relative to main repo parent)
69
+ # Available variables: {project_name}, {epic_number}, {epic_name_sanitized}
70
+ worktree_directory_pattern: "../{project_name}-epic-{epic_number}-{epic_name_sanitized}"
71
+
72
+ # Branch pattern for worktree branches
73
+ worktree_branch_pattern: "feature/epic-{epic_number}-{epic_name_sanitized}"
74
+
75
+ # Dependency installation command (auto-detected if empty)
76
+ # Examples: "npm install", "yarn", "pnpm install", "bun install"
77
+ dependency_command: ""
78
+
79
+ # ═══════════════════════════════════════════
80
+ # SIDECAR CONFIGURATION
81
+ # ═══════════════════════════════════════════
82
+
83
+ # Sidecar storage folder (will be gitignored)
84
+ sidecar_folder: "{output_folder}/epic-executions"
85
+
86
+ # Sidecar file pattern
87
+ sidecar_file_pattern: "epic-{epic_number}-state.yaml"
@@ -14,44 +14,5 @@
14
14
  ],
15
15
  "deny": [],
16
16
  "ask": []
17
- },
18
- "hooks": {
19
- "PreToolUse": [
20
- {
21
- "matcher": "Bash|Read|Grep|Glob|Write|Edit|MultiEdit",
22
- "hooks": [
23
- {
24
- "type": "command",
25
- "command": "python3 .claude/scripts/auto_approve_safe.py"
26
- }
27
- ]
28
- }
29
- ],
30
- "PostToolUse": [
31
- {
32
- "matcher": "Edit|MultiEdit",
33
- "hooks": [
34
- {
35
- "type": "command",
36
- "command": "if [[ \"$CLAUDE_TOOL_FILE_PATH\" == *.js || \"$CLAUDE_TOOL_FILE_PATH\" == *.ts || \"$CLAUDE_TOOL_FILE_PATH\" == *.jsx || \"$CLAUDE_TOOL_FILE_PATH\" == *.tsx ]]; then npx eslint \"$CLAUDE_TOOL_FILE_PATH\" --fix 2>/dev/null || true; fi"
37
- }
38
- ]
39
- }
40
- ],
41
- "Stop": [
42
- {
43
- "matcher": "*",
44
- "hooks": [
45
- {
46
- "type": "command",
47
- "command": "if command -v osascript >/dev/null 2>&1; then osascript -e 'display notification \"Claude Code task completed\" with title \"Claude Code\"'; elif command -v notify-send >/dev/null 2>&1; then notify-send 'Claude Code' 'Task completed'; fi"
48
- }
49
- ]
50
- }
51
- ]
52
- },
53
- "statusLine": {
54
- "type": "command",
55
- "command": "python3 .claude/scripts/context-monitor.py"
56
17
  }
57
18
  }
package/install.js CHANGED
@@ -129,12 +129,17 @@ function install() {
129
129
  };
130
130
 
131
131
  // Define what to copy and where
132
+ // Note: dest is relative to targetBase (.claude/)
133
+ // Use '../' to go to project root for _bmad/ paths
132
134
  const mappings = [
133
135
  { src: 'commands', dest: 'commands' },
134
136
  { src: 'agents', dest: 'agents' },
135
137
  { src: 'skills', dest: 'skills' },
136
- { src: 'hooks', dest: 'scripts' }, // Hooks go to scripts directory
137
- { src: 'scripts', dest: 'scripts' },
138
+ // BMAD workflows (installed to project root, not .claude/)
139
+ {
140
+ src: 'bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents',
141
+ dest: '../_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents',
142
+ },
138
143
  ];
139
144
 
140
145
  for (const { src, dest } of mappings) {
@@ -154,21 +159,19 @@ function install() {
154
159
 
155
160
  // Post-install instructions
156
161
  log('\n' + colors.bold + '📝 Next Steps' + colors.reset);
157
- log(' 1. Configure hooks in .claude/settings.local.json');
158
- log(' 2. See examples/settings.local.example.json for configuration');
159
- log(' 3. Run /git-cleanup-and-merge or /plan-parallelization to test\n');
162
+ log(' 1. Run /git-cleanup-and-merge or /plan-parallelization to test');
163
+ log(' 2. Try /designer-founder for UI/UX design workflows\n');
160
164
 
161
165
  // Note about BMAD dependencies
162
- log(colors.yellow + '⚠️ Note: Some components require BMAD Method workflows:' + colors.reset);
163
- log(' - implement-epic-with-subagents');
164
- log(' - principal-code-reviewer');
165
- log(' - story-prep-master');
166
- log('\n Standalone components work without dependencies:');
166
+ log(colors.yellow + '⚠️ Note: Some components work better with BMAD Method installed:' + colors.reset);
167
+ log(' - principal-code-reviewer (uses BMAD code-review workflow)');
168
+ log(' - story-prep-master (uses BMAD story workflows)');
169
+ log('\n Fully included (no external dependencies):');
167
170
  log(' ✓ git-cleanup-and-merge');
168
171
  log(' ✓ plan-parallelization');
172
+ log(' ✓ implement-epic-with-subagents (workflow files included)');
169
173
  log(' ✓ agent-creator skill');
170
- log(' ✓ auto_approve_safe hook');
171
- log(' ✓ context-monitor status line\n');
174
+ log(' ✓ designer-founder skill\n');
172
175
  }
173
176
 
174
177
  // Run installation
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@torka/claude-workflows",
3
- "version": "0.1.0",
4
- "description": "Claude Code workflow helpers: epic automation, git cleanup, agents, hooks, and status line",
3
+ "version": "0.3.0",
4
+ "description": "Claude Code workflow helpers: epic automation, git cleanup, agents, and design workflows",
5
5
  "keywords": [
6
6
  "claude-code",
7
7
  "ai-workflows",
@@ -14,14 +14,6 @@
14
14
  ],
15
15
  "author": "Varun Torka",
16
16
  "license": "MIT",
17
- "homepage": "https://github.com/varuntorka/vt-claude-workflows#readme",
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/varuntorka/vt-claude-workflows.git"
21
- },
22
- "bugs": {
23
- "url": "https://github.com/varuntorka/vt-claude-workflows/issues"
24
- },
25
17
  "scripts": {
26
18
  "postinstall": "node install.js",
27
19
  "preuninstall": "node uninstall.js"
@@ -30,8 +22,7 @@
30
22
  "commands",
31
23
  "agents",
32
24
  "skills",
33
- "hooks",
34
- "scripts",
25
+ "bmad-workflows",
35
26
  "examples",
36
27
  ".claude-plugin",
37
28
  "install.js",
@@ -0,0 +1,171 @@
1
+ # Step 1: Context & Mode Selection
2
+
3
+ ## MANDATORY EXECUTION RULES (READ FIRST)
4
+
5
+ - 🛑 NEVER assume project state without checking
6
+ - 📖 CRITICAL: Read complete step file before taking action
7
+ - ✅ ALWAYS treat this as collaborative discovery
8
+ - 🎯 Goal: Understand where we are and what mode to use
9
+
10
+ ---
11
+
12
+ ## YOUR TASK
13
+
14
+ Establish context and select the appropriate workflow mode based on project state and user intent.
15
+
16
+ ---
17
+
18
+ ## TASK SEQUENCE
19
+
20
+ ### 1. Greet and Understand Intent
21
+
22
+ Start with a brief greeting using `{user_name}` and ask what they'd like to design:
23
+
24
+ ```
25
+ Hey {user_name}! I'm ready to help you design.
26
+
27
+ What are you looking to create today?
28
+ ```
29
+
30
+ Wait for user input describing what they want to design.
31
+
32
+ ---
33
+
34
+ ### 2. Detect Project State
35
+
36
+ After user describes their intent, quickly assess:
37
+
38
+ **Check for existing project artifacts:**
39
+ - `_bmad-output/planning-artifacts/` - Do specs exist?
40
+ - `_bmad-output/planning-artifacts/ux-design/` - Existing design docs?
41
+ - Epic/story files related to user's intent?
42
+
43
+ **Determine project phase:**
44
+ - **Greenfield**: No relevant specs found → Need to establish design direction
45
+ - **Mid-project**: Specs exist → Pull context, focus on specific scope
46
+
47
+ **Report findings concisely:**
48
+ ```
49
+ Project Context:
50
+ - [Greenfield / Existing project with specs]
51
+ - Related artifacts found: [list or "none"]
52
+ - Relevant epics/stories: [list or "none"]
53
+ ```
54
+
55
+ ---
56
+
57
+ ### 3. Check Available Tools
58
+
59
+ Detect and report tool availability:
60
+
61
+ ```
62
+ Available Tools:
63
+ ✓ SuperDesign - HTML/CSS prototyping
64
+ [✓/✗] MagicPatterns MCP - React component generation
65
+ [✓/✗] shadcn MCP - Component search & install
66
+ [✓/✗] Playwright MCP - Screenshot verification
67
+ ```
68
+
69
+ Note: shadcn CLI (`npx shadcn@latest add`) is always available as fallback.
70
+
71
+ ---
72
+
73
+ ### 4. Present Mode Selection
74
+
75
+ Based on context, recommend a mode and let user choose:
76
+
77
+ ```
78
+ WORKFLOW MODE
79
+
80
+ Based on your request, I recommend: [Quick Prototype / Production Flow]
81
+
82
+ [Q] Quick Prototype
83
+ → Fast visual exploration
84
+ → Output: HTML prototype or wireframe
85
+ → Best for: Testing ideas, exploring directions
86
+
87
+ [P] Production Flow
88
+ → Full dev-ready artifacts
89
+ → Output: Component strategy, layouts, user journeys
90
+ → Best for: Features going into the product
91
+
92
+ Which mode? [Q/P]
93
+ ```
94
+
95
+ **Recommendation logic:**
96
+ - User says "explore", "try", "prototype", "quick" → Recommend Quick
97
+ - User mentions specific epic/story, "build", "implement" → Recommend Production
98
+ - Greenfield project, first design → Recommend Production (establish foundation)
99
+ - Uncertain → Ask user
100
+
101
+ ---
102
+
103
+ ### 5. Confirm and Route
104
+
105
+ Once user selects mode, confirm and route:
106
+
107
+ **If Quick Prototype:**
108
+ ```
109
+ Quick Prototype mode selected.
110
+
111
+ We'll skip detailed specs and focus on rapid visualization.
112
+ Ready to move to design tool selection.
113
+ ```
114
+ → Proceed to Step 3 (skip Step 2)
115
+
116
+ **If Production Flow:**
117
+ ```
118
+ Production Flow selected.
119
+
120
+ We'll create dev-ready artifacts including:
121
+ - Component strategy with shadcn mappings
122
+ - Page layouts (responsive)
123
+ - User journeys (if multi-step flow)
124
+
125
+ Let's define the scope first.
126
+ ```
127
+ → Proceed to Step 2
128
+
129
+ ---
130
+
131
+ ## COLLABORATION MENU
132
+
133
+ After confirming mode, present:
134
+
135
+ ```
136
+ [A] Advanced - Deep dive into project context
137
+ [P] Party Mode - Get multiple agent perspectives
138
+ [C] Continue - Proceed to next step
139
+ ```
140
+
141
+ **Menu Handlers:**
142
+ - **A**: Load `{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml` for deeper discovery
143
+ - **P**: Load `{project-root}/_bmad/core/workflows/party-mode/workflow.md` for multi-perspective input
144
+ - **C**: Proceed to next step based on mode selection
145
+
146
+ ---
147
+
148
+ ## STATE TO CARRY FORWARD
149
+
150
+ Store in working memory for subsequent steps:
151
+
152
+ ```yaml
153
+ mode: [quick_prototype | production]
154
+ user_intent: "[what user wants to design]"
155
+ project_state: [greenfield | existing]
156
+ related_artifacts: [list of relevant files found]
157
+ tools_available:
158
+ superdesign: true
159
+ magicpatterns: [true/false]
160
+ shadcn_mcp: [true/false]
161
+ playwright: [true/false]
162
+ ```
163
+
164
+ ---
165
+
166
+ ## NEXT STEP
167
+
168
+ - If mode = `quick_prototype`: Load `./step-03-design.md`
169
+ - If mode = `production`: Load `./step-02-scope.md`
170
+
171
+ Remember: Do NOT proceed until user explicitly selects [C]
@@ -0,0 +1,75 @@
1
+ # Step 1b: Continue Existing Session
2
+
3
+ ## PURPOSE
4
+
5
+ Handle resumption of an interrupted designer-founder workflow session.
6
+
7
+ ---
8
+
9
+ ## DETECTION
10
+
11
+ This step is loaded when:
12
+ - User invokes designer-founder workflow
13
+ - Existing design session state is detected
14
+ - User confirms they want to continue (not start fresh)
15
+
16
+ ---
17
+
18
+ ## TASK SEQUENCE
19
+
20
+ ### 1. Detect Previous State
21
+
22
+ Check for indicators of previous session:
23
+ - Recent files in `{planning_artifacts}/ux-design/` matching current date
24
+ - Incomplete artifacts (missing expected files)
25
+ - SuperDesign files created recently in `.superdesign/design_iterations/`
26
+
27
+ ### 2. Present Recovery Options
28
+
29
+ ```
30
+ EXISTING SESSION DETECTED
31
+
32
+ I found evidence of a previous design session:
33
+ - {list what was found}
34
+
35
+ Would you like to:
36
+
37
+ [C] Continue - Resume from where we left off
38
+ [R] Review - Show me what was created
39
+ [N] New - Start fresh (previous work preserved)
40
+ ```
41
+
42
+ ### 3. If Continue
43
+
44
+ Reconstruct state:
45
+ ```yaml
46
+ mode: {infer from artifacts}
47
+ scope: {infer from artifact names}
48
+ design:
49
+ tool_used: {infer from output files}
50
+ output_location: {found files}
51
+ last_completed_step: {infer from artifacts present}
52
+ ```
53
+
54
+ Route to appropriate step:
55
+ - Only design brief exists → Step 3 (Design) or Step 4 (Artifacts)
56
+ - Component strategy exists but incomplete → Step 4
57
+ - All artifacts exist → Offer to refine or start new
58
+
59
+ ### 4. If Review
60
+
61
+ Display summary of found artifacts and their contents.
62
+ Return to recovery options after review.
63
+
64
+ ### 5. If New
65
+
66
+ Proceed to `step-01-context.md` for fresh start.
67
+ Do not delete previous work.
68
+
69
+ ---
70
+
71
+ ## NEXT STEP
72
+
73
+ Based on user selection, route to:
74
+ - Appropriate step for continuation
75
+ - `step-01-context.md` for fresh start