agentic-loop 3.22.1 → 3.26.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.
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Pick the terminal background color Ralph uses to distinguish its terminal from Claude Code.
3
+ ---
4
+
5
+ # Terminal Color
6
+
7
+ The user wants to change Ralph's terminal background tint - the color applied during `npx agentic-loop run` to visually distinguish Ralph's terminal from Claude Code.
8
+
9
+ > **Note:** This only works in macOS Terminal.app. On other terminals (iTerm2, VS Code, Linux), Ralph skips tinting automatically.
10
+
11
+ ## Step 1: Show Current Color
12
+
13
+ Read `.ralph/config.json` and check for `terminalTint`. Show the current setting:
14
+ - If set: "Current tint: `{value}`"
15
+ - If not set: "Current tint: `#1a2e2e` (default dark teal)"
16
+
17
+ ## Step 2: Ask Color Preference
18
+
19
+ Use AskUserQuestion:
20
+
21
+ **Question:** "What color should Ralph's terminal background be?"
22
+ **Header:** "Tint color"
23
+ **Options:**
24
+ - **Dark Teal (default)** - "`#1a2e2e` - subtle blue-green, easy on the eyes"
25
+ - **Dark Purple** - "`#1a1a2e` - cool and distinct from standard dark themes"
26
+ - **Dark Red** - "`#2e1a1a` - warm undertone, clearly different"
27
+ - **Off** - "Disable terminal tinting entirely"
28
+
29
+ If the user selects "Other", ask them to provide a hex color (e.g., `#2e2e1a`).
30
+
31
+ ## Step 3: Validate (if custom hex)
32
+
33
+ If the user provided a custom hex:
34
+ - Must match `#` followed by exactly 6 hex characters (`/^#[0-9a-fA-F]{6}$/`)
35
+ - If invalid, say "That doesn't look like a valid hex color (e.g., `#1a2e2e`). Try again." and re-ask.
36
+
37
+ ## Step 4: Save to Config
38
+
39
+ Read `.ralph/config.json`, set the `terminalTint` field, and write it back.
40
+
41
+ - **If a color was chosen:** Set `"terminalTint": "#xxxxxx"`
42
+ - **If "Off" was chosen:** Set `"terminalTint": "off"`
43
+
44
+ Use jq to update:
45
+ ```bash
46
+ jq --arg color "THE_HEX_VALUE" '.terminalTint = $color' .ralph/config.json > .ralph/config.json.tmp && mv .ralph/config.json.tmp .ralph/config.json
47
+ ```
48
+
49
+ ## Step 5: Preview (macOS Terminal.app only)
50
+
51
+ If running in Terminal.app, apply the color immediately so the user can see it:
52
+
53
+ ```bash
54
+ # Apply preview (will be restored when Claude session ends)
55
+ osascript -e 'tell application "Terminal" to set background color of front window to {R, G, B}' 2>/dev/null
56
+ ```
57
+
58
+ Where R, G, B are the hex values converted to 16-bit (multiply each 8-bit value by 257).
59
+
60
+ If "Off" was chosen, skip the preview.
61
+
62
+ ## Step 6: Confirm
63
+
64
+ Say:
65
+
66
+ "Done! Ralph will use `#xxxxxx` as the terminal tint.
67
+
68
+ Next time you run `npx agentic-loop run`, the terminal background will change to this color. It restores to your original background when the loop ends.
69
+
70
+ Run `/color` again anytime to change it."
71
+
72
+ If "Off" was chosen, say:
73
+
74
+ "Done! Terminal tinting is now disabled. Ralph will run without changing your terminal background."
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Rename the current terminal tab so you can tell your Claude Code tabs apart.
3
+ ---
4
+
5
+ # Tab Rename
6
+
7
+ The user wants to rename the current terminal tab. This is useful when you have multiple Claude Code sessions open and every tab just shows "...skip-permissions".
8
+
9
+ > **Note:** This uses AppleScript and only works in macOS Terminal.app and iTerm2.
10
+
11
+ ## Step 1: Determine the Tab Name
12
+
13
+ Check if the user provided an argument: `$ARGUMENTS`
14
+
15
+ - **If provided:** Use it as the tab name (e.g., `/tab-rename my-api` → tab name is "my-api").
16
+ - **If not provided:** Auto-detect a sensible name from the project. Read the `name` field from `package.json` if it exists, or use the current directory's basename. Then ask the user to confirm or customize:
17
+
18
+ Use AskUserQuestion:
19
+
20
+ **Question:** "What should this tab be called?"
21
+ **Header:** "Tab name"
22
+ **Options:**
23
+ - **{detected_name}** - "Auto-detected from the project"
24
+ - **Claude: {detected_name}** - "Prefixed to distinguish from Ralph's terminal"
25
+
26
+ If the user selects "Other", use their custom text as the tab name.
27
+
28
+ ## Step 2: Set the Tab Title
29
+
30
+ Detect which terminal is running and set the title:
31
+
32
+ ```bash
33
+ # Try Terminal.app first
34
+ osascript -e 'tell application "Terminal" to set custom title of selected tab of front window to "TAB_NAME"' 2>/dev/null
35
+ ```
36
+
37
+ If that fails (not Terminal.app), try iTerm2:
38
+
39
+ ```bash
40
+ osascript -e 'tell application "iTerm2" to tell current session of current window to set name to "TAB_NAME"' 2>/dev/null
41
+ ```
42
+
43
+ **Important:** Escape any double quotes in the tab name before embedding in the AppleScript string.
44
+
45
+ ## Step 3: Confirm
46
+
47
+ If the rename succeeded, say:
48
+
49
+ "Tab renamed to **{tab_name}**."
50
+
51
+ If both osascript commands fail, say:
52
+
53
+ "Tab renaming requires macOS Terminal.app or iTerm2. On other terminals, you can set the tab title manually with: `printf '\033]0;my-title\007'`"
@@ -337,7 +337,7 @@ Quick Reference
337
337
  ───────────────
