ralphie 1.0.0 → 1.1.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.
- package/README.md +79 -22
- package/dist/cli.js +2982 -2701
- package/package.json +12 -4
- package/skills/SKILLS.md +69 -0
- package/skills/ralphie-iterate/SKILL.md +264 -751
- package/skills/ralphie-spec/SKILL.md +359 -0
- package/skills/review-spec/SKILL.md +367 -218
- package/templates/.claude/ralphie.md +2 -2
- package/templates/RALPHIE.md +87 -59
- package/templates/specs/active/.gitkeep +0 -0
- package/templates/specs/completed/.gitkeep +0 -0
- package/templates/specs/lessons.md +18 -0
- package/templates/specs/templates/bugfix.md +66 -0
- package/templates/specs/templates/feature.md +56 -0
- package/templates/specs/templates/refactor.md +80 -0
- package/skills/create-spec/SKILL.md +0 -222
- package/templates/.claude/skills/create-spec/SKILL.md +0 -222
- package/templates/.claude/skills/ralphie-iterate/SKILL.md +0 -959
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ralphie-spec
|
|
3
|
+
description: Generate project specifications in V2 format through structured user interviews. Requires user presence.
|
|
4
|
+
context: fork
|
|
5
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
author: ralphie
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
argument-hint: <project-description>
|
|
11
|
+
install-hint: npx add-skill skylarbarrera/ralphie --skill ralphie-spec
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Ralphie Spec Generation (V2 Format)
|
|
15
|
+
|
|
16
|
+
Generate comprehensive specs using the V2 format with task IDs, status tracking, and size-based budgeting through structured interviews with the user.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- User is present and can answer questions
|
|
21
|
+
- Complex projects needing clarification
|
|
22
|
+
- When requirements need discussion
|
|
23
|
+
|
|
24
|
+
## Output Location
|
|
25
|
+
|
|
26
|
+
Write specs to `specs/active/{name}.md`:
|
|
27
|
+
|
|
28
|
+
- Generate a kebab-case filename from the description
|
|
29
|
+
- Example: "user authentication" → `specs/active/user-authentication.md`
|
|
30
|
+
- Only one spec allowed in `specs/active/` at a time
|
|
31
|
+
|
|
32
|
+
## Workflow
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Interview User → Explore Codebase → Draft Tasks → Size Review → Write V2 Spec → Present for Approval
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 1: Interview User
|
|
41
|
+
|
|
42
|
+
Use AskUserQuestion to gather requirements in batches of 2-4 questions.
|
|
43
|
+
|
|
44
|
+
### Batch 1: Project Foundation
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
AskUserQuestion({
|
|
48
|
+
questions: [
|
|
49
|
+
{
|
|
50
|
+
question: "What type of project is this?",
|
|
51
|
+
header: "Type",
|
|
52
|
+
multiSelect: false,
|
|
53
|
+
options: [
|
|
54
|
+
{ label: "CLI tool", description: "Command-line application" },
|
|
55
|
+
{ label: "Web API", description: "REST/GraphQL backend" },
|
|
56
|
+
{ label: "Library", description: "Reusable package" },
|
|
57
|
+
{ label: "Full-stack", description: "Frontend + backend" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
question: "What language/framework?",
|
|
62
|
+
header: "Stack",
|
|
63
|
+
multiSelect: false,
|
|
64
|
+
options: [
|
|
65
|
+
{ label: "TypeScript/Node.js (Recommended)", description: "Modern JS with types" },
|
|
66
|
+
{ label: "Python", description: "Great for data, ML, scripting" },
|
|
67
|
+
{ label: "Go", description: "Fast, good for systems" },
|
|
68
|
+
{ label: "Rust", description: "Memory-safe systems" }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Batch 2: Requirements
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
AskUserQuestion({
|
|
79
|
+
questions: [
|
|
80
|
+
{
|
|
81
|
+
question: "What is the primary use case?",
|
|
82
|
+
header: "Use Case",
|
|
83
|
+
multiSelect: false,
|
|
84
|
+
options: [
|
|
85
|
+
{ label: "Internal tool", description: "Used by your team" },
|
|
86
|
+
{ label: "Public product", description: "External users" },
|
|
87
|
+
{ label: "Library/SDK", description: "For other developers" },
|
|
88
|
+
{ label: "Learning/experiment", description: "Personal project" }
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
question: "What's the testing expectation?",
|
|
93
|
+
header: "Testing",
|
|
94
|
+
multiSelect: false,
|
|
95
|
+
options: [
|
|
96
|
+
{ label: "Unit tests only (Recommended)", description: "Test individual functions" },
|
|
97
|
+
{ label: "Unit + Integration", description: "Test components together" },
|
|
98
|
+
{ label: "Full coverage", description: "Unit + Integration + E2E" },
|
|
99
|
+
{ label: "Minimal/none", description: "Prototype or spike" }
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
})
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Batch 3: Scope
|
|
107
|
+
|
|
108
|
+
Follow up based on previous answers:
|
|
109
|
+
- "What external services or APIs does this integrate with?"
|
|
110
|
+
- "Are there auth requirements? (none / basic / OAuth)"
|
|
111
|
+
- "What's the priority: MVP or full feature set?"
|
|
112
|
+
|
|
113
|
+
### Interview Tips
|
|
114
|
+
|
|
115
|
+
- If answers are vague, ask for specific examples
|
|
116
|
+
- Clarify: "Is X a must-have or nice-to-have?"
|
|
117
|
+
- Don't proceed until core requirements are clear
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Step 2: Explore Codebase
|
|
122
|
+
|
|
123
|
+
If this is a brownfield project (existing code), explore it:
|
|
124
|
+
|
|
125
|
+
### 2.1 Check for Existing Code
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
ls package.json pyproject.toml go.mod Cargo.toml 2>/dev/null
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 2.2 Understand Structure
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Glob("src/**/*")
|
|
135
|
+
Glob("lib/**/*")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 2.3 Read Context
|
|
139
|
+
|
|
140
|
+
- `README.md` - Project description
|
|
141
|
+
- `CLAUDE.md` - AI instructions
|
|
142
|
+
- `specs/lessons.md` - Past learnings to apply
|
|
143
|
+
- Main entry points
|
|
144
|
+
|
|
145
|
+
### 2.4 Detect Patterns
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Grep("export function", path="src/")
|
|
149
|
+
Grep("(describe|test)\\(", path="tests/")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Step 3: Draft Tasks with Sizes
|
|
155
|
+
|
|
156
|
+
Before writing the spec, draft tasks and estimate sizes.
|
|
157
|
+
|
|
158
|
+
### Size Guidelines
|
|
159
|
+
|
|
160
|
+
| Size | Points | Criteria | Examples |
|
|
161
|
+
|------|--------|----------|----------|
|
|
162
|
+
| S | 1 | Single file, simple logic, < 50 lines | Config setup, type definition, simple util |
|
|
163
|
+
| M | 2 | Multiple files, moderate logic, 50-200 lines | CRUD endpoint, feature module |
|
|
164
|
+
| L | 4 | Complex feature, architectural changes, 200+ lines | Auth system, major refactor |
|
|
165
|
+
|
|
166
|
+
### Draft Format
|
|
167
|
+
|
|
168
|
+
Create a mental or written draft:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
T001: Setup project structure [S]
|
|
172
|
+
T002: Implement core data model [M]
|
|
173
|
+
T003: Add authentication [L]
|
|
174
|
+
T004: Create API endpoints [M]
|
|
175
|
+
T005: Add tests [M]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Step 4: Size Review with User
|
|
181
|
+
|
|
182
|
+
Present the task breakdown and ask for size confirmation:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
AskUserQuestion({
|
|
186
|
+
questions: [
|
|
187
|
+
{
|
|
188
|
+
question: "Here's my task breakdown with size estimates. Do these sizes seem accurate?",
|
|
189
|
+
header: "Sizes",
|
|
190
|
+
multiSelect: false,
|
|
191
|
+
options: [
|
|
192
|
+
{ label: "Looks good", description: "Proceed with these estimates" },
|
|
193
|
+
{ label: "Some too small", description: "I'll bump up specific tasks" },
|
|
194
|
+
{ label: "Some too large", description: "Let's split into smaller tasks" },
|
|
195
|
+
{ label: "Discuss changes", description: "I have specific feedback" }
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Show the summary:
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
## Proposed Tasks
|
|
206
|
+
|
|
207
|
+
| ID | Task | Size | Points |
|
|
208
|
+
|----|------|------|--------|
|
|
209
|
+
| T001 | Setup project structure | S | 1 |
|
|
210
|
+
| T002 | Implement core data model | M | 2 |
|
|
211
|
+
| T003 | Add authentication | L | 4 |
|
|
212
|
+
| T004 | Create API endpoints | M | 2 |
|
|
213
|
+
| T005 | Add tests | M | 2 |
|
|
214
|
+
|
|
215
|
+
**Total: 11 points** (~3 iterations at 4 pts/iteration)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Adjust based on feedback before writing the spec.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Step 5: Write V2 Spec
|
|
223
|
+
|
|
224
|
+
### Format
|
|
225
|
+
|
|
226
|
+
```markdown
|
|
227
|
+
# Feature Name
|
|
228
|
+
|
|
229
|
+
Goal: One-sentence description of what this achieves when complete.
|
|
230
|
+
|
|
231
|
+
## Context
|
|
232
|
+
|
|
233
|
+
Background information for the agent implementing this spec:
|
|
234
|
+
- What problem does this solve?
|
|
235
|
+
- What existing code/patterns should it follow?
|
|
236
|
+
- Any constraints or requirements?
|
|
237
|
+
|
|
238
|
+
## Tasks
|
|
239
|
+
|
|
240
|
+
### T001: First task title
|
|
241
|
+
- Status: pending
|
|
242
|
+
- Size: S
|
|
243
|
+
|
|
244
|
+
**Deliverables:**
|
|
245
|
+
- What to build (WHAT, not HOW)
|
|
246
|
+
- Another deliverable
|
|
247
|
+
|
|
248
|
+
**Verify:** `npm test -- something`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### T002: Second task title
|
|
253
|
+
- Status: pending
|
|
254
|
+
- Size: M
|
|
255
|
+
|
|
256
|
+
**Deliverables:**
|
|
257
|
+
- Deliverable description
|
|
258
|
+
- Another deliverable
|
|
259
|
+
|
|
260
|
+
**Verify:** `curl localhost:3000/api` returns 200
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
### T003: Third task title
|
|
265
|
+
- Status: pending
|
|
266
|
+
- Size: S
|
|
267
|
+
|
|
268
|
+
**Deliverables:**
|
|
269
|
+
- Deliverable description
|
|
270
|
+
|
|
271
|
+
**Verify:** `npm run type-check` passes
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Acceptance Criteria
|
|
276
|
+
|
|
277
|
+
- WHEN user does X, THEN Y happens
|
|
278
|
+
- WHEN condition Z, THEN expected outcome
|
|
279
|
+
|
|
280
|
+
## Notes
|
|
281
|
+
|
|
282
|
+
<!-- AI updates this section during implementation -->
|
|
283
|
+
|
|
284
|
+
### Interview Summary
|
|
285
|
+
- Project type: [from interview]
|
|
286
|
+
- Stack: [from interview]
|
|
287
|
+
- Key decisions: [from interview]
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### V2 Format Rules
|
|
291
|
+
|
|
292
|
+
| Element | Format | Example |
|
|
293
|
+
|---------|--------|---------|
|
|
294
|
+
| Task ID | `### T###:` | `### T001: Setup database` |
|
|
295
|
+
| Status | `- Status: pending` | Always `pending` for new specs |
|
|
296
|
+
| Size | `- Size: S\|M\|L` | `- Size: M` |
|
|
297
|
+
| Deliverables | `**Deliverables:**` + bullets | See template |
|
|
298
|
+
| Verify | `**Verify:**` + command | `**Verify:** \`npm test\`` |
|
|
299
|
+
| Separator | `---` between tasks | Required |
|
|
300
|
+
|
|
301
|
+
### Content Rules
|
|
302
|
+
|
|
303
|
+
| Rule | Do | Don't |
|
|
304
|
+
|------|-----|-------|
|
|
305
|
+
| Task count | 3-10 total | 20+ micro-tasks |
|
|
306
|
+
| IDs | Sequential T001, T002... | T1, Task-1, random |
|
|
307
|
+
| Status | Always `pending` for new specs | Leave blank |
|
|
308
|
+
| Size | User-confirmed estimates | Skip or guess |
|
|
309
|
+
| Sub-bullets | Deliverables (WHAT) | Instructions (HOW) |
|
|
310
|
+
| Code | Only in **Verify:** | In task descriptions |
|
|
311
|
+
| File paths | Never in tasks | `src/auth.ts:42` |
|
|
312
|
+
| Batching | Related work = 1 task | Split into tiny pieces |
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Step 6: Present for Approval
|
|
317
|
+
|
|
318
|
+
Write spec to `specs/active/{name}.md` and present summary:
|
|
319
|
+
|
|
320
|
+
```markdown
|
|
321
|
+
## Spec Created
|
|
322
|
+
|
|
323
|
+
`specs/active/{name}.md` created with X tasks (Y size points total).
|
|
324
|
+
|
|
325
|
+
### Task Summary
|
|
326
|
+
| ID | Task | Size |
|
|
327
|
+
|----|------|------|
|
|
328
|
+
| T001 | First task | S |
|
|
329
|
+
| T002 | Second task | M |
|
|
330
|
+
...
|
|
331
|
+
|
|
332
|
+
### Estimated Effort
|
|
333
|
+
- Total points: Y
|
|
334
|
+
- Iterations needed: ~Z (at 4 pts/iteration)
|
|
335
|
+
|
|
336
|
+
### Key Decisions from Interview
|
|
337
|
+
- [Decision 1]
|
|
338
|
+
- [Decision 2]
|
|
339
|
+
|
|
340
|
+
Please review the spec. Ready to start with `ralphie run`?
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
The user reviews and approves. No automated review needed since user is present.
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Quick Reference
|
|
348
|
+
|
|
349
|
+
| Check | Pass | Fail |
|
|
350
|
+
|-------|------|------|
|
|
351
|
+
| Location | `specs/active/*.md` | Missing or wrong directory |
|
|
352
|
+
| Task IDs | `### T001:` | `- [ ]`, `### Task 1:` |
|
|
353
|
+
| Status | `- Status: pending` | Missing or blank |
|
|
354
|
+
| Size | `- Size: S\|M\|L` (user confirmed) | Missing or unconfirmed |
|
|
355
|
+
| Deliverables | `**Deliverables:**` + bullets | Missing section |
|
|
356
|
+
| Verify | `**Verify:** \`cmd\`` | Missing section |
|
|
357
|
+
| Separators | `---` between tasks | None |
|
|
358
|
+
| Code | Only in Verify | In task descriptions |
|
|
359
|
+
| Files | No paths | `src/file.ts:42` |
|