@programinglive/dev-workflow-mcp-server 1.8.1 → 1.10.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 (114) hide show
  1. package/.env.example +21 -1
  2. package/AGENTS.md +25 -0
  3. package/README.md +372 -649
  4. package/factory-client.js +554 -0
  5. package/git-facade.js +35 -0
  6. package/index.js +9 -34
  7. package/package.json +21 -20
  8. package/scripts/bootstrap-unix.sh +55 -0
  9. package/scripts/bootstrap-windows.ps1 +75 -0
  10. package/scripts/install-husky.js +43 -0
  11. package/scripts/setup-stack.js +436 -0
  12. package/scripts/setup-test-dbs.sh +61 -0
  13. package/scripts/test-db-adapters.sh +71 -0
  14. package/scripts/verify-bundle.mjs +92 -0
  15. package/tools/definitions.js +143 -0
  16. package/tools/handler-modules/commit-handlers.js +2 -1
  17. package/tools/handler-modules/factory-handlers.js +276 -0
  18. package/tools/handler-modules/index.js +24 -7
  19. package/tools/handler-modules/shared.js +7 -41
  20. package/tools/handler-modules/status-handlers.js +25 -3
  21. package/tools/handler-modules/workflow-handlers.js +57 -10
  22. package/vite.config.js +6 -0
  23. package/workflow-state.js +176 -2
  24. package/.agent/workflows/dev-workflow-bugfix.md +0 -250
  25. package/.agent/workflows/dev-workflow-feature.md +0 -201
  26. package/.agent/workflows/dev-workflow-full-cycle.md +0 -400
  27. package/.agent/workflows/dev-workflow-refactor.md +0 -238
  28. package/.env.production +0 -16
  29. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -34
  30. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -25
  31. package/.github/pull_request_template.md +0 -22
  32. package/.github/workflows/github-release.yml +0 -131
  33. package/.husky/commit-msg +0 -3
  34. package/.husky/pre-commit +0 -2
  35. package/CHANGELOG.md +0 -1145
  36. package/docs/GCP_DEPLOYMENT.md +0 -298
  37. package/docs/NETLIFY_DEPLOYMENT.md +0 -125
  38. package/docs/PLESK_DEPLOYMENT.md +0 -170
  39. package/docs/PRD.md +0 -86
  40. package/docs/WORKFLOW-BEST-PRACTICES.md +0 -58
  41. package/docs/antigravity/EXAMPLES.md +0 -535
  42. package/docs/antigravity/GETTING-STARTED.md +0 -292
  43. package/docs/antigravity/TROUBLESHOOTING.md +0 -742
  44. package/docs/antigravity/WALKTHROUGH.md +0 -25
  45. package/docs/antigravity/WORKFLOW-TEMPLATES.md +0 -670
  46. package/docs/release-notes/RELEASE_NOTES.md +0 -524
  47. package/docs/web-dashboard.md +0 -175
  48. package/scripts/test-auth-flow.js +0 -75
  49. package/tailwind.config.js +0 -8
  50. package/tests/build.test.js +0 -74
  51. package/tests/db-adapters.test.js +0 -108
  52. package/tests/env-support.test.js +0 -46
  53. package/tests/exec.test.js +0 -35
  54. package/tests/handlers-commit.test.js +0 -174
  55. package/tests/handlers-release.test.js +0 -212
  56. package/tests/handlers-workflow.test.js +0 -68
  57. package/tests/handlers.test.js +0 -1142
  58. package/tests/hello-world.test.js +0 -13
  59. package/tests/mcpRegistry.test.js +0 -65
  60. package/tests/patch-release.test.js +0 -7
  61. package/tests/release-wrapper.test.js +0 -107
  62. package/tests/startup-resilience.test.js +0 -73
  63. package/tests/test-helpers.js +0 -50
  64. package/tests/workflowState.test.js +0 -520
  65. package/web/Dockerfile.api +0 -25
  66. package/web/README.md +0 -133
  67. package/web/__tests__/api/workflow-history.test.js +0 -63
  68. package/web/api-server.js +0 -211
  69. package/web/app/docs/page.tsx +0 -202
  70. package/web/app/favicon.ico +0 -0
  71. package/web/app/globals.css +0 -91
  72. package/web/app/history/page.tsx +0 -220
  73. package/web/app/layout.tsx +0 -39
  74. package/web/app/login/page.tsx +0 -142
  75. package/web/app/page.tsx +0 -13
  76. package/web/components/ApiReference.tsx +0 -20
  77. package/web/components/Features.tsx +0 -61
  78. package/web/components/Footer.tsx +0 -9
  79. package/web/components/Hero.tsx +0 -96
  80. package/web/components/History.tsx +0 -175
  81. package/web/components/Navbar.tsx +0 -208
  82. package/web/components/Terminal.tsx +0 -114
  83. package/web/components/ThemeProvider.tsx +0 -58
  84. package/web/eslint.config.mjs +0 -18
  85. package/web/lib/api-client.ts +0 -123
  86. package/web/lib/auth.js +0 -75
  87. package/web/lib/db.js +0 -131
  88. package/web/lib/docs.js +0 -73
  89. package/web/middleware/auth.js +0 -26
  90. package/web/netlify.toml +0 -8
  91. package/web/next.config.ts +0 -19
  92. package/web/package-lock.json +0 -10911
  93. package/web/package.json +0 -42
  94. package/web/postcss.config.mjs +0 -9
  95. package/web/public/assets/android-chrome-192x192.png +0 -0
  96. package/web/public/assets/android-chrome-512x512.png +0 -0
  97. package/web/public/assets/apple-touch-icon.png +0 -0
  98. package/web/public/assets/favicon-16x16.png +0 -0
  99. package/web/public/assets/favicon-32x32.png +0 -0
  100. package/web/public/assets/favicon.ico +0 -0
  101. package/web/public/assets/favicon.png +0 -0
  102. package/web/public/assets/logo.png +0 -0
  103. package/web/public/assets/og-preview.png +0 -0
  104. package/web/public/assets/site.webmanifest +0 -1
  105. package/web/public/file.svg +0 -1
  106. package/web/public/globe.svg +0 -1
  107. package/web/public/next.svg +0 -1
  108. package/web/public/vercel.svg +0 -1
  109. package/web/public/window.svg +0 -1
  110. package/web/scripts/db-query-history.js +0 -120
  111. package/web/scripts/smoke-test.js +0 -30
  112. package/web/server.js +0 -184
  113. package/web/tailwind.config.ts +0 -20
  114. package/web/tsconfig.json +0 -42