338
338
 
339
339
  Workflow:
340
- /idea [feature] Brainstorm → PRD
340
+ /prd [feature] Brainstorm → PRD
341
341
  npx ralph run Execute autonomously
342
342
  npx ralph status Check progress
343
343
  npx ralph stop Stop after current story
@@ -354,4 +354,4 @@ Other:
354
354
  /vibe-help Full cheatsheet
355
355
  ```
356
356
 
357
- Say: "You're all set! Run `/idea [your next feature]` to get started."
357
+ Say: "You're all set! Run `/prd [your next feature]` to get started."
@@ -11,7 +11,7 @@ Print this cheatsheet for the user. Do not add any commentary or explanation.
11
11
  ## The Loop
12
12
 
13
13
  ```
14
- /idea [feature] brainstorm & generate PRD
14
+ /prd [feature] brainstorm & generate PRD
15
15
  npx ralph run autonomous coding loop (live activity feed)
16
16
  npx ralph run --quiet same, but suppress activity feed
17
17
  npx ralph status check progress
@@ -12,7 +12,7 @@ Print this complete reference for the user. Do not add any commentary.
12
12
 
13
13
  | Command | Description |
14
14
  |---------|-------------|
15
- | `/idea [feature]` | Brainstorm in plan mode, generate PRD for Ralph |
15
+ | `/prd [feature]` | Brainstorm feature, generate executable PRD for Ralph |
16
16
  | `/setup-review` | Review config against project, fix mismatches |
17
17
  | `/sign` | Add a learned pattern for Ralph to remember |
18
18
  | `/my-dna` | Set up your personal style preferences |
@@ -90,7 +90,7 @@ Print this complete reference for the user. Do not add any commentary.
90
90
  ## The Loop
91
91
 
