agentic-loop 3.7.0 → 3.7.1

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.
@@ -99,53 +99,83 @@ Break the idea into small, executable stories:
99
99
 
100
100
  - Each story completable in one Claude session (~10-15 min)
101
101
  - Max 3-4 acceptance criteria per story
102
- - Order by dependency
103
102
  - Max 10 stories (suggest phases if more needed)
104
103
  - If appending, start IDs from the next available number
105
104
 
106
- ### Step 5: Validate Test Steps (CRITICAL)
105
+ ### Step 5: Write Draft PRD
107
106
 
108
- **Before writing the PRD, validate EVERY story's testSteps:**
107
+ Write the initial PRD to `.ralph/prd.json`:
109
108
 
110
- For each story, check:
111
- - ❌ **REJECT** if testSteps only use `grep` to check code exists
112
- - **REJECT** if testSteps are human instructions ("Visit the page", "User can see")
113
- - ✅ **REQUIRE** curl commands for backend stories that verify actual API behavior
114
- - ✅ **REQUIRE** `npx tsc --noEmit` for TypeScript frontend stories
115
- - ✅ **REQUIRE** playwright/test commands for UI stories
109
+ 1. Ensure .ralph directory exists:
110
+ ```bash
111
+ mkdir -p .ralph && touch .ralph/.prd-edit-allowed
112
+ ```
116
113
 
117
- **Common mistake to catch:**
118
- ```json
119
- // ❌ This will pass but the feature is broken!
120
- "testSteps": ["grep -q 'myFunction' src/api/users.ts"]
114
+ 2. Write all stories to `.ralph/prd.json`
115
+ - If **appending**: Read existing JSON, add new stories, update count
116
+
117
+ **Do not present to user yet - validation comes next.**
121
118
 
122
- // This actually verifies behavior
123
- "testSteps": ["curl -s {config.urls.backend}/users | jq -e '.data | length >= 0'"]
119
+ ### Step 6: Validate and Fix (MANDATORY)
120
+
121
+ **Read back the PRD you just wrote and validate EVERY story.**
122
+
123
+ ```bash
124
+ cat .ralph/prd.json
124
125
  ```
125
126
 
126
- If a story's testSteps won't catch a broken implementation, FIX THEM before proceeding.
127
+ For EACH story, ask yourself:
127
128
 
128
- ### Step 6: Write PRD
129
+ 1. **"Is this testable?"** - Can the testSteps actually run?
130
+ - ❌ `grep -q 'function' file.py` → Only checks code exists, not behavior
131
+ - ❌ `test -f src/component.tsx` → Only checks file exists
132
+ - ❌ "Visit the page and verify" → Not executable
133
+ - ✅ `curl ... | jq -e` → Tests actual API response
134
+ - ✅ `npm test` / `pytest` → Runs real tests
135
+ - ✅ `npx playwright test` → Runs real tests
129
136
 
130
- 1. Ensure .ralph directory exists and allow PRD edit:
131
- ```bash
132
- mkdir -p .ralph && touch .ralph/.prd-edit-allowed
133
- ```
137
+ 2. **"Is this passable?"** - Given prior stories completed, can this story's tests pass?
138
+ - If TASK-003 needs a user to exist, does TASK-001 or TASK-002 create one?
139
+ - If TASK-004 tests a login flow, does a prior story create the auth endpoint?
140
+
141
+ **Fix any issues you find:**
142
+
143
+ | Problem | Fix |
144
+ |---------|-----|
145
+ | testSteps use grep/test only | Replace with curl, pytest, npm test, playwright |
146
+ | Story depends on something not yet created | Reorder stories or add missing dependency story |
147
+ | testSteps would pass on current code | Strengthen tests to verify NEW behavior |
148
+ | No testSteps for backend story | Add `curl -s {config.urls.backend}/endpoint \| jq -e '.field'` |
149
+ | No testSteps for frontend story | Add `npx tsc --noEmit` + `npm test` |
150
+
151
+ ### Step 7: Reorder if Needed
152
+
153
+ If validation found dependency issues, reorder stories:
134
154
 
135
- 2. Write to `.ralph/prd.json`:
136
- - If **overwriting** or no existing PRD: Create new file with full structure
137
- - If **appending**: Read existing JSON, add new stories to the `stories` array, update `metadata.estimatedStories` count, write back
155
+ 1. Stories that create foundations (DB schemas, base components) come first
156
+ 2. Stories that depend on others come after their dependencies
157
+ 3. Update `dependsOn` arrays to reflect the order
158
+ 4. Re-number story IDs if needed (TASK-001, TASK-002, etc.)
159
+
160
+ **After reordering, re-run Step 6 validation to confirm the new order works.**
161
+
162
+ ### Step 8: Present Final PRD
163
+
164
+ Open the PRD for review:
165
+ ```bash
166
+ open -a TextEdit .ralph/prd.json
167
+ ```
138
168
 
139
- 3. Say: "I've {created|updated} the PRD with {N} stories ({X} new).
169
+ Say: "I've {created|updated} the PRD with {N} stories and opened it in TextEdit.
140
170
 
141
- Review `.ralph/prd.json` and let me know:
142
- - **'approved'** - Ready for `ralph run`
143
- - **'edit [changes]'** - Tell me what to change
144
- - Or edit the JSON directly and say **'done'**"
171
+ Review the PRD and let me know:
172
+ - **'approved'** - Ready for `ralph run`
173
+ - **'edit [changes]'** - Tell me what to change
174
+ - Or edit the JSON directly and say **'done'**"
145
175
 
146
176
  **STOP and wait for user response.**
147
177
 
148
- ### Step 7: Final Instructions
178
+ ### Step 9: Final Instructions
149
179
 
150
180
  Once approved, say:
151
181
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-loop",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "Autonomous AI coding loop - PRD-driven development with Claude Code",
5
5
  "author": "Allie Jones <allie@allthrive.ai>",
6
6
  "license": "MIT",