@programinglive/dev-workflow-mcp-server 1.5.1 → 1.5.2

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 (78) hide show
  1. package/.agent/workflows/dev-workflow-bugfix.md +250 -250
  2. package/.agent/workflows/dev-workflow-feature.md +201 -201
  3. package/.agent/workflows/dev-workflow-full-cycle.md +400 -400
  4. package/.agent/workflows/dev-workflow-refactor.md +238 -238
  5. package/.github/ISSUE_TEMPLATE/bug_report.md +34 -34
  6. package/.github/ISSUE_TEMPLATE/feature_request.md +25 -25
  7. package/.github/pull_request_template.md +22 -22
  8. package/.github/workflows/npm-publish.yml +50 -50
  9. package/.husky/commit-msg +0 -0
  10. package/CHANGELOG.md +749 -739
  11. package/CODE_OF_CONDUCT.md +79 -79
  12. package/CONTRIBUTING.md +60 -60
  13. package/LICENSE +21 -21
  14. package/README.md +632 -632
  15. package/SECURITY.md +20 -20
  16. package/db/index.js +204 -204
  17. package/docs/NETLIFY_DEPLOYMENT.md +125 -125
  18. package/docs/PLESK_DEPLOYMENT.md +170 -170
  19. package/docs/WORKFLOW-BEST-PRACTICES.md +58 -58
  20. package/docs/antigravity/EXAMPLES.md +535 -535
  21. package/docs/antigravity/GETTING-STARTED.md +292 -292
  22. package/docs/antigravity/TROUBLESHOOTING.md +742 -742
  23. package/docs/antigravity/WALKTHROUGH.md +25 -25
  24. package/docs/antigravity/WORKFLOW-TEMPLATES.md +670 -670
  25. package/docs/product/PRD.md +67 -67
  26. package/docs/release-notes/RELEASE_NOTES.md +226 -226
  27. package/docs/web-dashboard.md +175 -175
  28. package/exec.js +49 -49
  29. package/index.js +279 -279
  30. package/install.js +73 -73
  31. package/package.json +4 -4
  32. package/release-wrapper.js +192 -192
  33. package/scripts/build-docs.js +63 -63
  34. package/scripts/hello-world.js +1 -1
  35. package/scripts/release.cjs +252 -252
  36. package/scripts/update-release-notes.cjs +178 -178
  37. package/server.json +23 -23
  38. package/tailwind.config.js +8 -8
  39. package/tests/build.test.js +83 -91
  40. package/tests/exec.test.js +35 -35
  41. package/tests/handlers.test.js +1058 -1058
  42. package/tests/hello-world.test.js +13 -13
  43. package/tests/mcpRegistry.test.js +65 -65
  44. package/tests/release-wrapper.test.js +107 -107
  45. package/tests/workflowState.test.js +505 -505
  46. package/tools/definitions.js +332 -332
  47. package/tools/handlers.js +1019 -1019
  48. package/vite.config.js +43 -43
  49. package/vite.web.config.js +23 -23
  50. package/web/README.md +36 -36
  51. package/web/app/docs/page.tsx +202 -202
  52. package/web/app/globals.css +90 -90
  53. package/web/app/layout.tsx +36 -36
  54. package/web/app/page.tsx +15 -15
  55. package/web/components/ApiReference.tsx +20 -20
  56. package/web/components/Features.tsx +61 -61
  57. package/web/components/Footer.tsx +9 -9
  58. package/web/components/Hero.tsx +96 -97
  59. package/web/components/History.tsx +143 -143
  60. package/web/components/Navbar.tsx +64 -64
  61. package/web/components/Terminal.tsx +114 -114
  62. package/web/eslint.config.mjs +18 -18
  63. package/web/lib/db.js +131 -131
  64. package/web/lib/docs.js +73 -73
  65. package/web/netlify.toml +3 -6
  66. package/web/next.config.ts +12 -7
  67. package/web/package-lock.json +6560 -6560
  68. package/web/package.json +28 -28
  69. package/web/postcss.config.mjs +9 -9
  70. package/web/server.js +31 -31
  71. package/web/tailwind.config.ts +19 -19
  72. package/web/tsconfig.json +42 -42
  73. package/workflow-state.js +612 -612
  74. package/web/app/api/docs/route.ts +0 -32
  75. package/web/app/api/history/route.ts +0 -12
  76. package/web/app/api/npm-downloads/route.ts +0 -21
  77. package/web/app/api/summary/route.ts +0 -13
  78. package/web/app/api/version/route.ts +0 -8