92
92
  ```
93
- /idea [feature] Brainstorm → PRD
93
+ /prd [feature] Brainstorm → PRD
94
94
  npx ralph run Autonomous coding
95
95
  npx ralph status Check progress
96
96
  npx ralph stop Stop after current story
@@ -100,10 +100,10 @@ npx ralph stop Stop after current story
100
100
 
101
101
  ## Slash Command Details
102
102
 
103
- ### /idea [feature description]
104
- Brainstorm in plan mode, explore codebase, ask clarifying questions.
105
- - Writes idea to `docs/ideas/{feature}.md`
106
- - On approval, splits into PRD stories
103
+ ### /prd [feature description]
104
+ Brainstorm feature, explore codebase, ask clarifying questions.
105
+ - Accepts a description or plan file (`docs/ideas/{feature}.md`)
106
+ - Splits into executable PRD stories
107
107
  - Writes to `.ralph/prd.json`
108
108
 
109
109
  ### /review [file or selection]
@@ -206,7 +206,7 @@ npx ralph unsign "camelCase"
206
206
 
207
207
  CLAUDE.md # Project standards (shared with team)
208
208
  PROMPT.md # Base prompt for Ralph sessions
209
- docs/ideas/ # Brainstorm outputs from /idea
209
+ docs/ideas/ # Brainstorm outputs from /prd
210
210
 
211
211
  # Global files (your home directory)
212
212
  ~/.claude/
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Pick the terminal background color Ralph uses to distinguish its terminal from Claude Code.
3
+ ---
4
+
5
+ # Terminal Color
6
+
7
+ The user wants to change Ralph's terminal background tint - the color applied during `npx agentic-loop run` to visually distinguish Ralph's terminal from Claude Code.
8
+
9
+ > **Note:** This only works in macOS Terminal.app. On other terminals (iTerm2, VS Code, Linux), Ralph skips tinting automatically.
10
+
11
+ ## Step 1: Show Current Color
12
+
13
+ Read `.ralph/config.json` and check for `terminalTint`. Show the current setting:
14
+ - If set: "Current tint: `{value}`"
15
+ - If not set: "Current tint: `#1a2e2e` (default dark teal)"
16
+
17
+ ## Step 2: Ask Color Preference
18
+
19
+ Use AskUserQuestion:
20
+
21
+ **Question:** "What color should Ralph's terminal background be?"
22
+ **Header:** "Tint color"
23
+ **Options:**
24
+ - **Dark Teal (default)** - "`#1a2e2e` - subtle blue-green, easy on the eyes"
25
+ - **Dark Purple** - "`#1a1a2e` - cool and distinct from standard dark themes"
26
+ - **Dark Red** - "`#2e1a1a` - warm undertone, clearly different"
27
+ - **Off** - "Disable terminal tinting entirely"
28
+
29
+ If the user selects "Other", ask them to provide a hex color (e.g., `#2e2e1a`).
30
+
31
+ ## Step 3: Validate (if custom hex)
32
+
33
+ If the user provided a custom hex:
34
+ - Must match `#` followed by exactly 6 hex characters (`/^#[0-9a-fA-F]{6}$/`)
35
+ - If invalid, say "That doesn't look like a valid hex color (e.g., `#1a2e2e`). Try again." and re-ask.
36
+
37
+ ## Step 4: Save to Config
38
+
39
+ Read `.ralph/config.json`, set the `terminalTint` field, and write it back.
40
+
41
+ - **If a color was chosen:** Set `"terminalTint": "#xxxxxx"`
42
+ - **If "Off" was chosen:** Set `"terminalTint": "off"`
43
+
44
+ Use jq to update:
45
+ ```bash
46
+ jq --arg color "THE_HEX_VALUE" '.terminalTint = $color' .ralph/config.json > .ralph/config.json.tmp && mv .ralph/config.json.tmp .ralph/config.json
47
+ ```
48
+
49
+ ## Step 5: Preview (macOS Terminal.app only)
50
+
51
+ If running in Terminal.app, apply the color immediately so the user can see it:
52
+
53
+ ```bash
54
+ # Apply preview (will be restored when Claude session ends)
55
+ osascript -e 'tell application "Terminal" to set background color of front window to {R, G, B}' 2>/dev/null
56
+ ```
57
+
58
+ Where R, G, B are the hex values converted to 16-bit (multiply each 8-bit value by 257).
59
+
60
+ If "Off" was chosen, skip the preview.
61
+
62
+ ## Step 6: Confirm
63
+
64
+ Say:
65
+
66
+ "Done! Ralph will use `#xxxxxx` as the terminal tint.
67
+
68
+ Next time you run `npx agentic-loop run`, the terminal background will change to this color. It restores to your original background when the loop ends.
69
+
70
+ Run `/color` again anytime to change it."
71
+
72
+ If "Off" was chosen, say:
73
+
74
+ "Done! Terminal tinting is now disabled. Ralph will run without changing your terminal background."
@@ -95,8 +95,10 @@ Use a marker `<!-- my-dna -->` to identify the section. If marker exists, replac
95
95
  ### Core Values
