@hopla/claude-setup 1.10.2 → 1.11.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.
Files changed (47) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +23 -0
  3. package/README.md +127 -30
  4. package/agents/code-reviewer.md +62 -0
  5. package/agents/codebase-researcher.md +41 -0
  6. package/agents/system-reviewer.md +64 -0
  7. package/cli.js +45 -14
  8. package/commands/guides/ai-optimized-codebase.md +70 -0
  9. package/commands/guides/hooks-reference.md +82 -0
  10. package/commands/guides/mcp-integration.md +32 -0
  11. package/commands/guides/remote-coding.md +70 -0
  12. package/commands/guides/scaling-beyond-engineering.md +54 -0
  13. package/commands/guides/write-skill.md +78 -0
  14. package/{files/commands → commands}/hopla-code-review-fix.md +8 -0
  15. package/commands/hopla-end-to-end.md +67 -0
  16. package/{files/commands → commands}/hopla-execute.md +2 -0
  17. package/commands/hopla-guide.md +61 -0
  18. package/{files/commands → commands}/hopla-plan-feature.md +2 -0
  19. package/commands/hopla-rca.md +64 -0
  20. package/{files/commands → commands}/hopla-validate.md +5 -0
  21. package/{files/CLAUDE.md → global-rules.md} +45 -0
  22. package/hooks/hooks.json +40 -0
  23. package/{files/hooks → hooks}/session-prime.js +13 -0
  24. package/package.json +7 -2
  25. package/skills/hopla-brainstorm/SKILL.md +89 -0
  26. package/{files/skills → skills}/hopla-code-review/SKILL.md +2 -1
  27. package/skills/hopla-debug/SKILL.md +73 -0
  28. package/{files/skills → skills}/hopla-execution-report/SKILL.md +3 -1
  29. package/{files/skills → skills}/hopla-git/SKILL.md +1 -1
  30. package/skills/hopla-parallel-dispatch/SKILL.md +69 -0
  31. package/{files/skills → skills}/hopla-prime/SKILL.md +3 -1
  32. package/skills/hopla-subagent-execution/SKILL.md +70 -0
  33. package/skills/hopla-tdd/SKILL.md +73 -0
  34. package/skills/hopla-verify/SKILL.md +64 -0
  35. package/skills/hopla-worktree/SKILL.md +73 -0
  36. /package/{files/commands → commands}/guides/data-audit.md +0 -0
  37. /package/{files/commands → commands}/guides/review-checklist.md +0 -0
  38. /package/{files/commands → commands}/hopla-create-prd.md +0 -0
  39. /package/{files/commands → commands}/hopla-git-commit.md +0 -0
  40. /package/{files/commands → commands}/hopla-git-pr.md +0 -0
  41. /package/{files/commands → commands}/hopla-init-project.md +0 -0
  42. /package/{files/commands → commands}/hopla-review-plan.md +0 -0
  43. /package/{files/commands → commands}/hopla-system-review.md +0 -0
  44. /package/{files/hooks → hooks}/env-protect.js +0 -0
  45. /package/{files/hooks → hooks}/tsc-check.js +0 -0
  46. /package/{files/skills → skills}/hopla-git/commit.md +0 -0
  47. /package/{files/skills → skills}/hopla-git/pr.md +0 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "hopla-marketplace",
3
+ "description": "Hopla Tools plugin marketplace for Claude Code",
4
+ "owner": {
5
+ "name": "Hopla Tools",
6
+ "email": "julio@hopla.tools"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "hopla",
11
+ "description": "Agentic coding system: PIV loop, TDD, debugging, brainstorming, subagent execution, and team workflows",
12
+ "version": "1.11.0",
13
+ "source": "./",
14
+ "author": {
15
+ "name": "Hopla Tools",
16
+ "email": "julio@hopla.tools"
17
+ }
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "hopla",
3
+ "description": "Agentic coding system for Claude Code: PIV loop (Plan → Implement → Validate), TDD, debugging, brainstorming, subagent execution, and team workflows",
4
+ "version": "1.11.0",
5
+ "author": {
6
+ "name": "Hopla Tools",
7
+ "email": "julio@hopla.tools"
8
+ },
9
+ "homepage": "https://github.com/hopla-tools/claude-setup",
10
+ "repository": "https://github.com/hopla-tools/claude-setup",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "claude",
14
+ "agentic-coding",
15
+ "piv-loop",
16
+ "tdd",
17
+ "debugging",
18
+ "brainstorming",
19
+ "code-review",
20
+ "workflows",
21
+ "skills"
22
+ ]
23
+ }
package/README.md CHANGED
@@ -1,17 +1,32 @@
1
1
  # @hopla/claude-setup
2
2
 