@@ -1,58 +0,0 @@
1
- # Workflow Best Practices
2
-
3
- ## Correct Release Workflow Order
4
-
5
- To avoid needing `--force` flag for releases, follow this exact order:
6
-
7
- 1. **Start Task**: `mcp0_start_task`
8
- 2. **Fix/Implement**: Make your code changes
9
- 3. **Mark Fixed**: `mcp0_mark_bug_fixed`
10
- 4. **Tests**: `mcp0_create_tests` + `mcp0_run_tests` (or `mcp0_skip_tests` with reason)
11
- 5. **Documentation**: `mcp0_create_documentation`
12
- 6. **Ready Check**: `mcp0_check_ready_to_commit`
13
- 7. **Commit & Push**: `mcp0_commit_and_push`
14
- 8. **Release**: `mcp0_perform_release` ⚠️ **MUST come BEFORE complete_task**
15
- 9. **Complete**: `mcp0_complete_task`
16
-
17
- ## Common Mistakes
18
-
19
- ### ❌ Wrong Order (causes forced releases)
20
- ```
21
- check_ready → commit → complete → release // WRONG!
22
- ```
23
-
24
- ### ✅ Correct Order
25
- ```
26
- check_ready → commit → release → complete // CORRECT!
27
- ```
28
-
29
- ## Why This Matters
30
-
31
- - `complete_task` **resets the workflow state**
32
- - `perform_release` **checks the workflow state** before running
33
- - If you complete before releasing, the state is cleared and release guards fail
34
- - Using `--force` bypasses guards but doesn't fix the root cause
35
-
36
- ## State Transitions
37
-
38
- 1. After `commit_and_push`: `currentPhase = "release"`
39
- 2. After `perform_release`: `currentPhase = "ready_to_complete"`, `released = true`
40
- 3. After `complete_task`: State is reset to idle
41
-
42
- ## Solution
43
-
44
- Always call `perform_release` BEFORE `complete_task`. Never use `--force` unless absolutely necessary.
45
-
46
- ## Documentation Phase Expectations
47
-
48
- During the documentation step (`mcp0_create_documentation`), make sure the core project docs are created or updated as needed:
49
-
50
- 1. `docs/product/PRD.md` – Product Requirements Document
51
- 2. `README.md` – Project overview and usage
52
- 3. `docs/release-notes/RELEASE_NOTES.md` – Release notes for changes in this task/version
53
-
54
- If one or more of these files already exist, **update them** instead of creating new variants. Use the `documentationType` argument to reflect what you touched:
55
-
56
- - `"PRD"` when you added/updated the PRD
57
- - `"README"` when you updated the main README
58
- - `"RELEASE_NOTES"` when you updated the release notes
@@ -1,535 +0,0 @@
1
- # Practical Examples for Dev-Workflow MCP Server
2
-
3
- This document provides real-world examples of using the dev-workflow MCP server in Antigravity.
4
-
5
- ## Table of Contents
6
-
7
- - [Simple Feature Development](#simple-feature-development)
8
- - [Bug Fix with Test Discovery](#bug-fix-with-test-discovery)
9
- - [Refactoring Workflow](#refactoring-workflow)
10
- - [Using run_full_workflow](#using-run_full_workflow)
11
- - [Multi-Project Workflow](#multi-project-workflow)
12
- - [Per-User Workflow Isolation](#per-user-workflow-isolation)
13
- - [Handling Test Failures](#handling-test-failures)
14
-
15
- ---
16
-
17
- ## Simple Feature Development
18
-
19
- **Scenario:** Adding a user profile avatar feature
20
-
21
- ### Step-by-Step
22
-
23
- **1. Start the task:**
24
- ```
25
- start_task:
26
- description: "Add user avatar upload and display"
27
- type: "feature"
28
- ```
29
-
30
- **Response:**
31
- ```
32
- ✅ Task started: Add user avatar upload and display
33
- 📝 Task ID: task-20231122-001
34
- 🔄 Phase: implementation
35
- Next: Implement the feature, then mark as fixed
36
- ```
37
-
38
- **2. Implement the feature:**
39
- - Create `components/Avatar.jsx`
40
- - Add upload functionality
41
- - Integrate with user profile page
42
-
43
- **3. Mark as fixed:**
44
- ```
45
- mark_bug_fixed:
46
- summary: "Avatar component with upload, preview, and persistence"
47
- ```
48
-
49
- **4. Create tests:**
50
- - Write `Avatar.test.jsx` with upload tests
51
- - Add integration tests for profile page
52
-
53
- ```
54
- create_tests
55
- ```
56
-
57
- **5. Run tests:**
58
- ```bash
59
- npm test
60
- ```
61
-
62
- ```
63
- run_tests:
64
- passed: true
65
- testCommand: "npm test"
66
- details: "31 tests passed (27 existing + 4 new avatar tests)"
67
- ```
68
-
69
- **6. Document:**
70
- Update `README.md` with avatar component usage:
71
-
72
- ```
73
- create_documentation:
74
- documentationType: "README"
75
- summary: "Added Avatar component documentation with API reference and examples"
76
- ```
77
-
78
- **7. Commit and push:**
79
- ```
80
- commit_and_push:
81
- commitMessage: "feat(profile): add user avatar upload and display"
82
- ```
83
-
84
- **8. Release:**
85
- ```
86
- perform_release:
87
- command: "npm run release:minor"
88
- notes: "v1.3.0 - User avatar feature"
89
- ```
90
-
91
- **9. Complete:**
92
- ```
93
- complete_task:
94
- commitMessage: "feat(profile): add user avatar upload and display"
95
- ```
96
-
97
- ---
98
-
99
- ## Bug Fix with Test Discovery
100
-
101
- **Scenario:** Fixing a date formatting bug discovered in production
102
-
103
- ### Workflow
104
-
105
- **1. Start:**
106
- ```
107
- start_task:
108
- description: "Fix incorrect date format in transaction history"
109
- type: "bugfix"
110
- ```
111
-
112
- **2. Reproduce and fix:**
113
- - Find the bug in `utils/formatDate.js`
114
- - Fix the formatting logic
115
- - Verify the fix
116
-
117
- **3. Mark as fixed:**
118
- ```
119
- mark_bug_fixed:
120
- summary: "Corrected date formatting to use ISO 8601 format"
121
- ```
122
-
123
- **4. Create regression test:**
124
- Create `utils/formatDate.test.js`:
125
-
126
- ```javascript
127
- describe('formatDate', () => {
128
- it('formats dates in ISO 8601 format', () => {
129
- const date = new Date('2023-11-22T10:30:00Z');
130
- expect(formatDate(date)).toBe('2023-11-22');
131
- });
132
-
133
- it('handles timezone correctly', () => {
134
- // Regression test for the bug
135
- const date = new Date('2023-11-22T23:00:00-05:00');
136
- expect(formatDate(date)).toBe('2023-11-22');
137
- });
138
- });
139
- ```
140
-
141
- ```
142
- create_tests
143
- ```
144
-
145
- **5. Run tests:**
146
- ```
147
- run_tests:
148
- passed: true
149
- testCommand: "npm test -- utils/formatDate.test.js"
150
- details: "2 new tests pass, including regression test"
151
- ```
152
-
153
- **6. Document:**
154
- Update `CHANGELOG.md`:
155
-
156
- ```
157
- create_documentation:
158
- documentationType: "changelog"
159
- summary: "Added bug fix entry for date formatting issue"
160
- ```
161
-
162
- **7. Commit:**
163
- ```
164
- commit_and_push:
165
- commitMessage: "fix(utils): correct date formatting to use ISO 8601"
166
- ```
167
-
168
- **8. Release:**
169
- ```
170
- perform_release:
171
- command: "npm run release:patch"
172
- notes: "v1.2.1 - Hotfix for date formatting"
173
- ```
174
-
175
- **9. Complete:**
176
- ```
177
- complete_task:
178
- commitMessage: "fix(utils): correct date formatting to use ISO 8601"
179
- ```
180
-
181
- ---
182
-
183
- ## Refactoring Workflow
184
-
185
- **Scenario:** Refactoring API service layer for better maintainability
186
-
187
- ### Workflow
188
-
189
- **1. Start:**
190
- ```
191
- start_task:
192
- description: "Refactor API service layer to use interceptors pattern"
193
- type: "refactor"
194
- ```
195
-
196
- **2. Refactor code:**
197
- - Extract common logic to interceptors
198
- - Update all API calls to use new pattern
199
- - Ensure backward compatibility
200
-
201
- **3. Mark as fixed:**
202
- ```
203
- mark_bug_fixed:
204
- summary: "Refactored API service to use axios interceptors for auth and error handling"
205
- ```
206
-
207
- **4. Update existing tests:**
208
- Since this is a refactor, update existing tests to work with new structure:
209
-
210
- ```
211
- create_tests
212
- ```
213
-
214
- **5. Run comprehensive test suite:**
215
- ```
216
- run_tests:
217
- passed: true
218
- testCommand: "npm test -- --coverage"
219
- details: "All 127 tests pass. Coverage: 94% → 96%"
220
- ```
221
-
222
- **6. Document changes:**
223
- Update inline comments and architecture docs:
224
-
225
- ```
226
- create_documentation:
227
- documentationType: "inline-comments"
228
- summary: "Added JSDoc comments for interceptors and updated architecture diagram"
229
- ```
230
-
231
- **7. Commit:**
232
- ```
233
- commit_and_push:
234
- commitMessage: "refactor(api): use interceptors pattern for auth and error handling"
235
- ```
236
-
237
- **8. Release:**
238
- ```
239
- perform_release:
240
- command: "npm run release:minor"
241
- notes: "v1.4.0 - API service refactoring (internal improvement)"
242
- ```
243
-
244
- **9. Complete:**
245
- ```
246
- complete_task:
247
- commitMessage: "refactor(api): use interceptors pattern for auth and error handling"
248
- ```
249
-
250
- ---
251
-
252
- ## Using run_full_workflow
253
-
254
- **Scenario:** Quick feature when you know all the details upfront
255
-
256
- The `run_full_workflow` tool executes all workflow steps in one call:
257
-
258
- ```
259
- run_full_workflow:
260
- summary: "Add dark mode toggle to settings"
261
- testCommand: "npm test"
262
- testsPassed: true
263
- testDetails: "3 new tests for dark mode: all pass"
264
- documentationType: "README"
265
- documentationSummary: "Added dark mode section to README with usage"
266
- commitMessage: "feat(ui): add dark mode toggle to settings"
267
- releaseCommand: "npm run release:minor"
268
- releaseNotes: "v1.5.0 - Dark mode support"
269
- ```
270
-
271
- This single call:
272
- 1. ✅ Marks the feature as fixed
273
- 2. ✅ Records test creation
274
- 3. ✅ Records test execution
275
- 4. ✅ Records documentation
276
- 5. ✅ Checks ready to commit
277
- 6. ✅ Commits and pushes
278
- 7. ✅ Performs release
279
- 8. ✅ Completes the task
280
-
281
- **When to use:**
282
- - Simple, well-defined features
283
- - You've already done the work and just need to record it
284
- - Batch processing multiple small changes
285
-
286
- **When not to use:**
287
- - Complex features requiring step-by-step verification
288
- - When tests might fail (you need to fix them first)
289
- - Learning the workflow for the first time
290
-
291
- ---
292
-
293
- ## Multi-Project Workflow
294
-
295
- **Scenario:** Working on multiple projects with separate workflow histories
296
-
297
- ### Setup
298
-
299
- Each project gets its own `.state/workflow-state.json`:
300
-
301
- ```bash
302
- # Project A
303
- cd ~/projects/frontend-app
304
- npm install @programinglive/dev-workflow-mcp-server
305
-
306
- # Project B
307
- cd ~/projects/backend-api
308
- npm install @programinglive/dev-workflow-mcp-server
309
- ```
310
-
311
- ### Usage
312
-
313
- Workflows are automatically isolated by project:
314
-
315
- **In frontend-app:**
316
- ```
317
- start_task:
318
- description: "Add checkout flow"
319
- type: "feature"
320
-
321
- # Work on frontend...
322
- # Complete workflow...
323
- ```
324
-
325
- **In backend-api:**
326
- ```
327
- start_task:
328
- description: "Add payment webhook endpoint"
329
- type: "feature"
330
-
331
- # Work on backend...
332
- # Complete workflow...
333
- ```
334
-
335
- Each project tracks its own:
336
- - Current task
337
- - Workflow phase
338
- - History
339
-
340
- View history for current project:
341
- ```
342
- view_history:
343
- limit: 5
344
- ```
345
-
346
- This shows only the history for the current project!
347
-
348
- ---
349
-
350
- ## Per-User Workflow Isolation
351
-
352
- **Scenario:** Multiple developers on the same machine or shared repository
353
-
354
- ### Configuration
355
-
356
- Set unique user IDs for each developer:
357
-
358
- **Developer 1 (Alice):**
359
- ```json
360
- {
361
- "mcpServers": {
362
- "dev-workflow": {
363
- "command": "node",
364
- "args": ["d:\\code\\dev-workflow-mcp-server\\index.js"],
365
- "env": {
366
- "DEV_WORKFLOW_USER_ID": "alice"
367
- }
368
- }
369
- }
370
- }
371
- ```
372
-
373
- **Developer 2 (Bob):**
374
- ```json
375
- {
376
- "mcpServers": {
377
- "dev-workflow": {
378
- "command": "node",
379
- "args": ["d:\\code\\dev-workflow-mcp-server\\index.js"],
380
- "env": {
381
- "DEV_WORKFLOW_USER_ID": "bob"
382
- }
383
- }
384
- }
385
- }
386
- ```
387
-
388
- ### Result
389
-
390
- Workflow states are isolated:
391
- - `.state/users/alice/workflow-state.db` - Alice's history
392
- - `.state/users/bob/workflow-state.db` - Bob's history
393
-
394
- Each developer can:
395
- - Work on different tasks simultaneously
396
- - Have independent workflow phases
397
- - View their own history without seeing others
398
-
399
- ### Web Dashboard
400
-
401
- View specific user's history:
402
- ```bash
403
- npm run web
404
- # Opens http://localhost:3111
405
-
406
- # Filter by user:
407
- # http://localhost:3111?user=alice
408
- # http://localhost:3111?user=bob
409
- ```
410
-
411
- ---
412
-
413
- ## Handling Test Failures
414
-
415
- **Scenario:** Tests fail during workflow
416
-
417
- ### Workflow with Failure
418
-
419
- **1. Start and implement:**
420
- ```
421
- start_task:
422
- description: "Add email validation to signup form"
423
- type: "feature"
424
-
425
- mark_bug_fixed:
426
- summary: "Email validation with regex and domain verification"
427
-
428
- create_tests
429
- ```
430
-
431
- **2. Run tests (they fail!):**
432
- ```
433
- run_tests:
434
- passed: false
435
- testCommand: "npm test"
436
- details: "2 of 4 tests failed: Invalid email format not caught"
437
- ```
438
-
439
- **Response:**
440
- ```
441
- ❌ Tests FAILED!
442
- 🚫 Cannot proceed to commit with failing tests
443
- 📝 Current phase: testing (blocked)
444
-
445
- You must:
446
- 1. Fix the failing tests
447
- 2. Re-run tests with passed: true
448
- ```
449
-
450
- **3. Fix the bugs:**
451
- - Update validation regex
452
- - Fix edge case handling
453
-
454
- **4. Run tests again:**
455
- ```
456
- run_tests:
457
- passed: true
458
- testCommand: "npm test"
459
- details: "All 4 tests now pass"
460
- ```
461
-
462
- **Response:**
463
- ```
464
- ✅ Tests passed!
465
- ✅ Testing phase complete
466
- Next: Create documentation
467
- ```
468
-
469
- **5. Continue workflow:**
470
- ```
471
- create_documentation:
472
- documentationType: "inline-comments"
473
- summary: "Added validation rules documentation"
474
-
475
- commit_and_push:
476
- commitMessage: "feat(auth): add email validation to signup"
477
-
478
- perform_release:
479
- command: "npm run release:minor"
480
-
481
- complete_task:
482
- commitMessage: "feat(auth): add email validation to signup"
483
- ```
484
-
485
- ### Key Takeaway
486
-
487
- **The workflow blocks commits when tests fail!** This enforces quality and prevents broken code from reaching your repository.
488
-
489
- ---
490
-
491
- ## Advanced: Skipping Tests
492
-
493
- **Scenario:** Manual testing required (mobile app, hardware integration, etc.)
494
-
495
- ```
496
- start_task:
497
- description: "Add iOS biometric authentication"
498
- type: "feature"
499
-
500
- mark_bug_fixed:
501
- summary: "Face ID and Touch ID integration complete"
502
-
503
- skip_tests:
504
- reason: "Biometric auth requires physical iOS device testing; automated tests not feasible. Manual QA completed on iPhone 14 Pro and iPhone 12."
505
- ```
506
-
507
- **Response:**
508
- ```
509
- ⚠️ Tests skipped with justification
510
- ✅ Testing phase marked as satisfied
511
- 📝 Task flagged for manual verification
512
-
513
- Reason: Biometric auth requires physical iOS device testing; automated tests not feasible. Manual QA completed on iPhone 14 Pro and iPhone 12.
514
-
515
- Next: Create documentation
516
- ```
517
-
518
- **When to skip tests:**
519
- - Hardware-dependent features
520
- - Manual UI testing on specific devices
521
- - Third-party service integration (with mocking limitations)
522
-
523
- **Best practice:** Always provide detailed justification for audit trail.
524
-
525
- ---
526
-
527
- ## Next Steps
528
-
529
- - Check [WORKFLOW-TEMPLATES.md](./WORKFLOW-TEMPLATES.md) for ready-to-use templates
530
- - See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for common issues
531
- - Return to [GETTING-STARTED.md](./GETTING-STARTED.md) for setup instructions
532
-
533
- ---
534
-
535
- **Happy coding with disciplined workflows!** 🎯