96
96
  - [List their selected values]
97
97
 
98
- ### Voice
98
+ ### Writing Style (responses and all file content)
99
99
  [Their style + any notes from writing sample]
100
+ - Never use em dashes. Use commas, periods, or parentheses instead.
101
+ Apply this style to everything: responses, code comments, docs, page copy, commit messages, and any content written to files.
100
102
 
101
103
  ### Project
102
104
  - **Priority:** [ship it / solid / beautiful / scale]
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Generate an executable PRD for Ralph from an idea file or description.
2
+ description: Brainstorm, harden, and generate an executable PRD for Ralph from a description, idea file, or plan file.
3
3
  ---
4
4
 
5
5
  # /prd - Generate PRD for Ralph
@@ -19,21 +19,27 @@ $ARGUMENTS
19
19
  ### Step 1: Determine Input Type
20
20
 
21
21
  **If `$ARGUMENTS` is empty:**
22
- 1. Check for idea files:
22
+ 1. Scan for existing source files:
23
23
  ```bash
24
- ls docs/ideas/*.md 2>/dev/null || echo "No ideas found"
24
+ ls docs/ideas/*.md 2>/dev/null || echo "No idea files found"
25
+ ls docs/plans/*.md 2>/dev/null || echo "No plan files found"
25
26
  ```
26
- 2. Ask: "Would you like to:
27
- - Convert an idea file (e.g., `/prd auth` for `docs/ideas/auth.md`)
27
+ 2. List what's available and ask: "Would you like to:
28
+ - Convert a source file (e.g., `/prd auth` or `/prd plans/my-feature`)
28
29
  - Describe a feature directly (e.g., `/prd 'Add user logout button'`)"
29
30
 
30
- **If `$ARGUMENTS` looks like a file reference** (no spaces, matches `docs/ideas/*.md`):
31
+ **If `$ARGUMENTS` looks like a plan file** (`plans/` prefix, `docs/plans/` path, or full path to a plan file):
31
32
  - If it's a full path, use it directly
32
- - If it's just a name like `content-engine`, look for `docs/ideas/content-engine.md`
33
+ - If it's `plans/name` or just a prefix, look for `docs/plans/{name}.md`
34
+ - Proceed to "Read and Understand the Plan"
35
+
36
+ **If `$ARGUMENTS` looks like an idea file reference** (no spaces, matches `docs/ideas/*.md`):
37
+ - If it's a full path, use it directly
38
+ - If it's just a name like `content-engine`, check `docs/ideas/content-engine.md` first, fall back to `docs/plans/content-engine.md`
33
39
  - Proceed to "Read and Understand the Idea"
34
40
 
35
41
  **If `$ARGUMENTS` is a description** (has spaces, is a sentence):