3
- Hopla team agentic coding system for Claude Code. Installs global rules and commands to `~/.claude/`.
3
+ Hopla team agentic coding system for Claude Code. Installs commands, skills, agents, hooks, and reference guides — available as a **Claude Code plugin** or via **npm CLI**.
4
4
 
5
5
  ## Install
6
6
 
7
- ### Full install for the implementer (Julio)
7
+ ### Option A: Claude Code Plugin (recommended)
8
+
9
+ ```
10
+ /plugin install hopla@hopla-marketplace
11
+ ```
12
+
13
+ Installs all commands, skills, agents, and hooks automatically. Updates are detected when the plugin version changes.
14
+
15
+ To also install the global rules template (`~/.claude/CLAUDE.md`), run the CLI:
16
+
17
+ ```bash
18
+ npm install -g @hopla/claude-setup
19
+ claude-setup --force
20
+ ```
21
+
22
+ ### Option B: npm CLI only
8
23
 
9
24
  ```bash
10
25
  npm install -g @hopla/claude-setup
11
26
  claude-setup
12
27
  ```
13
28
 
14
- Installs all commands: planning + execution + review.
29
+ Installs everything including `~/.claude/CLAUDE.md`. Use this if you don't want the plugin channel or need the `--planning` mode.
15
30
 
16
31
  ### Planning-only install — for the planner/non-technical role (Robert)
17
32
 
@@ -20,7 +35,7 @@ npm install -g @hopla/claude-setup
20
35
  claude-setup --planning
21
36
  ```
22
37
 
23
- Installs only planning commands: `init-project`, `prime`, `create-prd`, `plan-feature`, `review-plan`, `git-commit`, `git-pr`. No execution or review commands. No bash permission prompts during planning.
38
+ Installs only planning commands: `init-project`, `create-prd`, `plan-feature`, `review-plan`, `guide`, `git-commit`, `git-pr`. Also installs planning skills (`hopla-prime`, `hopla-brainstorm`). No execution or review commands. No bash permission prompts during planning.
24
39
 
25
40
  To overwrite existing files without prompting:
26
41
 
@@ -31,33 +46,50 @@ claude-setup --planning --force
31
46
 
32
47
  ## Update
33
48
 
49
+ **Plugin channel:** updates automatically when the plugin version changes, or manually:
50
+ ```
51
+ /plugin update hopla@hopla-marketplace
52
+ ```
53
+
54
+ **CLI channel (for global rules):**
34
55
  ```bash
35
56
  npm install -g @hopla/claude-setup@latest --prefer-online && claude-setup --force
36
57
  ```
37
58
 
38
59
  ## Uninstall
39
60
 
61
+ **Plugin:**
62
+ ```
63
+ /plugin uninstall hopla@hopla-marketplace
64
+ ```
65
+
66
+ **CLI:**
40
67
  ```bash
41
68
  claude-setup --uninstall
42
69
  ```
43
70
 
44
71
  ---
45
72
 
46
- ## How It Works — Layer 1 Planning
73
+ ## How It Works — Layered Context
47
74
 
48
- The system is built on two levels of context:
75
+ The system uses three levels of CLAUDE.md, each scoped differently:
49
76
 
50
77
  ```
51
- ~/.claude/CLAUDE.md ← Global rules (installed by claude-setup)
52
- └── applies to ALL projects
78
+ ~/.claude/CLAUDE.md ← Machine-level (installed by claude-setup)
79
+ └── applies to ALL projects on this machine
53
80
 
54
- CLAUDE.md (project root) ← Project-specific rules (created with /hopla-init-project)
81
+ CLAUDE.md (project root) ← Project-level (created with /hopla-init-project)
55
82
  └── applies to THIS project only
