@jwdobeutechsolutions/dobeutech-claude-code-custom 1.0.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 (59) hide show
  1. package/CLAUDE.md +174 -0
  2. package/CONTRIBUTING.md +191 -0
  3. package/README.md +345 -0
  4. package/agents/accessibility-auditor.md +315 -0
  5. package/agents/api-designer.md +265 -0
  6. package/agents/architect.md +211 -0
  7. package/agents/build-error-resolver.md +532 -0
  8. package/agents/ci-cd-generator.md +318 -0
  9. package/agents/code-reviewer.md +104 -0
  10. package/agents/database-migrator.md +258 -0
  11. package/agents/deployment-manager.md +296 -0
  12. package/agents/doc-updater.md +452 -0
  13. package/agents/docker-specialist.md +293 -0
  14. package/agents/e2e-runner.md +708 -0
  15. package/agents/fullstack-architect.md +293 -0
  16. package/agents/infrastructure-engineer.md +297 -0
  17. package/agents/integration-tester.md +320 -0
  18. package/agents/performance-tester.md +243 -0
  19. package/agents/planner.md +119 -0
  20. package/agents/refactor-cleaner.md +306 -0
  21. package/agents/security-reviewer.md +545 -0
  22. package/agents/tdd-guide.md +280 -0
  23. package/agents/unit-test-generator.md +290 -0
  24. package/bin/claude-config.js +290 -0
  25. package/commands/api-design.md +55 -0
  26. package/commands/audit-accessibility.md +37 -0
  27. package/commands/audit-performance.md +38 -0
  28. package/commands/audit-security.md +43 -0
  29. package/commands/build-fix.md +29 -0
  30. package/commands/changelog.md +31 -0
  31. package/commands/code-review.md +40 -0
  32. package/commands/deploy.md +51 -0
  33. package/commands/docs-api.md +41 -0
  34. package/commands/e2e.md +363 -0
  35. package/commands/plan.md +113 -0
  36. package/commands/refactor-clean.md +28 -0
  37. package/commands/tdd.md +326 -0
  38. package/commands/test-coverage.md +27 -0
  39. package/commands/update-codemaps.md +17 -0
  40. package/commands/update-docs.md +31 -0
  41. package/hooks/hooks.json +121 -0
  42. package/mcp-configs/mcp-servers.json +163 -0
  43. package/package.json +53 -0
  44. package/rules/agents.md +49 -0
  45. package/rules/coding-style.md +70 -0
  46. package/rules/git-workflow.md +45 -0
  47. package/rules/hooks.md +46 -0
  48. package/rules/patterns.md +55 -0
  49. package/rules/performance.md +47 -0
  50. package/rules/security.md +36 -0
  51. package/rules/testing.md +30 -0
  52. package/scripts/install.js +254 -0
  53. package/skills/backend-patterns.md +582 -0
  54. package/skills/clickhouse-io.md +429 -0
  55. package/skills/coding-standards.md +520 -0
  56. package/skills/frontend-patterns.md +631 -0
  57. package/skills/project-guidelines-example.md +345 -0
  58. package/skills/security-review/SKILL.md +494 -0
  59. package/skills/tdd-workflow/SKILL.md +409 -0