36
- - This is the **quick PRD flow** - no `docs/ideas/` file created
42
+ - This is the **quick PRD flow** - no source file created
37
43
  - Good for small features that don't need documentation
38
44
  - Skip to "Confirm Understanding" below
39
45
 
@@ -48,9 +54,9 @@ Say: "I've read `{path}`. Here's my understanding:
48
54
  **Solution:** {one line}
49
55
  **Scope:** {key items}
50
56
 
51
- I'll now split this into {N} stories for Ralph. Continue?"
57
+ I'll now ask a few hardening questions before generating stories."
52
58
 
53
- **STOP and wait for user confirmation.**
59
+ **Proceed to Step 2.5.**
54
60
 
55
61
  ### Step 2b: Confirm Understanding (from description)
56
62
 
@@ -65,12 +71,58 @@ Use the detected tech stack, test runners, and constraints when building each st
65
71
 
66
72
  Then say: "I'll create a PRD for: **{description}**
67
73
 
68
- Before I generate stories, quick questions:
69
- 1. **Type:** Frontend or backend?
70
- 2. **Scale:** Any specific limits (users, items, rate limits)?
71
- 3. **Anything else** I should know?
74
+ Here's what I found in your codebase: [brief summary of tech stack, existing patterns]
75
+
76
+ I'll now ask a few hardening questions before generating stories."
77
+
78
+ **Proceed to Step 2.5.**
79
+
80
+ ### Step 2c: Read and Understand the Plan (from plan file)
81
+
82
+ Read the plan file and summarize:
83
+
84
+ Say: "I've read `{path}`. Here's my understanding:
85
+
86
+ **Feature/Goal:** {name}
87
+ **Approach:** {summary of approach}
88
+ **Key Files:** {files mentioned}
89
+ **Scope:** {key items}
90
+
91
+ I'll now ask a few hardening questions before generating stories."
92
+
93
+ **Proceed to Step 2.5.**
94
+
95
+ ### Step 2.5: Harden the Requirements
72
96
 
73
- (Or say 'go' to proceed with defaults)"
97
+ **This step runs for ALL input types** (idea file, plan file, or description). Review what you already know from the input and ask ONLY about gaps — skip questions the input already answers.
98
+
99
+ Say: "Before I generate stories, I want to make sure we've covered the key areas:"
100
+
101
+ **Scope & UX** (always ask):
102
+ - What's in scope vs out of scope?
103
+ - Is this user-facing? What does the user see/do?
104
+ - What are the edge cases?
105
+ - **Responsive design** (if frontend): Must it work on mobile/tablet? What breakpoints? Any layout changes between screen sizes?
106
+
107
+ **Security** (ask if feature involves auth, user input, or sensitive data):
108
+ - Authentication: Who can access this? Login required?
109
+ - Passwords: How stored? (must be hashed, never plain text)
110
+ - User input: What validation needed? (SQL injection, XSS)
111
+ - Sensitive data: What should NEVER be in API responses?
112
+ - Rate limiting: Should this be rate limited?
113
+
114
+ **Scale** (ask if feature involves lists, data, or APIs):
115
+ - How many items expected? (10s, 1000s, millions?)
116
+ - Pagination needed? What's the max per page?
117
+ - Caching needed? How fresh must data be?
118
+ - Database indexes: What will be queried/sorted frequently?
119
+
120
+ **Migration** (ask if feature involves restructuring or moving code):
121
+ - Source → destination mapping: Where does code currently live? Where should it end up?
122
+ - Phases: What's the logical order?
123
+ - Verification: What commands prove each phase worked?
124
+
125
+ End with: "(Or say **'go'** to proceed with defaults for anything not answered)"
74
126
 
75
127
  **STOP and wait for user input** (can be brief or 'go').
76
128
 
@@ -95,6 +147,26 @@ If user chooses **'append'**:
95
147
  - **Always use TASK- prefix** for new stories (e.g., if highest is US-005 or TASK-005, new stories start at TASK-006)
