@hopla/claude-setup 1.1.4 → 1.1.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 +7 -0
- package/files/commands/hopla-init-project.md +103 -1
- package/package.json +3 -2
package/cli.js
CHANGED
|
@@ -7,6 +7,13 @@ import readline from "readline";
|
|
|
7
7
|
|
|
8
8
|
const FORCE = process.argv.includes("--force");
|
|
9
9
|
const UNINSTALL = process.argv.includes("--uninstall");
|
|
10
|
+
const VERSION = process.argv.includes("--version") || process.argv.includes("-v");
|
|
11
|
+
|
|
12
|
+
if (VERSION) {
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(new URL("./package.json", import.meta.url), "utf8"));
|
|
14
|
+
console.log(`@hopla/claude-setup v${pkg.version}`);
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
10
17
|
const CLAUDE_DIR = path.join(os.homedir(), ".claude");
|
|
11
18
|
const COMMANDS_DIR = path.join(CLAUDE_DIR, "commands");
|
|
12
19
|
const FILES_DIR = path.join(import.meta.dirname, "files");
|
|
@@ -49,7 +49,9 @@ Ask one topic at a time. Wait for each answer before continuing.
|
|
|
49
49
|
**Topic F — Reference Guides**
|
|
50
50
|
- Are there specific task types that need extra guidance?
|
|
51
51
|
(e.g. "When adding an API endpoint", "When creating a React component")
|
|
52
|
-
- For each task type: what
|
|
52
|
+
- For each task type identified: what are the exact steps? What files to follow as pattern? What pitfalls to avoid?
|
|
53
|
+
|
|
54
|
+
Collect enough detail to write a full guide for each task type — not just the name, but the actual patterns, file structure, and constraints.
|
|
53
55
|
|
|
54
56
|
## Step 3: Generate CLAUDE.md
|
|
55
57
|
|
|
@@ -105,6 +107,106 @@ Read: `.agents/guides/[guide-name].md`
|
|
|
105
107
|
This guide covers: [bullet list]
|
|
106
108
|
```
|
|
107
109
|
|
|
110
|
+
## Step 3.5: Generate Reference Guides
|
|
111
|
+
|
|
112
|
+
For each task type identified in Topic F, create a guide at `.agents/guides/[kebab-case-task-name].md`.
|
|
113
|
+
|
|
114
|
+
Use this template for every guide:
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
# Guide: [Task Type Name]
|
|
118
|
+
|
|
119
|
+
## When to Use This Guide
|
|
120
|
+
|
|
121
|
+
Load this guide when: [exact trigger condition, e.g. "adding a new API endpoint", "creating a React component"]
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Architecture Pattern
|
|
126
|
+
|
|
127
|
+
[Describe the layer structure for this task type. e.g.:]
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
Request → router/[resource].ts → service/[resource]Service.ts → model/[Resource].ts → DB
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Key rules:
|
|
134
|
+
- [Rule 1: e.g. "All business logic goes in the service layer, never in the router"]
|
|
135
|
+
- [Rule 2: e.g. "Always validate input with Zod before passing to service"]
|
|
136
|
+
- [Rule 3: e.g. "Return typed responses, never raw DB objects"]
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Reference Files
|
|
141
|
+
|
|
142
|
+
Follow these existing implementations as pattern:
|
|
143
|
+
- `[path/to/existing/example.ts]` — [what it demonstrates]
|
|
144
|
+
- `[path/to/existing/example.ts]` — [what it demonstrates]
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Step-by-Step Implementation
|
|
149
|
+
|
|
150
|
+
### 1. [First step]
|
|
151
|
+
- [What to create/modify]
|
|
152
|
+
- [Exact naming convention]
|
|
153
|
+
- [Code pattern to follow]
|
|
154
|
+
|
|
155
|
+
### 2. [Second step]
|
|
156
|
+
- [What to create/modify]
|
|
157
|
+
- [Key constraints]
|
|
158
|
+
|
|
159
|
+
### 3. [Third step]
|
|
160
|
+
[Continue for all steps...]
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Code Examples
|
|
165
|
+
|
|
166
|
+
### [Filename pattern, e.g. router/products.ts]
|
|
167
|
+
```[language]
|
|
168
|
+
// Example showing the exact pattern to follow
|
|
169
|
+
[concrete code snippet]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### [Next file pattern]
|
|
173
|
+
```[language]
|
|
174
|
+
[concrete code snippet]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Common Pitfalls
|
|
180
|
+
|
|
181
|
+
- **[Pitfall 1]:** [What goes wrong and how to avoid it]
|
|
182
|
+
- **[Pitfall 2]:** [What goes wrong and how to avoid it]
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Validation
|
|
187
|
+
|
|
188
|
+
After implementing, verify:
|
|
189
|
+
- [ ] `[exact lint/type check command]`
|
|
190
|
+
- [ ] `[exact test command]`
|
|
191
|
+
- [ ] [Manual check: e.g. "curl the endpoint and confirm response shape"]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Important:** Guides must contain concrete, project-specific information — not generic advice. If the user's answers in Topic F don't have enough detail for a section, ask a follow-up before writing the guide.
|
|
195
|
+
|
|
196
|
+
Also update the `CLAUDE.md` Section 7 (Task-Specific Reference Guides) to reference each guide created:
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
## 7. Task-Specific Reference Guides
|
|
200
|
+
|
|
201
|
+
**When adding an API endpoint:**
|
|
202
|
+
Read: `.agents/guides/api-endpoint.md`
|
|
203
|
+
This guide covers: router structure, service layer pattern, Zod validation, response types
|
|
204
|
+
|
|
205
|
+
**When creating a React component:**
|
|
206
|
+
Read: `.agents/guides/react-component.md`
|
|
207
|
+
This guide covers: file structure, props typing, hook usage, test co-location
|
|
208
|
+
```
|
|
209
|
+
|
|
108
210
|
## Step 4: Create .agents/ Structure
|
|
109
211
|
|
|
110
212
|
Create the following directories (with `.gitkeep` where needed):
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hopla/claude-setup",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Hopla team agentic coding system for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"claude-setup": "cli.js"
|
|
7
|
+
"claude-setup": "cli.js",
|
|
8
|
+
"hopla-claude-setup": "cli.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"cli.js",
|