package/README.md CHANGED
@@ -1,632 +1,632 @@
1
- # Development Workflow MCP Server
2
-
3
- <p align="left">
4
- <a href="https://www.npmjs.com/package/@programinglive/dev-workflow-mcp-server"><img src="https://img.shields.io/npm/v/@programinglive/dev-workflow-mcp-server.svg" alt="npm version"></a>
5
- <a href="https://www.npmjs.com/package/@programinglive/dev-workflow-mcp-server"><img src="https://img.shields.io/npm/dm/@programinglive/dev-workflow-mcp-server.svg" alt="npm downloads"></a>
6
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license: MIT"></a>
7
- </p>
8
-
9
- An MCP (Model Context Protocol) server that helps enforce development discipline and workflow best practices. This server acts as your coding conscience, reminding you to follow proper development workflows.
10
-
11
- ## 🎯 Purpose
12
-
13
- This MCP server guides you through a disciplined development workflow:
14
-
15
- 1. **Start Conscious** - Be clear about what you're coding
16
- 2. **Fix/Implement** - Write your code
17
- 3. **Create Tests** - Always test your changes
18
- 4. **Run Tests** - Tests must pass (GREEN)
19
- 5. **Document** - Update documentation
20
- 6. **Commit & Push** - Let the server stage, commit, **and push** your changes once verification passes (if you make new edits afterward, the workflow moves back to this step automatically)
21
- 7. **Release** - After the push succeeds, record the release details before closing out the task
22
-
23
- ## 🚀 Installation
24
-
25
- ### Option 1: Install as Dependency in Your Project (Recommended)
26
-
27
- Each project gets its own isolated workflow state file.
28
-
29
- ```bash
30
- npm install @programinglive/dev-workflow-mcp-server
31
- ```
32
-
33
- This will automatically create a `.state/workflow-state.json` file in the **project where you ran `npm install`** (using npm's `INIT_CWD`), keeping workflow history separate per project. If you're installing the package itself (inside `node_modules`), the script skips creation so it never pollutes the shared package directory.
34
-
35
- ### Option 2: Install from Source
36
-
37
- ```bash
38
- git clone https://github.com/programinglive/dev-workflow-mcp-server.git
39
- cd dev-workflow-mcp-server
40
- npm install
41
- ```
42
-
43
- > **Windows prerequisites:** Installing dependencies from source compiles native modules such as `better-sqlite3`. Make sure Python 3 (added to PATH) and the Visual Studio Build Tools “Desktop development with C++” workload are installed before running `npm install`. Without them, npm will fail with a “need python” or build error.
44
-
45
- ### Option 3: Install on Plesk Hosting
46
-
47
- Plesk supports Node.js applications through its Node.js extension. To deploy the MCP server on a Plesk subscription:
48
-
49
- 1. **Enable Node.js support** – Ensure the Plesk administrator has installed the Node.js extension and enabled SSH access for your subscription.
50
- 2. **Upload the project** – Either clone the repository or upload an archive into the directory you will run it from (e.g., `httpdocs/dev-workflow-mcp-server`). From SSH you can run:
51
- ```bash
52
- cd httpdocs
53
- git clone https://github.com/programinglive/dev-workflow-mcp-server.git
54
- cd dev-workflow-mcp-server
55
- ```
56
- 3. **Install dependencies** – In Plesk’s **Node.js** panel use “NPM install” (or run `npm install --production` over SSH). Linux hosts already ship the Python/build toolchain required for `better-sqlite3`; if your plan uses a Windows host, install Python 3 and the Visual Studio Build Tools beforehand or ask your provider to enable them.
57
- 4. **Define environment variables** – In the Node.js panel add any environment variables you need (for example `DEV_WORKFLOW_USER_ID` or `DEV_WORKFLOW_STATE_FILE`). This keeps state files outside the web root if desired.
58
- 5. **Configure the application** – Set **Application startup file** to `index.js` and **Application mode** to `production`. Plesk will run the server with `node index.js`.
59
- 6. **Start/Restart the app** – Click “Restart App” so Plesk launches the MCP server with the new configuration. When you update the code, rerun “NPM install” and restart.
60
-
61
- > **Tip:** The MCP server communicates over stdio. If you only need it as a CLI tool, you can also run `npx @programinglive/dev-workflow-mcp-server` directly in an SSH session without keeping it running under the Node.js panel.
62
-
63
- > **Important:** MCP clients (Windsurf, Claude Desktop, etc.) must launch the server process locally via stdio. Hosting the dashboard on a public domain does **not** expose the MCP interface. Without SSH or another way to execute `node index.js` on the server, users cannot connect their MCP clients to the hosted instance.
64
-
65
- #### Two Usage Modes
66
-
67
- - **Local (source)**: Point your MCP client to `index.js`. This runs directly from source and requires no build step. Recommended for MCP usage.
68
- - **Production (built)**: Run `npm run build` once to generate `dist/`. This creates an optimized bundle but isn’t needed for MCP usage.
69
-
70
- ### 3. Configure in Windsurf/Claude Desktop
71
-
72
- Point your MCP client to the server entry point. Replace `<PROJECT_ROOT>` with the absolute path to this repository on your machine.
73
-
74
- #### macOS
75
-
76
- - **Windsurf** (`~/Library/Application Support/Windsurf/config.json`):
77
-
78
- ```json
79
- {
80
- "mcpServers": {
81
- "dev-workflow": {
82
- "command": "node",
83
- "args": ["<PROJECT_ROOT>/index.js"]
84
- }
85
- }
86
- }
87
- ```
88
-
89
- - **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
90
-
91
- ```json
92
- {
93
- "mcpServers": {
94
- "dev-workflow": {
95
- "command": "node",
96
- "args": ["<PROJECT_ROOT>/index.js"]
97
- }
98
- }
99
- }
100
- ```
101
-
102
- #### Windows
103
-
104
- - **Windsurf** (`%APPDATA%\Windsurf\config.json`):
105
-
106
- ```json
107
- {
108
- "mcpServers": {
109
- "dev-workflow": {
110
- "command": "node",
111
- "args": ["<PROJECT_ROOT>\\index.js"]
112
- }
113
- }
114
- }
115
- ```
116
-
117
- - **Claude Desktop** (`%APPDATA%\Claude\claude_desktop_config.json`):
118
-
119
- ```json
120
- {
121
- "mcpServers": {
122
- "dev-workflow": {
123
- "command": "node",
124
- "args": ["<PROJECT_ROOT>\\index.js"]
125
- }
126
- }
127
- }
128
- ```
129
-
130
- #### Linux
131
-
132
- - **Windsurf** (`~/.config/windsurf/config.json`):
133
-
134
- ```json
135
- {
136
- "mcpServers": {
137
- "dev-workflow": {
138
- "command": "node",
139
- "args": ["<PROJECT_ROOT>/index.js"]
140
- }
141
- }
142
- }
143
- ```
144
-
145
- - **Claude Desktop** (`~/.config/claude/claude_desktop_config.json`):
146
-
147
- ```json
148
- {
149
- "mcpServers": {
150
- "dev-workflow": {
151
- "command": "node",
152
- "args": ["<PROJECT_ROOT>/index.js"]
153
- }
154
- }
155
- }
156
- ```
157
-
158
- > **Note:** On Windows paths in JSON require escaped backslashes (e.g., `"C:\\path\\to\\project"`).
159
-
160
- ### 4. Restart Windsurf/Claude Desktop
161
-
162
- After adding the configuration, restart the application to load the MCP server.
163
-
164
-
165
- ### 5. Configure in Antigravity
166
-
167
- Antigravity users should configure the MCP server in their `mcp_config.json`.
168
-
169
- **Windows:** `%APPDATA%\Antigravity\mcp_config.json` or `C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json`
170
-
171
- ```json
172
- {
173
- "mcpServers": {
174
- "dev-workflow": {
175
- "command": "node",
176
- "args": ["<PROJECT_ROOT>\\index.js"]
177
- }
178
- }
179
- }
180
- ```
181
-
182
- See [Antigravity Getting Started](./docs/antigravity/GETTING-STARTED.md) for detailed instructions and troubleshooting.
183
-
184
- ## 🏗️ Build System
185
-
186
- This project includes a Vite-based build system for creating optimized distributions.
187
-
188
- ### Scripts
189
-
190
- - `npm run build` - Bundle the source into `dist/index.mjs` for distribution
191
- - `npm run dev` - Run in development mode with file watching
192
- - `npm run local` - Alias for running from source (same as `npm start`)
193
- - `npm run web` - Launch the lightweight workflow dashboard for browsing task history (see [Web Dashboard docs](./docs/web-dashboard.md))
194
-
195
- #### `npm run web`
196
-
197
- This command starts the dashboard defined in `web/server.js`, giving you a quick view of workflow history and summary statistics.
198
-
199
- ```bash
200
- npm run web
201
- # 🌐 Dev Workflow Dashboard running at http://localhost:3111
202
- ```
203
-
204
- - **Default port:** 3111 (or the next free port if occupied).
205
- - **Environment overrides:** Honors `PORT` (common on hosts like Plesk/Render) or `DEV_WORKFLOW_WEB_PORT` before falling back to auto-selection.
206
- - **Query parameter:** `?user=<id>` lets you inspect another user’s history (defaults to `default`).
207
- - **API endpoints:**
208
- - `GET /api/version` → current package version from `package.json` (used by dashboard to display version dynamically).
209
- - `GET /api/summary?user=<id>` → overall stats for the user.
210
- - `GET /api/history?user=<id>&page=1&pageSize=20&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD` → paginated task history.
211
- - `GET /api/history-summary?user=<id>&frequency=daily|monthly|yearly` → aggregated counts over time.
212
-
213
- Open `http://localhost:3111` in a browser to view the dashboard UI (`web/index.html`).
214
-
215
- ### Build Output
216
-
217
- Running `npm run build` generates:
218
- - `dist/index.mjs` - Optimized ES module bundle
219
- - Source maps and other build artifacts
220
- - `dist/docs/` - Pre-rendered HTML documentation generated from Markdown via `scripts/build-docs.js`
221
-
222
- The build bundles all source files while externalizing Node.js built-in modules and dependencies, resulting in a single file distribution.
223
-
224
- ### Usage
225
-
226
- For MCP server usage, point your client at `index.js` (source) to avoid stdio transport compatibility issues. The built `dist/index.mjs` is primarily for:
227
- - npm package distribution
228
- - Performance optimization
229
- - Embedding in other projects
230
-
231
- ### MCP Tools Registry (Publishing)
232
-
233
- This package is configured for the official MCP Tools Registry using **npm package deployment**:
234
-
235
- - `package.json` declares `mcpName: "io.github.programinglive/dev-workflow-mcp-server"`.
236
- - `server.json` describes the server and links it to the npm package `@programinglive/dev-workflow-mcp-server`.
237
-
238
- To publish a new server version to the registry:
239
-
240
- 1. Release a new npm version (for example):
241
- - `npm test`
242
- - `npm run release:patch` (runs your existing release pipeline and publishes to npm)
243
- 2. Verify the new version exists on npm:
244
- - `npm view @programinglive/dev-workflow-mcp-server version`
245
- 3. Install the MCP publisher CLI (once per machine):
246
- - `brew install mcp-publisher` (or follow the docs at https://modelcontextprotocol.info/tools/registry/publishing/)
247
- 4. From this repo root, authenticate and publish:
248
- - `mcp-publisher login github`
249
- - `mcp-publisher publish`
250
- 5. Optionally verify in the registry:
251
- - `curl "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.programinglive/dev-workflow-mcp-server"`
252
-
253
- #### PowerShell CLI tip
254
-
255
- When invoking the lightweight CLI from PowerShell, use `--%` to prevent PowerShell from rewriting JSON arguments, for example:
256
-
257
- ```powershell
258
- node --% index.js call start_task --args "{\"description\":\"Convert docs to HTML during build\",\"type\":\"feature\"}"
259
- ```
260
-
261
- The `--%` prefix and escaped double quotes ensure the JSON reaches the MCP server unchanged.
262
-
263
- ## 📁 Project-Specific Workflow State
264
-
265
- When you install this package in a project, a `.state/workflow-state.json` file is automatically created in your project root. This file:
266
-
267
- - **Stores workflow history** specific to that project
268
- - **Tracks task progress** independently per project
269
- - **Should be gitignored** (already in `.gitignore` by default)
270
- - **Persists across sessions** so your workflow state is preserved
271
- - **Stays centralized** even if you run the server from nested build outputs like `dist/`. The MCP server walks back to the project root (looking for `.git` or `package.json`) before reading or writing workflow state, so you never need duplicate copies under build directories.
272
-
273
- Each project maintains its own isolated workflow history, so you can work on multiple projects without mixing their histories. Within that `.state` directory, the MCP server automatically creates a unique per-user subdirectory (e.g., `.state/users/user-abc123/`). The generated identifier persists locally so multiple developers sharing the same repository never clobber each other’s workflow files. If you prefer a specific name, set `DEV_WORKFLOW_USER_ID` before launching the server and that value will be used instead of the auto-generated ID.
274
-
275
- #### Choosing a User ID
276
-
277
- Use cases:
278
-
279
- 1. **Let the server choose** – Do nothing and the first time you run any MCP tool the server creates `.state/users/<random-id>/`. The dashboard `User ID` filter accepts that value (visible in the folder name or in workflow responses).
280
- 2. **Set an explicit ID** – Before starting the server, export `DEV_WORKFLOW_USER_ID`:
281
-
282
- ```bash
283
- # macOS/Linux
284
- export DEV_WORKFLOW_USER_ID=alice
285
- node index.js
286
-
287
- # Windows PowerShell
288
- $env:DEV_WORKFLOW_USER_ID = "alice"
289
- node index.js
290
- ```
291
-
292
- Now all history for that session lands in `.state/users/alice/` and the dashboard can be filtered with `alice`.
293
- 3. **Multiple users on one host** – Run separate processes (or MCP clients) with different `DEV_WORKFLOW_USER_ID` values. Each user’s workflow state remains isolated.
294
-
295
- > **Tip:** The web dashboard simply reads existing records. Typing a new value into the `User ID` filter will only return results after a workflow session has written history into `.state/users/<that-id>/`.
296
-
297
- ### Adding to .gitignore
298
-
299
- If you're using this package, add this to your project's `.gitignore`:
300
-
301
- ```
302
- .state/
303
- ```
304
-
305
- This keeps workflow state local to each developer's machine.
306
-
307
- > **Need to override the location?** Set `DEV_WORKFLOW_STATE_FILE=/absolute/path/to/your/project/.state/workflow-state.json` before launching the server (or inside your MCP client config). The server will honor that path, letting you keep the package installed centrally while maintaining per-project workflow history.
308
-
309
- ## 🛠️ Available Tools
310
-
311
- - `start_task` - Begin a new coding task
312
- - `mark_bug_fixed` - Mark the feature/bug as fixed (requires tests next)
313
- - `create_tests` - Mark that tests have been created
314
- - `skip_tests` - Skip tests with justification
315
- - `run_tests` - Record test results (must pass to proceed)
316
- - `create_documentation` - Mark documentation as created
317
- - `check_ready_to_commit` - Verify all steps are complete
318
- - `commit_and_push` - Commit and push changes
319
- - `perform_release` - Record release details
320
- - `complete_task` - Mark task as complete and reset
321
- - `force_complete_task` - Force completion with reason
322
- - `drop_task` - Abandon current task
323
- - `get_workflow_status` - Show current status
324
- - `view_history` - View completed tasks
325
- - `continue_workflow` - Get next-step guidance
326
- - `rerun_workflow` - Reset and restart the current task from the beginning
327
- - `run_full_workflow` - Execute every workflow step in sequence with a single command (requires supplying the details for each phase)
328
-
329
- ### `run_full_workflow`
330
-
331
- Use this when you already have all the information needed for each workflow phase and want to execute them in one go.
332
-
333
- ```json
334
- {
335
- "summary": "Add payment webhooks",
336
- "testCommand": "npm test",
337
- "documentationType": "README",
338
- "documentationSummary": "Document webhook configuration",
339
- "commitMessage": "feat: add payment webhooks",
340
- "releaseCommand": "npm run release:minor",
341
- "releaseNotes": "Release webhook support",
342
- "branch": "feature/payments",
343
- "testsPassed": true,
344
- "testDetails": "node --test; 42 tests",
345
- "releaseType": "minor",
346
- "preset": "minor"
347
- }
348
- ```
349
-
350
- The tool will:
351
-
352
- 1. `mark_bug_fixed` using `summary`
353
- 2. `create_tests`
354
- 3. `run_tests` with `testsPassed`, `testCommand`, and optional `testDetails`
355
- 4. `create_documentation` with `documentationType` and `documentationSummary`
356
- 5. `check_ready_to_commit`
357
- 6. `commit_and_push` with `commitMessage` and optional `branch`
358
- 7. `perform_release` with `releaseCommand`, plus optional `releaseNotes`, `releaseType`, and `preset`
359
- 8. `complete_task` reusing `commitMessage`
360
-
361
- All arguments except the optional flags are required and must be non-empty strings.
362
-
363
- ## 🚫 Releasing Without the Workflow Steps
364
-
365
- The package ships with a release guard (`release-wrapper.js`) that backs the `npm run release:*` scripts. The guard refuses to run unless:
366
-
367
- - The current workflow phase is **release**
368
- - `check_ready_to_commit` and `commit_and_push` have been completed
369
- - A release has not already been recorded for the active task
370
-
371
- If any requirements are missing, the guard exits with guidance to return to the MCP tools. This prevents accidentally bumping versions or tagging releases outside the managed workflow. To release correctly:
372
-
373
- 1. Use `perform_release {"command":"patch"}` (or `minor`/`major`) via the MCP client.
374
- 2. The guard runs automatically, verifies the workflow state, and records the release before letting you finish with `complete_task`.
375
-
376
- ### Automated npm Publishing
377
-
378
- This repository ships with `.github/workflows/npm-publish.yml`, which publishes the package to npm whenever a git tag matching `v*` is pushed (for example, `v1.1.14`). To enable the workflow:
379
-
380
- 1. Create an npm automation token with publish rights (`npm token create --read-only false`).
381
- 2. In the repository settings, add a secret named **`NPM_TOKEN`** containing that token.
382
- 3. Ensure your release process pushes tags after running `npm run release:<type>` so the workflow triggers.
383
- 4. Confirm `npm run build` succeeds locally; the workflow runs the build before publishing so broken bundles block the release.
384
- 5. GitHub provenance is enabled via `npm publish --provenance`. Leave GitHub Actions' default OIDC permissions enabled so the job can request an ID token.
385
- 6. Keep the `repository.url` field in `package.json` pointing at this GitHub repo. Provenance validation fails if it does not match the repository that built the package.
386
-
387
- The workflow verifies that the tag version matches `package.json` before publishing and fails fast if they diverge.
388
-
389
- ## 🛠️ Available Tools
390
-
391
- ### Tool Argument Requirements
392
-
393
- All tool invocations validate their `arguments` payload before running:
394
- - Strings are parsed as JSON and must resolve to an object (key/value pairs).
395
- - Passing non-object data (numbers, arrays, plain text) triggers a guidance error.
396
- - Missing or malformed arguments safely default to empty input so the tool can respond with actionable reminders.
397
-
398
- Example (stringified JSON object):
399
- ```
400
- {
401
- "name": "start_task",
402
- "arguments": "{\"description\":\"Add reporting endpoint\",\"type\":\"feature\"}"
403
- }
404
- ```
405
-
406
- ### `start_task`
407
- Start a new coding task. This is your first step - be conscious about what you're coding.
408
-
409
- **Parameters:**
410
- - `description` (string, required): Clear description of what you're going to code
411
- - `type` (enum, required): Type of task - "feature", "bugfix", "refactor", or "other"
412
-
413
- **Example:**
414
- ```
415
- Use the start_task tool with:
416
- - description: "Add user authentication to the login page"
417
- - type: "feature"
418
- ```
419
-
420
- ### `mark_bug_fixed`
421
- Mark that the bug/feature is fixed. **Reminder: Now you MUST create tests!**
422
-
423
- **Parameters:**
424
- - `summary` (string, required): Brief summary of what was fixed/implemented
425
-
426
- ### `create_tests`
427
- Confirm that you've created the necessary tests covering your change. Required before recording test results.
428
-
429
- **Parameters:** _none_
430
-
431
- ### `skip_tests`
432
- Record an explicit justification when automated tests aren't feasible. Marks testing as satisfied so you can proceed with documentation and verification, while flagging the task for manual QA.
433
-
434
- **Parameters:**
435
- - `reason` (string, required): Why automated tests were skipped
436
-
437
- ### `run_tests`
438
- Record test results. **NEVER commit if tests fail!** Only proceed if all tests are green.
439
-
440
- **Parameters:**
441
- - `passed` (boolean, required): Did all tests pass?
442
- - `testCommand` (string, required): The test command that was run
443
- - `details` (string, optional): Test results details
444
-
445
- **Example:**
446
- ```
447
- Use run_tests with:
448
- - passed: true
449
- - testCommand: "npm test"
450
- - details: "All 15 tests passed"
451
- ```
452
-
453
- ### `create_documentation`
454
- Mark that documentation has been created/updated. This is required before committing.
455
-
456
- **Parameters:**
457
- - `documentationType` (enum, required): "PRD", "README", "RELEASE_NOTES", "inline-comments", "API-docs", "changelog", or "other"
458
- - `summary` (string, required): What was documented
459
-
460
- ### `check_ready_to_commit`
461
- Check if all workflow steps are completed and you're ready to commit & push.
462
-
463
- ### `commit_and_push`
464
- Automatically run `git add`, `git commit`, and `git push` after the ready check passes.
465
-
466
- **Auto-detection of primary branch:** If no `branch` is specified, the tool automatically detects your project's primary branch by checking for `origin/main` first, then falling back to `origin/master`. This eliminates the need to specify the branch parameter for most projects.
467
-
468
- **Parameters:**
469
- - `commitMessage` (string, required): Conventional commit message to use
470
- - `branch` (string, optional): Target branch to push. If omitted, auto-detects primary branch (main or master)
471
-
472
- ### `perform_release`
473
- Record the release after you've committed and pushed. Required before you can complete the task.
474
-
475
- **Parameters:**
476
- - `command` (string, required): Release command that was executed (e.g., `npm run release`)
477
- - `notes` (string, optional): Additional release notes
478
-
479
- ### `complete_task`
480
- Mark the task as complete after successful commit & push. Resets workflow for next task.
481
-
482
- **Parameters:**
483
- - `commitMessage` (string, required): The commit message used
484
-
485
- ### `drop_task`
486
- Abandon the current task without completing the workflow. Preserves an audit entry with context, then resets the state so you can start fresh.
487
-
488
- **Parameters:**
489
- - `reason` (string, optional): Additional detail about why the task was dropped
490
-
491
- ### `get_workflow_status`
492
- Get current workflow status and what needs to be done next.
493
-
494
- ### `view_history`
495
- View workflow history of completed tasks.
496
-
497
- **Parameters:**
498
- - `limit` (number, optional): Number of recent tasks to show (default: 10)
499
-
500
- ## 📋 Available Prompts
501
-
502
- ### `workflow_reminder`
503
- Get a complete reminder of the development workflow discipline.
504
-
505
- ### `pre_commit_checklist`
506
- Get a pre-commit checklist to ensure nothing is missed before committing.
507
-
508
- ## 🔄 Typical Workflow
509
-
510
- Here's how you'd use this MCP server in a typical coding session:
511
-
512
- 1. **Start your task:**
513
- ```
514
- Ask Cascade to use start_task:
515
- "Start a new task: implementing user profile page, type: feature"
516
- ```
517
-
518
- 2. **Code your feature/fix**
519
- - Write your code as usual
520
-
521
- 3. **Mark as fixed:**
522
- ```
523
- "Mark the feature as fixed: User profile page with avatar and bio completed"
524
- ```
525
-
526
- 4. **Create tests:**
527
- - Write your tests
528
- - The server will remind you this is mandatory!
529
-
530
- 5. **Run tests:**
531
- ```
532
- "Record test results: passed=true, command='npm test'"
533
- ```
534
- - If tests fail, the server will **block** you from proceeding!
535
-
536
- 7. **Document:**
537
- ```
538
- "Create documentation: type=README, summary='Added user profile section to docs'"
539
- ```
540
-
541
- 8. **Check readiness:**
542
- ```
543
- "Check if I'm ready to commit"
544
- ```
545
-
546
- 9. **Commit & Push:**
547
- ```
548
- "Commit and push: commitMessage='feat: add user profile page with tests and docs'"
549
- ```
550
-
551
- 10. **Record release:**
552
- ```
553
- "Record release: command='npm run release', notes='v1.2.3'"
554
- ```
555
-
556
- 11. **Complete:**
557
- ```
558
- "Complete the task with commit message: 'feat: add user profile page'"
559
- ```
560
-
561
- 12. **Drop task (optional):**
562
- ```
563
- "Drop task: reason='Switching to a different feature'"
564
- ```
565
-
566
- ## 🎯 Key Features
567
-
568
- - **Enforces discipline**: Won't let you skip steps
569
- - **Test-driven**: Blocks commits if tests fail
570
- - **Documentation reminder**: Ensures you document your work
571
- - **State tracking**: Remembers where you are in the workflow
572
- - **History**: Keeps track of completed tasks
573
- - **Prompts**: Quick reminders of best practices
574
-
575
- ## 🚫 What This Server Prevents
576
-
577
- - ❌ Committing without tests
578
- - ❌ Committing with failing tests
579
- - ❌ Committing without documentation
580
- - ❌ Losing track of what you're working on
581
- - ❌ Skipping important workflow steps
582
-
583
- ## 💡 Tips
584
-
585
- 1. **Always start with `start_task`** - This sets your intention
586
- 2. **Never skip tests without justification** - Use `skip_tests` only when absolutely necessary and document the reason for manual QA
587
- 3. **Use `get_workflow_status`** - Check where you are anytime
588
- 4. **Review history** - Learn from your past tasks
589
- 5. **Follow the prompts** - They contain best practices
590
-
591
- ## 🔧 Customization
592
-
593
- You can modify the workflow in `index.js`:
594
- - Add more workflow phases
595
- - Customize reminders
596
- - Add integration with your test runner
597
- - Add custom validation rules
598
-
599
- ## 📝 State Management
600
-
601
- The server maintains state in `.state/workflow-state.json`:
602
- - Current phase
603
- - Task description
604
- - Completion status of each step
605
- - History of completed tasks
606
-
607
- This file is automatically created and managed by the server.
608
- It contains local, machine-specific progress and is ignored by git so each environment can manage its own workflow history without cross-contamination.
609
-
610
- ## 🤝 Integration with Your Rules
611
-
612
- This MCP server aligns with your existing development rules:
613
- - ✅ Enforces test-first discipline
614
- - ✅ Prevents commits with failing tests
615
- - ✅ Reminds about documentation
616
- - ✅ Tracks workflow state
617
- - ✅ Maintains history
618
-
619
- ## 📄 License
620
-
621
- MIT
622
-
623
- ## 🙏 Contributing
624
-
625
- Feel free to customize this server to match your specific workflow needs!
626
-
627
- ## 📜 Project Governance
628
-
629
- - [Code of Conduct](./CODE_OF_CONDUCT.md)
630
- - [Contributing Guide](./CONTRIBUTING.md)
631
- - [Security Policy](./SECURITY.md)
632
- - [License](./LICENSE)
1
+ # Development Workflow MCP Server
2
+
3
+ <p align="left">
4
+ <a href="https://www.npmjs.com/package/@programinglive/dev-workflow-mcp-server"><img src="https://img.shields.io/npm/v/@programinglive/dev-workflow-mcp-server.svg" alt="npm version"></a>
5
+ <a href="https://www.npmjs.com/package/@programinglive/dev-workflow-mcp-server"><img src="https://img.shields.io/npm/dm/@programinglive/dev-workflow-mcp-server.svg" alt="npm downloads"></a>
6
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license: MIT"></a>
7
+ </p>
8
+
9
+ An MCP (Model Context Protocol) server that helps enforce development discipline and workflow best practices. This server acts as your coding conscience, reminding you to follow proper development workflows.
10
+
11
+ ## 🎯 Purpose
12
+
13
+ This MCP server guides you through a disciplined development workflow:
14
+
15
+ 1. **Start Conscious** - Be clear about what you're coding
16
+ 2. **Fix/Implement** - Write your code
17
+ 3. **Create Tests** - Always test your changes
18
+ 4. **Run Tests** - Tests must pass (GREEN)
19
+ 5. **Document** - Update documentation
20
+ 6. **Commit & Push** - Let the server stage, commit, **and push** your changes once verification passes (if you make new edits afterward, the workflow moves back to this step automatically)
21
+ 7. **Release** - After the push succeeds, record the release details before closing out the task
22
+
23
+ ## 🚀 Installation
24
+
25
+ ### Option 1: Install as Dependency in Your Project (Recommended)
26
+
27
+ Each project gets its own isolated workflow state file.
28
+
29
+ ```bash
30
+ npm install @programinglive/dev-workflow-mcp-server
31
+ ```
32
+
33
+ This will automatically create a `.state/workflow-state.json` file in the **project where you ran `npm install`** (using npm's `INIT_CWD`), keeping workflow history separate per project. If you're installing the package itself (inside `node_modules`), the script skips creation so it never pollutes the shared package directory.
34
+
35
+ ### Option 2: Install from Source
36
+
37
+ ```bash
38
+ git clone https://github.com/programinglive/dev-workflow-mcp-server.git
39
+ cd dev-workflow-mcp-server
40
+ npm install
41
+ ```
42
+
43
+ > **Windows prerequisites:** Installing dependencies from source compiles native modules such as `better-sqlite3`. Make sure Python 3 (added to PATH) and the Visual Studio Build Tools “Desktop development with C++” workload are installed before running `npm install`. Without them, npm will fail with a “need python” or build error.
44
+
45
+ ### Option 3: Install on Plesk Hosting
46
+
47
+ Plesk supports Node.js applications through its Node.js extension. To deploy the MCP server on a Plesk subscription:
48
+
49
+ 1. **Enable Node.js support** – Ensure the Plesk administrator has installed the Node.js extension and enabled SSH access for your subscription.
50
+ 2. **Upload the project** – Either clone the repository or upload an archive into the directory you will run it from (e.g., `httpdocs/dev-workflow-mcp-server`). From SSH you can run:
51
+ ```bash
52
+ cd httpdocs
53
+ git clone https://github.com/programinglive/dev-workflow-mcp-server.git
54
+ cd dev-workflow-mcp-server
55
+ ```
56
+ 3. **Install dependencies** – In Plesk’s **Node.js** panel use “NPM install” (or run `npm install --production` over SSH). Linux hosts already ship the Python/build toolchain required for `better-sqlite3`; if your plan uses a Windows host, install Python 3 and the Visual Studio Build Tools beforehand or ask your provider to enable them.
57
+ 4. **Define environment variables** – In the Node.js panel add any environment variables you need (for example `DEV_WORKFLOW_USER_ID` or `DEV_WORKFLOW_STATE_FILE`). This keeps state files outside the web root if desired.
58
+ 5. **Configure the application** – Set **Application startup file** to `index.js` and **Application mode** to `production`. Plesk will run the server with `node index.js`.
59
+ 6. **Start/Restart the app** – Click “Restart App” so Plesk launches the MCP server with the new configuration. When you update the code, rerun “NPM install” and restart.
60
+
61
+ > **Tip:** The MCP server communicates over stdio. If you only need it as a CLI tool, you can also run `npx @programinglive/dev-workflow-mcp-server` directly in an SSH session without keeping it running under the Node.js panel.
62
+
63
+ > **Important:** MCP clients (Windsurf, Claude Desktop, etc.) must launch the server process locally via stdio. Hosting the dashboard on a public domain does **not** expose the MCP interface. Without SSH or another way to execute `node index.js` on the server, users cannot connect their MCP clients to the hosted instance.
64
+
65
+ #### Two Usage Modes
66
+
67
+ - **Local (source)**: Point your MCP client to `index.js`. This runs directly from source and requires no build step. Recommended for MCP usage.
68
+ - **Production (built)**: Run `npm run build` once to generate `dist/`. This creates an optimized bundle but isn’t needed for MCP usage.
69
+
70
+ ### 3. Configure in Windsurf/Claude Desktop
71
+
72
+ Point your MCP client to the server entry point. Replace `<PROJECT_ROOT>` with the absolute path to this repository on your machine.
73
+
74
+ #### macOS
75
+
76
+ - **Windsurf** (`~/Library/Application Support/Windsurf/config.json`):
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "dev-workflow": {
82
+ "command": "node",
83
+ "args": ["<PROJECT_ROOT>/index.js"]
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ - **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
90
+
91
+ ```json
92
+ {
93
+ "mcpServers": {
94
+ "dev-workflow": {
95
+ "command": "node",
96
+ "args": ["<PROJECT_ROOT>/index.js"]
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ #### Windows
103
+
104
+ - **Windsurf** (`%APPDATA%\Windsurf\config.json`):
105
+
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "dev-workflow": {
110
+ "command": "node",
111
+ "args": ["<PROJECT_ROOT>\\index.js"]
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ - **Claude Desktop** (`%APPDATA%\Claude\claude_desktop_config.json`):
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "dev-workflow": {
123
+ "command": "node",
124
+ "args": ["<PROJECT_ROOT>\\index.js"]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ #### Linux
131
+
132
+ - **Windsurf** (`~/.config/windsurf/config.json`):
133
+
134
+ ```json
135
+ {
136
+ "mcpServers": {
137
+ "dev-workflow": {
138
+ "command": "node",
139
+ "args": ["<PROJECT_ROOT>/index.js"]
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ - **Claude Desktop** (`~/.config/claude/claude_desktop_config.json`):
146
+
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "dev-workflow": {
151
+ "command": "node",
152
+ "args": ["<PROJECT_ROOT>/index.js"]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ > **Note:** On Windows paths in JSON require escaped backslashes (e.g., `"C:\\path\\to\\project"`).
159
+
160
+ ### 4. Restart Windsurf/Claude Desktop
161
+
162
+ After adding the configuration, restart the application to load the MCP server.
163
+
164
+
165
+ ### 5. Configure in Antigravity
166
+
167
+ Antigravity users should configure the MCP server in their `mcp_config.json`.
168
+
169
+ **Windows:** `%APPDATA%\Antigravity\mcp_config.json` or `C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json`
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "dev-workflow": {
175
+ "command": "node",
176
+ "args": ["<PROJECT_ROOT>\\index.js"]
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ See [Antigravity Getting Started](./docs/antigravity/GETTING-STARTED.md) for detailed instructions and troubleshooting.
183
+
184
+ ## 🏗️ Build System
185
+
186
+ This project includes a Vite-based build system for creating optimized distributions.
187
+
188
+ ### Scripts
189
+
190
+ - `npm run build` - Bundle the source into `dist/index.mjs` for distribution
191
+ - `npm run dev` - Run in development mode with file watching
192
+ - `npm run local` - Alias for running from source (same as `npm start`)
193
+ - `npm run web` - Launch the lightweight workflow dashboard for browsing task history (see [Web Dashboard docs](./docs/web-dashboard.md))
194
+
195
+ #### `npm run web`
196
+
197
+ This command starts the dashboard defined in `web/server.js`, giving you a quick view of workflow history and summary statistics.
198
+
199
+ ```bash
200
+ npm run web
201
+ # 🌐 Dev Workflow Dashboard running at http://localhost:3111
202
+ ```
203
+
204
+ - **Default port:** 3111 (or the next free port if occupied).
205
+ - **Environment overrides:** Honors `PORT` (common on hosts like Plesk/Render) or `DEV_WORKFLOW_WEB_PORT` before falling back to auto-selection.
206
+ - **Query parameter:** `?user=<id>` lets you inspect another user’s history (defaults to `default`).
207
+ - **API endpoints:**
208
+ - `GET /api/version` → current package version from `package.json` (used by dashboard to display version dynamically).
209
+ - `GET /api/summary?user=<id>` → overall stats for the user.
210
+ - `GET /api/history?user=<id>&page=1&pageSize=20&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD` → paginated task history.
211
+ - `GET /api/history-summary?user=<id>&frequency=daily|monthly|yearly` → aggregated counts over time.
212
+
213
+ Open `http://localhost:3111` in a browser to view the dashboard UI (`web/index.html`).
214
+
215
+ ### Build Output
216
+
217
+ Running `npm run build` generates:
218
+ - `dist/index.mjs` - Optimized ES module bundle
219
+ - Source maps and other build artifacts
220
+ - `dist/docs/` - Pre-rendered HTML documentation generated from Markdown via `scripts/build-docs.js`
221
+
222
+ The build bundles all source files while externalizing Node.js built-in modules and dependencies, resulting in a single file distribution.
223
+
224
+ ### Usage
225
+
226
+ For MCP server usage, point your client at `index.js` (source) to avoid stdio transport compatibility issues. The built `dist/index.mjs` is primarily for:
227
+ - npm package distribution
228
+ - Performance optimization
229
+ - Embedding in other projects
230
+
231
+ ### MCP Tools Registry (Publishing)
232
+
233
+ This package is configured for the official MCP Tools Registry using **npm package deployment**:
234
+
235
+ - `package.json` declares `mcpName: "io.github.programinglive/dev-workflow-mcp-server"`.
236
+ - `server.json` describes the server and links it to the npm package `@programinglive/dev-workflow-mcp-server`.
237
+
238
+ To publish a new server version to the registry:
239
+
240
+ 1. Release a new npm version (for example):
241
+ - `npm test`
242
+ - `npm run release:patch` (runs your existing release pipeline and publishes to npm)
243
+ 2. Verify the new version exists on npm:
244
+ - `npm view @programinglive/dev-workflow-mcp-server version`
245
+ 3. Install the MCP publisher CLI (once per machine):
246
+ - `brew install mcp-publisher` (or follow the docs at https://modelcontextprotocol.info/tools/registry/publishing/)
247
+ 4. From this repo root, authenticate and publish:
248
+ - `mcp-publisher login github`
249
+ - `mcp-publisher publish`
250
+ 5. Optionally verify in the registry:
251
+ - `curl "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.programinglive/dev-workflow-mcp-server"`
252
+
253
+ #### PowerShell CLI tip
254
+
255
+ When invoking the lightweight CLI from PowerShell, use `--%` to prevent PowerShell from rewriting JSON arguments, for example:
256
+
257
+ ```powershell
258
+ node --% index.js call start_task --args "{\"description\":\"Convert docs to HTML during build\",\"type\":\"feature\"}"
259
+ ```
260
+
261
+ The `--%` prefix and escaped double quotes ensure the JSON reaches the MCP server unchanged.
262
+
263
+ ## 📁 Project-Specific Workflow State
264
+
265
+ When you install this package in a project, a `.state/workflow-state.json` file is automatically created in your project root. This file:
266
+
267
+ - **Stores workflow history** specific to that project
268
+ - **Tracks task progress** independently per project
269
+ - **Should be gitignored** (already in `.gitignore` by default)
270
+ - **Persists across sessions** so your workflow state is preserved
271
+ - **Stays centralized** even if you run the server from nested build outputs like `dist/`. The MCP server walks back to the project root (looking for `.git` or `package.json`) before reading or writing workflow state, so you never need duplicate copies under build directories.
272
+
273
+ Each project maintains its own isolated workflow history, so you can work on multiple projects without mixing their histories. Within that `.state` directory, the MCP server automatically creates a unique per-user subdirectory (e.g., `.state/users/user-abc123/`). The generated identifier persists locally so multiple developers sharing the same repository never clobber each other’s workflow files. If you prefer a specific name, set `DEV_WORKFLOW_USER_ID` before launching the server and that value will be used instead of the auto-generated ID.
274
+
275
+ #### Choosing a User ID
276
+
277
+ Use cases:
278
+
279
+ 1. **Let the server choose** – Do nothing and the first time you run any MCP tool the server creates `.state/users/<random-id>/`. The dashboard `User ID` filter accepts that value (visible in the folder name or in workflow responses).
280
+ 2. **Set an explicit ID** – Before starting the server, export `DEV_WORKFLOW_USER_ID`:
281
+
282
+ ```bash
283
+ # macOS/Linux
284
+ export DEV_WORKFLOW_USER_ID=alice
285
+ node index.js
286
+
287
+ # Windows PowerShell
288
+ $env:DEV_WORKFLOW_USER_ID = "alice"
289
+ node index.js
290
+ ```
291
+
292
+ Now all history for that session lands in `.state/users/alice/` and the dashboard can be filtered with `alice`.
293
+ 3. **Multiple users on one host** – Run separate processes (or MCP clients) with different `DEV_WORKFLOW_USER_ID` values. Each user’s workflow state remains isolated.
294
+
295
+ > **Tip:** The web dashboard simply reads existing records. Typing a new value into the `User ID` filter will only return results after a workflow session has written history into `.state/users/<that-id>/`.
296
+
297
+ ### Adding to .gitignore
298
+
299
+ If you're using this package, add this to your project's `.gitignore`:
300
+
301
+ ```
302
+ .state/
303
+ ```
304
+
305
+ This keeps workflow state local to each developer's machine.
306
+
307
+ > **Need to override the location?** Set `DEV_WORKFLOW_STATE_FILE=/absolute/path/to/your/project/.state/workflow-state.json` before launching the server (or inside your MCP client config). The server will honor that path, letting you keep the package installed centrally while maintaining per-project workflow history.
308
+
309
+ ## 🛠️ Available Tools
310
+
311
+ - `start_task` - Begin a new coding task
312
+ - `mark_bug_fixed` - Mark the feature/bug as fixed (requires tests next)
313
+ - `create_tests` - Mark that tests have been created
314
+ - `skip_tests` - Skip tests with justification
315
+ - `run_tests` - Record test results (must pass to proceed)
316
+ - `create_documentation` - Mark documentation as created
317
+ - `check_ready_to_commit` - Verify all steps are complete
318
+ - `commit_and_push` - Commit and push changes
319
+ - `perform_release` - Record release details
320
+ - `complete_task` - Mark task as complete and reset
321
+ - `force_complete_task` - Force completion with reason
322
+ - `drop_task` - Abandon current task
323
+ - `get_workflow_status` - Show current status
324
+ - `view_history` - View completed tasks
325
+ - `continue_workflow` - Get next-step guidance
326
+ - `rerun_workflow` - Reset and restart the current task from the beginning
327
+ - `run_full_workflow` - Execute every workflow step in sequence with a single command (requires supplying the details for each phase)
328
+
329
+ ### `run_full_workflow`
330
+
331
+ Use this when you already have all the information needed for each workflow phase and want to execute them in one go.
332
+
333
+ ```json
334
+ {
335
+ "summary": "Add payment webhooks",
336
+ "testCommand": "npm test",
337
+ "documentationType": "README",
338
+ "documentationSummary": "Document webhook configuration",
339
+ "commitMessage": "feat: add payment webhooks",
340
+ "releaseCommand": "npm run release:minor",
341
+ "releaseNotes": "Release webhook support",
342
+ "branch": "feature/payments",
343
+ "testsPassed": true,
344
+ "testDetails": "node --test; 42 tests",
345
+ "releaseType": "minor",
346
+ "preset": "minor"
347
+ }
348
+ ```
349
+
350
+ The tool will:
351
+
352
+ 1. `mark_bug_fixed` using `summary`
353
+ 2. `create_tests`
354
+ 3. `run_tests` with `testsPassed`, `testCommand`, and optional `testDetails`
355
+ 4. `create_documentation` with `documentationType` and `documentationSummary`
356
+ 5. `check_ready_to_commit`
357
+ 6. `commit_and_push` with `commitMessage` and optional `branch`
358
+ 7. `perform_release` with `releaseCommand`, plus optional `releaseNotes`, `releaseType`, and `preset`
359
+ 8. `complete_task` reusing `commitMessage`
360
+
361
+ All arguments except the optional flags are required and must be non-empty strings.
362
+
363
+ ## 🚫 Releasing Without the Workflow Steps
364
+
365
+ The package ships with a release guard (`release-wrapper.js`) that backs the `npm run release:*` scripts. The guard refuses to run unless:
366
+
367
+ - The current workflow phase is **release**
368
+ - `check_ready_to_commit` and `commit_and_push` have been completed
369
+ - A release has not already been recorded for the active task
370
+
371
+ If any requirements are missing, the guard exits with guidance to return to the MCP tools. This prevents accidentally bumping versions or tagging releases outside the managed workflow. To release correctly:
372
+
373
+ 1. Use `perform_release {"command":"patch"}` (or `minor`/`major`) via the MCP client.
374
+ 2. The guard runs automatically, verifies the workflow state, and records the release before letting you finish with `complete_task`.
375
+
376
+ ### Automated npm Publishing
377
+
378
+ This repository ships with `.github/workflows/npm-publish.yml`, which publishes the package to npm whenever a git tag matching `v*` is pushed (for example, `v1.1.14`). To enable the workflow:
379
+
380
+ 1. Create an npm automation token with publish rights (`npm token create --read-only false`).
381
+ 2. In the repository settings, add a secret named **`NPM_TOKEN`** containing that token.
382
+ 3. Ensure your release process pushes tags after running `npm run release:<type>` so the workflow triggers.
383
+ 4. Confirm `npm run build` succeeds locally; the workflow runs the build before publishing so broken bundles block the release.
384
+ 5. GitHub provenance is enabled via `npm publish --provenance`. Leave GitHub Actions' default OIDC permissions enabled so the job can request an ID token.
385
+ 6. Keep the `repository.url` field in `package.json` pointing at this GitHub repo. Provenance validation fails if it does not match the repository that built the package.
386
+
387
+ The workflow verifies that the tag version matches `package.json` before publishing and fails fast if they diverge.
388
+
389
+ ## 🛠️ Available Tools
390
+
391
+ ### Tool Argument Requirements
392
+
393
+ All tool invocations validate their `arguments` payload before running:
394
+ - Strings are parsed as JSON and must resolve to an object (key/value pairs).
395
+ - Passing non-object data (numbers, arrays, plain text) triggers a guidance error.
396
+ - Missing or malformed arguments safely default to empty input so the tool can respond with actionable reminders.
397
+
398
+ Example (stringified JSON object):
399
+ ```
400
+ {
401
+ "name": "start_task",
402
+ "arguments": "{\"description\":\"Add reporting endpoint\",\"type\":\"feature\"}"
403
+ }
404
+ ```
405
+
406
+ ### `start_task`
407
+ Start a new coding task. This is your first step - be conscious about what you're coding.
408
+
409
+ **Parameters:**
410
+ - `description` (string, required): Clear description of what you're going to code
411
+ - `type` (enum, required): Type of task - "feature", "bugfix", "refactor", or "other"
412
+
413
+ **Example:**
414
+ ```
415
+ Use the start_task tool with:
416
+ - description: "Add user authentication to the login page"
417
+ - type: "feature"
418
+ ```
419
+
420
+ ### `mark_bug_fixed`
421
+ Mark that the bug/feature is fixed. **Reminder: Now you MUST create tests!**
422
+
423
+ **Parameters:**
424
+ - `summary` (string, required): Brief summary of what was fixed/implemented
425
+
426
+ ### `create_tests`
427
+ Confirm that you've created the necessary tests covering your change. Required before recording test results.
428
+
429
+ **Parameters:** _none_
430
+
431
+ ### `skip_tests`
432
+ Record an explicit justification when automated tests aren't feasible. Marks testing as satisfied so you can proceed with documentation and verification, while flagging the task for manual QA.
433
+
434
+ **Parameters:**
435
+ - `reason` (string, required): Why automated tests were skipped
436
+
437
+ ### `run_tests`
438
+ Record test results. **NEVER commit if tests fail!** Only proceed if all tests are green.
439
+
440
+ **Parameters:**
441
+ - `passed` (boolean, required): Did all tests pass?
442
+ - `testCommand` (string, required): The test command that was run
443
+ - `details` (string, optional): Test results details
444
+
445
+ **Example:**
446
+ ```
447
+ Use run_tests with:
448
+ - passed: true
449
+ - testCommand: "npm test"
450
+ - details: "All 15 tests passed"
451
+ ```
452
+
453
+ ### `create_documentation`
454
+ Mark that documentation has been created/updated. This is required before committing.
455
+
456
+ **Parameters:**
457
+ - `documentationType` (enum, required): "PRD", "README", "RELEASE_NOTES", "inline-comments", "API-docs", "changelog", or "other"
458
+ - `summary` (string, required): What was documented
459
+
460
+ ### `check_ready_to_commit`
461
+ Check if all workflow steps are completed and you're ready to commit & push.
462
+
463
+ ### `commit_and_push`
464
+ Automatically run `git add`, `git commit`, and `git push` after the ready check passes.
465
+
466
+ **Auto-detection of primary branch:** If no `branch` is specified, the tool automatically detects your project's primary branch by checking for `origin/main` first, then falling back to `origin/master`. This eliminates the need to specify the branch parameter for most projects.
467
+
468
+ **Parameters:**
469
+ - `commitMessage` (string, required): Conventional commit message to use
470
+ - `branch` (string, optional): Target branch to push. If omitted, auto-detects primary branch (main or master)
471
+
472
+ ### `perform_release`
473
+ Record the release after you've committed and pushed. Required before you can complete the task.
474
+
475
+ **Parameters:**
476
+ - `command` (string, required): Release command that was executed (e.g., `npm run release`)
477
+ - `notes` (string, optional): Additional release notes
478
+
479
+ ### `complete_task`
480
+ Mark the task as complete after successful commit & push. Resets workflow for next task.
481
+
482
+ **Parameters:**
483
+ - `commitMessage` (string, required): The commit message used
484
+
485
+ ### `drop_task`
486
+ Abandon the current task without completing the workflow. Preserves an audit entry with context, then resets the state so you can start fresh.
487
+
488
+ **Parameters:**
489
+ - `reason` (string, optional): Additional detail about why the task was dropped
490
+
491
+ ### `get_workflow_status`
492
+ Get current workflow status and what needs to be done next.
493
+
494
+ ### `view_history`
495
+ View workflow history of completed tasks.
496
+
497
+ **Parameters:**
498
+ - `limit` (number, optional): Number of recent tasks to show (default: 10)
499
+
500
+ ## 📋 Available Prompts
501
+
502
+ ### `workflow_reminder`
503
+ Get a complete reminder of the development workflow discipline.
504
+
505
+ ### `pre_commit_checklist`
506
+ Get a pre-commit checklist to ensure nothing is missed before committing.
507
+
508
+ ## 🔄 Typical Workflow
509
+
510
+ Here's how you'd use this MCP server in a typical coding session:
511
+
512
+ 1. **Start your task:**
513
+ ```
514
+ Ask Cascade to use start_task:
515
+ "Start a new task: implementing user profile page, type: feature"
516
+ ```
517
+
518
+ 2. **Code your feature/fix**
519
+ - Write your code as usual
520
+
521
+ 3. **Mark as fixed:**
522
+ ```
523
+ "Mark the feature as fixed: User profile page with avatar and bio completed"
524
+ ```
525
+
526
+ 4. **Create tests:**
527
+ - Write your tests
528
+ - The server will remind you this is mandatory!
529
+
530
+ 5. **Run tests:**
531
+ ```
532
+ "Record test results: passed=true, command='npm test'"
533
+ ```
534
+ - If tests fail, the server will **block** you from proceeding!
535
+
536
+ 7. **Document:**
537
+ ```
538
+ "Create documentation: type=README, summary='Added user profile section to docs'"
539
+ ```
540
+
541
+ 8. **Check readiness:**
542
+ ```
543
+ "Check if I'm ready to commit"
544
+ ```
545
+
546
+ 9. **Commit & Push:**
547
+ ```
548
+ "Commit and push: commitMessage='feat: add user profile page with tests and docs'"
549
+ ```
550
+
551
+ 10. **Record release:**
552
+ ```
553
+ "Record release: command='npm run release', notes='v1.2.3'"
554
+ ```
555
+
556
+ 11. **Complete:**
557
+ ```
558
+ "Complete the task with commit message: 'feat: add user profile page'"
559
+ ```
560
+
561
+ 12. **Drop task (optional):**
562
+ ```
563
+ "Drop task: reason='Switching to a different feature'"
564
+ ```
565
+
566
+ ## 🎯 Key Features
567
+
568
+ - **Enforces discipline**: Won't let you skip steps
569
+ - **Test-driven**: Blocks commits if tests fail
570
+ - **Documentation reminder**: Ensures you document your work
571
+ - **State tracking**: Remembers where you are in the workflow
572
+ - **History**: Keeps track of completed tasks
573
+ - **Prompts**: Quick reminders of best practices
574
+
575
+ ## 🚫 What This Server Prevents
576
+
577
+ - ❌ Committing without tests
578
+ - ❌ Committing with failing tests
579
+ - ❌ Committing without documentation
580
+ - ❌ Losing track of what you're working on
581
+ - ❌ Skipping important workflow steps
582
+
583
+ ## 💡 Tips
584
+
585
+ 1. **Always start with `start_task`** - This sets your intention
586
+ 2. **Never skip tests without justification** - Use `skip_tests` only when absolutely necessary and document the reason for manual QA
587
+ 3. **Use `get_workflow_status`** - Check where you are anytime
588
+ 4. **Review history** - Learn from your past tasks
589
+ 5. **Follow the prompts** - They contain best practices
590
+
591
+ ## 🔧 Customization
592
+
593
+ You can modify the workflow in `index.js`:
594
+ - Add more workflow phases
595
+ - Customize reminders
596
+ - Add integration with your test runner
597
+ - Add custom validation rules
598
+
599
+ ## 📝 State Management
600
+
601
+ The server maintains state in `.state/workflow-state.json`:
602
+ - Current phase
603
+ - Task description
604
+ - Completion status of each step
605
+ - History of completed tasks
606
+
607
+ This file is automatically created and managed by the server.
608
+ It contains local, machine-specific progress and is ignored by git so each environment can manage its own workflow history without cross-contamination.
609
+
610
+ ## 🤝 Integration with Your Rules
611
+
612
+ This MCP server aligns with your existing development rules:
613
+ - ✅ Enforces test-first discipline
614
+ - ✅ Prevents commits with failing tests
615
+ - ✅ Reminds about documentation
616
+ - ✅ Tracks workflow state
617
+ - ✅ Maintains history
618
+
619
+ ## 📄 License
620
+
621
+ MIT
622
+
623
+ ## 🙏 Contributing
624
+
625
+ Feel free to customize this server to match your specific workflow needs!
626
+
627
+ ## 📜 Project Governance
628
+
629
+ - [Code of Conduct](./CODE_OF_CONDUCT.md)
630
+ - [Contributing Guide](./CONTRIBUTING.md)
631
+ - [Security Policy](./SECURITY.md)
632
+ - [License](./LICENSE)