96
148
  - New stories will be added after existing ones
97
149
 
150
+ ### Step 3.5: Read Existing Test Infrastructure
151
+
152
+ Before writing stories, discover the project's existing test setup so stories reference real fixtures, helpers, and patterns:
153
+
154
+ ```bash
155
+ # Find test config and fixtures
156
+ ls tests/conftest.py tests/fixtures/ src/__tests__/ e2e/ 2>/dev/null
157
+ cat tests/conftest.py 2>/dev/null | head -50
158
+ cat e2e/*.config.ts 2>/dev/null | head -30
159
+
160
+ # Find existing test patterns
161
+ grep -r "def test_\|async def test_\|it(\|describe(" tests/ src/__tests__/ e2e/ 2>/dev/null | head -20
162
+ ```
163
+
164
+ Use what you find to:
165
+ - Reference correct fixture names in story `notes` (e.g., "Use `db_session` and `client` fixtures from `conftest.py`")
166
+ - Match existing test file organization (e.g., `tests/domains/auth/` not `tests/test_auth.py`)
167
+ - Include specific test scenarios in `notes` based on patterns you see in existing tests
168
+ - Reference real helpers (e.g., "Use `MockRequest` from `test_auth.py` for request mocking")
169
+
98
170
  ### Step 4: Split into Stories
99
171
 
100
172
  Break the idea into small, executable stories:
@@ -156,12 +228,54 @@ Does acceptanceCriteria include:
156
228
  - Large datasets → "Database query uses index on [column]"
157
229
 
158
230
  #### 6e. Context (for all stories)
159
- - Does `contextFiles` include the idea file (has ASCII mockups)?
231
+ - Does `contextFiles` include the source file (idea or plan file, especially if it has ASCII mockups)?
160
232
  - Does `contextFiles` include styleguide (if exists)?
161
233
  - Does `techStack` include the relevant stack for this story?
162
234
  - Does `constraints` include any rules this story must follow?
163
235
  - For frontend: Is `testUrl` set?
164
236
  - For frontend: Is `mcp` set to `["playwright", "devtools"]`?
237
+ - For frontend: Does `notes` include Playwright MCP visual verification instructions? (See "Playwright MCP for Visual Verification" section below)
238
+
239
+ #### 6f. E2E Coverage (MANDATORY for user-facing features)
240
+ If the feature has ANY frontend stories that add or modify user-facing UI:
241
+ - There MUST be at least one story with `"e2e"` in its `testing.types`
242
+ - That story MUST have Playwright test files in `testing.files.e2e`
243
+ - That story's `testSteps` MUST include `npx playwright test ...`
244
+ - The E2E story should be the LAST story (depends on all others) to test the full integrated flow
245
+ - If no E2E story exists, CREATE one as the final story
246
+
247
+ #### 6h. Responsive Design (for frontend stories)
248
+ Every frontend story that creates or modifies user-facing UI MUST include:
249
+ - `acceptanceCriteria` with responsive behavior: "Layout adapts to mobile (< 768px), tablet (768-1024px), and desktop (> 1024px)"
250
+ - `testSteps` with a viewport resize check OR Playwright test that validates mobile layout
251
+ - `notes` with Playwright MCP instructions to screenshot at mobile and desktop widths
252
+
253
+ **Example acceptanceCriteria:**
254
+ ```
255
+ "Component renders in single-column layout on mobile (< 768px)",
256
+ "Navigation collapses to hamburger menu on mobile",
257
+ "Touch targets are at least 44x44px on mobile"
258
+ ```
259
+
260
+ **Example testSteps:**
261
+ ```
262
+ "npx playwright test tests/e2e/dashboard.spec.ts --project=mobile"
263
+ ```
264
+
265
+ If a frontend story has no responsive criteria and the feature is user-facing, add them.
266
+
267
+ #### 6g. Test Scenario Specificity
268
+ Every story's `notes` field MUST include **3+ specific test scenarios** that describe what to test and how. Vague notes like "Test the service methods" are not acceptable.
269
+
270
+ Good example:
271
+ ```
272
+ "notes": "Test scenarios: (1) Exchange valid auth code → returns JWT with correct claims. (2) Exchange expired code → returns 401 with 'code_expired' error. (3) Exchange code with wrong redirect_uri → returns 400. (4) Verify nonce mismatch is rejected. Use existing test fixtures: db_session, client from conftest.py."
273
+ ```
274
+
275
+ Bad example:
276
+ ```
277
+ "notes": "Test the authentication service methods with proper mocking."
278
+ ```
165
279
 
