bobs-workshop 0.3.3 → 3.1.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/LICENSE +2 -2
- package/README.md +199 -210
- package/bin/bobs-workshop.js +109 -0
- package/config/agents.json +27 -0
- package/dist/plugins/bobs-workshop.js +34 -0
- package/dist/tools/background-agent/cancel.d.ts +3 -0
- package/dist/tools/background-agent/cancel.d.ts.map +1 -0
- package/dist/tools/background-agent/cancel.js +52 -0
- package/dist/tools/background-agent/concurrency.d.ts +15 -0
- package/dist/tools/background-agent/concurrency.d.ts.map +1 -0
- package/dist/tools/background-agent/concurrency.js +61 -0
- package/dist/tools/background-agent/index.d.ts +8 -0
- package/dist/tools/background-agent/index.d.ts.map +1 -0
- package/dist/tools/background-agent/index.js +7 -0
- package/dist/tools/background-agent/launch.d.ts +6 -0
- package/dist/tools/background-agent/launch.d.ts.map +1 -0
- package/dist/tools/background-agent/launch.js +33 -0
- package/dist/tools/background-agent/list.d.ts +7 -0
- package/dist/tools/background-agent/list.d.ts.map +1 -0
- package/dist/tools/background-agent/list.js +40 -0
- package/dist/tools/background-agent/manager.d.ts +29 -0
- package/dist/tools/background-agent/manager.d.ts.map +1 -0
- package/dist/tools/background-agent/manager.js +377 -0
- package/dist/tools/background-agent/output.d.ts +3 -0
- package/dist/tools/background-agent/output.d.ts.map +1 -0
- package/dist/tools/background-agent/output.js +41 -0
- package/dist/tools/background-agent/types.d.ts +46 -0
- package/dist/tools/background-agent/types.d.ts.map +1 -0
- package/dist/tools/background-agent/types.js +1 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/manual/index.d.ts +3 -0
- package/dist/tools/manual/index.d.ts.map +1 -0
- package/dist/tools/manual/index.js +2 -0
- package/dist/tools/manual/manual-update.d.ts +4 -0
- package/dist/tools/manual/manual-update.d.ts.map +1 -0
- package/dist/tools/manual/manual-update.js +190 -0
- package/dist/tools/manual/verify-manual.d.ts +4 -0
- package/dist/tools/manual/verify-manual.d.ts.map +1 -0
- package/dist/tools/manual/verify-manual.js +46 -0
- package/package.json +34 -66
- package/postinstall.js +190 -0
- package/src/agents/alice.md +466 -0
- package/src/agents/bob-rev.md +493 -0
- package/src/agents/bob-send.md +277 -0
- package/src/agents/bob.md +442 -0
- package/src/agents/trace.md +451 -0
- package/src/plugins/bobs-workshop.ts +45 -0
- package/src/skills/api-patterns/SKILL.md +376 -0
- package/src/skills/architecture/SKILL.md +271 -0
- package/src/skills/bobs-workshop/performance/icon.svg +3 -0
- package/src/skills/brainstorming/SKILL.md +210 -0
- package/src/skills/clean-code/SKILL.md +151 -0
- package/src/skills/code-review-checklist/SKILL.md +220 -0
- package/src/skills/database-design/SKILL.md +271 -0
- package/src/skills/exploration/SKILL.md +257 -0
- package/src/skills/frontend-ui-ux/SKILL.md +78 -0
- package/src/skills/git-master/SKILL.md +1105 -0
- package/src/skills/performance/SKILL.md +144 -0
- package/src/skills/performance/icon.svg +3 -0
- package/src/skills/plan-writing/SKILL.md +225 -0
- package/src/skills/security/SKILL.md +410 -0
- package/src/skills/simplification/SKILL.md +238 -0
- package/src/skills/systematic-debugging/SKILL.md +175 -0
- package/src/skills/testing-patterns/SKILL.md +305 -0
- package/src/skills/verification/SKILL.md +286 -0
- package/src/tools/background-agent/cancel.ts +67 -0
- package/src/tools/background-agent/concurrency.ts +71 -0
- package/src/tools/background-agent/index.ts +7 -0
- package/src/tools/background-agent/launch.ts +39 -0
- package/src/tools/background-agent/list.ts +50 -0
- package/src/tools/background-agent/manager.ts +455 -0
- package/src/tools/background-agent/output.ts +57 -0
- package/src/tools/background-agent/types.ts +55 -0
- package/src/tools/index.ts +8 -0
- package/src/tools/manual/index.ts +2 -0
- package/src/tools/manual/manual-update.ts +197 -0
- package/src/tools/manual/verify-manual.ts +55 -0
- package/uninstall.js +64 -0
- package/Claude.md +0 -162
- package/bin/bobs-mcp-server.js +0 -11
- package/bin/bobs-mcp.js +0 -130
- package/dist/api/taskLogger.js +0 -106
- package/dist/api/taskLogger.js.map +0 -1
- package/dist/cli/checker.js +0 -401
- package/dist/cli/checker.js.map +0 -1
- package/dist/cli/cleanup.js +0 -131
- package/dist/cli/cleanup.js.map +0 -1
- package/dist/cli/debug.js +0 -157
- package/dist/cli/debug.js.map +0 -1
- package/dist/cli/health.js +0 -97
- package/dist/cli/health.js.map +0 -1
- package/dist/cli/setup.js +0 -81
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/workshop.js +0 -42
- package/dist/cli/workshop.js.map +0 -1
- package/dist/dashboard/server.js +0 -1203
- package/dist/dashboard/server.js.map +0 -1
- package/dist/index.js +0 -960
- package/dist/index.js.map +0 -1
- package/dist/prompts/architect.js +0 -221
- package/dist/prompts/architect.js.map +0 -1
- package/dist/prompts/debugger.js +0 -257
- package/dist/prompts/debugger.js.map +0 -1
- package/dist/prompts/engineer.js +0 -249
- package/dist/prompts/engineer.js.map +0 -1
- package/dist/prompts/orchestrator.js +0 -304
- package/dist/prompts/orchestrator.js.map +0 -1
- package/dist/prompts/reviewer.js +0 -289
- package/dist/prompts/reviewer.js.map +0 -1
- package/dist/services/activitySummarizer.js +0 -388
- package/dist/services/activitySummarizer.js.map +0 -1
- package/dist/services/changeValidator.js +0 -396
- package/dist/services/changeValidator.js.map +0 -1
- package/dist/services/claudeOrchestrator.js +0 -343
- package/dist/services/claudeOrchestrator.js.map +0 -1
- package/dist/services/fileMonitor.js +0 -250
- package/dist/services/fileMonitor.js.map +0 -1
- package/dist/services/implementationSummarizer.js +0 -306
- package/dist/services/implementationSummarizer.js.map +0 -1
- package/dist/services/liveMonitor.js +0 -315
- package/dist/services/liveMonitor.js.map +0 -1
- package/dist/services/mcpAuditLogger.js +0 -104
- package/dist/services/mcpAuditLogger.js.map +0 -1
- package/dist/services/mcpLogger.js +0 -223
- package/dist/services/mcpLogger.js.map +0 -1
- package/dist/services/tmuxManager.js +0 -541
- package/dist/services/tmuxManager.js.map +0 -1
- package/dist/tools/approvalTools.js +0 -244
- package/dist/tools/approvalTools.js.map +0 -1
- package/dist/tools/autoDebugger.js +0 -147
- package/dist/tools/autoDebugger.js.map +0 -1
- package/dist/tools/cleanupService.js +0 -221
- package/dist/tools/cleanupService.js.map +0 -1
- package/dist/tools/dashboardTools.js +0 -342
- package/dist/tools/dashboardTools.js.map +0 -1
- package/dist/tools/developmentNudges.js +0 -336
- package/dist/tools/developmentNudges.js.map +0 -1
- package/dist/tools/gitTools.js +0 -741
- package/dist/tools/gitTools.js.map +0 -1
- package/dist/tools/orchestratorTools.js +0 -832
- package/dist/tools/orchestratorTools.js.map +0 -1
- package/dist/tools/searchCache.js +0 -64
- package/dist/tools/searchCache.js.map +0 -1
- package/dist/tools/searchTools.js +0 -1107
- package/dist/tools/searchTools.js.map +0 -1
- package/dist/tools/semgrep-patterns.js +0 -296
- package/dist/tools/semgrep-patterns.js.map +0 -1
- package/dist/tools/specTools.js +0 -332
- package/dist/tools/specTools.js.map +0 -1
- package/dist/tools/structural/__tests__/orchestrator.test.js +0 -61
- package/dist/tools/structural/__tests__/orchestrator.test.js.map +0 -1
- package/dist/tools/structural/cache.js +0 -226
- package/dist/tools/structural/cache.js.map +0 -1
- package/dist/tools/structural/engines/python/index.js +0 -118
- package/dist/tools/structural/engines/python/index.js.map +0 -1
- package/dist/tools/structural/engines/typescript/__tests__/typescript-engine.test.js +0 -97
- package/dist/tools/structural/engines/typescript/__tests__/typescript-engine.test.js.map +0 -1
- package/dist/tools/structural/engines/typescript/analyzer.js +0 -433
- package/dist/tools/structural/engines/typescript/analyzer.js.map +0 -1
- package/dist/tools/structural/engines/typescript/index.js +0 -381
- package/dist/tools/structural/engines/typescript/index.js.map +0 -1
- package/dist/tools/structural/engines/typescript/utils.js +0 -279
- package/dist/tools/structural/engines/typescript/utils.js.map +0 -1
- package/dist/tools/structural/index.js +0 -248
- package/dist/tools/structural/index.js.map +0 -1
- package/dist/tools/structural/types.js +0 -18
- package/dist/tools/structural/types.js.map +0 -1
- package/dist/tools/tmuxTools.js +0 -100
- package/dist/tools/tmuxTools.js.map +0 -1
- package/dist/tools/workRecorder.js +0 -215
- package/dist/tools/workRecorder.js.map +0 -1
- package/dist/tools/worktreeTools.js +0 -705
- package/dist/tools/worktreeTools.js.map +0 -1
- package/dist/utils/__tests__/integration.test.js +0 -57
- package/dist/utils/__tests__/integration.test.js.map +0 -1
- package/dist/utils/__tests__/serverDetection.test.js +0 -151
- package/dist/utils/__tests__/serverDetection.test.js.map +0 -1
- package/dist/utils/errorHandling.js +0 -336
- package/dist/utils/errorHandling.js.map +0 -1
- package/dist/utils/processManager.js +0 -172
- package/dist/utils/processManager.js.map +0 -1
- package/dist/utils/reliability.js +0 -263
- package/dist/utils/reliability.js.map +0 -1
- package/dist/utils/responseFormatter.js +0 -250
- package/dist/utils/responseFormatter.js.map +0 -1
- package/dist/utils/serverDetection.js +0 -133
- package/dist/utils/serverDetection.js.map +0 -1
- package/dist/utils/specMigration.js +0 -105
- package/dist/utils/specMigration.js.map +0 -1
- package/dist/validation/schemas.js +0 -299
- package/dist/validation/schemas.js.map +0 -1
- package/public/.well-known/mcp/manifest.json +0 -473
- package/public/index.html +0 -3157
- package/public/index.html.backup +0 -2805
- package/public/index.html.backup2 +0 -1292
- package/scripts/cleanup-system-logs.ts +0 -121
- package/scripts/init-workspace.js +0 -63
- package/scripts/install-search-tools.js +0 -116
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: Socratic questioning protocol + user communication. MANDATORY for complex requests, new features, or unclear requirements.
|
|
4
|
+
metadata:
|
|
5
|
+
recommended_for: alice
|
|
6
|
+
category: communication
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Brainstorming & Communication Protocol
|
|
10
|
+
|
|
11
|
+
> **MANDATORY:** Use for complex/vague requests, new features, updates.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🛑 SOCRATIC GATE (ENFORCEMENT)
|
|
16
|
+
|
|
17
|
+
### When to Trigger
|
|
18
|
+
|
|
19
|
+
| Pattern | Action |
|
|
20
|
+
|---------|--------|
|
|
21
|
+
| "Build/Create/Make [thing]" without details | 🛑 ASK 3 questions |
|
|
22
|
+
| Complex feature or architecture | 🛑 Clarify before implementing |
|
|
23
|
+
| Update/change request | 🛑 Confirm scope |
|
|
24
|
+
| Vague requirements | 🛑 Ask purpose, users, constraints |
|
|
25
|
+
|
|
26
|
+
### 🚫 MANDATORY: 3 Questions Before Implementation
|
|
27
|
+
|
|
28
|
+
1. **STOP** - Do NOT start coding
|
|
29
|
+
2. **ASK** - Minimum 3 questions:
|
|
30
|
+
- 🎯 Purpose: What problem are you solving?
|
|
31
|
+
- 👥 Users: Who will use this?
|
|
32
|
+
- 📦 Scope: Must-have vs nice-to-have?
|
|
33
|
+
3. **WAIT** - Get response before proceeding
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 🧠 Dynamic Question Generation
|
|
38
|
+
|
|
39
|
+
**⛔ NEVER use static templates.** Read `dynamic-questioning.md` for principles.
|
|
40
|
+
|
|
41
|
+
### Core Principles
|
|
42
|
+
|
|
43
|
+
| Principle | Meaning |
|
|
44
|
+
|-----------|---------|
|
|
45
|
+
| **Questions Reveal Consequences** | Each question connects to an architectural decision |
|
|
46
|
+
| **Context Before Content** | Understand greenfield/feature/refactor/debug context first |
|
|
47
|
+
| **Minimum Viable Questions** | Each question must eliminate implementation paths |
|
|
48
|
+
| **Generate Data, Not Assumptions** | Don't guess—ask with trade-offs |
|
|
49
|
+
|
|
50
|
+
### Question Generation Process
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
1. Parse request → Extract domain, features, scale indicators
|
|
54
|
+
2. Identify decision points → Blocking vs. deferable
|
|
55
|
+
3. Generate questions → Priority: P0 (blocking) > P1 (high-leverage) > P2 (nice-to-have)
|
|
56
|
+
4. Format with trade-offs → What, Why, Options, Default
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Question Format (MANDATORY)
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
### [PRIORITY] **[DECISION POINT]**
|
|
63
|
+
|
|
64
|
+
**Question:** [Clear question]
|
|
65
|
+
|
|
66
|
+
**Why This Matters:**
|
|
67
|
+
- [Architectural consequence]
|
|
68
|
+
- [Affects: cost/complexity/timeline/scale]
|
|
69
|
+
|
|
70
|
+
**Options:**
|
|
71
|
+
| Option | Pros | Cons | Best For |
|
|
72
|
+
|--------|------|------|----------|
|
|
73
|
+
| A | [+] | [-] | [Use case] |
|
|
74
|
+
|
|
75
|
+
**If Not Specified:** [Default + rationale]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Progress Reporting (PRINCIPLE-BASED)
|
|
81
|
+
|
|
82
|
+
**PRINCIPLE:** Transparency builds trust. Status must be visible and actionable.
|
|
83
|
+
|
|
84
|
+
### Status Board Format
|
|
85
|
+
|
|
86
|
+
| Agent | Status | Current Task | Progress |
|
|
87
|
+
|-------|--------|--------------|----------|
|
|
88
|
+
| [Agent Name] | ✅🔄⏳❌⚠️ | [Task description] | [% or count] |
|
|
89
|
+
|
|
90
|
+
### Status Icons
|
|
91
|
+
|
|
92
|
+
| Icon | Meaning | Usage |
|
|
93
|
+
|------|---------|-------|
|
|
94
|
+
| ✅ | Completed | Task finished successfully |
|
|
95
|
+
| 🔄 | Running | Currently executing |
|
|
96
|
+
| ⏳ | Waiting | Blocked, waiting for dependency |
|
|
97
|
+
| ❌ | Error | Failed, needs attention |
|
|
98
|
+
| ⚠️ | Warning | Potential issue, not blocking |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Error Handling (PRINCIPLE-BASED)
|
|
103
|
+
|
|
104
|
+
**PRINCIPLE:** Errors are opportunities for clear communication.
|
|
105
|
+
|
|
106
|
+
### Error Response Pattern
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
1. Acknowledge the error
|
|
110
|
+
2. Explain what happened (user-friendly)
|
|
111
|
+
3. Offer specific solutions with trade-offs
|
|
112
|
+
4. Ask user to choose or provide alternative
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Error Categories
|
|
116
|
+
|
|
117
|
+
| Category | Response Strategy |
|
|
118
|
+
|----------|-------------------|
|
|
119
|
+
| **Port Conflict** | Offer alternative port or close existing |
|
|
120
|
+
| **Dependency Missing** | Auto-install or ask permission |
|
|
121
|
+
| **Build Failure** | Show specific error + suggested fix |
|
|
122
|
+
| **Unclear Error** | Ask for specifics: screenshot, console output |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Completion Message (PRINCIPLE-BASED)
|
|
127
|
+
|
|
128
|
+
**PRINCIPLE:** Celebrate success, guide next steps.
|
|
129
|
+
|
|
130
|
+
### Completion Structure
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
1. Success confirmation (celebrate briefly)
|
|
134
|
+
2. Summary of what was done (concrete)
|
|
135
|
+
3. How to verify/test (actionable)
|
|
136
|
+
4. Next steps suggestion (proactive)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Communication Principles
|
|
142
|
+
|
|
143
|
+
| Principle | Implementation |
|
|
144
|
+
|-----------|----------------|
|
|
145
|
+
| **Concise** | No unnecessary details, get to point |
|
|
146
|
+
| **Visual** | Use emojis (✅🔄⏳❌) for quick scanning |
|
|
147
|
+
| **Specific** | "~2 minutes" not "wait a bit" |
|
|
148
|
+
| **Alternatives** | Offer multiple paths when stuck |
|
|
149
|
+
| **Proactive** | Suggest next step after completion |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Anti-Patterns (AVOID)
|
|
154
|
+
|
|
155
|
+
| Anti-Pattern | Why |
|
|
156
|
+
|--------------|-----|
|
|
157
|
+
| Jumping to solutions before understanding | Wastes time on wrong problem |
|
|
158
|
+
| Assuming requirements without asking | Creates wrong output |
|
|
159
|
+
| Over-engineering first version | Delays value delivery |
|
|
160
|
+
| Ignoring constraints | Creates unusable solutions |
|
|
161
|
+
| "I think" phrases | Uncertainty → Ask instead |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Bob's Workshop Integration
|
|
166
|
+
|
|
167
|
+
This skill is used by **alice (architect)** agent during the PLAN phase.
|
|
168
|
+
|
|
169
|
+
### MANUAL Integration
|
|
170
|
+
|
|
171
|
+
Add planning section to MANUAL:
|
|
172
|
+
```markdown
|
|
173
|
+
## 📝 Product Specifications
|
|
174
|
+
|
|
175
|
+
### Requirements Clarification (Socratic Gate)
|
|
176
|
+
- [ ] Purpose identified
|
|
177
|
+
- [ ] Target users defined
|
|
178
|
+
- [ ] Scope confirmed (must-have vs nice-to-have)
|
|
179
|
+
|
|
180
|
+
### Key Decisions
|
|
181
|
+
| Decision | Options | Chosen | Rationale |
|
|
182
|
+
|----------|---------|---------|-----------|
|
|
183
|
+
| [Tech stack] | [Option A/B/C] | [Choice] | [Why] |
|
|
184
|
+
| [Database] | [Option A/B/C] | [Choice] | [Why] |
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Progress Tracking
|
|
188
|
+
|
|
189
|
+
Update agent handoffs with status:
|
|
190
|
+
```markdown
|
|
191
|
+
## 🤝 Agent Handoffs
|
|
192
|
+
|
|
193
|
+
🔄 alice: Planning in progress (3/5 tasks complete)
|
|
194
|
+
🤝 alice → bob-eng: Handoff - MANUAL ready for implementation
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Error Handling
|
|
198
|
+
|
|
199
|
+
Standardize error messages across all agents:
|
|
200
|
+
```markdown
|
|
201
|
+
❌ Error: [Brief description]
|
|
202
|
+
|
|
203
|
+
**What happened:** [User-friendly explanation]
|
|
204
|
+
|
|
205
|
+
**Options:**
|
|
206
|
+
1. [Solution A] - [Trade-off]
|
|
207
|
+
2. [Solution B] - [Trade-off]
|
|
208
|
+
|
|
209
|
+
Which would you prefer?
|
|
210
|
+
```
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
|
|
4
|
+
metadata:
|
|
5
|
+
recommended_for: bob-eng
|
|
6
|
+
category: code-quality
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Clean Code - Pragmatic AI Coding Standards
|
|
10
|
+
|
|
11
|
+
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principles
|
|
16
|
+
|
|
17
|
+
| Principle | Rule |
|
|
18
|
+
|-----------|------|
|
|
19
|
+
| **SRP** | Single Responsibility - each function/class does ONE thing |
|
|
20
|
+
| **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
|
|
21
|
+
| **KISS** | Keep It Simple - simplest solution that works |
|
|
22
|
+
| **YAGNI** | You Aren't Gonna Need It - don't build unused features |
|
|
23
|
+
| **Boy Scout** | Leave code cleaner than you found it |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Naming Rules
|
|
28
|
+
|
|
29
|
+
| Element | Convention |
|
|
30
|
+
|---------|------------|
|
|
31
|
+
| **Variables** | Reveal intent: `userCount` not `n` |
|
|
32
|
+
| **Functions** | Verb + noun: `getUserById()` not `user()` |
|
|
33
|
+
| **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
|
|
34
|
+
| **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
|
|
35
|
+
|
|
36
|
+
> **Rule:** If you need a comment to explain a name, rename it.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Function Rules
|
|
41
|
+
|
|
42
|
+
| Rule | Description |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| **Small** | Max 20 lines, ideally 5-10 |
|
|
45
|
+
| **One Thing** | Does one thing, does it well |
|
|
46
|
+
| **One Level** | One level of abstraction per function |
|
|
47
|
+
| **Few Args** | Max 3 arguments, prefer 0-2 |
|
|
48
|
+
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Code Structure
|
|
53
|
+
|
|
54
|
+
| Pattern | Apply |
|
|
55
|
+
|---------|-------|
|
|
56
|
+
| **Guard Clauses** | Early returns for edge cases |
|
|
57
|
+
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
58
|
+
| **Composition** | Small functions composed together |
|
|
59
|
+
| **Colocation** | Keep related code close |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## AI Coding Style
|
|
64
|
+
|
|
65
|
+
| Situation | Action |
|
|
66
|
+
|-----------|--------|
|
|
67
|
+
| User asks for feature | Write it directly |
|
|
68
|
+
| User reports bug | Fix it, don't explain |
|
|
69
|
+
| No clear requirement | Ask, don't assume |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Anti-Patterns (DON'T)
|
|
74
|
+
|
|
75
|
+
| ❌ Pattern | ✅ Fix |
|
|
76
|
+
|-----------|-------|
|
|
77
|
+
| Comment every line | Delete obvious comments |
|
|
78
|
+
| Helper for one-liner | Inline the code |
|
|
79
|
+
| Factory for 2 objects | Direct instantiation |
|
|
80
|
+
| utils.ts with 1 function | Put code where used |
|
|
81
|
+
| "First we import..." | Just write code |
|
|
82
|
+
| Deep nesting | Guard clauses |
|
|
83
|
+
| Magic numbers | Named constants |
|
|
84
|
+
| God functions | Split by responsibility |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🔴 Before Editing ANY File (THINK FIRST!)
|
|
89
|
+
|
|
90
|
+
**Before changing a file, ask yourself:**
|
|
91
|
+
|
|
92
|
+
| Question | Why |
|
|
93
|
+
|----------|-----|
|
|
94
|
+
| **What imports this file?** | They might break |
|
|
95
|
+
| **What does this file import?** | Interface changes |
|
|
96
|
+
| **What tests cover this?** | Tests might fail |
|
|
97
|
+
| **Is this a shared component?** | Multiple places affected |
|
|
98
|
+
|
|
99
|
+
**Quick Check:**
|
|
100
|
+
```
|
|
101
|
+
File to edit: UserService.ts
|
|
102
|
+
└── Who imports this? → UserController.ts, AuthController.ts
|
|
103
|
+
└── Do they need changes too? → Check function signatures
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
|
|
107
|
+
> 🔴 **Never leave broken imports or missing updates.**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Self-Check Before Completing (MANDATORY)
|
|
112
|
+
|
|
113
|
+
**Before saying "task complete", verify:**
|
|
114
|
+
|
|
115
|
+
| Check | Question |
|
|
116
|
+
|-------|----------|
|
|
117
|
+
| ✅ **Goal met?** | Did I do exactly what user asked? |
|
|
118
|
+
| ✅ **Files edited?** | Did I modify all necessary files? |
|
|
119
|
+
| ✅ **Code works?** | Did I test/verify the change? |
|
|
120
|
+
| ✅ **No errors?** | Lint and TypeScript pass? |
|
|
121
|
+
| ✅ **Nothing forgotten?** | Any edge cases missed? |
|
|
122
|
+
|
|
123
|
+
> 🔴 **Rule:** If ANY check fails, fix it before completing.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Bob's Workshop Integration
|
|
128
|
+
|
|
129
|
+
This skill is used by **bob-eng (engineer)** agent during the BUILD phase.
|
|
130
|
+
|
|
131
|
+
### MANUAL Integration
|
|
132
|
+
|
|
133
|
+
Add code quality checks to implementation logs:
|
|
134
|
+
```markdown
|
|
135
|
+
## 📈 Execution Logs
|
|
136
|
+
|
|
137
|
+
### Code Quality
|
|
138
|
+
- [ ] Functions under 20 lines
|
|
139
|
+
- [ ] Nesting depth ≤ 2
|
|
140
|
+
- [ ] No magic numbers
|
|
141
|
+
- [ ] Clear, descriptive names
|
|
142
|
+
- [ ] No deep nesting
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Verification
|
|
146
|
+
|
|
147
|
+
Before handing off to bob-rev, verify:
|
|
148
|
+
- All code follows clean code principles
|
|
149
|
+
- No linting errors
|
|
150
|
+
- No TypeScript errors
|
|
151
|
+
- All imports are correct
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review-checklist
|
|
3
|
+
description: Code review guidelines covering code quality, security, and best practices.
|
|
4
|
+
metadata:
|
|
5
|
+
recommended_for: bob-rev
|
|
6
|
+
category: review
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Code Review Checklist
|
|
10
|
+
|
|
11
|
+
## Quick Review Checklist
|
|
12
|
+
|
|
13
|
+
### Correctness
|
|
14
|
+
- [ ] Code does what it's supposed to do
|
|
15
|
+
- [ ] Edge cases handled
|
|
16
|
+
- [ ] Error handling in place
|
|
17
|
+
- [ ] No obvious bugs
|
|
18
|
+
|
|
19
|
+
### Security
|
|
20
|
+
- [ ] Input validated and sanitized
|
|
21
|
+
- [ ] No SQL/NoSQL injection vulnerabilities
|
|
22
|
+
- [ ] No XSS or CSRF vulnerabilities
|
|
23
|
+
- [ ] No hardcoded secrets or sensitive credentials
|
|
24
|
+
- [ ] **AI-Specific:** Protection against Prompt Injection (if applicable)
|
|
25
|
+
- [ ] **AI-Specific:** Outputs are sanitized before being used in critical sinks
|
|
26
|
+
|
|
27
|
+
### Performance
|
|
28
|
+
- [ ] No N+1 queries
|
|
29
|
+
- [ ] No unnecessary loops
|
|
30
|
+
- [ ] Appropriate caching
|
|
31
|
+
- [ ] Bundle size impact considered
|
|
32
|
+
|
|
33
|
+
### Code Quality
|
|
34
|
+
- [ ] Clear naming
|
|
35
|
+
- [ ] DRY - no duplicate code
|
|
36
|
+
- [ ] SOLID principles followed
|
|
37
|
+
- [ ] Appropriate abstraction level
|
|
38
|
+
|
|
39
|
+
### Testing
|
|
40
|
+
- [ ] Unit tests for new code
|
|
41
|
+
- [ ] Edge cases tested
|
|
42
|
+
- [ ] Tests readable and maintainable
|
|
43
|
+
|
|
44
|
+
### Documentation
|
|
45
|
+
- [ ] Complex logic commented
|
|
46
|
+
- [ ] Public APIs documented
|
|
47
|
+
- [ ] README updated if needed
|
|
48
|
+
|
|
49
|
+
## AI & LLM Review Patterns (2025)
|
|
50
|
+
|
|
51
|
+
### Logic & Hallucinations
|
|
52
|
+
- [ ] **Chain of Thought:** Does the logic follow a verifiable path?
|
|
53
|
+
- [ ] **Edge Cases:** Did the AI account for empty states, timeouts, and partial failures?
|
|
54
|
+
- [ ] **External State:** Is the code making safe assumptions about file systems or networks?
|
|
55
|
+
|
|
56
|
+
### Prompt Engineering Review
|
|
57
|
+
```markdown
|
|
58
|
+
// ❌ Vague prompt in code
|
|
59
|
+
const response = await ai.generate(userInput);
|
|
60
|
+
|
|
61
|
+
// ✅ Structured & Safe prompt
|
|
62
|
+
const response = await ai.generate({
|
|
63
|
+
system: "You are a specialized parser...",
|
|
64
|
+
input: sanitize(userInput),
|
|
65
|
+
schema: ResponseSchema
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Anti-Patterns to Flag
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// ❌ Magic numbers
|
|
73
|
+
if (status === 3) { ... }
|
|
74
|
+
|
|
75
|
+
// ✅ Named constants
|
|
76
|
+
if (status === Status.ACTIVE) { ... }
|
|
77
|
+
|
|
78
|
+
// ❌ Deep nesting
|
|
79
|
+
if (a) { if (b) { if (c) { ... } } }
|
|
80
|
+
|
|
81
|
+
// ✅ Early returns
|
|
82
|
+
if (!a) return;
|
|
83
|
+
if (!b) return;
|
|
84
|
+
if (!c) return;
|
|
85
|
+
// do work
|
|
86
|
+
|
|
87
|
+
// ❌ Long functions (100+ lines)
|
|
88
|
+
// ✅ Small, focused functions
|
|
89
|
+
|
|
90
|
+
// ❌ any type
|
|
91
|
+
const data: any = ...
|
|
92
|
+
|
|
93
|
+
// ✅ Proper types
|
|
94
|
+
const data: UserData = ...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Review Comments Guide
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
// Blocking issues use 🔴
|
|
101
|
+
🔴 BLOCKING: SQL injection vulnerability here
|
|
102
|
+
|
|
103
|
+
// Important suggestions use 🟡
|
|
104
|
+
🟡 SUGGESTION: Consider using useMemo for performance
|
|
105
|
+
|
|
106
|
+
// Minor nits use 🟢
|
|
107
|
+
🟢 NIT: Prefer const over let for immutable variable
|
|
108
|
+
|
|
109
|
+
// Questions use ❓
|
|
110
|
+
❓ QUESTION: What happens if user is null here?
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Bob's Workshop Integration
|
|
116
|
+
|
|
117
|
+
This skill is used by **bob-rev (reviewer)** agent during the VERIFY phase.
|
|
118
|
+
|
|
119
|
+
### MANUAL Integration
|
|
120
|
+
|
|
121
|
+
Add review section to MANUAL:
|
|
122
|
+
```markdown
|
|
123
|
+
## 🔍 Review Notes
|
|
124
|
+
|
|
125
|
+
### Review Checklist
|
|
126
|
+
#### Correctness
|
|
127
|
+
- [ ] Code does what it's supposed to do
|
|
128
|
+
- [ ] Edge cases handled
|
|
129
|
+
- [ ] Error handling in place
|
|
130
|
+
|
|
131
|
+
#### Security
|
|
132
|
+
- [ ] Input validation present
|
|
133
|
+
- [ ] No injection vulnerabilities
|
|
134
|
+
- [ ] No hardcoded secrets
|
|
135
|
+
- [ ] AI outputs sanitized (if applicable)
|
|
136
|
+
|
|
137
|
+
#### Performance
|
|
138
|
+
- [ ] No N+1 queries
|
|
139
|
+
- [ ] Appropriate caching
|
|
140
|
+
- [ ] Bundle size considered
|
|
141
|
+
|
|
142
|
+
#### Code Quality
|
|
143
|
+
- [ ] Clear naming
|
|
144
|
+
- [ ] No duplicate code
|
|
145
|
+
- [ ] SOLID principles followed
|
|
146
|
+
- [ ] Proper error handling
|
|
147
|
+
|
|
148
|
+
#### Testing
|
|
149
|
+
- [ ] Unit tests added
|
|
150
|
+
- [ ] Edge cases covered
|
|
151
|
+
- [ ] Tests readable
|
|
152
|
+
|
|
153
|
+
### Review Comments
|
|
154
|
+
| Severity | Comment | File:Line | Status |
|
|
155
|
+
|----------|----------|-----------|--------|
|
|
156
|
+
| 🔴 BLOCKING | [Description] | [File:Line] | [Open/Resolved] |
|
|
157
|
+
| 🟡 SUGGESTION | [Description] | [File:Line] | [Open/Resolved] |
|
|
158
|
+
| 🟢 NIT | [Description] | [File:Line] | [Open/Resolved] |
|
|
159
|
+
| ❓ QUESTION | [Description] | [File:Line] | [Answered] |
|
|
160
|
+
|
|
161
|
+
### Review Decision
|
|
162
|
+
- [ ] ✅ PASS - Ready for SEND
|
|
163
|
+
- [ ] ❌ FAIL - Return to trace for fixes
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### PASS/FAIL Criteria
|
|
167
|
+
|
|
168
|
+
#### PASS Conditions
|
|
169
|
+
- All 🔴 BLOCKING issues resolved
|
|
170
|
+
- Security vulnerabilities addressed
|
|
171
|
+
- Tests pass and have good coverage
|
|
172
|
+
- Code follows project conventions
|
|
173
|
+
- No obvious bugs
|
|
174
|
+
|
|
175
|
+
#### FAIL Conditions
|
|
176
|
+
- Any unresolved 🔴 BLOCKING issues
|
|
177
|
+
- Security vulnerabilities present
|
|
178
|
+
- Tests failing or missing
|
|
179
|
+
- Code doesn't match MANUAL specifications
|
|
180
|
+
- Breaking changes not documented
|
|
181
|
+
|
|
182
|
+
### Handoff Format
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
## 🤝 Agent Handoffs
|
|
186
|
+
|
|
187
|
+
🤝 bob-rev: Review complete - ✅ PASS / ❌ FAIL
|
|
188
|
+
[Decision rationale]
|
|
189
|
+
|
|
190
|
+
🤝 bob-rev → trace: [FAIL - Issues found, please fix]
|
|
191
|
+
🤝 bob-rev → bob-send: [PASS - Ready for shipping]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Code Quality Standards
|
|
197
|
+
|
|
198
|
+
When quality issues are discussed:
|
|
199
|
+
|
|
200
|
+
- **Enforce conventions** - Ensure code follows project style guides and patterns
|
|
201
|
+
- **Suggest refactors for clarity** - Identify opportunities to simplify complex code
|
|
202
|
+
- **Highlight test coverage gaps** - Point out areas lacking sufficient tests
|
|
203
|
+
|
|
204
|
+
### Quality Guidelines
|
|
205
|
+
|
|
206
|
+
| Area | Check | Priority |
|
|
207
|
+
|------|-------|----------|
|
|
208
|
+
| **Readability** | Clear naming, consistent style | High |
|
|
209
|
+
| **Maintainability** | Low complexity, single responsibility | High |
|
|
210
|
+
| **Extensibility** | Easy to extend without major changes | Medium |
|
|
211
|
+
| **Consistency** | Uniform patterns across codebase | Medium |
|
|
212
|
+
|
|
213
|
+
### Quality Indicators
|
|
214
|
+
|
|
215
|
+
| Good ✅ | Poor ❌ |
|
|
216
|
+
|---------|---------|
|
|
217
|
+
| Self-documenting code | Requires comments to explain |
|
|
218
|
+
| Small, focused functions | God functions (100+ lines) |
|
|
219
|
+
| Descriptive variable names | Single-letter or cryptic names |
|
|
220
|
+
| DRY - no duplication | Copy-paste code blocks |
|