@hopla/claude-setup 1.0.3 → 1.0.5
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/cli.js +33 -0
- package/files/commands/hopla-create-prd.md +202 -0
- package/files/commands/{prime.md → hopla-prime.md} +7 -8
- package/package.json +1 -1
- package/files/commands/create-prd.md +0 -85
- /package/files/commands/{code-review-fix.md → hopla-code-review-fix.md} +0 -0
- /package/files/commands/{code-review.md → hopla-code-review.md} +0 -0
- /package/files/commands/{commit.md → hopla-commit.md} +0 -0
- /package/files/commands/{execute.md → hopla-execute.md} +0 -0
- /package/files/commands/{execution-report.md → hopla-execution-report.md} +0 -0
- /package/files/commands/{plan-feature.md → hopla-plan-feature.md} +0 -0
- /package/files/commands/{system-review.md → hopla-system-review.md} +0 -0
package/cli.js
CHANGED
|
@@ -90,6 +90,36 @@ async function uninstall() {
|
|
|
90
90
|
log(`\n${GREEN}${BOLD}Done!${RESET} Files removed.\n`);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
const LEGACY_FILES = [
|
|
94
|
+
"code-review-fix.md",
|
|
95
|
+
"code-review.md",
|
|
96
|
+
"commit.md",
|
|
97
|
+
"create-prd.md",
|
|
98
|
+
"execute.md",
|
|
99
|
+
"execution-report.md",
|
|
100
|
+
"plan-feature.md",
|
|
101
|
+
"prime.md",
|
|
102
|
+
"system-review.md",
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
function removeLegacyFiles() {
|
|
106
|
+
const removed = [];
|
|
107
|
+
for (const file of LEGACY_FILES) {
|
|
108
|
+
const dest = path.join(COMMANDS_DIR, file);
|
|
109
|
+
if (fs.existsSync(dest)) {
|
|
110
|
+
fs.rmSync(dest);
|
|
111
|
+
removed.push(file);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (removed.length > 0) {
|
|
115
|
+
log(`${CYAN}Cleaning up legacy commands...${RESET}`);
|
|
116
|
+
for (const file of removed) {
|
|
117
|
+
log(` ${YELLOW}↷${RESET} Removed legacy: ~/.claude/commands/${file}`);
|
|
118
|
+
}
|
|
119
|
+
log("");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
93
123
|
async function install() {
|
|
94
124
|
log(`\n${BOLD}@hopla/claude-setup${RESET} — Agentic Coding System\n`);
|
|
95
125
|
|
|
@@ -97,6 +127,9 @@ async function install() {
|
|
|
97
127
|
fs.mkdirSync(CLAUDE_DIR, { recursive: true });
|
|
98
128
|
fs.mkdirSync(COMMANDS_DIR, { recursive: true });
|
|
99
129
|
|
|
130
|
+
// Remove old non-prefixed commands from previous versions
|
|
131
|
+
removeLegacyFiles();
|
|
132
|
+
|
|
100
133
|
log(`${CYAN}Installing global rules...${RESET}`);
|
|
101
134
|
await installFile(
|
|
102
135
|
path.join(FILES_DIR, "CLAUDE.md"),
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a Product Requirements Document (PRD) for a project through guided questions
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create a PRD for this project following the Layer 1 Planning approach: an exploratory conversation that defines scope, reduces assumptions, and generates both a `PRD.md` and supporting on-demand context documents.
|
|
6
|
+
|
|
7
|
+
> Layer 1 Planning = Global Rules + On-Demand Context + PRD
|
|
8
|
+
|
|
9
|
+
## Step 1: Load Existing Context
|
|
10
|
+
|
|
11
|
+
Before asking anything, read what already exists:
|
|
12
|
+
- `CLAUDE.md` or `AGENTS.md` — extract product name, tech stack, business context
|
|
13
|
+
- `README.md` — extract any existing product description
|
|
14
|
+
- Any existing `PRD.md` — understand what's already defined
|
|
15
|
+
|
|
16
|
+
Use this to avoid asking questions that are already answered.
|
|
17
|
+
|
|
18
|
+
## Step 2: Detect Project Mode
|
|
19
|
+
|
|
20
|
+
Before starting the conversation, determine which mode to use based on what exists:
|
|
21
|
+
|
|
22
|
+
**Greenfield mode** (project is new or nearly empty):
|
|
23
|
+
- No significant source code found
|
|
24
|
+
- No existing architecture or stack decisions
|
|
25
|
+
- Proceed with the full exploratory conversation below
|
|
26
|
+
|
|
27
|
+
**Existing project mode** (project has code, structure, or a prior PRD):
|
|
28
|
+
- Source code, architecture, or stack already exist
|
|
29
|
+
- Skip feasibility and stack topics — read the code instead
|
|
30
|
+
- Focus the conversation only on gaps: what's undocumented, what's next, what's changing
|
|
31
|
+
- Announce to the user: "I can see this project already has code. I'll read the existing structure first and only ask about what's missing or unclear."
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### Greenfield Mode — Full Exploratory Conversation
|
|
36
|
+
|
|
37
|
+
Start with an informal, open-ended exploration — not a rigid questionnaire. The goal is to understand the project deeply before structuring anything.
|
|
38
|
+
|
|
39
|
+
Ask one topic at a time and wait for the answer before continuing. Adapt follow-up questions based on the answers — this is a conversation, not a form.
|
|
40
|
+
|
|
41
|
+
**Topic A — The Product Vision**
|
|
42
|
+
- What is this product? Describe it as if explaining to someone who has never heard of it.
|
|
43
|
+
- What problem does it solve? What was the situation before this product existed?
|
|
44
|
+
- What is the MVP goal — the minimum that makes this useful?
|
|
45
|
+
|
|
46
|
+
**Topic B — The Users**
|
|
47
|
+
- Who are the primary users? (role, context, technical level)
|
|
48
|
+
- How and how often do they use it?
|
|
49
|
+
|
|
50
|
+
**Topic C — Feasibility & Stack**
|
|
51
|
+
- What technology stack are you thinking? Any hard constraints or preferences?
|
|
52
|
+
- Are there existing integrations, APIs, or services this must work with?
|
|
53
|
+
- What are the biggest technical risks or unknowns?
|
|
54
|
+
|
|
55
|
+
**Topic D — Scope**
|
|
56
|
+
- What are the 3-5 core features the MVP must have?
|
|
57
|
+
- What is explicitly OUT of scope for the MVP? (things users might expect but won't be built)
|
|
58
|
+
|
|
59
|
+
**Topic E — Architecture & Key Decisions**
|
|
60
|
+
- What architectural pattern makes sense for this? (e.g., monolith, microservices, vertical slices)
|
|
61
|
+
- Are there key technical decisions that need to be made upfront? (e.g., auth approach, data model, tool design)
|
|
62
|
+
- Are there external resources, docs, or best practices we should factor in?
|
|
63
|
+
|
|
64
|
+
**Topic F — Success**
|
|
65
|
+
- How do you know the MVP is working well? What are the measurable success criteria?
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Existing Project Mode — Documentation Conversation
|
|
70
|
+
|
|
71
|
+
First, explore the codebase to understand what's already built:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git ls-files | head -60
|
|
75
|
+
git log --oneline -10
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Read key files: entry points, main modules, config files, existing tests.
|
|
79
|
+
|
|
80
|
+
Then ask only about what's unclear or missing after reading the code:
|
|
81
|
+
|
|
82
|
+
**Topic A — Confirm Understanding**
|
|
83
|
+
- "Based on what I've read, this project does X using Y. Is that accurate?"
|
|
84
|
+
- Correct any misunderstandings before continuing.
|
|
85
|
+
|
|
86
|
+
**Topic B — Scope Gaps**
|
|
87
|
+
- What features are planned but not yet built?
|
|
88
|
+
- What is explicitly out of scope going forward?
|
|
89
|
+
|
|
90
|
+
**Topic C — Users (if not documented)**
|
|
91
|
+
- Who uses this? What's their technical level and usage pattern?
|
|
92
|
+
|
|
93
|
+
**Topic D — Success**
|
|
94
|
+
- How do you measure whether this project is working well?
|
|
95
|
+
|
|
96
|
+
## Step 3: Extract On-Demand Context Documents
|
|
97
|
+
|
|
98
|
+
After the conversation, identify technical decisions complex enough to warrant their own document. For each one, create a separate file in the project root or a `docs/` folder.
|
|
99
|
+
|
|
100
|
+
Common examples:
|
|
101
|
+
- `mvp-tool-designs.md` — detailed tool/API specifications
|
|
102
|
+
- `architecture-decisions.md` — key architectural decisions and rationale
|
|
103
|
+
- `data-model.md` — core entities and relationships
|
|
104
|
+
|
|
105
|
+
These become **on-demand context** referenced from the PRD and used in future planning commands.
|
|
106
|
+
|
|
107
|
+
## Step 4: Generate the PRD
|
|
108
|
+
|
|
109
|
+
Save to `PRD.md` at the project root. Use this structure:
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
# PRD — [Product Name]
|
|
113
|
+
|
|
114
|
+
## Executive Summary
|
|
115
|
+
|
|
116
|
+
[2-3 sentences: what it does, who it's for, and why it exists.]
|
|
117
|
+
|
|
118
|
+
## Mission
|
|
119
|
+
|
|
120
|
+
[What this product aims to achieve. Include core principles if relevant.]
|
|
121
|
+
|
|
122
|
+
## Problem
|
|
123
|
+
|
|
124
|
+
[What problem does this solve? What was the situation before this product?]
|
|
125
|
+
|
|
126
|
+
## Target Users
|
|
127
|
+
|
|
128
|
+
**Primary users:** [Role and context]
|
|
129
|
+
**Technical level:** [Technical comfort expected]
|
|
130
|
+
**Usage pattern:** [How often and in what context they use it]
|
|
131
|
+
|
|
132
|
+
## MVP Scope
|
|
133
|
+
|
|
134
|
+
### In Scope
|
|
135
|
+
- [Feature/capability 1]
|
|
136
|
+
- [Feature/capability 2]
|
|
137
|
+
- [Feature/capability 3]
|
|
138
|
+
|
|
139
|
+
### Out of Scope
|
|
140
|
+
- [Thing 1 — why it's excluded]
|
|
141
|
+
- [Thing 2 — why it's excluded]
|
|
142
|
+
|
|
143
|
+
## User Stories
|
|
144
|
+
|
|
145
|
+
1. **As a [user], I want to [action]**, so that [outcome].
|
|
146
|
+
- Example: "[concrete usage example]"
|
|
147
|
+
|
|
148
|
+
[Add the most important 3-5 user stories]
|
|
149
|
+
|
|
150
|
+
## Core Architecture & Patterns
|
|
151
|
+
|
|
152
|
+
[Describe the chosen architecture, key patterns, and rationale. Reference on-demand context docs for details.]
|
|
153
|
+
|
|
154
|
+
## Technology Stack
|
|
155
|
+
|
|
156
|
+
- **[Layer/role]:** [Technology and version]
|
|
157
|
+
- **[Layer/role]:** [Technology and version]
|
|
158
|
+
|
|
159
|
+
## Success Criteria
|
|
160
|
+
|
|
161
|
+
The MVP is working when:
|
|
162
|
+
- [ ] [Specific, testable criterion]
|
|
163
|
+
- [ ] [Specific, testable criterion]
|
|
164
|
+
- [ ] [Specific, testable criterion]
|
|
165
|
+
|
|
166
|
+
## Implementation Phases
|
|
167
|
+
|
|
168
|
+
### Phase 1: [Name] — Goal: [one line]
|
|
169
|
+
- [ ] [Deliverable]
|
|
170
|
+
- [ ] [Deliverable]
|
|
171
|
+
**Validation:** [How to know this phase is done]
|
|
172
|
+
|
|
173
|
+
### Phase 2: [Name] — Goal: [one line]
|
|
174
|
+
[Same structure]
|
|
175
|
+
|
|
176
|
+
## Risks & Mitigations
|
|
177
|
+
|
|
178
|
+
| Risk | Mitigation |
|
|
179
|
+
|------|------------|
|
|
180
|
+
| [Risk 1] | [How to address it] |
|
|
181
|
+
| [Risk 2] | [How to address it] |
|
|
182
|
+
|
|
183
|
+
## Future Considerations (Post-MVP)
|
|
184
|
+
|
|
185
|
+
- [Enhancement 1]
|
|
186
|
+
- [Enhancement 2]
|
|
187
|
+
|
|
188
|
+
## Related Documents
|
|
189
|
+
|
|
190
|
+
- [on-demand context doc] — [what it contains]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Step 5: Confirm and Save
|
|
194
|
+
|
|
195
|
+
Show the draft PRD to the user and ask:
|
|
196
|
+
> "Does this accurately reflect the product? Any corrections before I save it?"
|
|
197
|
+
|
|
198
|
+
Once confirmed:
|
|
199
|
+
1. Save `PRD.md` to the project root
|
|
200
|
+
2. Save any on-demand context documents created in Step 3
|
|
201
|
+
3. List all files created
|
|
202
|
+
4. Suggest running `/hopla-commit` to save everything to the repository
|
|
@@ -31,13 +31,12 @@ git status
|
|
|
31
31
|
|
|
32
32
|
## Step 4: Summary Report
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Write a short, conversational message (2-4 sentences) addressed directly to the user. Mention:
|
|
35
|
+
- What the project is and what it does
|
|
36
|
+
- The current branch and what it's for
|
|
37
|
+
- Whether there are uncommitted changes or pending work
|
|
38
|
+
- The command to start the project (if available)
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
**Stack:** [languages, frameworks, key libraries]
|
|
38
|
-
**Current branch:** [branch name and what it's for]
|
|
39
|
-
**Key structure:** [main folders and their purpose]
|
|
40
|
-
**Useful commands:** [how to run, test, build]
|
|
41
|
-
**Git status:** [clean / changes pending / uncommitted files]
|
|
40
|
+
End with a sentence like: "Listo para continuar — ¿por dónde empezamos?" or "All caught up — what are we working on today?" depending on the language the user writes in.
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
Do NOT use headers, labels, or bullet points in this final message. Write it as natural, friendly prose.
|
package/package.json
CHANGED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create a Product Requirements Document (PRD) for a project through guided questions
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Create a PRD for this project by gathering the necessary information through a structured conversation.
|
|
6
|
-
|
|
7
|
-
## Step 1: Gather Context
|
|
8
|
-
|
|
9
|
-
Before asking questions, read what already exists:
|
|
10
|
-
- `CLAUDE.md` or `AGENTS.md` — extract product name, tech stack, and any business context
|
|
11
|
-
- `README.md` — extract any existing product description
|
|
12
|
-
|
|
13
|
-
Use this to avoid asking questions that are already answered.
|
|
14
|
-
|
|
15
|
-
## Step 2: Ask Key Questions
|
|
16
|
-
|
|
17
|
-
Ask the following questions **one section at a time** — do not dump all questions at once. Wait for the answer before continuing.
|
|
18
|
-
|
|
19
|
-
**Section A — The Product**
|
|
20
|
-
1. In 1-2 sentences, what does this product do?
|
|
21
|
-
2. What problem does it solve? What was happening before this product existed?
|
|
22
|
-
|
|
23
|
-
**Section B — The Users**
|
|
24
|
-
3. Who are the primary users? (role, context, technical level)
|
|
25
|
-
4. How do they use it? (daily, weekly, ad-hoc?)
|
|
26
|
-
|
|
27
|
-
**Section C — Scope**
|
|
28
|
-
5. What are the 3-5 most important features the product must have?
|
|
29
|
-
6. What is explicitly OUT of scope? (things users might expect but won't be built)
|
|
30
|
-
|
|
31
|
-
**Section D — Success**
|
|
32
|
-
7. How do you know the product is working well? (key outcomes or metrics)
|
|
33
|
-
|
|
34
|
-
## Step 3: Generate the PRD
|
|
35
|
-
|
|
36
|
-
Once all questions are answered, generate the PRD and save it to `PRD.md` at the project root.
|
|
37
|
-
|
|
38
|
-
Use this structure:
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
```markdown
|
|
43
|
-
# PRD — [Product Name]
|
|
44
|
-
|
|
45
|
-
## What is it?
|
|
46
|
-
|
|
47
|
-
[2-3 sentence executive summary. What it does, who it's for, and why it exists.]
|
|
48
|
-
|
|
49
|
-
## Problem
|
|
50
|
-
|
|
51
|
-
[What problem does this solve? What was the situation before this product?]
|
|
52
|
-
|
|
53
|
-
## Users
|
|
54
|
-
|
|
55
|
-
**Primary users:** [Role and context]
|
|
56
|
-
**Usage pattern:** [How often and in what context they use it]
|
|
57
|
-
|
|
58
|
-
## Core Features (In Scope)
|
|
59
|
-
|
|
60
|
-
- [Feature 1 — one line description]
|
|
61
|
-
- [Feature 2 — one line description]
|
|
62
|
-
- [Feature 3 — one line description]
|
|
63
|
-
[Add as many as needed]
|
|
64
|
-
|
|
65
|
-
## Out of Scope
|
|
66
|
-
|
|
67
|
-
These are explicitly NOT part of this product:
|
|
68
|
-
- [Thing 1 — why it's excluded]
|
|
69
|
-
- [Thing 2 — why it's excluded]
|
|
70
|
-
|
|
71
|
-
## Success Criteria
|
|
72
|
-
|
|
73
|
-
The product is working well when:
|
|
74
|
-
- [Measurable outcome 1]
|
|
75
|
-
- [Measurable outcome 2]
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Step 4: Confirm and Save
|
|
81
|
-
|
|
82
|
-
Show the draft PRD to the user and ask:
|
|
83
|
-
> "Does this accurately reflect the product? Any corrections before I save it?"
|
|
84
|
-
|
|
85
|
-
Once confirmed, save to `PRD.md` and suggest running `/commit` to add it to the repository.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|