166
280
  **Fix any issues you find:**
167
281
 
@@ -172,11 +286,16 @@ Does acceptanceCriteria include:
172
286
  | Story depends on something not created | Reorder or add missing dependency |
173
287
  | Auth story missing security criteria | Add password hashing, rate limiting to acceptanceCriteria |
174
288
  | List endpoint missing pagination | Add pagination criteria to acceptanceCriteria |
175
- | Frontend missing contextFiles | Add idea file + styleguide paths |
289
+ | Frontend missing contextFiles | Add source file (idea or plan) + styleguide paths |
176
290
  | Frontend missing testUrl | Add URL from config |
177
291
  | Frontend missing mcp | Add `"mcp": ["playwright", "devtools"]` |
292
+ | Frontend notes missing Playwright MCP guidance | Add visual verification instructions to notes (see Playwright MCP section) |
178
293
  | Story missing techStack | Add relevant subset of detected tech |
179
294
  | Story missing constraints | Add applicable rules for this story |
295
+ | testSteps use import-checks (`python -c "from X import Y"`) | Replace with curl, pytest, or real behavioral tests |
296
+ | No E2E story for user-facing feature | Add a final E2E story with Playwright tests |
297
+ | Story notes lack specific test scenarios | Add 3+ concrete scenarios with inputs, expected outputs, and fixture references |
298
+ | Frontend story missing responsive design | Add mobile/tablet/desktop acceptanceCriteria and viewport test steps |
180
299
 
181
300
  ### Step 7: Reorder if Needed
182
301
 
@@ -228,7 +347,7 @@ Once approved, say:
228
347
 
229
348
  "PRD is ready!
230
349
 
231
- **Source:** `{idea-file-path}`
350
+ **Source:** `{source-file-path}`
232
351
  **PRD:** `.ralph/prd.json` ({N} stories)
233
352
 
234
353
  To start autonomous development, open another terminal and run:
