@hopla/claude-setup 1.0.4 → 1.0.6

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 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"),
@@ -2,84 +2,201 @@
2
2
  description: Create a Product Requirements Document (PRD) for a project through guided questions
3
3
  ---
4
4
 
5
- Create a PRD for this project by gathering the necessary information through a structured conversation.
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
6
 
7
- ## Step 1: Gather Context
7
+ > Layer 1 Planning = Global Rules + On-Demand Context + PRD
8
8
 
9
- Before asking questions, read what already exists:
10
- - `CLAUDE.md` or `AGENTS.md` — extract product name, tech stack, and any business context
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
11
13
  - `README.md` — extract any existing product description
14
+ - Any existing `PRD.md` — understand what's already defined
12
15
 
13
16
  Use this to avoid asking questions that are already answered.
14
17
 
15
- ## Step 2: Ask Key Questions
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
+ ---
16
34
 
17
- Ask the following questions **one section at a time** do not dump all questions at once. Wait for the answer before continuing.
35
+ ### Greenfield ModeFull Exploratory Conversation
18
36
 
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?
37
+ Start with an informal, open-ended exploration not a rigid questionnaire. The goal is to understand the project deeply before structuring anything.
22
38
 
23
- **Section BThe Users**
24
- 3. Who are the primary users? (role, context, technical level)
25
- 4. How do they use it? (daily, weekly, ad-hoc?)
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.
26
40
 
27
- **Section CScope**
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)
41
+ **Topic AThe 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?
30
45
 
31
- **Section DSuccess**
32
- 7. How do you know the product is working well? (key outcomes or metrics)
46
+ **Topic BThe Users**
47
+ - Who are the primary users? (role, context, technical level)
48
+ - How and how often do they use it?
33
49
 
34
- ## Step 3: Generate the PRD
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?
35
54
 
36
- Once all questions are answered, generate the PRD and save it to `PRD.md` at the project root.
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)
37
58
 
38
- Use this structure:
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?
39
66
 
40
67
  ---
41
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
+
42
111
  ```markdown
43
112
  # PRD — [Product Name]
44
113
 
45
- ## What is it?
114
+ ## Executive Summary
115
+
116
+ [2-3 sentences: what it does, who it's for, and why it exists.]
117
+
118
+ ## Mission
46
119
 
47
- [2-3 sentence executive summary. What it does, who it's for, and why it exists.]
120
+ [What this product aims to achieve. Include core principles if relevant.]
48
121
 
49
122
  ## Problem
50
123
 
51
124
  [What problem does this solve? What was the situation before this product?]
52
125
 
53
- ## Users
126
+ ## Target Users
54
127
 
55
128
  **Primary users:** [Role and context]
129
+ **Technical level:** [Technical comfort expected]
56
130
  **Usage pattern:** [How often and in what context they use it]
57
131
 
58
- ## Core Features (In Scope)
132
+ ## MVP Scope
59
133
 
60
- - [Feature 1 — one line description]
61
- - [Feature 2 — one line description]
62
- - [Feature 3 — one line description]
63
- [Add as many as needed]
134
+ ### In Scope
135
+ - [Feature/capability 1]
136
+ - [Feature/capability 2]
137
+ - [Feature/capability 3]
64
138
 
65
- ## Out of Scope
66
-
67
- These are explicitly NOT part of this product:
139
+ ### Out of Scope
68
140
  - [Thing 1 — why it's excluded]
69
141
  - [Thing 2 — why it's excluded]
70
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
+
71
159
  ## Success Criteria
72
160
 
73
- The product is working well when:
74
- - [Measurable outcome 1]
75
- - [Measurable outcome 2]
76
- ```
161
+ The MVP is working when:
162
+ - [ ] [Specific, testable criterion]
163
+ - [ ] [Specific, testable criterion]
164
+ - [ ] [Specific, testable criterion]
77
165
 
78
- ---
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
+ ```
79
192
 
80
- ## Step 4: Confirm and Save
193
+ ## Step 5: Confirm and Save
81
194
 
82
195
  Show the draft PRD to the user and ask:
83
196
  > "Does this accurately reflect the product? Any corrections before I save it?"
84
197
 
85
- Once confirmed, save to `PRD.md` and suggest running `/commit` to add it to the repository.
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
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Set the preferred response language for all Claude Code sessions
3
+ ---
4
+
5
+ Set the language Claude should always respond in, regardless of the language the user writes in.
6
+
7
+ ## Step 1: Ask for Language Preference
8
+
9
+ Ask the user:
10
+ > "What language should I always respond in? (e.g. Spanish, English, French, Portuguese)"
11
+
12
+ Wait for the answer.
13
+
14
+ ## Step 2: Update CLAUDE.md
15
+
16
+ Read `~/.claude/CLAUDE.md` and find the communication language rule. Replace it with a fixed language preference.
17
+
18
+ Find the line that says something like:
19
+ ```
20
+ Always respond in the same language the user writes in
21
+ ```
22
+
23
+ Replace it with:
24
+ ```
25
+ Always respond in [chosen language], regardless of the language the user writes in.
26
+ ```
27
+
28
+ Make sure to preserve all other rules in the file — only change the language line.
29
+
30
+ ## Step 3: Confirm
31
+
32
+ Tell the user:
33
+ > "Done. I'll always respond in [chosen language] from now on, even if you write in a different language."
34
+
35
+ If the user ever wants to revert to auto-detection, they can run `/hopla-lang` again and choose "auto" or "match the user's language".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hopla/claude-setup",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Hopla team agentic coding system for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {