You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhance: improve Bobby's GitHub issue creation with comprehensive clarification workflow
- Add mandatory 5-step process for GitHub issue creation
- Require code examination and iterative clarification before creating issues
- Include detailed examples for clarification and creation phases
- Ensure Bobby creates well-researched, comprehensive GitHub issues
- Add node_modules/ to .gitignore for cleaner repository
🤖 Generated with [opencode](https://opencode.ai)
Co-Authored-By: opencode <[email protected]>
Bobby is a Discord chatbot that helps answer questions about your codebase, file bugs, and translate business requirements into technical requirements. Bobby leverages Claude Code to understand your codebase and provide intelligent responses in a self-hosted, privacy-first environment.
6
+
7
+
## Core Architecture
8
+
9
+
### Main Components
10
+
11
+
-**index.js** - Main Node.js application using Bun runtime
12
+
-**Discord.js** - Handles Discord bot interactions and thread management
13
+
-**Claude Code CLI** - Powers AI analysis of codebases with streaming responses
14
+
-**GitHub CLI** - Creates issues automatically when bugs are detected
15
+
-**Docker Container** - Self-contained environment with all dependencies
-**Data Storage**: `/app/data` (Claude Code sessions and configs)
34
+
-**Entrypoint**: `entrypoint.sh` (handles authentication and setup)
35
+
36
+
## Thread-Based Session Management
37
+
38
+
Bobby uses Discord threads for session management with streaming responses:
39
+
40
+
1.**New Conversations**: Mention Bobby in any channel to create a new thread with a new Claude Code session
41
+
2.**Follow-ups**: Simply type in the thread (no need to mention Bobby) to continue the same Claude Code session
42
+
3.**Thread Naming**: Threads are automatically named as `Bobby - Title - session-id` where:
43
+
-`Title` is a 3-5 word summary generated by Claude (hidden from user via regex)
44
+
-`session-id` is the Claude Code session identifier
45
+
4.**Streaming Responses**: Real-time message streaming with JSON parsing
46
+
5.**Auto-Archive**: Threads automatically archive after 24 hours of inactivity
47
+
48
+
### Session Flow
49
+
50
+
```
51
+
User mentions Bobby → Create thread → Spawn Claude process → Stream JSON responses → Extract session ID → Update thread name
52
+
```
53
+
54
+
## Available Tools & Capabilities
55
+
56
+
Bobby has access to the following tools through Claude Code:
57
+
58
+
-**Read, Grep, Glob, LS** - File operations for codebase analysis
59
+
-**Bash(gh:*)** - GitHub CLI for issue creation and repository access
60
+
-**Bash(git:*)** - Git commands for repository operations
61
+
-**WebFetch, WebSearch** - Web access for additional information
62
+
63
+
## Important Limitations
64
+
65
+
Bobby is designed as a **READ-ONLY** assistant:
66
+
67
+
- ✅ Can analyze, explore, and read your codebase
68
+
- ✅ Can create GitHub issues for bugs and improvements
69
+
- ✅ Can provide code recommendations and suggestions
70
+
- ✅ Can fetch latest git changes and analyze repository state
71
+
- ❌ Cannot modify, edit, or write code files
72
+
- ❌ Cannot make commits or push changes
73
+
74
+
**Enforcement**: The system prompt explicitly instructs Claude to immediately decline any modification requests and offer to create GitHub issues instead.
- Syncs README to Docker Hub (with error tolerance)
132
+
133
+
## Issue Filing Guidelines
134
+
135
+
When Bobby detects bugs, it follows these guidelines:
136
+
137
+
1.**Clear title** describing the bug
138
+
2.**Detailed description** with technical details
139
+
3.**Reproduction steps** when available
140
+
4.**Labels**: "bug,bobby-detected" or "enhancement,bobby-detected"
141
+
5.**Attribution**: "Detected by Bobby (Claude Code assistant)"
142
+
6.**Response Format**: Always includes issue link and number
143
+
144
+
## Memory Management
145
+
146
+
Bobby stores information in Markdown files in the `docs/` directory, organized by topic. The `CLAUDE.md` file serves as an index to these memory files, helping Claude find relevant information during conversations.
147
+
148
+
## Troubleshooting
149
+
150
+
### Claude API Authentication Issues
151
+
152
+
If authentication errors occur (known issue):
153
+
154
+
1. Access running container: `docker exec -it bobby /bin/sh`
@@ -134,11 +134,12 @@ When users ask about your capabilities or session management, explain this syste
134
134
<instructions>
135
135
1. **FIRST: Check if the request involves code modification** - if yes, immediately decline and offer to create a GitHub issue
136
136
2. **Always start by fetching latest git changes** using available tools (only for analysis requests)
137
-
3. **Analyze the relevant code sections** thoroughly but efficiently
137
+
3. **Analyze the relevant code sections** thoroughly but efficiently
138
138
4. **Provide direct, actionable answers** - users need solutions, not explanations of problems
139
139
5. **If you discover genuine bugs:** Check for existing GitHub issues first, then create a detailed issue if none exists
140
140
6. **When declining code modifications:** IMMEDIATELY create a GitHub issue using the Bash tool with gh CLI
141
-
7. **You HAVE Bash tool access** - use it confidently to run gh commands for issue creation
141
+
7. **When users ask to create GitHub issues:** Follow the mandatory clarification process - examine code, ask questions, iterate until complete understanding, then create
142
+
8. **You HAVE Bash tool access** - use it confidently to run gh commands for issue creation
142
143
143
144
<response_format>
144
145
- Lead with the **direct answer** (1-2 sentences max)
@@ -153,26 +154,88 @@ You HAVE the Bash tool with gh CLI access and MUST create GitHub issues for:
153
154
- Bugs you discover in the code
154
155
- Feature requests when users ask for code modifications
155
156
- Improvements you identify
157
+
- **When users explicitly ask you to create a GitHub issue**
156
158
157
159
IMPORTANT: You have these tools available - use them confidently:
158
160
- Bash tool (for gh and git commands)
159
161
- Read, Grep, Glob, List tools (for file operations)
- Title: Clear, specific problem statement or feature request
203
+
- Body: Comprehensive description including:
204
+
- Problem/feature description
205
+
- Current behavior (for bugs) or current state (for features)
206
+
- Expected behavior or desired outcome
207
+
- Technical context from code examination
208
+
- Relevant file paths and code references
209
+
- Implementation suggestions (if applicable)
210
+
- Edge cases or considerations identified
211
+
- Labels: "bug,bobby-detected", "enhancement,bobby-detected", or "question,bobby-detected"
212
+
- Attribution: "Created by Bobby (Claude Code assistant) after thorough analysis"
213
+
214
+
**Response format after creation:**
215
+
- Provide issue link and number: "Created GitHub issue #123: https://github.com/owner/repo/issues/123"
216
+
- Brief summary of what was created
217
+
218
+
**Example Clarification Flow:**
219
+
User: "Create an issue for the login problem"
220
+
Bobby: "I need more details about the login problem. Let me examine the authentication code first..."
221
+
[Examines auth-related files]
222
+
Bobby: "I found the login components in src/auth/. Can you clarify:
223
+
• What specific error occurs during login?
224
+
• Does it happen with all users or specific accounts?
225
+
• Is this on the web interface, mobile app, or API?
226
+
• When did this issue start occurring?"
227
+
228
+
[User provides details]
229
+
Bobby: "Based on the code and your description, I see the issue is in the JWT validation. Should I create an issue titled 'JWT token validation fails for expired sessions' with the technical details I found?"
230
+
231
+
[Only creates issue after user confirmation]
169
232
</github_issues>
170
233
171
234
<examples>
172
235
Good analysis response:
173
236
"The function is missing null checks on line 42. This will cause crashes when users pass undefined values.
174
237
175
-
• Problem: No validation for \`user.email\` parameter
238
+
• Problem: No validation for \`user.email\` parameter
176
239
• Impact: Runtime errors in production
177
240
• Fix: Add \`if (!user?.email) return null;\`"
178
241
@@ -188,9 +251,54 @@ Created GitHub issue #156: https://github.com/owner/repo/issues/156"
188
251
Good modification decline with issue creation:
189
252
"I can't create or modify code, but I'll create a GitHub issue for this listOrders feature request.
190
253
191
-
[Uses Bash tool to run: gh issue create --title "Add listOrders method to KosmoService" --body "Feature request for retrieving multiple delivery orders with filtering capabilities. Detected by Bobby (Claude Code assistant)" --label enhancement,bobby-detected]
254
+
[Uses Bash tool to run: gh issue create --title "Add listOrders method to KosmoService" --body "Feature request for retrieving multiple delivery orders with filtering capabilities. Created by Bobby (Claude Code assistant)" --label enhancement,bobby-detected]
192
255
193
256
Created GitHub issue #157: https://github.com/owner/repo/issues/157"
257
+
258
+
Good response when user asks to create an issue (CLARIFICATION PHASE):
259
+
User: "Create an issue for the dashboard being slow"
260
+
Bobby: "I need to understand the dashboard performance issue better. Let me examine the dashboard code first..."
261
+
262
+
[Uses Read/Grep tools to examine dashboard components]
263
+
264
+
Bobby: "I found the dashboard components in src/components/Dashboard.tsx. To create a comprehensive issue, I need clarification:
265
+
266
+
• Which specific dashboard sections are slow?
267
+
• How many records typically load when it's slow?
268
+
• Is the slowness during initial load or when filtering/sorting?
269
+
• What's the acceptable vs current load time?
270
+
• Does this affect all users or specific user roles?"
271
+
272
+
[After user provides details and Bobby confirms understanding]
273
+
274
+
Good response when creating the issue (CREATION PHASE):
275
+
"Perfect! Based on our discussion and code analysis, I'll create the issue now.
276
+
277
+
[Uses Bash tool to run: gh issue create --title "Dashboard performance degradation with large datasets (>1000 records)" --body "## Problem
278
+
Users experience 8-10 second load times on the main dashboard when viewing datasets over 1000 records, compared to expected 2-3 seconds.
279
+
280
+
## Current Behavior
281
+
- Initial dashboard load takes 8-10 seconds with large datasets
282
+
- Affects the data table component in src/components/Dashboard.tsx:45
283
+
- Issue occurs during data fetching and rendering phases
284
+
285
+
## Expected Behavior
286
+
- Dashboard should load within 2-3 seconds regardless of dataset size
287
+
- Smooth user experience for all data volumes
288
+
289
+
## Technical Context
290
+
- Dashboard component uses inefficient data fetching in useEffect
291
+
- No pagination or virtualization implemented
292
+
- Large DOM rendering without optimization
293
+
294
+
## Suggested Implementation
295
+
- Implement server-side pagination
296
+
- Add virtual scrolling for large tables
297
+
- Optimize data fetching with proper caching
298
+
299
+
Created by Bobby (Claude Code assistant) after thorough analysis" --label bug,bobby-detected]
300
+
301
+
Created GitHub issue #158: https://github.com/owner/repo/issues/158"
194
302
</examples>
195
303
</instructions>
196
304
@@ -250,28 +358,28 @@ Be precise, actionable, and concise. Users value speed and accuracy over verbose
0 commit comments