@hopla/claude-setup 1.10.1 → 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 +4 -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,70 @@
1
+ # AI-Optimized Codebase Guide
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when initializing a project with `/hopla-init-project` or when optimizing an existing codebase for better AI-assisted development.
5
+
6
+ ## Principles
7
+
8
+ ### 1. Vertical Slice Architecture
9
+ Organize code by feature, not by layer:
10
+ ```
11
+ src/
12
+ ├── core/ # Universal infrastructure (config, database, logging)
13
+ ├── shared/ # Code used by 3+ features (the "three-feature rule")
14
+ └── features/ # Independent vertical slices
15
+ ├── auth/ # routes + service + models + tests
16
+ ├── products/ # routes + service + models + tests
17
+ └── orders/ # routes + service + models + tests
18
+ ```
19
+
20
+ **Why**: AI can load an entire feature in one context window. Layer-based organization scatters context across many files.
21
+
22
+ ### 2. LLM-Friendly Docstrings
23
+ Write docstrings that help AI understand code:
24
+ ```typescript
25
+ /**
26
+ * PURPOSE: Calculate total order cost including tax and discounts
27
+ * INPUTS: items (OrderItem[]), taxRate (number), discount? (Discount)
28
+ * OUTPUTS: { subtotal, tax, discount, total } (all in cents)
29
+ * GOTCHA: All monetary values are in cents to avoid floating point issues
30
+ * EXAMPLE: calculateTotal([{price: 1000, qty: 2}], 0.08) → {subtotal: 2000, tax: 160, total: 2160}
31
+ */
32
+ ```
33
+
34
+ ### 3. Structured Logging
35
+ Use JSON-structured logs with context for AI parsing:
36
+ ```typescript
37
+ logger.info("order_created", {
38
+ correlation_id: req.id,
39
+ order_id: order.id,
40
+ items_count: items.length,
41
+ total_cents: total,
42
+ duration_ms: Date.now() - start
43
+ });
44
+ ```
45
+
46
+ **Never**: Log sensitive data, use string formatting, spam in loops
47
+
48
+ ### 4. Strict Type Safety
49
+ - Enable strict TypeScript (`strict: true` in tsconfig)
50
+ - For Python: use mypy (strict) + pyright
51
+ - Types serve as contracts that AI can read and follow
52
+
53
+ ### 5. Comprehensive Validation Commands
54
+ Include in CLAUDE.md:
55
+ ```markdown
56
+ ## Development Commands
57
+ - `npm run lint` — ESLint check
58
+ - `npm run typecheck` — TypeScript strict check
59
+ - `npm run test` — Unit tests
60
+ - `npm run test:integration` — Integration tests
61
+ - `npm run dev` — Development server
62
+ ```
63
+
64
+ ### 6. Test Structure Mirrors Source
65
+ ```
66
+ src/features/auth/auth.service.ts
67
+ src/features/auth/__tests__/auth.service.test.ts
68
+ ```
69
+
70
+ AI can find tests by convention, no configuration needed.
@@ -0,0 +1,82 @@
1
+ # Hooks Reference Guide
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when creating custom hooks or troubleshooting existing ones.
5
+
6
+ ## Hook Types
7
+
8
+ | Hook | When It Fires | Can Block? | Use For |
9
+ |------|---------------|------------|---------|
10
+ | PreToolUse | Before any tool call | Yes (exit 2) | Blocking dangerous operations |
11
+ | PostToolUse | After any tool call | No | Feedback, auto-formatting, validation |
12
+ | Notification | When Claude needs permission or after 60s inactivity | No | Custom notifications |
13
+ | Stop | When Claude finishes responding | No | Post-response automation |
14
+ | SubagentStop | When a subagent finishes | No | Subagent result processing |
15
+ | PreCompact | Before /compact operation | No | Saving context before compaction |
16
+ | UserPromptSubmit | When user submits a prompt | Yes (exit 2) | Input validation, routing |
17
+ | SessionStart | When session begins | No | Context loading, setup |
18
+ | SessionEnd | When session ends | No | Cleanup, logging |
19
+
20
+ ## Hook Configuration
21
+
22
+ Hooks are configured in settings.json (global, project, or local):
23
+
24
+ ```json
25
+ {
26
+ "hooks": {
27
+ "PreToolUse": [
28
+ {
29
+ "matcher": "Read|Grep",
30
+ "hooks": [
31
+ {
32
+ "type": "command",
33
+ "command": "/absolute/path/to/hook.js"
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ```
41
+
42
+ ## Hook Input (stdin JSON)
43
+
44
+ ```json
45
+ {
46
+ "session_id": "...",
47
+ "transcript_path": "...",
48
+ "hook_event_name": "PreToolUse",
49
+ "tool_name": "Read",
50
+ "tool_input": {
51
+ "file_path": "/code/.env"
52
+ }
53
+ }
54
+ ```
55
+
56
+ ## Exit Codes
57
+ - `0` — Allow operation to proceed
58
+ - `2` — Block operation (PreToolUse only)
59
+ - Stderr output → shown to Claude as feedback when blocking
60
+
61
+ ## Security Best Practices
62
+ - **ALWAYS use absolute paths** for hook scripts (prevents path hijacking)
63
+ - Use `$PWD` placeholders in version control, replace with absolute paths on setup
64
+ - Never run hooks from user-writable directories without verification
65
+
66
+ ## Debugging Hooks
67
+
68
+ Log all hook data to inspect the structure:
69
+ ```json
70
+ "PostToolUse": [{
71
+ "matcher": "*",
72
+ "hooks": [{
73
+ "type": "command",
74
+ "command": "jq . > /tmp/hook-debug.json"
75
+ }]
76
+ }]
77
+ ```
78
+
79
+ ## HOPLA Installed Hooks
80
+ - **tsc-check.js** (PostToolUse): Runs TypeScript type checking after file edits
81
+ - **env-protect.js** (PreToolUse): Blocks reads of .env files
82
+ - **session-prime.js** (SessionStart): Provides project context at session start
@@ -0,0 +1,32 @@
1
+ # MCP Integration Guide
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when planning features that involve external tools or services available via MCP.
5
+
6
+ ## MCP in the PIV Loop
7
+
8
+ ### During Planning (`/hopla-plan-feature`)
9
+ - Check what MCP servers are configured (listed in CLAUDE.md under "MCP Servers")
10
+ - For each external integration point, specify which MCP tool to use
11
+ - Example: "Step 3: Use Playwright MCP to verify the component renders correctly"
12
+
13
+ ### During Execution (`/hopla-execute`)
14
+ - Before starting, verify MCP servers are available and responsive
15
+ - When a task involves an MCP tool, use it explicitly (don't fall back to manual alternatives)
16
+ - If an MCP server is unavailable, document it and skip that validation step
17
+
18
+ ### During Validation (`/hopla-validate`)
19
+ - Use Playwright MCP for E2E browser validation if configured
20
+ - Use database MCPs to verify data state after migrations
21
+ - Document which validations were done via MCP vs. manual
22
+
23
+ ## Common MCP Patterns
24
+ - **Playwright**: Browser automation for E2E testing and visual verification
25
+ - **Database (Supabase, D1, etc.)**: Schema management, data verification
26
+ - **API testing**: Endpoint verification, response validation
27
+ - **File systems**: Cross-system file operations
28
+
29
+ ## Adding MCP to Your Project
30
+ 1. Configure MCP servers in `.claude/settings.json` or `.claude/settings.local.json`
31
+ 2. List them in your project's CLAUDE.md under the "MCP Servers" section
32
+ 3. Pre-approve permissions in settings to avoid repeated prompts
@@ -0,0 +1,70 @@
1
+ # Remote Agentic Coding Guide (Future)
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when setting up GitHub-based automation for remote code generation.
5
+
6
+ ## Overview
7
+
8
+ Remote agentic coding moves AI-assisted development from your local terminal to GitHub, enabling:
9
+ - Issue-driven development (create issue → agent implements → PR created)
10
+ - Automated code review on PRs
11
+ - Release note generation from commit history
12
+ - Parallel feature development across multiple agents
13
+
14
+ ## Three Autonomy Levels
15
+
16
+ ### Level 1: Hybrid (Recommended Starting Point)
17
+ - **Agent**: Creates branch, implements, comments on issue
18
+ - **Human**: Reviews PR, makes final decision to merge
19
+ - **Setup**: GitHub Actions + Claude Code CLI
20
+
21
+ ### Level 2: Autonomous
22
+ - **Agent**: Everything including PR creation and merge
23
+ - **Human**: Only monitors
24
+ - **Setup**: GitHub Actions + full permissions
25
+
26
+ ### Level 3: Deterministic
27
+ - **Workflow**: Controls process (branch creation, PR management)
28
+ - **Agent**: Only responsible for code changes
29
+ - **Setup**: Strict GitHub Actions workflow
30
+
31
+ ## GitHub Actions Workflow (Level 1)
32
+
33
+ ```yaml
34
+ name: Claude Code Agent
35
+ on:
36
+ issues:
37
+ types: [assigned]
38
+ issue_comment:
39
+ types: [created]
40
+
41
+ jobs:
42
+ agent:
43
+ if: contains(github.event.comment.body, '@claude')
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Run Claude Code
48
+ env:
49
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
50
+ run: |
51
+ npx claude-code --print "
52
+ Read issue #${{ github.event.issue.number }}.
53
+ /hopla-plan-feature based on the issue requirements.
54
+ /hopla-execute the plan.
55
+ /hopla-validate
56
+ Create a PR with the results.
57
+ "
58
+ ```
59
+
60
+ ## Prerequisites
61
+ - HOPLA commands installed in the repo (.claude/commands/)
62
+ - CLAUDE.md configured for the project
63
+ - GitHub Actions enabled
64
+ - Claude Code API key in GitHub Secrets
65
+
66
+ ## Best Practices
67
+ - Start with Level 1 (hybrid) until you trust the system
68
+ - Always require human PR review
69
+ - Use conventional commits for automated changelog generation
70
+ - Set up branch protection rules to prevent direct merges
@@ -0,0 +1,54 @@
1
+ # Scaling Agentic Coding Beyond Engineering
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when expanding HOPLA usage to non-technical team members.
5
+
6
+ ## The Opportunity
7
+
8
+ According to Anthropic's 2026 Agentic Coding Trends Report:
9
+ - Non-technical teams (legal, sales, marketing, ops) are building their own solutions
10
+ - The barrier between "people who code" and "people who don't" is becoming permeable
11
+ - Domain experts implementing solutions directly removes bottlenecks
12
+
13
+ ## HOPLA's Planning Mode
14
+
15
+ HOPLA already supports non-technical users via `--planning` mode:
16
+ - Restricted command set (planning and review only)
17
+ - Limited git permissions (read-only)
18
+ - Focus on product decisions, not implementation
19
+
20
+ ## Expanding the Model
21
+
22
+ ### Phase 1: Product Planning (Current)
23
+ Non-technical users can:
24
+ - Create PRDs with `/hopla-create-prd`
25
+ - Plan features with `/hopla-plan-feature`
26
+ - Review plans with `/hopla-review-plan`
27
+ - Guide workflow with `/hopla-guide` (4D Framework)
28
+
29
+ ### Phase 2: Assisted Creation (Future)
30
+ Non-technical users could:
31
+ - Create simple automations with guided workflows
32
+ - Generate reports from existing data
33
+ - Build simple dashboards with AI assistance
34
+ - Create documentation from templates
35
+
36
+ ### Phase 3: Domain Expert Development (Future)
37
+ Domain experts could:
38
+ - Implement domain-specific logic with AI guidance
39
+ - Create and modify business rules
40
+ - Build prototype interfaces
41
+ - Automate repetitive workflows
42
+
43
+ ## The 4D Framework for Non-Technical Users
44
+
45
+ 1. **Description**: Communicate clearly what you need (context-rich prompts)
46
+ 2. **Discernment**: Evaluate critically what the AI produces
47
+ 3. **Delegation**: Choose what AI handles vs. what you handle
48
+ 4. **Diligence**: Take responsibility for outputs, test before deploying
49
+
50
+ ## Success Metrics
51
+ - Time to first productive output for new non-technical users
52
+ - Quality of plans produced (review scores)
53
+ - Reduction in engineer bottleneck for planning tasks
54
+ - User satisfaction and confidence scores
@@ -0,0 +1,78 @@
1
+ # Writing Skills Guide (Internal)
2
+
3
+ ## When to Use This Guide
4
+ Reference this guide when creating new skills for the HOPLA system.
5
+
6
+ ## Skill Structure
7
+
8
+ ```
9
+ skill-name/
10
+ ├── SKILL.md (< 500 lines, main instructions)
11
+ ├── scripts/ (executable code — only output consumes tokens)
12
+ ├── references/ (detailed docs, loaded on-demand)
13
+ └── assets/ (templates, data files)
14
+ ```
15
+
16
+ ## SKILL.md Format
17
+
18
+ ```yaml
19
+ ---
20
+ name: skill-name
21
+ description: "100-150 words. Start with what it does, then 'Use when...' + specific triggers. End with 'Do NOT use for...' anti-triggers."
22
+ allowed-tools: Read, Grep, Glob, Bash # Optional: restrict tools
23
+ model: sonnet # Optional: force specific model
24
+ ---
25
+ ```
26
+
27
+ ## Writing Effective Descriptions
28
+
29
+ The description is the MOST CRITICAL field — it determines when the skill activates.
30
+
31
+ ### Pattern
32
+ ```
33
+ [What the skill does]. Use when [trigger phrases, synonyms, variations in English and Spanish]. Do NOT use for [anti-triggers].
34
+ ```
35
+
36
+ ### Good Example
37
+ ```
38
+ "Technical code review on changed files. Use when the user says 'review code', 'code review', 'check my code', 'review changes', 'look for bugs', or 'audit code'. Do NOT use for reviewing plans or documents — only code."
39
+ ```
40
+
41
+ ### Bad Example
42
+ ```
43
+ "A skill for reviewing things."
44
+ ```
45
+
46
+ ## Claude Search Optimization (CSO)
47
+
48
+ Claude uses SEMANTIC matching, not keyword matching. Cover:
49
+ - Different phrasings of the same intent
50
+ - English AND Spanish triggers (for HOPLA's bilingual users)
51
+ - Common misspellings or abbreviations
52
+ - Related verbs and nouns
53
+
54
+ ## Testing Skills
55
+
56
+ Before shipping a new skill:
57
+ 1. **Pressure test**: Does it activate when it should?
58
+ 2. **Negative test**: Does it NOT activate when it shouldn't?
59
+ 3. **Conflict test**: Does it conflict with existing skills?
60
+ 4. **Content test**: Are the instructions clear enough for the agent to follow?
61
+
62
+ ## Rationalization Tables
63
+
64
+ For skills that enforce discipline (like TDD or verification), include a table of common excuses:
65
+
66
+ | Rationalization | Counter |
67
+ |----------------|---------|
68
+ | "I'll do it later" | No. Do it now. Later means never. |
69
+ | "This is too simple" | Simple things grow complex. Document intent. |
70
+
71
+ ## Progressive Disclosure
72
+
73
+ Keep SKILL.md under 500 lines. If you need more:
74
+ - Put detailed reference material in `references/` subdirectory
75
+ - Put executable logic in `scripts/` subdirectory
76
+ - In SKILL.md, reference them: "When doing X, read references/x-guide.md"
77
+
78
+ Scripts are better than docs when possible — only the OUTPUT consumes tokens, not the script source.
@@ -19,6 +19,14 @@ If $1 is a description, treat it as the list of issues to fix.
19
19
 
20
20
  If $2 is provided, filter to only the issues within that scope.
21
21
 
22
+ ## Pre-Fix Verification
23
+
24
+ Before fixing each issue:
25
+ 1. **Verify the issue is real** — Read the actual code. Is this a genuine bug or a false positive?
26
+ 2. **Push back if needed** — If an issue is not real, document WHY it's a false positive instead of "fixing" it
27
+ 3. **YAGNI check** — Does the suggested fix add unnecessary complexity? If the fix introduces code that isn't needed for current requirements, skip it and document the reason
28
+ 4. **Never use performative agreement** — Don't say "You're absolutely right!" before verifying. Check the codebase first, then respond.
29
+
22
30
  ## Step 2: Fix Issues One by One
23
31
 
24
32
  For each issue, in order of severity (critical → high → medium → low):
@@ -0,0 +1,67 @@
1
+ # End-to-End Feature Implementation
2
+
3
+ > Execute the complete PIV loop for a feature in one go: prime → brainstorm → plan → review → execute → validate → commit.
4
+
5
+ > ⚠️ **Advanced**: Only use this command after you've proven each individual command works reliably. Build trust gradually.
6
+
7
+ ## Input
8
+ - `$ARGUMENTS`: Feature description or requirement
9
+
10
+ ## Autonomy Levels
11
+
12
+ This command represents **Level 3 autonomy**. Make sure you've mastered:
13
+ - Level 1: Manual prompts (writing everything each time)
14
+ - Level 2: Individual commands (/hopla-plan-feature, /hopla-execute, etc.)
15
+ - Level 3: Command chaining (this command)
16
+
17
+ ## Process
18
+
19
+ ### Phase 1: Context Loading
20
+ Load project context:
21
+ - Read CLAUDE.md, README, package.json
22
+ - Check git state (branch, status, pending plans)
23
+ - Identify current development phase
24
+
25
+ ### Phase 2: Brainstorm (if needed)
26
+ If the feature is non-trivial (estimated > 1 hour):
27
+ - Explore 2-3 approaches with trade-offs
28
+ - Get user approval on approach
29
+ - Save design doc to `.agents/specs/`
30
+
31
+ If trivial: skip to Phase 3.
32
+
33
+ ### Phase 3: Plan
34
+ - Research codebase for related patterns
35
+ - Generate structured implementation plan
36
+ - Save to `.agents/plans/[feature-name].md`
37
+
38
+ ### 🔒 GATE: Plan Review
39
+ **STOP and present the plan to the user.**
40
+ - Show executive summary
41
+ - Wait for explicit approval before proceeding
42
+ - If changes requested: iterate on the plan
43
+
44
+ ### Phase 4: Execute
45
+ - Create feature branch (`feature/[name]` from develop)
46
+ - Execute all plan tasks sequentially
47
+ - Validate after each phase boundary
48
+
49
+ ### Phase 5: Validate
50
+ - Run full validation pyramid (lint → types → tests → integration)
51
+ - Run code review
52
+ - Fix any critical/important issues found
53
+
54
+ ### 🔒 GATE: Human Review
55
+ **STOP and present results to the user.**
56
+ - Show what was built, what was validated
57
+ - Wait for approval before committing
58
+
59
+ ### Phase 6: Commit & PR
60
+ - Create conventional commit(s)
61
+ - Suggest creating a PR if on a feature branch
62
+
63
+ ## Rules
64
+ - Never skip the human gates (plan review, final review)
65
+ - If any phase fails, stop and report — don't push through
66
+ - Each phase should feel like a natural conversation, not a script
67
+ - Adapt: skip brainstorming for small features, skip PR for hotfixes
@@ -3,6 +3,8 @@ description: Execute a structured plan from start to finish with validation
3
3
  argument-hint: "<plan-file-path>"
4
4
  ---
5
5
 
6
+ > 💡 **Tip**: For complex tasks with intricate logic, consider using Extended Thinking mode for better reasoning quality.
7
+
6
8
  > 🌐 **Language:** All user-facing output must match the user's language. Code, paths, and commands stay in English.
7
9
 
8
10
  Execute the implementation plan provided. You are the executing agent — you have not seen the planning conversation. The plan is your only source of truth.
@@ -0,0 +1,61 @@
1
+ # HOPLA Guide for Non-Technical Users
2
+
3
+ > A guided framework for working effectively with your AI coding assistant.
4
+
5
+ ## The 4D Framework
6
+
7
+ ### 📝 Description — Communicate Clearly
8
+ Tell the AI what you need with rich context:
9
+ - What problem are you solving?
10
+ - Who is the user/audience?
11
+ - What does success look like?
12
+ - What constraints exist (budget, timeline, tech)?
13
+
14
+ **Tip**: The more specific you are, the better the output. "Add a login page" → "Add a login page with email/password, Google OAuth, and a forgot password flow that matches our brand colors."
15
+
16
+ ### 🔍 Discernment — Evaluate Critically
17
+ Don't accept AI output at face value:
18
+ - Does this match what you asked for?
19
+ - Does it make sense for your users?
20
+ - Is the quality acceptable?
21
+ - Would you be comfortable showing this to stakeholders?
22
+
23
+ **Tip**: Ask the AI to explain its reasoning. If you don't understand the explanation, ask for a simpler one.
24
+
25
+ ### 🤝 Delegation — Choose What AI Does vs. You
26
+ Three categories for every task:
27
+
28
+ | Category | Examples |
29
+ |----------|---------|
30
+ | **AI handles** | Writing boilerplate, research, first drafts, data analysis |
31
+ | **AI assists, you review** | Feature plans, PRDs, code reviews, documentation |
32
+ | **You handle** | Final decisions, stakeholder communication, business strategy |
33
+
34
+ ### ✅ Diligence — Take Responsibility
35
+ - **Creation diligence**: Verify outputs before sharing
36
+ - **Deployment diligence**: Test before using in production
37
+ - **Transparency diligence**: Document when AI was used
38
+
39
+ ## Your Available Commands
40
+
41
+ ### For Planning & Product
42
+ - `/hopla-create-prd` — Create a Product Requirements Document through guided conversation
43
+ - `/hopla-plan-feature` — Create an implementation plan (AI researches, you approve)
44
+ - `/hopla-review-plan` — Review a plan before execution
45
+
46
+ ### For Oversight
47
+ - `/hopla-system-review` — Analyze how well the AI followed the plan
48
+ - `/hopla-guide` — Show this guide again
49
+
50
+ ## Getting Started
51
+
52
+ 1. Start with `/hopla-create-prd` to define your project scope
53
+ 2. Use `/hopla-plan-feature "your feature idea"` to plan each feature
54
+ 3. Review the plan with `/hopla-review-plan`
55
+ 4. Hand off to a developer for execution, or ask the AI to execute
56
+
57
+ ## Tips for Better Results
58
+ - One request at a time — don't overload with multiple asks
59
+ - Be specific about what you want, not how to build it
60
+ - If the output isn't right, say what's wrong rather than starting over
61
+ - Use the review loop: the AI expects your feedback before proceeding
@@ -3,6 +3,8 @@ description: Research the codebase and create a structured implementation plan f
3
3
  argument-hint: "<feature-name-or-description>"
4
4
  ---
5
5
 
6
+ > 💡 **Tip**: Activate Plan Mode (`Shift+Tab` twice) before running this command for deeper codebase exploration. For complex features, use Extended Thinking for better reasoning.
7
+
6
8
  > 🌐 **Language:** All user-facing output must match the user's language. Code, paths, and commands stay in English.
7
9
 
8
10
  Transform the requirements discussed in this conversation into a structured plan that another agent can execute without access to this conversation.
@@ -72,6 +74,8 @@ Based on research, define:
72
74
  - **Bidirectional data interactions:** If feature A updates data that feature B displays, does B need to react? If adding an item triggers validation, does editing trigger re-validation? Map all data mutation → side effect chains, not just keyboard navigation. Missed bidirectional interactions were a recurring planning blind spot.
73
75
  - **AI/LLM prompt tasks:** If the plan involves creating or modifying AI prompts (system prompts, prompt templates, LLM-based features), add an explicit task for testing against real data with 2-3 iteration cycles budgeted. AI prompt engineering rarely works on the first attempt.
74
76
  - **User preferences check:** Before specifying UI architecture (modal vs. inline, page vs. panel, dialog vs. drawer), verify against MEMORY.md and conversation history for established preferences. In past implementations, plans that specified modals were rejected because the user preferred inline panels — this caused rework. When no preference exists, note it as a decision point for the user to confirm.
77
+ - **Reuse context analysis:** When a new view reuses an existing component in a different context (e.g., a list component in a "history" view vs. an "active" view), the plan MUST list what's different about the new context's requirements: different columns, different data filters, different interactions, different toolbar layout. Missed context differences caused 40%+ of unplanned work in past implementations.
78
+ - **Multi-phase plan guidance:** For features requiring 3+ phases, create an architectural plan (`backlog/NN-feature.md`) with schema, phase boundaries, and target architecture. When executing each phase, create a standalone plan (`phase-NX-description.md`) with full task-level detail following this template. The architectural plan is the spec; phase plans are the execution instructions. Each phase should have its own feature branch and PR.
75
79
 
76
80
  ## Phase 5: Generate the Plan
77
81
 
@@ -0,0 +1,64 @@
1
+ # Root Cause Analysis
2
+
3
+ > Investigate a bug or issue and produce a structured RCA document.
4
+
5
+ > 💡 **Tip**: Use Extended Thinking mode for complex bugs with multiple possible causes.
6
+
7
+ ## Input
8
+ - `$ARGUMENTS`: Issue description, error message, or GitHub issue ID/URL
9
+
10
+ ## Process
11
+
12
+ ### Step 1: Gather Information
13
+ - If a GitHub issue: read the full issue, comments, and any linked PRs
14
+ - If an error: read the full error message and stack trace
15
+ - Run `git log --oneline -20` to check recent changes
16
+ - Run `git diff` to see current uncommitted changes
17
+
18
+ ### Step 2: Investigate
19
+ - Search the codebase for the affected code: `grep`, `glob`, `read`
20
+ - Identify the function/component where the error originates
21
+ - Check git blame for recent changes to that area
22
+ - Look for related tests — do they pass? Are they missing?
23
+
24
+ ### Step 3: Root Cause Analysis
25
+ Apply the hopla-debug methodology:
26
+ 1. **Reproduce**: Can you trigger the issue?
27
+ 2. **Narrow**: Which exact file and line?
28
+ 3. **Hypothesize**: What's the most likely cause based on evidence?
29
+ 4. **Verify**: Can you confirm the hypothesis?
30
+
31
+ ### Step 4: Generate RCA Document
32
+ Save to `.agents/rca/[issue-name].md`:
33
+
34
+ ```
35
+ # RCA: [Issue Title]
36
+
37
+ ## Symptoms
38
+ What the user sees / what the error is
39
+
40
+ ## Root Cause
41
+ What's actually wrong and why
42
+
43
+ ## Evidence
44
+ - [file:line] — what you found
45
+ - [git commit] — what changed
46
+
47
+ ## Proposed Fix
48
+ What needs to change to resolve this
49
+
50
+ ## Tests Needed
51
+ - Test to reproduce the bug
52
+ - Test to verify the fix
53
+
54
+ ## Prevention
55
+ How to prevent similar issues in the future
56
+
57
+ ## Next Steps
58
+ - [ ] Implement fix (run `/hopla-execute` with a plan, or fix directly if simple)
59
+ - [ ] Add regression test
60
+ - [ ] Validate with `/hopla-validate`
61
+ ```
62
+
63
+ ## Output
64
+ The RCA document in `.agents/rca/`, ready for review or execution.
@@ -64,6 +64,11 @@ If everything passes, confirm the project is healthy.
64
64
 
65
65
  If anything failed and could not be fixed, list the remaining issues and suggest next steps.
66
66
 
67
+ ## After Validation Passes
68
+
69
+ - Suggest running `/hopla-code-review` if not already done
70
+ - Remind that completion claims must be backed by this fresh validation evidence (see hopla-verify skill)
71
+
67
72
  ## Next Step
68
73
 
69
74
  After validation passes, suggest: