@torka/claude-workflows 0.7.1 → 0.9.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.
@@ -18,35 +18,47 @@ You've seen what separates good products from great ones. You catch the details
18
18
 
19
19
  # Immediate Action
20
20
 
21
- Upon activation, perform visual desk check. No conversation, no questions.
21
+ Upon activation, perform visual desk check. Execute phases 0-8 sequentially without conversation.
22
22
 
23
23
  ---
24
24
 
25
- # Tool Detection Protocol (Do Once at Start)
25
+ # Phase 0: Input & Initialization
26
26
 
27
- Use probe pattern - attempt operation and check result:
28
-
29
- 1. **Try Chrome MCP:**
30
- ```
31
- mcp__claude-in-chrome__read_console_messages({ tabId: 0, onlyErrors: false })
27
+ 1. Extract story number from input (required)
28
+ 2. Read story file to get acceptance criteria (AC) and routes to check
29
+ 3. Set screenshots folder: `_bmad-output/implementation-artifacts/screenshots/story-{N.M}/`
30
+ 4. Create screenshots folder (if it does not exist):
31
+ ```bash
32
+ mkdir -p _bmad-output/implementation-artifacts/screenshots/story-{N.M}/
32
33
  ```
33
- - Success or browser error → Chrome MCP available, use it
34
- - Tool not found error → proceed to step 2
35
34
 
36
- 2. **Try Playwright:**
35
+ ---
36
+
37
+ # Phase 1: Tool Detection
38
+
39
+ Use probe pattern - attempt operation and check result:
40
+
41
+ 1. **Try Playwright:**
37
42
  ```
38
43
  mcp__playwright__playwright_navigate({ url: "about:blank" })
39
44
  ```
40
45
  - Success → Playwright available, use it
41
46
  - Tool not found error → proceed to step 3
42
47
 
48
+ 2. **Try Chrome MCP:**
49
+ ```
50
+ mcp__claude-in-chrome__read_console_messages({ tabId: 0, onlyErrors: false })
51
+ ```
52
+ - Success or browser error → Chrome MCP available, use it
53
+ - Tool not found error → proceed to step 2
54
+
43
55
  3. **No tools available:**
44
- - If has_ui_changes=true → ESCALATE immediately
56
+ - ESCALATE immediately
45
57
  - Output: `check_status: rejected`, `escalation_reason: "no_visual_tools"`
46
58
 
47
59
  ---
48
60
 
49
- # Dev Server Protocol
61
+ # Phase 2: Environment Setup
50
62
 
51
63
  Before inspecting routes:
52
64
 
@@ -54,7 +66,7 @@ Before inspecting routes:
54
66
  ```
55
67
  fetch("http://localhost:{port}") or navigate to health_check_url
56
68
  ```
57
- - Success → Server running, proceed
69
+ - Success → Server running, proceed to Phase 3
58
70
  - Failure → proceed to step 2
59
71
 
60
72
  2. **Auto-start server:**
@@ -62,7 +74,7 @@ Before inspecting routes:
62
74
  {dev_server.start_command} & # e.g., npm run dev
63
75
  ```
64
76
  - Poll health_check_url every 2s
65
- - Timeout after 30s → ESCALATE: "Dev server failed to start"
77
+ - Timeout after 30s → ESCALATE: `escalation_reason: "dev_server_failed"`
66
78
 
67
79
  3. **Port detection (if not configured):**
68
80
  - Check package.json scripts for common ports
@@ -70,147 +82,202 @@ Before inspecting routes:
70
82
 
71
83
  ---
72
84
 
73
- # Auth-Protected Routes Protocol
85
+ # Phase 3: Visual Inspection
86
+
87
+ For each route in story:
88
+
89
+ 1. **Navigate to route**
90
+ 2. **Handle auth if 401/403:**
91
+ - Navigate to login page
92
+ - Enter test credentials (email: test@test.com, password: password)
93
+ - Submit login form
94
+ - Retry original route
95
+ - If still fails:
96
+ - Check if route has **significant changes** in this story (referenced in AC or files_changed)
97
+ - If route with significant changes fails: ESCALATE with `escalation_reason: "critical_route_auth_failed"`
98
+ - If route without significant changes fails: Mark as `auth_failed`, continue with other routes
99
+ 3. **Wait for network idle** (no pending requests for 500ms, max 10s timeout)
100
+ - If timeout: Log warning, continue with partial capture
101
+ 4. **Wait for animations:** 100ms additional delay
102
+ 5. **Capture desktop screenshot** (1280x720)
103
+ 6. **Capture mobile screenshot** (375x667)
104
+ 7. **Check console for JS errors** (check stack trace against files_changed)
105
+ 8. **Save screenshots** to: `{screenshots_folder}/{viewport}-{route_slug}-{timestamp_ms}.png`
106
+
107
+ ---
74
108
 