@@ -0,0 +1,363 @@
1
+ ---
2
+ description: Generate and run end-to-end tests with Playwright. Creates test journeys, runs tests, captures screenshots/videos/traces, and uploads artifacts.
3
+ ---
4
+
5
+ # E2E Command
6
+
7
+ This command invokes the **e2e-runner** agent to generate, maintain, and execute end-to-end tests using Playwright.
8
+
9
+ ## What This Command Does
10
+
11
+ 1. **Generate Test Journeys** - Create Playwright tests for user flows
12
+ 2. **Run E2E Tests** - Execute tests across browsers
13
+ 3. **Capture Artifacts** - Screenshots, videos, traces on failures
14
+ 4. **Upload Results** - HTML reports and JUnit XML
15
+ 5. **Identify Flaky Tests** - Quarantine unstable tests
16
+
17
+ ## When to Use
18
+
19
+ Use `/e2e` when:
20
+ - Testing critical user journeys (login, trading, payments)
21
+ - Verifying multi-step flows work end-to-end
22
+ - Testing UI interactions and navigation
23
+ - Validating integration between frontend and backend
24
+ - Preparing for production deployment
25
+
26
+ ## How It Works
27
+
28
+ The e2e-runner agent will:
29
+
30
+ 1. **Analyze user flow** and identify test scenarios
31
+ 2. **Generate Playwright test** using Page Object Model pattern
32
+ 3. **Run tests** across multiple browsers (Chrome, Firefox, Safari)
33
+ 4. **Capture failures** with screenshots, videos, and traces
34
+ 5. **Generate report** with results and artifacts
35
+ 6. **Identify flaky tests** and recommend fixes
36
+
37
+ ## Example Usage
38
+
39
+ ```
40
+ User: /e2e Test the market search and view flow
41
+
42
+ Agent (e2e-runner):
43
+ # E2E Test Generation: Market Search and View Flow
44
+
45
+ ## Test Scenario Identified
46
+
47
+ **User Journey:** Market Search → View Results → Click Market → View Details
48
+
49
+ **Test Coverage:**
50
+ 1. Navigate to markets page
51
+ 2. Perform semantic search
52
+ 3. Verify search results
53
+ 4. Click on first result
54
+ 5. Verify market details page loads
55
+ 6. Verify chart renders
56
+
57
+ ## Generated Test Code
58
+
59
+ ```typescript
60
+ // tests/e2e/markets/search-and-view.spec.ts
61
+ import { test, expect } from '@playwright/test'
62
+ import { MarketsPage } from '../../pages/MarketsPage'
63
+ import { MarketDetailsPage } from '../../pages/MarketDetailsPage'
64
+
65
+ test.describe('Market Search and View Flow', () => {
66
+ test('user can search markets and view details', async ({ page }) => {
67
+ // 1. Navigate to markets page
68
+ const marketsPage = new MarketsPage(page)
69
+ await marketsPage.goto()
70
+
71
+ // Verify page loaded
72
+ await expect(page).toHaveTitle(/Markets/)
73
+ await expect(page.locator('h1')).toContainText('Markets')
74
+
75
+ // 2. Perform semantic search
76
+ await marketsPage.searchMarkets('election')
77
+
78
+ // Wait for API response
79
+ await page.waitForResponse(resp =>
80
+ resp.url().includes('/api/markets/search') && resp.status() === 200
81
+ )
82
+
83
+ // 3. Verify search results
84
+ const marketCards = marketsPage.marketCards
85
+ await expect(marketCards.first()).toBeVisible()
86
+ const resultCount = await marketCards.count()
87
+ expect(resultCount).toBeGreaterThan(0)
88
+
89
+ // Take screenshot of search results
90
+ await page.screenshot({ path: 'artifacts/search-results.png' })
91
+
92
+ // 4. Click on first result
93
+ const firstMarketTitle = await marketCards.first().textContent()
94
+ await marketCards.first().click()
95
+
96
+ // 5. Verify market details page loads
97
+ await expect(page).toHaveURL(/\/markets\/[a-z0-9-]+/)
98
+
99
+ const detailsPage = new MarketDetailsPage(page)
100
+ await expect(detailsPage.marketName).toBeVisible()
101
+ await expect(detailsPage.marketDescription).toBeVisible()
102
+
103
+ // 6. Verify chart renders
104
+ await expect(detailsPage.priceChart).toBeVisible()
105
+
106
+ // Verify market name matches
107
+ const detailsTitle = await detailsPage.marketName.textContent()
108
+ expect(detailsTitle?.toLowerCase()).toContain(
109
+ firstMarketTitle?.toLowerCase().substring(0, 20) || ''
110
+ )
111
+
112
+ // Take screenshot of market details
113
+ await page.screenshot({ path: 'artifacts/market-details.png' })
114
+ })
115
+
116
+ test('search with no results shows empty state', async ({ page }) => {
117
+ const marketsPage = new MarketsPage(page)
118
+ await marketsPage.goto()
119
+
120
+ // Search for non-existent market
121
+ await marketsPage.searchMarkets('xyznonexistentmarket123456')
122
+
123
+ // Verify empty state
124
+ await expect(page.locator('[data-testid="no-results"]')).toBeVisible()
125
+ await expect(page.locator('[data-testid="no-results"]')).toContainText(
126
+ /no.*results|no.*markets/i
127
+ )
128
+
129
+ const marketCount = await marketsPage.marketCards.count()
130
+ expect(marketCount).toBe(0)
131
+ })
132
+
133
+ test('can clear search and see all markets again', async ({ page }) => {
134
+ const marketsPage = new MarketsPage(page)
135
+ await marketsPage.goto()
136
+
137
+ // Initial market count
138
+ const initialCount = await marketsPage.marketCards.count()
139
+
140
+ // Perform search
141
+ await marketsPage.searchMarkets('trump')
142
+ await page.waitForLoadState('networkidle')
143
+
144
+ // Verify filtered results
145
+ const filteredCount = await marketsPage.marketCards.count()
146
+ expect(filteredCount).toBeLessThan(initialCount)
147
+
148
+ // Clear search
149
+ await marketsPage.searchInput.clear()
150
+ await page.waitForLoadState('networkidle')
151
+
152
+ // Verify all markets shown again
153
+ const finalCount = await marketsPage.marketCards.count()
154
+ expect(finalCount).toBe(initialCount)
155
+ })
156
+ })
157
+ ```
158
+
159
+ ## Running Tests
160
+
161
+ ```bash
162
+ # Run the generated test
163
+ npx playwright test tests/e2e/markets/search-and-view.spec.ts
164
+
165
+ Running 3 tests using 3 workers
166
+
167
+ ✓ [chromium] › search-and-view.spec.ts:5:3 › user can search markets and view details (4.2s)
168
+ ✓ [chromium] › search-and-view.spec.ts:52:3 › search with no results shows empty state (1.8s)
169
+ ✓ [chromium] › search-and-view.spec.ts:67:3 › can clear search and see all markets again (2.9s)
170
+
171
+ 3 passed (9.1s)
172
+
173
+ Artifacts generated:
174
+ - artifacts/search-results.png
175
+ - artifacts/market-details.png
176
+ - playwright-report/index.html
177
+ ```
178
+
179
+ ## Test Report
180
+
181
+ ```
182
+ ╔══════════════════════════════════════════════════════════════╗
183
+ ║ E2E Test Results ║
184
+ ╠══════════════════════════════════════════════════════════════╣
185
+ ║ Status: ✅ ALL TESTS PASSED ║
186
+ ║ Total: 3 tests ║
187
+ ║ Passed: 3 (100%) ║
188
+ ║ Failed: 0 ║
189
+ ║ Flaky: 0 ║
190
+ ║ Duration: 9.1s ║
191
+ ╚══════════════════════════════════════════════════════════════╝
192
+
193
+ Artifacts:
194
+ 📸 Screenshots: 2 files
195
+ 📹 Videos: 0 files (only on failure)
196
+ 🔍 Traces: 0 files (only on failure)
197
+ 📊 HTML Report: playwright-report/index.html
198
+
199
+ View report: npx playwright show-report
200
+ ```
201
+
202
+ ✅ E2E test suite ready for CI/CD integration!
203
+ ```
204
+
205
+ ## Test Artifacts
206
+
207
+ When tests run, the following artifacts are captured:
208
+
209
+ **On All Tests:**
210
+ - HTML Report with timeline and results
211
+ - JUnit XML for CI integration
212
+
213
+ **On Failure Only:**
214
+ - Screenshot of the failing state
215
+ - Video recording of the test
216
+ - Trace file for debugging (step-by-step replay)
217
+ - Network logs
218
+ - Console logs
219
+
220
+ ## Viewing Artifacts
221
+
222
+ ```bash
223
+ # View HTML report in browser
224
+ npx playwright show-report
225
+
226
+ # View specific trace file
227
+ npx playwright show-trace artifacts/trace-abc123.zip
228
+
229
+ # Screenshots are saved in artifacts/ directory
230
+ open artifacts/search-results.png
231
+ ```
232
+
233
+ ## Flaky Test Detection
234
+
235
+ If a test fails intermittently:
236
+
237
+ ```
238
+ ⚠️ FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts
239
+
240
+ Test passed 7/10 runs (70% pass rate)
241
+
242
+ Common failure:
243
+ "Timeout waiting for element '[data-testid="confirm-btn"]'"
244
+
245
+ Recommended fixes:
246
+ 1. Add explicit wait: await page.waitForSelector('[data-testid="confirm-btn"]')
247
+ 2. Increase timeout: { timeout: 10000 }
248
+ 3. Check for race conditions in component
249
+ 4. Verify element is not hidden by animation
250
+
251
+ Quarantine recommendation: Mark as test.fixme() until fixed
252
+ ```
253
+
254
+ ## Browser Configuration
255
+
256
+ Tests run on multiple browsers by default:
257
+ - ✅ Chromium (Desktop Chrome)
258
+ - ✅ Firefox (Desktop)
259
+ - ✅ WebKit (Desktop Safari)
260
+ - ✅ Mobile Chrome (optional)
261
+
262
+ Configure in `playwright.config.ts` to adjust browsers.
263
+
264
+ ## CI/CD Integration
265
+
266
+ Add to your CI pipeline:
267
+
268
+ ```yaml
269
+ # .github/workflows/e2e.yml
270
+ - name: Install Playwright
271
+ run: npx playwright install --with-deps
272
+
273
+ - name: Run E2E tests
274
+ run: npx playwright test
275
+
276
+ - name: Upload artifacts
277
+ if: always()
278
+ uses: actions/upload-artifact@v3
279
+ with:
280
+ name: playwright-report
281
+ path: playwright-report/
282
+ ```
283
+
284
+ ## PMX-Specific Critical Flows
285
+
286
+ For PMX, prioritize these E2E tests:
287
+
288
+ **🔴 CRITICAL (Must Always Pass):**
289
+ 1. User can connect wallet
290
+ 2. User can browse markets
291
+ 3. User can search markets (semantic search)
292
+ 4. User can view market details
293
+ 5. User can place trade (with test funds)
294
+ 6. Market resolves correctly
295
+ 7. User can withdraw funds
296
+
297
+ **🟡 IMPORTANT:**
298
+ 1. Market creation flow
299
+ 2. User profile updates
300
+ 3. Real-time price updates
301
+ 4. Chart rendering
302
+ 5. Filter and sort markets
303
+ 6. Mobile responsive layout
304
+
305
+ ## Best Practices
306
+
307
+ **DO:**
308
+ - ✅ Use Page Object Model for maintainability
309
+ - ✅ Use data-testid attributes for selectors
310
+ - ✅ Wait for API responses, not arbitrary timeouts
311
+ - ✅ Test critical user journeys end-to-end
312
+ - ✅ Run tests before merging to main
313
+ - ✅ Review artifacts when tests fail
314
+
315
+ **DON'T:**
316
+ - ❌ Use brittle selectors (CSS classes can change)
317
+ - ❌ Test implementation details
318
+ - ❌ Run tests against production
319
+ - ❌ Ignore flaky tests
320
+ - ❌ Skip artifact review on failures
321
+ - ❌ Test every edge case with E2E (use unit tests)
322
+
323
+ ## Important Notes
324
+
325
+ **CRITICAL for PMX:**
326
+ - E2E tests involving real money MUST run on testnet/staging only
327
+ - Never run trading tests against production
328
+ - Set `test.skip(process.env.NODE_ENV === 'production')` for financial tests
329
+ - Use test wallets with small test funds only
330
+
331
+ ## Integration with Other Commands
332
+
333
+ - Use `/plan` to identify critical journeys to test
334
+ - Use `/tdd` for unit tests (faster, more granular)
335
+ - Use `/e2e` for integration and user journey tests
336
+ - Use `/code-review` to verify test quality
337
+
338
+ ## Related Agents
339
+
340
+ This command invokes the `e2e-runner` agent located at:
341
+ `~/.claude/agents/e2e-runner.md`
342
+
343
+ ## Quick Commands
344
+
345
+ ```bash
346
+ # Run all E2E tests
347
+ npx playwright test
348
+
349
+ # Run specific test file
350
+ npx playwright test tests/e2e/markets/search.spec.ts
351
+
352
+ # Run in headed mode (see browser)
353
+ npx playwright test --headed
354
+
355
+ # Debug test
356
+ npx playwright test --debug
357
+
358
+ # Generate test code
359
+ npx playwright codegen http://localhost:3000
360
+
361
+ # View report
362
+ npx playwright show-report
363
+ ```
@@ -0,0 +1,113 @@
1
+ ---
2
+ description: Restate requirements, assess risks, and create step-by-step implementation plan. WAIT for user CONFIRM before touching any code.
3
+ ---
4
+
5
+ # Plan Command
6
+
7
+ This command invokes the **planner** agent to create a comprehensive implementation plan before writing any code.
8
+
9
+ ## What This Command Does
10
+
11
+ 1. **Restate Requirements** - Clarify what needs to be built
12
+ 2. **Identify Risks** - Surface potential issues and blockers
13
+ 3. **Create Step Plan** - Break down implementation into phases
14
+ 4. **Wait for Confirmation** - MUST receive user approval before proceeding
15
+
16
+ ## When to Use
17
+
18
+ Use `/plan` when:
19
+ - Starting a new feature
20
+ - Making significant architectural changes
21
+ - Working on complex refactoring
22
+ - Multiple files/components will be affected
23
+ - Requirements are unclear or ambiguous
24
+
25
+ ## How It Works
26
+
27
+ The planner agent will:
28
+
29
+ 1. **Analyze the request** and restate requirements in clear terms
30
+ 2. **Break down into phases** with specific, actionable steps
31
+ 3. **Identify dependencies** between components
32
+ 4. **Assess risks** and potential blockers
33
+ 5. **Estimate complexity** (High/Medium/Low)
34
+ 6. **Present the plan** and WAIT for your explicit confirmation
35
+
36
+ ## Example Usage
37
+
38
+ ```
39
+ User: /plan I need to add real-time notifications when markets resolve
40
+
41
+ Agent (planner):
42
+ # Implementation Plan: Real-Time Market Resolution Notifications
43
+
44
+ ## Requirements Restatement
45
+ - Send notifications to users when markets they're watching resolve
46
+ - Support multiple notification channels (in-app, email, webhook)
47
+ - Ensure notifications are delivered reliably
48
+ - Include market outcome and user's position result
49
+
50
+ ## Implementation Phases
51
+
52
+ ### Phase 1: Database Schema
53
+ - Add notifications table with columns: id, user_id, market_id, type, status, created_at
54
+ - Add user_notification_preferences table for channel preferences
55
+ - Create indexes on user_id and market_id for performance
56
+
57
+ ### Phase 2: Notification Service
58
+ - Create notification service in lib/notifications.ts
59
+ - Implement notification queue using BullMQ/Redis
60
+ - Add retry logic for failed deliveries
61
+ - Create notification templates
62
+
63
+ ### Phase 3: Integration Points
64
+ - Hook into market resolution logic (when status changes to "resolved")
65
+ - Query all users with positions in market
66
+ - Enqueue notifications for each user
67
+
68
+ ### Phase 4: Frontend Components
69
+ - Create NotificationBell component in header
70
+ - Add NotificationList modal
71
+ - Implement real-time updates via Supabase subscriptions
72
+ - Add notification preferences page
73
+
74
+ ## Dependencies
75
+ - Redis (for queue)
76
+ - Email service (SendGrid/Resend)
77
+ - Supabase real-time subscriptions
78
+
79
+ ## Risks
80
+ - HIGH: Email deliverability (SPF/DKIM required)
81
+ - MEDIUM: Performance with 1000+ users per market
82
+ - MEDIUM: Notification spam if markets resolve frequently
83
+ - LOW: Real-time subscription overhead
84
+
85
+ ## Estimated Complexity: MEDIUM
86
+ - Backend: 4-6 hours
87
+ - Frontend: 3-4 hours
88
+ - Testing: 2-3 hours
89
+ - Total: 9-13 hours
90
+
91
+ **WAITING FOR CONFIRMATION**: Proceed with this plan? (yes/no/modify)
92
+ ```
93
+
94
+ ## Important Notes
95
+
96
+ **CRITICAL**: The planner agent will **NOT** write any code until you explicitly confirm the plan with "yes" or "proceed" or similar affirmative response.
97
+
98
+ If you want changes, respond with:
99
+ - "modify: [your changes]"
100
+ - "different approach: [alternative]"
101
+ - "skip phase 2 and do phase 3 first"
102
+
103
+ ## Integration with Other Commands
104
+
105
+ After planning:
106
+ - Use `/tdd` to implement with test-driven development
107
+ - Use `/build-and-fix` if build errors occur
108
+ - Use `/code-review` to review completed implementation
109
+
110
+ ## Related Agents
111
+
112
+ This command invokes the `planner` agent located at:
113
+ `~/.claude/agents/planner.md`
@@ -0,0 +1,28 @@
1
+ # Refactor Clean
2
+
3
+ Safely identify and remove dead code with test verification:
4
+
5
+ 1. Run dead code analysis tools:
6
+ - knip: Find unused exports and files
7
+ - depcheck: Find unused dependencies
8
+ - ts-prune: Find unused TypeScript exports
9
+
10
+ 2. Generate comprehensive report in .reports/dead-code-analysis.md
11
+
12
+ 3. Categorize findings by severity:
13
+ - SAFE: Test files, unused utilities
14
+ - CAUTION: API routes, components
15
+ - DANGER: Config files, main entry points
16
+
17
+ 4. Propose safe deletions only
18
+
19
+ 5. Before each deletion:
20
+ - Run full test suite
21
+ - Verify tests pass
22
+ - Apply change
23
+ - Re-run tests
24
+ - Rollback if tests fail
25
+
26
+ 6. Show summary of cleaned items
27
+
28
+ Never delete code without running tests first!