ralphie 1.0.0 → 1.1.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.
- 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
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: create-spec
|
|
3
|
-
description: Create a SPEC.md through structured interview and LLM review. Use this when starting a new project or feature.
|
|
4
|
-
context: fork
|
|
5
|
-
allowed-tools: Read, Write, Edit, AskUserQuestion, Task
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Create SPEC Skill
|
|
9
|
-
|
|
10
|
-
Create a well-structured SPEC.md through guided interview and quality review.
|
|
11
|
-
|
|
12
|
-
## Workflow
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Interview → Generate → Review → Finalize
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Step 1: Interview
|
|
19
|
-
|
|
20
|
-
Use **AskUserQuestion** to gather requirements in batches. Don't generate the spec until you have enough context.
|
|
21
|
-
|
|
22
|
-
### Batch 1: Project Foundation
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
AskUserQuestion({
|
|
26
|
-
questions: [
|
|
27
|
-
{
|
|
28
|
-
question: "What type of project is this?",
|
|
29
|
-
header: "Type",
|
|
30
|
-
multiSelect: false,
|
|
31
|
-
options: [
|
|
32
|
-
{ label: "CLI tool", description: "Command-line application" },
|
|
33
|
-
{ label: "Web API", description: "REST/GraphQL backend" },
|
|
34
|
-
{ label: "Library", description: "Reusable package" },
|
|
35
|
-
{ label: "Full-stack", description: "Frontend + backend" }
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
question: "What language/framework?",
|
|
40
|
-
header: "Stack",
|
|
41
|
-
multiSelect: false,
|
|
42
|
-
options: [
|
|
43
|
-
{ label: "TypeScript/Node.js (Recommended)", description: "Modern JS with types" },
|
|
44
|
-
{ label: "Python", description: "Great for data, ML, scripting" },
|
|
45
|
-
{ label: "Go", description: "Fast, good for systems" },
|
|
46
|
-
{ label: "Rust", description: "Memory-safe systems" }
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Batch 2: Core Requirements
|
|
54
|
-
|
|
55
|
-
Ask about:
|
|
56
|
-
- Primary use case (what problem does it solve?)
|
|
57
|
-
- Target users (who will use this?)
|
|
58
|
-
- Core features (what must it do?)
|
|
59
|
-
- External integrations (APIs, databases, services?)
|
|
60
|
-
|
|
61
|
-
### Batch 3: Quality & Constraints
|
|
62
|
-
|
|
63
|
-
Ask about:
|
|
64
|
-
- Testing expectations (unit only / unit+integration / full)
|
|
65
|
-
- Auth requirements (none / basic / OAuth / custom)
|
|
66
|
-
- Performance constraints (if any)
|
|
67
|
-
- Timeline/priority (MVP vs full feature set)
|
|
68
|
-
|
|
69
|
-
### Interview Tips
|
|
70
|
-
|
|
71
|
-
- Ask follow-up questions if answers are vague
|
|
72
|
-
- Dig into edge cases: "What happens when X fails?"
|
|
73
|
-
- Clarify scope: "Is Y a must-have or nice-to-have?"
|
|
74
|
-
- Don't proceed until you understand the core requirements
|
|
75
|
-
|
|
76
|
-
## Step 2: Generate SPEC
|
|
77
|
-
|
|
78
|
-
Write `SPEC.md` following these rules:
|
|
79
|
-
|
|
80
|
-
### Structure
|
|
81
|
-
|
|
82
|
-
```markdown
|
|
83
|
-
# Project Name
|
|
84
|
-
|
|
85
|
-
Brief description (1-2 sentences).
|
|
86
|
-
|
|
87
|
-
## Goal
|
|
88
|
-
What this project achieves when complete.
|
|
89
|
-
|
|
90
|
-
## Tasks
|
|
91
|
-
|
|
92
|
-
### Phase 1: Foundation
|
|
93
|
-
- [ ] Task description
|
|
94
|
-
- Deliverable 1
|
|
95
|
-
- Deliverable 2
|
|
96
|
-
|
|
97
|
-
### Phase 2: Core Features
|
|
98
|
-
- [ ] Another task
|
|
99
|
-
- Deliverable 1
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Task Rules
|
|
103
|
-
|
|
104
|
-
**Each checkbox = one Ralphie iteration.** Batch related work.
|
|
105
|
-
|
|
106
|
-
```markdown
|
|
107
|
-
# BAD - 4 iterations
|
|
108
|
-
- [ ] Create UserModel.ts
|
|
109
|
-
- [ ] Create UserService.ts
|
|
110
|
-
- [ ] Create UserController.ts
|
|
111
|
-
- [ ] Create user.test.ts
|
|
112
|
-
|
|
113
|
-
# GOOD - 1 iteration
|
|
114
|
-
- [ ] Create User module (Model, Service, Controller) with tests
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### What SPECs Must NOT Include
|
|
118
|
-
|
|
119
|
-
SPECs describe **requirements**, not solutions.
|
|
120
|
-
|
|
121
|
-
**Never include:**
|
|
122
|
-
- Code snippets or implementation examples
|
|
123
|
-
- File:line references (e.g., `auth.ts:42`)
|
|
124
|
-
- Shell commands (`npm install X`, `git log`)
|
|
125
|
-
- Root cause analysis ("The bug is because...")
|
|
126
|
-
- "Technical Notes" or "Fix Approach" sections
|
|
127
|
-
- Implementation instructions
|
|
128
|
-
|
|
129
|
-
**Sub-bullets are deliverables, not instructions:**
|
|
130
|
-
|
|
131
|
-
```markdown
|
|
132
|
-
# BAD - prescribes HOW
|
|
133
|
-
- [ ] Fix auth bug
|
|
134
|
-
- Use `bcrypt.compare()` instead of `===`
|
|
135
|
-
- Add try/catch at line 50
|
|
136
|
-
|
|
137
|
-
# GOOD - describes WHAT
|
|
138
|
-
- [ ] Fix auth bug
|
|
139
|
-
- Password comparison should be timing-safe
|
|
140
|
-
- Handle comparison errors gracefully
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Verification Steps
|
|
144
|
-
|
|
145
|
-
Each task SHOULD include a **Verify:** section with concrete checks:
|
|
146
|
-
|
|
147
|
-
```markdown
|
|
148
|
-
- [ ] Implement authentication system
|
|
149
|
-
- POST /auth/register - create user with hashed password
|
|
150
|
-
- POST /auth/login - validate credentials, return JWT
|
|
151
|
-
- Tests for all auth flows
|
|
152
|
-
|
|
153
|
-
**Verify:**
|
|
154
|
-
- `curl -X POST localhost:3000/auth/register -d '{"email":"test@test.com","password":"test123"}'` → 201
|
|
155
|
-
- `curl -X POST localhost:3000/auth/login -d '{"email":"test@test.com","password":"test123"}'` → returns JWT
|
|
156
|
-
- `npm test` → all tests pass
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Good verification steps:
|
|
160
|
-
- API calls with expected response codes
|
|
161
|
-
- CLI commands with expected output
|
|
162
|
-
- File existence checks (`ls dist/` → contains index.js)
|
|
163
|
-
- Test commands (`npm test` → all pass)
|
|
164
|
-
|
|
165
|
-
## Step 3: Review with LLM
|
|
166
|
-
|
|
167
|
-
After generating the spec, spawn a review agent to check for violations:
|
|
168
|
-
|
|
169
|
-
```typescript
|
|
170
|
-
Task({
|
|
171
|
-
subagent_type: 'general-purpose',
|
|
172
|
-
description: 'Review SPEC.md',
|
|
173
|
-
prompt: `Review SPEC.md for convention violations.
|
|
174
|
-
|
|
175
|
-
Check for these anti-patterns:
|
|
176
|
-
1. Code snippets (any \`\`\` blocks with implementation code)
|
|
177
|
-
2. File:line references (e.g., setup.ts:150)
|
|
178
|
-
3. Shell commands in tasks (npm, git, docker, etc.)
|
|
179
|
-
4. "Technical Notes" or "Fix Approach" sections
|
|
180
|
-
5. Implementation instructions ("Use X to...", "Change line Y")
|
|
181
|
-
|
|
182
|
-
For each violation found:
|
|
183
|
-
- Quote the problematic line
|
|
184
|
-
- Explain why it's a violation
|
|
185
|
-
- Suggest a requirement-focused alternative
|
|
186
|
-
|
|
187
|
-
Respond with:
|
|
188
|
-
- PASS: No violations found
|
|
189
|
-
- FAIL: List each violation with fix suggestion`
|
|
190
|
-
})
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### If Review Fails
|
|
194
|
-
|
|
195
|
-
1. Fix each violation the reviewer identified
|
|
196
|
-
2. Re-run the review
|
|
197
|
-
3. Only proceed when review passes
|
|
198
|
-
|
|
199
|
-
## Step 4: Finalize
|
|
200
|
-
|
|
201
|
-
After review passes:
|
|
202
|
-
|
|
203
|
-
1. Confirm with user: "SPEC is ready. Review it or start first iteration?"
|
|
204
|
-
2. Wait for explicit approval
|
|
205
|
-
3. Do NOT auto-start implementation
|
|
206
|
-
|
|
207
|
-
```markdown
|
|
208
|
-
✓ SPEC.md created with X tasks across Y phases
|
|
209
|
-
✓ Passed convention review
|
|
210
|
-
|
|
211
|
-
Ready to proceed? Say "start" to begin first iteration.
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
## Quick Reference
|
|
215
|
-
|
|
216
|
-
| Do | Don't |
|
|
217
|
-
|----|-------|
|
|
218
|
-
| Describe outcomes | Prescribe implementation |
|
|
219
|
-
| Use deliverable sub-bullets | Use instruction sub-bullets |
|
|
220
|
-
| Batch related tasks | Split tiny tasks |
|
|
221
|
-
| Keep it scannable | Add code examples |
|
|
222
|
-
| Run LLM review | Skip validation |
|