83
+
84
+ .claude/CLAUDE.local.md ← Local overrides (personal, gitignored)
85
+ └── your personal tweaks, not shared with team
56
86
  ```
57
87
 
58
- **Global rules** cover: language preferences, tech defaults (React, TypeScript, Vite), Git Flow, Conventional Commits, and autonomy behavior.
88
+ **Machine-level rules** cover: language preferences, tech defaults, Git Flow, Conventional Commits, autonomy behavior, context management, and available commands/skills reference.
89
+
90
+ **Project-level rules** cover: specific stack versions, architecture patterns, naming conventions, logging, testing, dev commands, and task-specific reference guides.
59
91
 
60
- **Project rules** cover: specific stack versions, architecture patterns, naming conventions, logging, testing, dev commands, and task-specific reference guides.
92
+ **Local overrides** cover: personal preferences that differ from the team (e.g., verbose logging, different editor settings).
61
93
 
62
94
  ---
63
95
 
@@ -73,6 +105,7 @@ This system is built on two core concepts from the Agentic Coding Course:
73
105
  | **On-Demand Context** | Task-specific guides loaded when needed (e.g. "how to add an API endpoint") | `.agents/guides/*.md` |
74
106
  | **Commands** | Reusable processes that tell the agent *how* to work | `~/.claude/commands/hopla-*.md` |
75
107
  | **Skills** | Auto-activate by semantic matching — no slash command needed | `~/.claude/skills/hopla-*/SKILL.md` |
108
+ | **Agents** | Specialized subagents for delegation (code review, research, system analysis) | `~/.claude/agents/*.md` |
76
109
  | **Hooks** | Run automatically before/after tool use for type checking and protection | `~/.claude/hooks/*.js` |
77
110
 
78
111
  The key insight: **commands inject on-demand context deterministically** — when you run `/hopla-plan-feature`, it automatically reads the relevant guide from `.agents/guides/` before planning.
@@ -102,18 +135,21 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
102
135
  | Command | Description |
103
136
  |---|---|
104
137
  | `/hopla-init-project` | Read PRD, recommend stack, create CLAUDE.md and .agents/ structure |
105
- | `/hopla-prime` | Load project context at the start of a session |
106
138
  | `/hopla-create-prd` | Create a Product Requirements Document through guided questions |
107
139
  | `/hopla-plan-feature` | Research codebase and create a structured implementation plan |
108
140
  | `/hopla-review-plan` | Review a plan before execution — get a concise summary and approve |
109
141
  | `/hopla-execute` | Execute a structured plan from start to finish with validation |
142
+ | `/hopla-validate` | Run the validation pyramid: lint → types → tests → integration |
143
+ | `/hopla-end-to-end` | Full PIV loop in one command: prime → brainstorm → plan → execute → validate → commit |
110
144
  | `/hopla-git-commit` | Create a Conventional Commit with Git Flow awareness |
111
145
  | `/hopla-git-pr` | Create a GitHub Pull Request with a structured description |
112
- | `/hopla-code-review` | Technical code review on recently changed files |
113
146
  | `/hopla-code-review-fix` | Fix issues found in a code review report |
114
- | `/hopla-execution-report` | Generate an implementation report for system review |
147
+ | `/hopla-rca` | Root Cause Analysis investigate a bug systematically and generate an RCA doc |
148
+ | `/hopla-guide` | 4D Framework guide for non-technical users (Description, Discernment, Delegation, Diligence) |
115
149
  | `/hopla-system-review` | Analyze implementation against plan to find process improvements |
116
150
 
151
+ > **Note:** `hopla-prime`, `hopla-code-review`, and `hopla-execution-report` are **skills only** (no slash command needed) — they auto-activate when you describe the task in natural language.
152
+
117
153
  **`~/.claude/skills/`** — Auto-activate by semantic matching, no slash command needed:
118
154
 
119
155
  | Skill | Auto-activates when you say... |
@@ -122,6 +158,13 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
122
158
  | `hopla-prime` | "orient yourself", "ponte al día", "what is this project" |
123
159
  | `hopla-code-review` | "review the code", "code review", "analiza los cambios" |
124
160
  | `hopla-execution-report` | "generate the report", "genera el reporte", "document what was done" |
161
+ | `hopla-verify` | "verify it works", "make sure it's correct", "check before finishing" |
162
+ | `hopla-brainstorm` | "let's brainstorm", "explore approaches", "design this before coding" |
163
+ | `hopla-debug` | "debug this", "find the bug", "why is this failing" |
164
+ | `hopla-tdd` | "write tests first", "TDD", "red-green-refactor" |
165
+ | `hopla-subagent-execution` | "use subagents", "execute with agents", plans with 5+ tasks |
166
+ | `hopla-parallel-dispatch` | "run in parallel", "parallelize this", independent tasks |
167
+ | `hopla-worktree` | "use a worktree", "isolated branch", "parallel feature work" |
125
168
 
126
169
  **`~/.claude/hooks/`** — Run automatically before/after tool use (configured in `~/.claude/settings.json`):
127
170
 
@@ -131,18 +174,51 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
131
174
  | `env-protect.js` | PreToolUse | Blocks reads/greps targeting `.env` files |
132
175
  | `session-prime.js` | SessionStart (opt-in) | Loads git context + CLAUDE.md summary at session start |
133
176
 
177
+ **`~/.claude/agents/`** — Specialized subagents for delegation:
178
+
179
+ | Agent | What it does |
180
+ |---|---|
181
+ | `code-reviewer` | Senior code reviewer (model: sonnet, read-only). Reviews plan alignment, code quality, architecture, logic, security, performance |
182
+ | `codebase-researcher` | Fast codebase explorer (model: haiku, read-only). Systematic search and structured findings |
183
+ | `system-reviewer` | System review analyst (model: sonnet, read-only). Analyzes execution vs plan, classifies divergences |
184
+
185
+ **`~/.claude/commands/guides/`** — Reference guides loaded on-demand:
186
+
187
+ | Guide | What it covers |
188
+ |---|---|
189
+ | `mcp-integration.md` | How to integrate MCP servers into the PIV loop |
190
+ | `ai-optimized-codebase.md` | Vertical slice architecture, LLM-friendly docstrings, strict types |
191
+ | `hooks-reference.md` | All hook types, configuration, input JSON, exit codes, debugging |
192
+ | `write-skill.md` | How to create new skills with CSO, testing, progressive disclosure |
193
+ | `remote-coding.md` | GitHub-based remote agentic coding with autonomy levels |
194
+ | `scaling-beyond-engineering.md` | Expanding HOPLA to non-technical teams with 4D Framework |
195
+ | `data-audit.md` | Data pipeline audit checklist |
196
+ | `review-checklist.md` | Code review checklist reference |
197
+
134
198
  **Installed layout:**
135
199
 
136
200
  ```
137
201
  ~/.claude/
138
202
  ├── CLAUDE.md ← Global rules
139
203
  ├── commands/
140
- └── hopla-*.md ← Slash commands (/hopla-prime, /hopla-execute, etc.)
204
+ ├── hopla-*.md ← Slash commands (/hopla-prime, /hopla-execute, etc.)
205
+ │ └── guides/ ← Reference guides (loaded on-demand by commands/skills)
141
206
  ├── skills/
142
207
  │ ├── hopla-git/ ← Auto-activates for commit/PR requests
143
208
  │ ├── hopla-prime/ ← Auto-activates for orientation requests
144
209
  │ ├── hopla-code-review/ ← Auto-activates for review requests
145
- └── hopla-execution-report/ ← Auto-activates for report requests
210
+ ├── hopla-execution-report/ ← Auto-activates for report requests
211
+ │ ├── hopla-verify/ ← Auto-activates for verification before completion
212
+ │ ├── hopla-brainstorm/ ← Auto-activates for design exploration
213
+ │ ├── hopla-debug/ ← Auto-activates for systematic debugging
214
+ │ ├── hopla-tdd/ ← Auto-activates for test-driven development
215
+ │ ├── hopla-subagent-execution/ ← Auto-activates for multi-task plans
216
+ │ ├── hopla-parallel-dispatch/ ← Auto-activates for parallel work
217
+ │ └── hopla-worktree/ ← Auto-activates for isolated branch work
218
+ ├── agents/
219
+ │ ├── code-reviewer.md ← Senior code review subagent
220
+ │ ├── codebase-researcher.md ← Fast codebase exploration subagent
221
+ │ └── system-reviewer.md ← Execution vs plan analysis subagent
146
222
  ├── hooks/
147
223
  │ ├── tsc-check.js ← TypeScript type checking after edits
148
224
  │ ├── env-protect.js ← .env file protection
@@ -163,23 +239,35 @@ After each PIV loop, run `/hopla-execution-report` + `/hopla-system-review` to f
163
239
 
164
240
  ### Feature development (PIV loop)
165
241
  ```
166
- /hopla-prime load context at session start
242
+ "ponte al día" → hopla-prime skill auto-loads project context
167
243
  /hopla-plan-feature → research codebase and create plan
168
244
  /hopla-review-plan → review plan summary and approve
169
245
  /hopla-execute → implement the plan with validation
170
- /hopla-code-review standalone review of changes
246
+ /hopla-validate run lint types → tests → integration
247
+ "review the code" → hopla-code-review skill runs automatically
171
248
  /hopla-code-review-fix → fix issues found
172
- /hopla-execution-report document what was built
249
+ /hopla-rca root cause analysis if a bug is found
250
+ "genera el reporte" → hopla-execution-report skill documents what was built
173
251
  /hopla-git-commit → save to git
174
252
  /hopla-git-pr → open pull request on GitHub
175
253
  ```
176
254
 
255
+ ### Full automation (one command)
256
+ ```
257
+ /hopla-end-to-end → runs the entire PIV loop: prime → brainstorm → plan → execute → validate → commit
258
+ ```
259
+
177
260
  ### After implementation
178
261
  ```
179
262
  /hopla-system-review → analyze plan vs. actual for process improvements
180
263
  ```
181
264
 
182
- > **Tip:** `hopla-prime`, `hopla-git-commit`, `hopla-git-pr`, `hopla-code-review`, and `hopla-execution-report` also exist as skills — they auto-activate when you describe what you want in natural language, without typing the slash command.
265
+ ### For non-technical users
266
+ ```
267
+ /hopla-guide → 4D Framework walkthrough (Description, Discernment, Delegation, Diligence)
268
+ ```
269
+
270
+ > **Tip:** Many commands also exist as skills — they auto-activate when you describe what you want in natural language. For example, saying "debug this" triggers `hopla-debug`, and "let's brainstorm" triggers `hopla-brainstorm`, without typing any slash command.
183
271
 
184
272
  ---
185
273
 
@@ -192,7 +280,9 @@ Commands are modular — the output of one becomes the input of the next. Some c
192
280
  | Command | Argument | Example |
193
281
  |---|---|---|
194
282
  | `/hopla-execute` | Path to plan file | `/hopla-execute .agents/plans/auth-feature.md` |
283
+ | `/hopla-end-to-end` | Feature description | `/hopla-end-to-end add user authentication` |
195
284
  | `/hopla-code-review-fix` | Path to review report or description | `/hopla-code-review-fix .agents/code-reviews/auth-review.md` |
285
+ | `/hopla-rca` | Bug description or error message | `/hopla-rca "login fails with 403 after token refresh"` |
196
286
  | `/hopla-system-review` | Plan file + execution report | `/hopla-system-review .agents/plans/auth-feature.md .agents/execution-reports/auth-feature.md` |
197
287
 
198
288
  ### Full PIV loop example
@@ -209,36 +299,41 @@ Commands are modular — the output of one becomes the input of the next. Some c
209
299
  /hopla-execute .agents/plans/add-user-authentication.md
210
300
  → implements the plan, runs validation
211
301
 
212
- # 4. Code review
213
- /hopla-code-review
302
+ # 4. Validate
303
+ /hopla-validate
304
+ → runs lint → types → tests → integration
305
+
306
+ # 5. Code review (auto-triggered skill — just say "review the code")
214
307
  → saves: .agents/code-reviews/add-user-authentication.md
215
308
 
216
- # 5. Fix issues
309
+ # 6. Fix issues
217
310
  /hopla-code-review-fix .agents/code-reviews/add-user-authentication.md
218
311
 
219
- # 6. Document
220
- /hopla-execution-report
312
+ # 7. Document (auto-triggered skill — just say "genera el reporte")
221
313
  → saves: .agents/execution-reports/add-user-authentication.md
222
314
 
223
- # 7. Commit
315
+ # 8. Commit
224
316
  /hopla-git-commit
225
317
 
226
- # 8. Pull request
318
+ # 9. Pull request
227
319
  /hopla-git-pr
228
320
 
229
- # 9. Process improvement (after PR merge)
321
+ # 10. Process improvement (after PR merge)
230
322
  /hopla-system-review .agents/plans/add-user-authentication.md .agents/execution-reports/add-user-authentication.md
231
323
  ```
232
324
 
325
+ > **Or do it all in one command:** `/hopla-end-to-end add user authentication`
326
+
233
327
  ---
234
328
 
235
329
  ## Roadmap
236
330
 
237
331
  Features under consideration for future versions:
238
332
 
239
- - **Custom subagents** (`.claude/agents/`) Define specialized agents with their own instructions and skills for large projects with isolated domains (e.g. frontend agent, backend agent)
333
+ - **Domain-specific agents** — Project-level custom agents beyond the 3 built-in ones (e.g. frontend agent, backend agent, database agent)
240
334
  - **Hook templates** — Installable hook patterns beyond tsc-check and env-protect (e.g. query deduplication, notification hooks)
241
- - **GitHub Actions integration** — Automated PR reviews and `@claude` mentions via GitHub App
335
+ - **GitHub Actions integration** — Automated PR reviews and `@claude` mentions via GitHub App (see `guides/remote-coding.md`)
336
+ - **Team dashboards** — Aggregate execution reports and system reviews across team members
242
337
 
243
338
  ---
244
339
 
@@ -250,7 +345,9 @@ project/
250
345
  ├── CLAUDE.md ← Project rules and stack (from /hopla-init-project)
251
346
  ├── .agents/
252
347
  │ ├── plans/ ← Implementation plans (commit these)
348
+ │ ├── specs/ ← Design specs from brainstorming (commit these)
253
349
  │ ├── guides/ ← On-demand reference guides (commit these)
350
+ │ ├── rca/ ← Root cause analysis docs (commit these)
254
351
  │ ├── execution-reports/ ← Post-implementation reports (don't commit)
255
352
  │ ├── code-reviews/ ← Code review reports (don't commit)
256
353
  │ └── system-reviews/ ← Process improvement reports (don't commit)
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: "Senior code reviewer agent for thorough code quality analysis. Use this agent to review completed code changes with fresh context, catching issues the implementer might miss."
4
+ model: sonnet
5
+ allowed-tools: Read, Grep, Glob, Bash
6
+ ---
7
+
8
+ You are a Senior Code Reviewer. Your job is to review code changes thoroughly and provide actionable feedback.
9
+
10
+ ## Your Review Process
11
+
12
+ 1. **Plan Alignment**: Does the code match what was planned? Are there unexplained deviations?
13
+ 2. **Code Quality**: Is the code clean, readable, and following project conventions?
14
+ 3. **Architecture & Design**: Do the patterns fit? Is the abstraction level appropriate?
15
+ 4. **Logic & Correctness**: Are there bugs, edge cases, or race conditions?
16
+ 5. **Security**: Any secrets, injection vectors, missing validation, or XSS risks?
17
+ 6. **Performance**: Any obvious N+1 queries, unnecessary re-renders, or memory leaks?
18
+
19
+ ## Issue Categories
20
+
21
+ Classify every issue as:
22
+ - **Critical**: Must fix before merge. Bugs, security issues, data loss risks
23
+ - **Important**: Should fix before merge. Logic errors, missing validation, poor patterns
24
+ - **Suggestion**: Nice to have. Style improvements, minor optimizations
25
+
26
+ ## Communication Rules
27
+
28
+ - **Start with what's good** — Always acknowledge well-done work before listing issues
29
+ - **Be specific** — Include file path, line number, and exact suggestion
30
+ - **Explain WHY** — Don't just say "this is wrong", explain the impact
31
+ - **Suggest fixes** — Don't just complain, propose a solution
32
+ - **Stay objective** — Review the code, not the coder
33
+
34
+ ## Output Format
35
+
36
+ Save your review to `.agents/code-reviews/[feature-name].md` with:
37
+ ```
38
+ # Code Review: [Feature Name]
39
+
40
+ ## Summary
41
+ [1-2 sentences: overall assessment]
42
+
43
+ ## What's Done Well
44
+ - [positive observations]
45
+
46
+ ## Issues Found
47
+
48
+ ### Critical
49
+ | File | Line | Issue | Suggestion |
50
+ |------|------|-------|------------|
51
+
52
+ ### Important
53
+ | File | Line | Issue | Suggestion |
54
+ |------|------|-------|------------|
55
+
56
+ ### Suggestions
57
+ | File | Line | Issue | Suggestion |
58
+ |------|------|-------|------------|
59
+
60
+ ## Verdict
61
+ [APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]
62
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: codebase-researcher
3
+ description: "Fast codebase exploration agent for research tasks. Use this agent to investigate code, find patterns, map dependencies, or gather context without polluting the main conversation."
4
+ model: haiku
5
+ allowed-tools: Read, Grep, Glob, Bash
6
+ ---
7
+
8
+ You are a Codebase Researcher. Your job is to quickly explore a codebase and report findings.
9
+
10
+ ## Your Process
11
+
12
+ 1. Understand the research question
13
+ 2. Search the codebase systematically (Glob for files, Grep for patterns, Read for content)
14
+ 3. Organize findings clearly
15
+ 4. Report back with specific file paths, line numbers, and code examples
16
+
17
+ ## Output Format
18
+
19
+ Always structure your findings as:
20
+ ```
21
+ # Research: [Topic]
22
+
23
+ ## Files Found
24
+ - path/to/file.ts — [what it contains and why it's relevant]
25
+
26
+ ## Patterns Observed
27
+ - [pattern 1 with code example]
28
+ - [pattern 2 with code example]
29
+
30
+ ## Key Findings
31
+ [Most important discoveries, ordered by relevance]
32
+
33
+ ## Recommendations
34
+ [How this information should be used]
35
+ ```
36
+
37
+ ## Rules
38
+ - Be thorough but fast — check all relevant directories
39
+ - Include specific line numbers when referencing code
40
+ - Report what you DON'T find too — negative results are valuable
41
+ - Don't modify any files — you are read-only
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: system-reviewer
3
+ description: "System review agent that analyzes execution reports against plans to identify process improvements. Use after feature completion to find patterns and improve the development system."
4
+ model: sonnet
5
+ allowed-tools: Read, Grep, Glob, Bash
6
+ ---
7
+
8
+ You are a System Reviewer. Your job is to analyze how well the implementation matched the plan and suggest process improvements.
9
+
10
+ ## Your Process
11
+
12
+ 1. **Read the plan** — Understand what was intended
13
+ 2. **Read the execution report** — Understand what actually happened
14
+ 3. **Identify divergences** — Where did reality differ from the plan?
15
+ 4. **Classify divergences**:
16
+ - **Good divergence**: Found a better approach, justified deviation
17
+ - **Bad divergence**: Missed requirements, ignored constraints, skipped steps
18
+ 5. **Trace root causes** — Why did each divergence happen?
19
+ 6. **Suggest improvements** — What should change to prevent bad divergences?
20
+
21
+ ## Improvement Decision Matrix
22
+
23
+ | Pattern | Action |
24
+ |---------|--------|
25
+ | Issue appears in ALL features | Update CLAUDE.md |
26
+ | Issue appears in one CLASS of features | Update the specific command |
27
+ | Same manual step repeated 3+ times | Create a new command |
28
+ | Plan ambiguous at same point twice | Update planning command |
29
+ | First occurrence | Document, don't over-engineer |
30
+
31
+ ## Output Format
32
+
33
+ Save to `.agents/system-reviews/[feature-name].md`:
34
+ ```
35
+ # System Review: [Feature Name]
36
+
37
+ ## Alignment Score: [X/10]
38
+
39
+ ## Good Divergences
40
+ - [What changed and why it was better]
41
+
42
+ ## Bad Divergences
43
+ - [What was missed and why]
44
+
45
+ ## Root Causes
46
+ - [Why each bad divergence happened]
47
+
48
+ ## Recommended Improvements
49
+
50
+ ### CLAUDE.md Updates
51
+ - [Specific changes to project rules]
52
+
53
+ ### Command Updates
54
+ - [Specific changes to commands]
55
+
56
+ ### New Commands/Skills Needed
57
+ - [Gaps in the current system]
58
+
59
+ ### Process Changes
60
+ - [Workflow improvements]
61
+
62
+ ## Key Learnings
63
+ - [Insights worth remembering]
64
+ ```
package/cli.js CHANGED
@@ -19,7 +19,8 @@ const CLAUDE_DIR = path.join(os.homedir(), ".claude");
19
19
  const COMMANDS_DIR = path.join(CLAUDE_DIR, "commands");
20
20
  const SKILLS_DIR = path.join(CLAUDE_DIR, "skills");
21
21
  const HOOKS_DIR = path.join(CLAUDE_DIR, "hooks");
22
- const FILES_DIR = path.join(import.meta.dirname, "files");
22
+ const AGENTS_DIR = path.join(CLAUDE_DIR, "agents");
23
+ const REPO_ROOT = import.meta.dirname;
23
24
 
24
25
  const GREEN = "\x1b[32m";
25
26
  const RED = "\x1b[31m";
@@ -72,12 +73,12 @@ function removeFile(dest, label) {
72
73
  async function uninstall() {
73
74
  log(`\n${BOLD}@hopla/claude-setup${RESET} — Uninstall\n`);
74
75
 
75
- const srcEntries = fs.readdirSync(path.join(FILES_DIR, "commands"));
76
+ const srcEntries = fs.readdirSync(path.join(REPO_ROOT, "commands"));
76
77
  const srcFiles = srcEntries.filter((f) =>
77
- fs.statSync(path.join(FILES_DIR, "commands", f)).isFile()
78
+ fs.statSync(path.join(REPO_ROOT, "commands", f)).isFile()
78
79
  );
79
80
  const srcDirs = srcEntries.filter((f) =>
80
- fs.statSync(path.join(FILES_DIR, "commands", f)).isDirectory()
81
+ fs.statSync(path.join(REPO_ROOT, "commands", f)).isDirectory()
81
82
  );
82
83
 
83
84
  // Also include any hopla-* files in ~/.claude/commands/ not in current source
@@ -107,10 +108,13 @@ async function uninstall() {
107
108
  })),
108
109
  ];
109
110
 
110
- // Also remove skills and hooks installed by hopla
111
+ // Also remove skills, agents, and hooks installed by hopla
111
112
  if (fs.existsSync(SKILLS_DIR)) {
112
113
  itemsToRemove.push({ dest: SKILLS_DIR, label: "~/.claude/skills/", isDir: true });
113
114
  }
115
+ if (fs.existsSync(AGENTS_DIR)) {
116
+ itemsToRemove.push({ dest: AGENTS_DIR, label: "~/.claude/agents/", isDir: true });
117
+ }
114
118
  if (fs.existsSync(HOOKS_DIR)) {
115
119
  itemsToRemove.push({ dest: HOOKS_DIR, label: "~/.claude/hooks/", isDir: true });
116
120
  }
@@ -167,6 +171,7 @@ const PLANNING_COMMANDS = [
167
171
  "hopla-review-plan.md",
168
172
  "hopla-git-commit.md",
169
173
  "hopla-git-pr.md",
174
+ "hopla-guide.md",
170
175
  ];
171
176
 
172
177
  async function install() {
@@ -178,14 +183,14 @@ async function install() {
178
183
  fs.mkdirSync(COMMANDS_DIR, { recursive: true });
179
184
 
180
185
  // Determine which command files will be installed
181
- const allCommandEntries = fs.readdirSync(path.join(FILES_DIR, "commands"));
186
+ const allCommandEntries = fs.readdirSync(path.join(REPO_ROOT, "commands"));
182
187
  const allCommandFiles = allCommandEntries.filter((f) => {
183
188
  if (f.startsWith(".")) return false;
184
- const stat = fs.statSync(path.join(FILES_DIR, "commands", f));
189
+ const stat = fs.statSync(path.join(REPO_ROOT, "commands", f));
185
190
  return stat.isFile();
186
191
  });
187
192
  const allCommandDirs = allCommandEntries.filter((f) => {
188
- const stat = fs.statSync(path.join(FILES_DIR, "commands", f));
193
+ const stat = fs.statSync(path.join(REPO_ROOT, "commands", f));
189
194
  return stat.isDirectory();
190
195
  });
191
196
  const commandFiles = PLANNING
@@ -197,7 +202,7 @@ async function install() {
197
202
 
198
203
  log(`${CYAN}Installing global rules...${RESET}`);
199
204
  await installFile(
200
- path.join(FILES_DIR, "CLAUDE.md"),
205
+ path.join(REPO_ROOT, "global-rules.md"),
201
206
  path.join(CLAUDE_DIR, "CLAUDE.md"),
202
207
  "~/.claude/CLAUDE.md"
203
208
  );
@@ -205,14 +210,14 @@ async function install() {
205
210
  log(`\n${CYAN}Installing commands...${RESET}`);
206
211
  for (const file of commandFiles.sort()) {
207
212
  await installFile(
208
- path.join(FILES_DIR, "commands", file),
213
+ path.join(REPO_ROOT, "commands", file),
209
214
  path.join(COMMANDS_DIR, file),
210
215
  `~/.claude/commands/${file}`
211
216
  );
212
217
  }
213
218
  // Install subdirectories (e.g. guides/)
214
219
  for (const dir of allCommandDirs.sort()) {
215
- const srcDir = path.join(FILES_DIR, "commands", dir);
220
+ const srcDir = path.join(REPO_ROOT, "commands", dir);
216
221
  const destDir = path.join(COMMANDS_DIR, dir);
217
222
  fs.mkdirSync(destDir, { recursive: true });
218
223
  for (const file of fs.readdirSync(srcDir).sort()) {
@@ -237,14 +242,15 @@ async function install() {
237
242
 
238
243
  await setupPermissions();
239
244
  await installSkills();
245
+ await installAgents();
240
246
  await installHooks();
241
247
  }
242
248
 
243
249
  // Skills to install in planning mode (subset)
244
- const PLANNING_SKILLS = ["hopla-prime"];
250
+ const PLANNING_SKILLS = ["hopla-prime", "hopla-brainstorm"];
245
251
 
246
252
  async function installSkills() {
247
- const skillsSrcDir = path.join(FILES_DIR, "skills");
253
+ const skillsSrcDir = path.join(REPO_ROOT, "skills");
248
254
  if (!fs.existsSync(skillsSrcDir)) return;
249
255
 
250
256
  fs.mkdirSync(SKILLS_DIR, { recursive: true });
@@ -279,8 +285,33 @@ async function installSkills() {
279
285
  }
280
286
  }
281
287
 
288
+ async function installAgents() {
289
+ const agentsSrcDir = path.join(REPO_ROOT, "agents");
290
+ if (!fs.existsSync(agentsSrcDir)) return;
291
+
292
+ fs.mkdirSync(AGENTS_DIR, { recursive: true });
293
+
294
+ const agentFiles = fs.readdirSync(agentsSrcDir).filter((f) => f.endsWith(".md"));
295
+ if (agentFiles.length === 0) return;
296
+
297
+ log(`\n${CYAN}Installing agents...${RESET}`);
298
+ for (const file of agentFiles.sort()) {
299
+ await installFile(
300
+ path.join(agentsSrcDir, file),
301
+ path.join(AGENTS_DIR, file),
302
+ `~/.claude/agents/${file}`
303
+ );
304
+ }
305
+
306
+ log(`\n${GREEN}${BOLD}Agents installed!${RESET} Available for use:\n`);
307
+ for (const file of agentFiles.sort()) {
308
+ const name = file.replace(".md", "");
309
+ log(` ${CYAN}${name}${RESET}`);
310
+ }
311
+ }
312
+
282
313
  async function installHooks() {
283
- const hooksSrcDir = path.join(FILES_DIR, "hooks");
314
+ const hooksSrcDir = path.join(REPO_ROOT, "hooks");
284
315
  if (!fs.existsSync(hooksSrcDir)) return;
285
316
 
286
317
  const hookFiles = fs.readdirSync(hooksSrcDir).filter((f) => f.endsWith(".js"));