@hopla/claude-setup 1.8.2 → 1.10.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 +5 -5
- package/files/commands/hopla-init-project.md +280 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
|
|
|
101
101
|
|
|
102
102
|
| Command | Description |
|
|
103
103
|
|---|---|
|
|
104
|
-
| `/hopla-init-project` |
|
|
104
|
+
| `/hopla-init-project` | Read PRD, recommend stack, create CLAUDE.md and .agents/ structure |
|
|
105
105
|
| `/hopla-prime` | Load project context at the start of a session |
|
|
106
106
|
| `/hopla-create-prd` | Create a Product Requirements Document through guided questions |
|
|
107
107
|
| `/hopla-plan-feature` | Research codebase and create a structured implementation plan |
|
|
@@ -156,8 +156,8 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
|
|
|
156
156
|
|
|
157
157
|
### Starting a new project
|
|
158
158
|
```
|
|
159
|
-
/hopla-
|
|
160
|
-
/hopla-
|
|
159
|
+
/hopla-create-prd → define what you're building (PRD.md)
|
|
160
|
+
/hopla-init-project → reads PRD, recommends stack, creates CLAUDE.md + .agents/
|
|
161
161
|
/hopla-git-commit → saves Layer 1 foundation to git
|
|
162
162
|
```
|
|
163
163
|
|
|
@@ -242,12 +242,12 @@ Features under consideration for future versions:
|
|
|
242
242
|
|
|
243
243
|
---
|
|
244
244
|
|
|
245
|
-
## Project Structure (after /hopla-init-project)
|
|
245
|
+
## Project Structure (after /hopla-create-prd + /hopla-init-project)
|
|
246
246
|
|
|
247
247
|
```
|
|
248
248
|
project/
|
|
249
|
-
├── CLAUDE.md ← Project-specific rules
|
|
250
249
|
├── PRD.md ← Product scope (from /hopla-create-prd)
|
|
250
|
+
├── CLAUDE.md ← Project rules and stack (from /hopla-init-project)
|
|
251
251
|
├── .agents/
|
|
252
252
|
│ ├── plans/ ← Implementation plans (commit these)
|
|
253
253
|
│ ├── guides/ ← On-demand reference guides (commit these)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
description: Initialize a new project with a CLAUDE.md and .agents/ structure
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> **Language:** All user-facing output must match the user's language. Code, paths, and commands stay in English.
|
|
6
6
|
|
|
7
7
|
Set up the Layer 1 planning foundation for this project: a project-specific `CLAUDE.md` with rules and architecture decisions, plus the `.agents/` directory structure.
|
|
8
8
|
|
|
@@ -18,85 +18,291 @@ Before asking anything, check what already exists:
|
|
|
18
18
|
|
|
19
19
|
If a `CLAUDE.md` already exists at the project root, tell the user and ask if they want to update it or start fresh.
|
|
20
20
|
|
|
21
|
-
## Step 2:
|
|
21
|
+
## Step 2: Understand the Product
|
|
22
|
+
|
|
23
|
+
Check if a `PRD.md` or `PRD.draft.md` exists in the project root.
|
|
24
|
+
|
|
25
|
+
### Path A — PRD exists (recommended flow)
|
|
26
|
+
|
|
27
|
+
If a PRD is found, read it and extract:
|
|
28
|
+
- Product name and description
|
|
29
|
+
- Core features and capabilities
|
|
30
|
+
- Target users and usage patterns
|
|
31
|
+
- Technology preferences or constraints mentioned
|
|
32
|
+
- External integrations or services
|
|
33
|
+
|
|
34
|
+
Tell the user:
|
|
35
|
+
> "I found the PRD for [product name]. I'll use it to recommend the right stack for this project."
|
|
36
|
+
|
|
37
|
+
Then skip directly to **Step 3** (Recommend Stack).
|
|
38
|
+
|
|
39
|
+
### Path B — No PRD found
|
|
40
|
+
|
|
41
|
+
Ask the user:
|
|
42
|
+
> "I don't see a PRD yet. Tell me about the project — what are you building? What does it do, who is it for, and what are the main things a user can do with it?"
|
|
43
|
+
|
|
44
|
+
Wait for the answer. If the description is too short or vague, ask **product-focused** follow-up questions like:
|
|
45
|
+
- "Who uses this — is it internal for your team, or for external customers?"
|
|
46
|
+
- "What's the main thing a user does when they open the app?"
|
|
47
|
+
- "Does it work with lists or tables of data? Like orders, products, users..."
|
|
48
|
+
- "Do users need to log in? Can anyone sign up, or is it invite-only?"
|
|
49
|
+
- "Does it need to talk to any external services or APIs?"
|
|
50
|
+
- "Is there anything that runs in the background — imports, syncs, notifications?"
|
|
51
|
+
|
|
52
|
+
**Do NOT ask technical questions.** The user describes the product; you infer the technical needs. For example:
|
|
53
|
+
- "dashboard with a list of orders" → needs AG Grid, backend API
|
|
54
|
+
- "users log in with Google" → needs Firebase Auth + JOSE
|
|
55
|
+
- "imports a CSV and processes it in the background" → needs Durable Objects
|
|
56
|
+
- "simple landing page with a contact form" → frontend only, no backend needed
|
|
57
|
+
- "shows charts and trends over time" → needs Recharts
|
|
58
|
+
|
|
59
|
+
Then proceed to **Step 3**.
|
|
60
|
+
|
|
61
|
+
## Step 3: Recommend Stack
|
|
62
|
+
|
|
63
|
+
Based on the PRD or the user's description, evaluate against the **Hopla Default Stack** and present a recommendation.
|
|
64
|
+
|
|
65
|
+
### Hopla Default Stack (baseline)
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Frontend:
|
|
69
|
+
- Language: TypeScript (strict: false)
|
|
70
|
+
- UI Framework: React 19 + React Router 7
|
|
71
|
+
- Bundler: Vite
|
|
72
|
+
- Styling: Tailwind CSS 4 + Shadcn UI
|
|
73
|
+
- Data Tables: AG Grid Community
|
|
74
|
+
- Forms: React Hook Form + Zod
|
|
75
|
+
- Icons: Lucide React
|
|
76
|
+
- Testing: Vitest
|
|
77
|
+
- Linting: ESLint
|
|
78
|
+
- Formatting: Prettier
|
|
79
|
+
|
|
80
|
+
Backend:
|
|
81
|
+
- Runtime: Cloudflare Workers
|
|
82
|
+
- Routing: Hono
|
|
83
|
+
- Database: Cloudflare D1 (SQLite)
|
|
84
|
+
- Cache: Cloudflare KV
|
|
85
|
+
- Stateful Logic: Cloudflare Durable Objects (if needed)
|
|
86
|
+
- Auth: Firebase (Google Sign-In) + JOSE (if needed)
|
|
87
|
+
|
|
88
|
+
Package manager: npm
|
|
89
|
+
Path alias: @/* -> ./src/*
|
|
90
|
+
|
|
91
|
+
Architecture:
|
|
92
|
+
src/
|
|
93
|
+
├── components/ <- shared UI components
|
|
94
|
+
│ ├── common/ <- generic reusable components
|
|
95
|
+
│ └── ui/ <- Shadcn primitives (do not edit)
|
|
96
|
+
├── modules/ <- self-contained feature modules
|
|
97
|
+
│ └── [feature]/ <- components, hooks, view per feature
|
|
98
|
+
├── hooks/ <- shared hooks
|
|
99
|
+
├── lib/ <- utilities and helpers
|
|
100
|
+
├── types/ <- shared TypeScript types
|
|
101
|
+
├── layouts/ <- sidebar, topbar, app shell
|
|
102
|
+
├── pages/ <- page-level components
|
|
103
|
+
└── main.tsx <- entry point
|
|
104
|
+
worker/
|
|
105
|
+
├── src/
|
|
106
|
+
│ ├── index.ts <- worker entry point, route registration
|
|
107
|
+
│ ├── routes/ <- API route handlers (one file per domain)
|
|
108
|
+
│ ├── lib/ <- backend utilities, auth, business logic
|
|
109
|
+
│ └── types/ <- backend type definitions
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### How to present the recommendation
|
|
113
|
+
|
|
114
|
+
**If the default stack covers everything:**
|
|
115
|
+
> "Based on [the PRD / what you described], the Hopla default stack covers this project well. Here's what we'll use: [show stack]. Does this look good, or do you want to adjust anything?"
|
|
116
|
+
|
|
117
|
+
**If the default stack needs additions or removals:**
|
|
118
|
+
> "The default stack covers most of it, but based on your needs I'd recommend these changes: [list additions/removals with reasoning]. Here's the adjusted stack: [show modified stack]. Does this look good?"
|
|
119
|
+
|
|
120
|
+
Examples of adjustments:
|
|
121
|
+
- Project doesn't need data tables → remove AG Grid
|
|
122
|
+
- Project doesn't need auth → remove Firebase + JOSE
|
|
123
|
+
- Project doesn't need a backend → remove worker/, Hono, D1, KV, DO
|
|
124
|
+
- Project needs real-time/WebSockets → add Durable Objects
|
|
125
|
+
- Project needs file uploads → note Cloudflare R2
|
|
126
|
+
- Project needs charts → add Recharts
|
|
127
|
+
- Project needs i18n → add i18next + react-i18next
|
|
128
|
+
- Project needs a specific library the user mentioned → add it
|
|
129
|
+
|
|
130
|
+
**If the project is fundamentally different from the default** (e.g. Python backend, mobile app, CLI tool):
|
|
131
|
+
> "This project doesn't fit the default stack. Let me ask a few questions to define the right stack for it."
|
|
132
|
+
Then proceed to the full conversational discovery (Step 3.1).
|
|
133
|
+
|
|
134
|
+
### Step 3.1: Full Conversational Discovery (only if default doesn't fit)
|
|
22
135
|
|
|
23
136
|
Ask one topic at a time. Wait for each answer before continuing.
|
|
24
137
|
|
|
25
138
|
**Topic A — Tech Stack**
|
|
26
|
-
- What languages, frameworks, and key libraries
|
|
27
|
-
- What versions matter?
|
|
28
|
-
- What package manager?
|
|
139
|
+
- What languages, frameworks, and key libraries?
|
|
140
|
+
- What versions matter?
|
|
141
|
+
- What package manager?
|
|
29
142
|
|
|
30
143
|
**Topic B — Architecture**
|
|
31
|
-
- How is the project structured?
|
|
32
|
-
- What are the main layers or modules?
|
|
33
|
-
-
|
|
144
|
+
- How is the project structured?
|
|
145
|
+
- What are the main layers or modules?
|
|
146
|
+
- Naming conventions for files and folders?
|
|
34
147
|
|
|
35
148
|
**Topic C — Code Style**
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- Linting/formatting tools and configs? (Ruff, ESLint, Biome, Prettier)
|
|
149
|
+
- Naming conventions? TypeScript strict mode?
|
|
150
|
+
- Linting/formatting tools?
|
|
39
151
|
|
|
40
152
|
**Topic D — Testing**
|
|
41
|
-
-
|
|
42
|
-
- Test structure? (mirrors source, separate folder, colocated)
|
|
43
|
-
- Any naming conventions for tests?
|
|
153
|
+
- Framework? Structure? Naming?
|
|
44
154
|
|
|
45
155
|
**Topic E — Development Commands**
|
|
46
|
-
-
|
|
47
|
-
- How do you run tests?
|
|
48
|
-
- How do you lint/format?
|
|
49
|
-
- Any other key commands the AI should know?
|
|
156
|
+
- Dev server? Tests? Lint/format? Other key commands?
|
|
50
157
|
|
|
51
158
|
**Topic F — Reference Guides**
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
159
|
+
- Specific task types that need step-by-step guidance?
|
|
160
|
+
|
|
161
|
+
## Step 4: Collect Project Info
|
|
55
162
|
|
|
56
|
-
|
|
163
|
+
Once the stack is confirmed, ask only what's NOT already known from the PRD or conversation:
|
|
57
164
|
|
|
58
|
-
|
|
165
|
+
1. **Project name** — skip if already in PRD
|
|
166
|
+
2. **Project description** — skip if already in PRD
|
|
167
|
+
3. **Reference Guides** (optional) — Are there specific task types that need step-by-step guidance? (e.g. "When adding a page", "When creating an API route"). If none, skip — guides can always be added later.
|
|
168
|
+
|
|
169
|
+
## Step 5: Generate CLAUDE.md
|
|
59
170
|
|
|
60
171
|
Save to `CLAUDE.md` at the project root. Use this structure:
|
|
61
172
|
|
|
173
|
+
**For default stack projects**, use these pre-filled values:
|
|
174
|
+
|
|
62
175
|
```markdown
|
|
63
176
|
# [Project Name] — Development Rules
|
|
64
177
|
|
|
65
178
|
## 1. Core Principles
|
|
66
179
|
|
|
67
|
-
|
|
180
|
+
- Functional React only — hooks, no class components
|
|
181
|
+
- Feature modules are self-contained under `src/modules/`
|
|
182
|
+
- Shadcn UI components in `src/components/ui/` are NOT to be edited
|
|
183
|
+
- Code and comments in English, user-facing strings can be localized
|
|
184
|
+
- Always run `npm run format` after making code changes
|
|
68
185
|
|
|
69
186
|
---
|
|
70
187
|
|
|
71
188
|
## 2. Tech Stack
|
|
72
189
|
|
|
73
|
-
|
|
190
|
+
### Frontend
|
|
191
|
+
|
|
192
|
+
| Tool | Version | Purpose |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| React | 19 | UI framework |
|
|
195
|
+
| TypeScript | 5.x | Type safety (strict: false) |
|
|
196
|
+
| React Router | v7 | Client-side routing |
|
|
197
|
+
| Vite | 7.x | Build tool + dev server |
|
|
198
|
+
| Tailwind CSS | 4.x | Styling |
|
|
199
|
+
| Shadcn UI + Radix | — | Accessible component primitives |
|
|
200
|
+
| AG Grid Community | 35.x | Data tables and grids |
|
|
201
|
+
| React Hook Form + Zod | — | Form handling and validation |
|
|
202
|
+
| Lucide React | — | Icons (always use Lucide) |
|
|
203
|
+
| Vitest | — | Unit testing |
|
|
204
|
+
|
|
205
|
+
### Backend
|
|
206
|
+
|
|
207
|
+
| Tool | Version | Purpose |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| Cloudflare Workers | — | Serverless runtime |
|
|
210
|
+
| Cloudflare D1 | — | SQLite on the edge (database) |
|
|
211
|
+
| Cloudflare KV | — | Key-value cache layer |
|
|
212
|
+
| Cloudflare Durable Objects | — | Stateful long-running logic (if needed) |
|
|
213
|
+
| Hono | 4.x | HTTP routing framework |
|
|
214
|
+
| Firebase + JOSE | — | Authentication, Google Sign-In (if needed) |
|
|
74
215
|
|
|
75
216
|
---
|
|
76
217
|
|
|
77
218
|
## 3. Architecture
|
|
78
219
|
|
|
79
|
-
|
|
220
|
+
```
|
|
221
|
+
src/
|
|
222
|
+
├── components/ <- shared UI components
|
|
223
|
+
│ ├── common/ <- generic reusable components
|
|
224
|
+
│ └── ui/ <- Shadcn primitives (do not edit)
|
|
225
|
+
├── modules/ <- self-contained feature modules
|
|
226
|
+
│ └── [feature]/ <- components, hooks, view per feature
|
|
227
|
+
├── hooks/ <- shared hooks
|
|
228
|
+
├── lib/ <- utilities and helpers (api, firebase, utils)
|
|
229
|
+
├── types/ <- shared TypeScript types (index.ts)
|
|
230
|
+
├── layouts/ <- sidebar, topbar, app shell
|
|
231
|
+
├── pages/ <- page-level components (login, 404)
|
|
232
|
+
├── App.tsx <- root router
|
|
233
|
+
├── main.tsx <- entry point
|
|
234
|
+
└── index.css <- global styles
|
|
235
|
+
worker/
|
|
236
|
+
├── src/
|
|
237
|
+
│ ├── index.ts <- worker entry, route registration
|
|
238
|
+
│ ├── routes/ <- API route handlers (one file per domain)
|
|
239
|
+
│ ├── lib/ <- backend utilities, auth, business logic
|
|
240
|
+
│ └── types/ <- backend type definitions
|
|
241
|
+
├── wrangler.jsonc <- Cloudflare Workers config
|
|
242
|
+
└── migrations/ <- D1 SQLite migrations (numbered, sequential)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Key rules:
|
|
246
|
+
- Feature modules in `src/modules/` are self-contained with their own components and hooks
|
|
247
|
+
- Shared hooks go in `src/hooks/`, feature-specific ones stay in the module
|
|
248
|
+
- All data tables use AG Grid Community — Shadcn UI for everything else
|
|
249
|
+
- All icons use Lucide React — no other icon libraries
|
|
250
|
+
- All API routes are under `/api`, organized by domain in `worker/src/routes/`
|
|
251
|
+
- Backend uses prepared statements for D1 queries
|
|
252
|
+
- Durable Objects for stateful long-running operations (if needed)
|
|
80
253
|
|
|
81
254
|
---
|
|
82
255
|
|
|
83
256
|
## 4. Code Style
|
|
84
257
|
|
|
85
|
-
###
|
|
86
|
-
|
|
258
|
+
### TypeScript
|
|
259
|
+
- strict: false
|
|
260
|
+
- Path alias: `@/*` maps to `./src/*`
|
|
261
|
+
- Interfaces for object shapes, types for unions/intersections
|
|
262
|
+
- Named exports preferred
|
|
263
|
+
|
|
264
|
+
### React
|
|
265
|
+
- Functional components only
|
|
266
|
+
- Props defined as interface above the component
|
|
267
|
+
- File name matches component name: `UserCard.tsx` exports `UserCard`
|
|
268
|
+
|
|
269
|
+
### Naming
|
|
270
|
+
- Components: `PascalCase.tsx`
|
|
271
|
+
- Hooks: `useCamelCase.ts`
|
|
272
|
+
- Utilities: `camelCase.ts`
|
|
273
|
+
- Types/Interfaces: `PascalCase`
|
|
274
|
+
- Constants: `UPPER_SNAKE_CASE`
|
|
275
|
+
- Route files: `kebab-case.ts`
|
|
276
|
+
|
|
277
|
+
### Backend (Hono)
|
|
278
|
+
- One route file per domain in `worker/src/routes/`
|
|
279
|
+
- Register static routes BEFORE parameterized routes
|
|
280
|
+
- Use prepared statements for D1 queries
|
|
281
|
+
- Auth middleware on protected routes
|
|
87
282
|
|
|
88
283
|
---
|
|
89
284
|
|
|
90
285
|
## 5. Testing
|
|
91
286
|
|
|
92
|
-
|
|
287
|
+
- **Framework:** Vitest
|
|
288
|
+
- **Run:** `npm run test` (vitest run)
|
|
93
289
|
|
|
94
290
|
---
|
|
95
291
|
|
|
96
292
|
## 6. Development Commands
|
|
97
293
|
|
|
98
294
|
```bash
|
|
99
|
-
|
|
295
|
+
npm run dev # Vite frontend dev server
|
|
296
|
+
npm run dev:worker # Wrangler worker only
|
|
297
|
+
npm run dev:full # Both frontend and worker concurrently
|
|
298
|
+
npm run build # Production build
|
|
299
|
+
npm run deploy # Deploy to Cloudflare Workers
|
|
300
|
+
npm run db:migrate # Apply pending D1 migrations (local)
|
|
301
|
+
npm run db:migrate:remote # Apply pending D1 migrations (production)
|
|
302
|
+
npm run typecheck # TypeScript type checking (tsc -b --noEmit)
|
|
303
|
+
npm run lint # ESLint
|
|
304
|
+
npm run format # Prettier formatting
|
|
305
|
+
npm run test # Vitest unit tests
|
|
100
306
|
```
|
|
101
307
|
|
|
102
308
|
---
|
|
@@ -109,9 +315,11 @@ Read: `.agents/guides/[guide-name].md`
|
|
|
109
315
|
This guide covers: [bullet list]
|
|
110
316
|
```
|
|
111
317
|
|
|
112
|
-
|
|
318
|
+
**For custom stack projects**, fill in the values collected during Step 2.2 following the same structure.
|
|
113
319
|
|
|
114
|
-
|
|
320
|
+
## Step 5.5: Generate Reference Guides
|
|
321
|
+
|
|
322
|
+
For each task type identified (in Step 4 or Step 3.1), create a guide at `.agents/guides/[kebab-case-task-name].md`.
|
|
115
323
|
|
|
116
324
|
Use this template for every guide:
|
|
117
325
|
|
|
@@ -120,7 +328,7 @@ Use this template for every guide:
|
|
|
120
328
|
|
|
121
329
|
## When to Use This Guide
|
|
122
330
|
|
|
123
|
-
Load this guide when: [exact trigger condition, e.g. "adding a new API
|
|
331
|
+
Load this guide when: [exact trigger condition, e.g. "adding a new API route", "creating a React component"]
|
|
124
332
|
|
|
125
333
|
---
|
|
126
334
|
|
|
@@ -129,13 +337,15 @@ Load this guide when: [exact trigger condition, e.g. "adding a new API endpoint"
|
|
|
129
337
|
[Describe the layer structure for this task type. e.g.:]
|
|
130
338
|
|
|
131
339
|
```
|
|
132
|
-
|
|
340
|
+
src/modules/[feature]/components/[Component].tsx
|
|
341
|
+
src/modules/[feature]/hooks/use[Hook].ts
|
|
342
|
+
worker/src/routes/[domain].ts
|
|
133
343
|
```
|
|
134
344
|
|
|
135
345
|
Key rules:
|
|
136
|
-
- [Rule 1: e.g. "All business logic goes in
|
|
137
|
-
- [Rule 2: e.g. "
|
|
138
|
-
- [Rule 3: e.g. "
|
|
346
|
+
- [Rule 1: e.g. "All business logic goes in hooks or backend services, never in components"]
|
|
347
|
+
- [Rule 2: e.g. "Use prepared statements for all D1 queries"]
|
|
348
|
+
- [Rule 3: e.g. "Register static routes before parameterized routes"]
|
|
139
349
|
|
|
140
350
|
---
|
|
141
351
|
|
|
@@ -165,7 +375,7 @@ Follow these existing implementations as pattern:
|
|
|
165
375
|
|
|
166
376
|
## Code Examples
|
|
167
377
|
|
|
168
|
-
### [Filename pattern, e.g.
|
|
378
|
+
### [Filename pattern, e.g. worker/src/routes/products.ts]
|
|
169
379
|
```[language]
|
|
170
380
|
// Example showing the exact pattern to follow
|
|
171
381
|
[concrete code snippet]
|
|
@@ -188,38 +398,40 @@ Follow these existing implementations as pattern:
|
|
|
188
398
|
## Validation
|
|
189
399
|
|
|
190
400
|
After implementing, verify:
|
|
191
|
-
- [ ] `
|
|
192
|
-
- [ ] `
|
|
193
|
-
- [ ]
|
|
401
|
+
- [ ] `npm run lint`
|
|
402
|
+
- [ ] `npm run typecheck`
|
|
403
|
+
- [ ] `npm run test`
|
|
404
|
+
- [ ] `npm run format`
|
|
405
|
+
- [ ] [Manual check if applicable]
|
|
194
406
|
```
|
|
195
407
|
|
|
196
|
-
**Important:** Guides must contain concrete, project-specific information — not generic advice. If the user's answers
|
|
408
|
+
**Important:** Guides must contain concrete, project-specific information — not generic advice. If the user's answers don't have enough detail for a section, ask a follow-up before writing the guide.
|
|
197
409
|
|
|
198
410
|
Also update the `CLAUDE.md` Section 7 (Task-Specific Reference Guides) to reference each guide created:
|
|
199
411
|
|
|
200
412
|
```markdown
|
|
201
413
|
## 7. Task-Specific Reference Guides
|
|
202
414
|
|
|
203
|
-
**When adding an API
|
|
204
|
-
Read: `.agents/guides/api-
|
|
205
|
-
This guide covers:
|
|
415
|
+
**When adding an API route:**
|
|
416
|
+
Read: `.agents/guides/api-route.md`
|
|
417
|
+
This guide covers: Hono route setup, D1 queries, auth middleware, response format
|
|
206
418
|
|
|
207
|
-
**When creating a
|
|
208
|
-
Read: `.agents/guides/
|
|
209
|
-
This guide covers:
|
|
419
|
+
**When creating a feature module:**
|
|
420
|
+
Read: `.agents/guides/feature-module.md`
|
|
421
|
+
This guide covers: module structure, components, hooks, routing
|
|
210
422
|
```
|
|
211
423
|
|
|
212
|
-
## Step
|
|
424
|
+
## Step 6: Create .agents/ Structure
|
|
213
425
|
|
|
214
426
|
Create the following directories (with `.gitkeep` where needed):
|
|
215
427
|
|
|
216
428
|
```
|
|
217
429
|
.agents/
|
|
218
|
-
├── plans/
|
|
219
|
-
├── guides/
|
|
220
|
-
├── execution-reports/
|
|
221
|
-
├── code-reviews/
|
|
222
|
-
└── system-reviews/
|
|
430
|
+
├── plans/ <- /hopla-plan-feature saves here (commit these)
|
|
431
|
+
├── guides/ <- on-demand reference guides (commit these)
|
|
432
|
+
├── execution-reports/ <- /hopla-execution-report saves here (do NOT commit)
|
|
433
|
+
├── code-reviews/ <- /hopla-code-review saves here (do NOT commit)
|
|
434
|
+
└── system-reviews/ <- /hopla-system-review saves here (do NOT commit)
|
|
223
435
|
```
|
|
224
436
|
|
|
225
437
|
Add to `.gitignore` (create if it doesn't exist):
|
|
@@ -229,28 +441,31 @@ Add to `.gitignore` (create if it doesn't exist):
|
|
|
229
441
|
.agents/system-reviews/
|
|
230
442
|
```
|
|
231
443
|
|
|
232
|
-
## Step
|
|
444
|
+
## Step 7: Create .claude/commands/ (optional but recommended)
|
|
233
445
|
|
|
234
446
|
Create `.claude/commands/` at the project root for project-specific commands that override or extend the global ones.
|
|
235
447
|
|
|
236
|
-
Common project-specific commands to create:
|
|
237
|
-
|
|
238
448
|
**`validate.md`** — runs the full validation sequence for this project:
|
|
449
|
+
|
|
450
|
+
For default stack:
|
|
239
451
|
```markdown
|
|
240
452
|
---
|
|
241
453
|
description: Run full validation for this project
|
|
242
454
|
---
|
|
243
455
|
Run in order, stop if any level fails:
|
|
244
|
-
1. `
|
|
245
|
-
2. `
|
|
246
|
-
3. `
|
|
456
|
+
1. `npm run lint`
|
|
457
|
+
2. `npm run typecheck`
|
|
458
|
+
3. `npm run test`
|
|
459
|
+
4. `npm run format`
|
|
247
460
|
```
|
|
248
461
|
|
|
249
|
-
|
|
462
|
+
For custom stack, use the commands collected during discovery.
|
|
463
|
+
|
|
464
|
+
Ask the user: "Do you want me to create a project-specific `/validate` command?"
|
|
250
465
|
|
|
251
|
-
If yes, create `.claude/commands/validate.md
|
|
466
|
+
If yes, create `.claude/commands/validate.md`.
|
|
252
467
|
|
|
253
|
-
## Step
|
|
468
|
+
## Step 8: Confirm and Save
|
|
254
469
|
|
|
255
470
|
Show the draft `CLAUDE.md` to the user and ask:
|
|
256
471
|
> "Does this accurately reflect the project's rules? Any corrections before I save it?"
|
|
@@ -259,5 +474,6 @@ Once confirmed:
|
|
|
259
474
|
1. Save `CLAUDE.md` to the project root
|
|
260
475
|
2. Create `.agents/` directory structure
|
|
261
476
|
3. Update `.gitignore`
|
|
262
|
-
4.
|
|
477
|
+
4. If no PRD exists yet, tell the user: "Project initialized. Run `/hopla-create-prd` next to define the product scope, or `/hopla-plan-feature` to start planning a feature."
|
|
478
|
+
If a PRD already exists, tell the user: "Project initialized. Run `/hopla-plan-feature` to start planning the first feature."
|
|
263
479
|
5. Suggest running `/hopla-git-commit` to save everything
|