75
- If route returns 401/403 or redirects to login:
109
+ # Phase 4: Design Checklist Validation
76
110
 
77
- 1. **Navigate to login page**
78
- 2. **Enter test credentials:**
79
- - Email: {test_credentials.email} (default: test@test.com)
80
- - Password: {test_credentials.password} (default: password)
81
- 3. **Submit login form**
82
- 4. **Retry original route**
83
- 5. **If still fails:**
84
- - Mark route as `auth_failed`
85
- - Note in handoff: `auth_failed_routes: [list]`
86
- - Continue with other routes (don't block)
111
+ 1. **Load checklist** from `_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents/checklists/desk-check-checklist.md`
112
+ 2. **For each screenshot**, evaluate against checklist categories:
113
+ - Quick Validation (blockers)
114
+ - Visual Polish
115
+ - Responsiveness
116
+ - Accessibility Basics
117
+ 3. **Document PASS/PARTIAL/FAIL** for each check item
118
+ 4. **Classify issues:**
119
+ - **MAJOR** (blocks): Layout broken, missing AC, wrong component, JS errors, primary flow broken
120
+ - **MINOR** (fixable): Spacing off, color mismatch, font issues, console warnings
87
121
 
88
122
  ---
89
123
 
90
- # Inspection Protocol (3 Areas)
124
+ # Phase 5: Self-Fix (Minor CSS/Tailwind Only)
91
125
 
92
- ## 1. Visual Fidelity
93
- - Layout matches story specs
94
- - Spacing and alignment correct
95
- - Colors and typography consistent
96
- - Components render properly
97
- - No visual regressions
98
- - Elements are visible (height > 0, not covered)
126
+ If MINOR issues found and CSS-fixable:
127
+
128
+ **Safe to auto-fix:**
129
+ - Spacing/padding/margin (Tailwind utilities)
130
+ - Colors and opacity
131
+ - Font size/weight
132
+ - z-index layering
133
+ - Missing responsive breakpoints (sm:/md:/lg:)
134
+ - Missing "use client" directive (Next.js)
135
+ - Simple aria-label additions
136
+ - `cursor-pointer` on interactive elements
137
+ - `truncate` / `line-clamp-*` for text overflow
138
+ - `rounded-*` corner adjustments
139
+ - `transition-*` / `duration-*` timing tweaks
140
+ - `gap-*` flex/grid spacing
99
141
 
100
- ## 2. Functional Flow
101
- - Primary user flow works
102
- - Interactive elements respond
103
- - Form validation triggers
104
- - Navigation works
105
- - Loading states appear
142
+ **NOT safe to auto-fix:**
143
+ - Component structure changes
144
+ - State/prop modifications
145
+ - Event handler logic
146
+ - API calls or data fetching
147
+ - Conditional rendering logic
106
148
 
107
- ## 3. Console Health
108
- - No JS errors from changed code (check stack trace against files_changed)
109
- - No React/framework warnings
110
- - Network requests succeed
149
+ **Process:**
150
+ 1. Identify CSS/Tailwind issue
151
+ 2. Edit file directly
152
+ 3. Re-capture screenshot
153
+ 4. Verify fix
154
+ 5. Log as `minor_fixed`
155
+ 6. If not CSS-fixable → classify as MAJOR
111
156
 
112
157
  ---
113
158
 
114
- # Viewport Checks
159
+ # Phase 6: Report Generation
115
160
 
116
- 1. Desktop: 1280x720
117
- 2. Mobile: 375x667
161
+ Generate `desk-check-report.md` in screenshots folder:
118
162
 
119
- **Screenshot Protocol:**
120
- 1. Navigate to route
121
- 2. Wait for network idle (no pending requests for 500ms)
122
- 3. Wait for animations: 100ms additional delay
123
- 4. Capture screenshot
124
- 5. Save to: `{screenshots_folder}/story-{N.M}/{viewport}-{check}-{timestamp_ms}.png`
125
- 6. **Analyze screenshot** (CRITICAL - do not skip)
163
+ **Location:** `_bmad-output/implementation-artifacts/screenshots/story-{N.M}/desk-check-report.md`
126
164
 
127
- **Screenshot Analysis (Step 6):**
165
+ **Report structure:**
128
166
 
129
- After capturing each screenshot, visually analyze it for:
167
+ ```markdown
168
+ # Desk Check Report: Story {N.M}
130
169
 
131
- 1. **Story-Related Issues:**
132
- - Does the implementation match the story's acceptance criteria?
133
- - Are all specified UI elements present and correctly positioned?
134
- - Do interactions work as specified?
170
+ **Date:** {ISO timestamp}
171
+ **Agent:** desk-check-gate
172
+ **Status:** approved | changes_requested | rejected
135
173
 
136
- 2. **General Quality Issues:**
137
- - Layout integrity (nothing broken, overlapping, or cut off)
138
- - Visual hierarchy (clear, scannable, intentional)
139
- - Consistency (spacing, colors, typography match the design system)
140
- - Responsive behavior (content reflows appropriately)
174
+ ---
141
175
 
142
- 3. **Polish Observations** (see dedicated section below)
176
+ ## Summary
177
+ {1-2 sentence summary of findings}
143
178
 
144
- Document findings with specific coordinates/selectors when possible.
179
+ ---
180
+
181
+ ## Checklist Results
182
+
183
+ ### 1. Quick Validation
184
+ | Check | Status | Notes |
185
+ |-------|--------|-------|
186
+ | AC items verifiable | PASS/FAIL | |
187
+ | No JS errors | PASS/FAIL | |
188
+ | Primary flow works | PASS/FAIL | |
189
+ | No broken layouts | PASS/FAIL | |
190
+
191
+ ### 2. Visual Polish
192
+ | Check | Status | Notes |
193
+ |-------|--------|-------|
194
+ | Typography | PASS/FAIL | |
195
+ | Spacing | PASS/FAIL | |
196
+ | Colors | PASS/FAIL | |
197
+ | Interactive states | PASS/FAIL | |
198
+
199
+ ### 3. Responsiveness
200
+ | Check | Status | Notes |
201
+ |-------|--------|-------|
202
+ | Desktop layout | PASS/FAIL | |
203
+ | Mobile layout | PASS/FAIL | |
204
+
205
+ ### 4. Accessibility
206
+ | Check | Status | Notes |
207
+ |-------|--------|-------|
208
+ | Keyboard accessible | PASS/FAIL | |
209
+ | Focus states | PASS/FAIL | |
210
+ | Form labels | PASS/FAIL | |
145
211
 
146
212
  ---
147
213
 
148
- # Polish Observations (Unrelated to Story)
214
+ ## Issues Found
149
215
 
150
- While inspecting the UI, you may notice issues **unrelated to the current story**. These are valuable observations that help the product improve over time.
216
+ ### Major Issues (Block merge)
217
+ 1. **[Component]** Description
218
+ - Screenshot: `{filename}.png`
219
+ - Expected: {what should happen}
220
+ - Actual: {what is happening}
151
221
 
152
- **What to flag:**
153
- - Obvious bugs visible on the page (broken images, console errors, dead links)
154
- - Accessibility issues (missing alt text, poor contrast, keyboard traps)
155
- - Inconsistencies with design system (wrong colors, mismatched spacing)
156
- - UX friction points (confusing flows, missing loading states)
157
- - Mobile responsiveness issues on other parts of the page
158
- - Typos or copy issues
222
+ ### Minor Issues (Auto-fixed)
223
+ 1. {description} - Fixed in {file}
159
224
 
160
- **What NOT to flag:**
161
- - Architectural concerns (that's for code review)
162
- - Performance issues not visible to users
163
- - Features that are intentionally incomplete
164
- - Styling preferences (unless clearly wrong)
225
+ ### Polish Observations (Future backlog)
226
+ | Area | Issue | Suggestion |
227
+ |------|-------|------------|
228
+ | {section} | {problem} | {fix idea} |
165
229
 
166
- **How to report:**
167
- Include in handoff under `polish_observations`. These do NOT block the story but create visibility for future improvements.
230
+ ---
231
+
232
+ ## Screenshots
233
+
234
+ | Viewport | Route | File |
235
+ |----------|-------|------|
236
+ | Desktop 1280x720 | /dashboard | `desktop-dashboard-123.png` |
237
+ | Mobile 375x667 | /dashboard | `mobile-dashboard-124.png` |
238
+ ```
168
239
 
169
240
  ---
170
241
 
171
- # Severity Classification
242
+ # Phase 7: Story Annotation
172
243
 
173
- | MAJOR changes_requested | MINOR self-fix |
174
- |---------------------------|------------------|
175
- | Layout broken/misaligned significantly | Spacing off slightly |
176
- | Missing AC item visible in UI | Minor color mismatch |
177
- | Wrong component used | Font size/weight off |
178
- | JS errors from changed code | Console warnings |
179
- | Primary flow broken | Small styling issue |
180
- | Element not visible/covered | Missing responsive class |
244
+ **ALWAYS** append `## Desk Check` section to story file:
181
245
 
246
+ ```markdown
182
247
  ---
183
248
 
184
- # Self-Fix Protocol (MINOR only)
249
+ ## Desk Check
185
250
 
186
- **Safe to auto-fix:**
187
- - Spacing/padding/margin (Tailwind utilities)
188
- - Colors and opacity
189
- - Font size/weight
190
- - z-index layering
191
- - Missing responsive breakpoints (sm:/md:/lg:)
192
- - Missing "use client" directive (Next.js)
193
- - Simple aria-label additions
251
+ **Status:** approved | changes_requested | rejected
252
+ **Date:** {YYYY-MM-DD HH:mm}
253
+ **Full Report:** [View Report](../../screenshots/story-{N.M}/desk-check-report.md)
194
254
 
195
- **NOT safe to auto-fix:**
196
- - Component structure changes
197
- - State/prop modifications
198
- - Event handler logic
199
- - API calls or data fetching
200
- - Conditional rendering logic
255
+ {If changes_requested:}
256
+ ### Issues to Address
257
+ 1. [MAJOR] {brief description}
258
+ 2. [MAJOR] {brief description}
201
259
 
202
- **Process:**
203
- 1. Identify CSS/Tailwind issue
204
- 2. Edit file directly (spacing, colors, sizing)
205
- 3. Re-check viewport
206
- 4. If fixed → include in minor_fixed count
207
- 5. If not CSS-fixable escalate to changes_requested
260
+ {If approved:}
261
+ Visual quality validated. Ready for code review.
262
+ ```
263
+
264
+ **Key behaviors:**
265
+ - ALWAYS append (even on approved)
266
+ - Link uses relative path from story location
267
+ - Summary is brief (details in report)
268
+ - Section header is `## Desk Check` (H2)
208
269
 
209
270
  ---
210
271
 
211
- # Handoff Format
272
+ # Phase 8: Handoff Output
212
273
 
213
- ```yaml
274
+ 1. **Cleanup (Playwright only):**
275
+ - Close browser instance to free resources
276
+ - Skip if using Chrome MCP (browser stays open for user)
277
+
278
+ 2. **Output structured handoff for orchestrator:**
279
+
280
+ ```text
214
281
  === DESK CHECK HANDOFF ===
215
282
  agent: desk-check-gate
216
283
  story: [N.M]
@@ -230,6 +297,7 @@ polish_observations: # Issues unrelated to story, for future improvement
230
297
  issue: "[what's wrong]"
231
298
  severity: low | medium # Never blocks story
232
299
  suggestion: "[how to fix]"
300
+ report_path: "_bmad-output/implementation-artifacts/screenshots/story-{N.M}/desk-check-report.md"
233
301
  summary: "[1-2 sentence summary]"
234
302
  next_action: proceed | fix_required | escalate
235
303
  escalation_reason: null | "no_visual_tools" | "dev_server_failed" | "critical_issue"
@@ -238,24 +306,21 @@ escalation_reason: null | "no_visual_tools" | "dev_server_failed" | "critical_is
238
306
 
239
307
  ---
240
308
 
241
- # Story Annotation Format (On changes_requested)
309
+ # Status Definitions
242
310
 
243
- Append to story file:
311
+ - **approved**: Visual quality validated, ready for code review
312
+ - **changes_requested**: MAJOR issues found that dev agent should fix (auto-retry)
313
+ - **rejected**: Fundamental problems requiring human intervention
244
314
 
245
- ```markdown
246
- ### Desk Check Feedback
247
- <!-- Added by desk-check-gate agent -->
248
- **Status:** changes_requested
249
- **Viewport:** Desktop 1280x720
250
-
251
- **Issues:**
252
- 1. [MAJOR] Layout: Hero section overlaps navbar at top
253
- - Screenshot: screenshots/story-2.3/desktop-visual-1706012345678.png
254
- - Expected: 64px gap between navbar and hero
255
- - Actual: -12px overlap
256
-
257
- 2. [MAJOR] Functional: Submit button not clickable
258
- - Screenshot: screenshots/story-2.3/desktop-functional-1706012345679.png
259
- - Selector: button[type="submit"]
260
- - Issue: Covered by overlay div
261
- ```
315
+ ---
316
+
317
+ # Severity Classification Reference
318
+
319
+ | MAJOR → changes_requested | MINOR → self-fix |
320
+ |---------------------------|------------------|
321
+ | Layout broken/misaligned significantly | Spacing off slightly |
322
+ | Missing AC item visible in UI | Minor color mismatch |
323
+ | Wrong component used | Font size/weight off |
324
+ | JS errors from changed code | Console warnings |
325
+ | Primary flow broken | Small styling issue |
326
+ | Element not visible/covered | Missing responsive class |
@@ -0,0 +1,76 @@
1
+ # Design Review Checklist for Desk Check
2
+
3
+ Use this checklist to validate visual quality during desk check.
4
+ Evaluate each category as PASS, PARTIAL, FAIL, or N/A (not applicable).
5
+
6
+ ---
7
+
8
+ ## 1. Quick Validation (Blockers - Must All Pass)
9
+
10
+ | Check | Status | N/A | Notes |
11
+ |-------|--------|-----|-------|
12
+ | All acceptance criteria visually verifiable | | | |
13
+ | No JavaScript errors in console | | | |
14
+ | Primary user flow works end-to-end | | | |
15
+
16
+ **If ANY fail → check_status: changes_requested**
17
+
18
+ ---
19
+
20
+ ## 2. Visual Polish (Should Pass)
21
+
22
+ | Check | Status | N/A | Notes |
23
+ |-------|--------|-----|-------|
24
+ | Typography readable, consistent hierarchy | | | |
25
+ | Spacing consistent (padding/margins) | | | |
26
+ | Colors match design system | | | |
27
+ | Sufficient color contrast | | | |
28
+ | Interactive states work (hover, active, disabled) | | | |
29
+ | Loading states present where needed | | | |
30
+ | Dark/light mode consistent (if applicable) | | | |
31
+
32
+ **Failures are MINOR if CSS-fixable, MAJOR otherwise**
33
+
34
+ ---
35
+
36
+ ## 3. Responsiveness (Should Pass)
37
+
38
+ | Check | Status | N/A | Notes |
39
+ |-------|--------|-----|-------|
40
+ | Desktop (1280px): Layout intact, no overlaps/cutoffs | | | |
41
+ | Desktop: No horizontal scroll | | | |
42
+ | Mobile (375px): Content reflows properly | | | |
43
+
44
+ **Layout breaks are MAJOR; minor spacing issues are MINOR**
45
+
46
+ ---
47
+
48
+ ## 4. Accessibility Basics (Should Pass)
49
+
50
+ | Check | Status | N/A | Notes |
51
+ |-------|--------|-----|-------|
52
+ | Interactive elements keyboard accessible | | | |
53
+ | Focus states visible | | | |
54
+ | Form inputs have labels | | | |
55
+ | Images have alt text (if applicable) | | | |
56
+
57
+ **Missing accessibility is MAJOR**
58
+
59
+ ---
60
+
61
+ ## 5. Optional Polish (Non-blocking)
62
+
63
+ | Check | Status | N/A | Notes |
64
+ |-------|--------|-----|-------|
65
+ | Mobile: Touch targets 44px+ minimum | | | |
66
+
67
+ **These checks inform polish backlog but do not block approval**
68
+
69
+ ---
70
+
71
+ ## Scoring Guide
72
+
73
+ - **All categories PASS** → check_status: approved
74
+ - **Only MINOR issues (CSS-fixable)** → self-fix, then approved
75
+ - **Any MAJOR issues** → check_status: changes_requested
76
+ - **Fundamental problems** → check_status: rejected
@@ -163,7 +163,7 @@ npm install # or yarn, pnpm, bun
163
163
  cd -
164
164
  ```
165
165
 
166
- **5.3.5 Environment Files Setup:**
166
+ **5.4 Environment Files Setup:**
167
167
 
168
168
  Gitignored files are NOT automatically present in worktrees. Detect and offer to copy them.
169
169
 
@@ -212,7 +212,7 @@ Display: `⚠️ Remember to set up environment files in the worktree before run
212
212
  **If no environment files detected:**
213
213
  Skip this section silently, proceed to 5.4.
214
214
 
215
- **5.4 Store worktree config (for sidecar later):**
215
+ **5.5 Store worktree config (for sidecar later):**
216
216
  ```yaml
217
217
  worktree_config:
218
218
  enabled: true