@@ -250,7 +369,7 @@ Ralph will work through each story, running tests and committing as it goes."
250
369
  {
251
370
  "feature": {
252
371
  "name": "Feature Name",
253
- "ideaFile": "docs/ideas/{feature-name}.md",
372
+ "ideaFile": "docs/ideas/{feature-name}.md or docs/plans/{feature-name}.md",
254
373
  "branch": "feature/{feature-name}",
255
374
  "status": "pending"
256
375
  },
@@ -358,7 +477,7 @@ Ralph will work through each story, running tests and committing as it goes."
358
477
 
359
478
  | Field | Required | Description |
360
479
  |-------|----------|-------------|
361
- | `feature` | Yes | Feature name, ideaFile, branch, status |
480
+ | `feature` | Yes | Feature name, ideaFile (idea or plan path), branch, status |
362
481
  | `metadata` | Yes | Created date, estimated stories, complexity |
363
482
 
364
483
  **Note:** URLs come from `.ralph/config.json`, not the PRD. Use `{config.urls.backend}` in testSteps.
@@ -583,9 +702,30 @@ Specify which MCP tools Claude should use for verification:
583
702
  | `devtools` | Console errors, network inspection, DOM debugging |
584
703
  | `postgres` | Database verification (future) |
585
704
 
586
- **Frontend stories** default to `["playwright", "devtools"]`.
705
+ **Frontend stories** MUST have `"mcp": ["playwright", "devtools"]`.
587
706
  **Backend-only stories** can use `[]` or omit.
588
707
 
708
+ ### Playwright MCP for Visual Verification
709
+
710
+ Frontend stories should include guidance in `notes` for using Playwright MCP during implementation. This is how Ralph visually verifies that UI changes actually render correctly — screenshots catch layout bugs, missing elements, and broken styles that unit tests miss.
711
+
712
+ **Every frontend story's `notes` should include Playwright MCP instructions like:**
713
+
714
+ ```
715
+ Use Playwright MCP to verify:
716
+ 1. Navigate to {testUrl} and take a screenshot
717
+ 2. Verify [specific element] is visible and correctly styled
718
+ 3. Click [interactive element] and verify [expected behavior]
719
+ 4. Check browser console for errors after interactions
720
+ ```
721
+
722
+ **Example for a login page SSO button story:**
723
+ ```json
724
+ "notes": "Use Playwright MCP to verify: navigate to /login, screenshot the page, confirm 'Sign in with Okta' button is visible below the email/password form with a divider. Click the button and verify it redirects to /api/v1/auth/okta/authorize. Check devtools console for errors."
725
+ ```
726
+
727
+ This is NOT a replacement for automated Playwright tests — it's additional visual verification that Ralph performs during the implementation step using the MCP browser tools.
728
+
589
729
  ---
590
730
 
591
731
  ## Skills Reference
@@ -697,11 +837,15 @@ Ralph reads `.ralph/config.json` and expands `{config.urls.backend}` before runn
697
837
  "grep -q 'function createUser' app/services/user.py", // ❌ PASSES if code exists, even if broken
698
838
  "grep -q 'export default' src/components/Dashboard.tsx", // ❌ PASSES even if component crashes
699
839
  "test -f src/api/users.ts", // ❌ PASSES if file exists, even if empty
840
+ "python -c \"from app.services.auth import AuthService\"", // ❌ PASSES if import works, says nothing about behavior
841
+ "python -c \"hasattr(AuthService, 'login')\"", // ❌ PASSES if method exists, even if completely broken
700
842
  "Visit http://localhost:3000/dashboard", // ❌ Not executable
701
843
  "User can see the dashboard" // ❌ Not executable
702
844
  ]
703
845
  ```
704
846
 
847
+ **NEVER use import-checks (`python -c "from X import Y"` or `hasattr`) as test steps.** These only verify a symbol exists — they don't test behavior, error handling, or integration. A function that raises on every call still passes an import check.
848
+
705
849
  **NEVER use grep/test to verify behavior.** These will mark stories as PASSED when the feature is broken.
706
850
 
707
851
  **If a step can't be automated**, put it in `acceptanceCriteria` instead. Claude will verify it visually using MCP tools.
@@ -715,6 +859,7 @@ Use `contextFiles` to point Claude to important reference material:
715
859
  ```json
716
860
  "contextFiles": [
717
861
  "docs/ideas/dashboard.md",
862
+ "docs/plans/auth-feature.md",
718
863
  "src/styles/styleguide.html",
719
864
  "docs/api-spec.md"
720
865
  ]
@@ -736,7 +881,9 @@ This is where ASCII mockups, design specs, and detailed requirements live. Claud
736
881
  ### UI Stories Must Include
737
882
  - `testUrl` - Where to verify
738
883
  - `mcp: ["playwright", "devtools"]` - Browser tools
739
- - Acceptance criteria for: page loads, elements render, mobile works
884
+ - Acceptance criteria for: page loads, elements render correctly
885
+ - **Responsive design criteria**: layout adapts at mobile (< 768px), tablet (768-1024px), desktop (> 1024px) breakpoints
886
+ - Playwright test or MCP verification at multiple viewport widths
740
887
 
741
888
  ### API Stories Must Include
742
889
  - `apiContract` - Expected request/response