@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.
- package/.env.example +21 -1
- package/AGENTS.md +25 -0
- package/README.md +372 -649
- package/factory-client.js +554 -0
- package/git-facade.js +35 -0
- package/index.js +9 -34
- package/package.json +21 -20
- package/scripts/bootstrap-unix.sh +55 -0
- package/scripts/bootstrap-windows.ps1 +75 -0
- package/scripts/install-husky.js +43 -0
- package/scripts/setup-stack.js +436 -0
- package/scripts/setup-test-dbs.sh +61 -0
- package/scripts/test-db-adapters.sh +71 -0
- package/scripts/verify-bundle.mjs +92 -0
- package/tools/definitions.js +143 -0
- package/tools/handler-modules/commit-handlers.js +2 -1
- package/tools/handler-modules/factory-handlers.js +276 -0
- package/tools/handler-modules/index.js +24 -7
- package/tools/handler-modules/shared.js +7 -41
- package/tools/handler-modules/status-handlers.js +25 -3
- package/tools/handler-modules/workflow-handlers.js +57 -10
- package/vite.config.js +6 -0
- package/workflow-state.js +176 -2
- package/.agent/workflows/dev-workflow-bugfix.md +0 -250
- package/.agent/workflows/dev-workflow-feature.md +0 -201
- package/.agent/workflows/dev-workflow-full-cycle.md +0 -400
- package/.agent/workflows/dev-workflow-refactor.md +0 -238
- package/.env.production +0 -16
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -34
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -25
- package/.github/pull_request_template.md +0 -22
- package/.github/workflows/github-release.yml +0 -131
- package/.husky/commit-msg +0 -3
- package/.husky/pre-commit +0 -2
- package/CHANGELOG.md +0 -1145
- package/docs/GCP_DEPLOYMENT.md +0 -298
- package/docs/NETLIFY_DEPLOYMENT.md +0 -125
- package/docs/PLESK_DEPLOYMENT.md +0 -170
- package/docs/PRD.md +0 -86
- package/docs/WORKFLOW-BEST-PRACTICES.md +0 -58
- package/docs/antigravity/EXAMPLES.md +0 -535
- package/docs/antigravity/GETTING-STARTED.md +0 -292
- package/docs/antigravity/TROUBLESHOOTING.md +0 -742
- package/docs/antigravity/WALKTHROUGH.md +0 -25
- package/docs/antigravity/WORKFLOW-TEMPLATES.md +0 -670
- package/docs/release-notes/RELEASE_NOTES.md +0 -524
- package/docs/web-dashboard.md +0 -175
- package/scripts/test-auth-flow.js +0 -75
- package/tailwind.config.js +0 -8
- package/tests/build.test.js +0 -74
- package/tests/db-adapters.test.js +0 -108
- package/tests/env-support.test.js +0 -46
- package/tests/exec.test.js +0 -35
- package/tests/handlers-commit.test.js +0 -174
- package/tests/handlers-release.test.js +0 -212
- package/tests/handlers-workflow.test.js +0 -68
- package/tests/handlers.test.js +0 -1142
- package/tests/hello-world.test.js +0 -13
- package/tests/mcpRegistry.test.js +0 -65
- package/tests/patch-release.test.js +0 -7
- package/tests/release-wrapper.test.js +0 -107
- package/tests/startup-resilience.test.js +0 -73
- package/tests/test-helpers.js +0 -50
- package/tests/workflowState.test.js +0 -520
- package/web/Dockerfile.api +0 -25
- package/web/README.md +0 -133
- package/web/__tests__/api/workflow-history.test.js +0 -63
- package/web/api-server.js +0 -211
- package/web/app/docs/page.tsx +0 -202
- package/web/app/favicon.ico +0 -0
- package/web/app/globals.css +0 -91
- package/web/app/history/page.tsx +0 -220
- package/web/app/layout.tsx +0 -39
- package/web/app/login/page.tsx +0 -142
- package/web/app/page.tsx +0 -13
- package/web/components/ApiReference.tsx +0 -20
- package/web/components/Features.tsx +0 -61
- package/web/components/Footer.tsx +0 -9
- package/web/components/Hero.tsx +0 -96
- package/web/components/History.tsx +0 -175
- package/web/components/Navbar.tsx +0 -208
- package/web/components/Terminal.tsx +0 -114
- package/web/components/ThemeProvider.tsx +0 -58
- package/web/eslint.config.mjs +0 -18
- package/web/lib/api-client.ts +0 -123
- package/web/lib/auth.js +0 -75
- package/web/lib/db.js +0 -131
- package/web/lib/docs.js +0 -73
- package/web/middleware/auth.js +0 -26
- package/web/netlify.toml +0 -8
- package/web/next.config.ts +0 -19
- package/web/package-lock.json +0 -10911
- package/web/package.json +0 -42
- package/web/postcss.config.mjs +0 -9
- package/web/public/assets/android-chrome-192x192.png +0 -0
- package/web/public/assets/android-chrome-512x512.png +0 -0
- package/web/public/assets/apple-touch-icon.png +0 -0
- package/web/public/assets/favicon-16x16.png +0 -0
- package/web/public/assets/favicon-32x32.png +0 -0
- package/web/public/assets/favicon.ico +0 -0
- package/web/public/assets/favicon.png +0 -0
- package/web/public/assets/logo.png +0 -0
- package/web/public/assets/og-preview.png +0 -0
- package/web/public/assets/site.webmanifest +0 -1
- package/web/public/file.svg +0 -1
- package/web/public/globe.svg +0 -1
- package/web/public/next.svg +0 -1
- package/web/public/vercel.svg +0 -1
- package/web/public/window.svg +0 -1
- package/web/scripts/db-query-history.js +0 -120
- package/web/scripts/smoke-test.js +0 -30
- package/web/server.js +0 -184
- package/web/tailwind.config.ts +0 -20
- package/web/tsconfig.json +0 -42
package/README.md
CHANGED
|
@@ -1,842 +1,565 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Dev Workflow MCP Server
|
|
2
|
+
|
|
3
|
+
An MCP server that enforces development workflow discipline: **tests → documentation → commit → release**, with no way to skip a step.
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
graph LR
|
|
7
|
+
A[start_task] --> B[Implement]
|
|
8
|
+
B --> C[mark_bug_fixed]
|
|
9
|
+
C --> D[create_tests]
|
|
10
|
+
D --> E[run_tests]
|
|
11
|
+
E -- FAIL --> B
|
|
12
|
+
E -- PASS --> F[create_documentation]
|
|
13
|
+
F --> G[check_ready_to_commit]
|
|
14
|
+
G --> H[commit_and_push]
|
|
15
|
+
H --> I[perform_release / skip_release]
|
|
16
|
+
I --> J[complete_task]
|
|
17
|
+
```
|
|
2
18
|
|
|
3
|
-
|
|
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>
|
|
19
|
+
---
|
|
8
20
|
|
|
9
|
-
|
|
21
|
+
## Quick Start
|
|
10
22
|
|
|
11
|
-
###
|
|
12
|
-
- **Startup Resilience**: 5-second connection timeouts for external databases.
|
|
13
|
-
- **Background Loading**: Non-critical assets (compatibility mirrors) initialize in the background to ensure sub-second startup.
|
|
14
|
-
- **Diagnostic Mode**: Automatic startup timing logs displayed in stderr.
|
|
23
|
+
### 1. Clone and install
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/programinglive/dev-workflow-mcp-server.git
|
|
27
|
+
cd dev-workflow-mcp-server
|
|
28
|
+
npm install
|
|
29
|
+
```
|
|
17
30
|
|
|
18
|
-
|
|
31
|
+
`better-sqlite3` ships prebuilt binaries for Node 22 and newer (ABI 127, 137,
|
|
32
|
+
141, 147). On Node 20 there is no prebuild for the current version, so npm falls
|
|
33
|
+
back to `node-gyp` and you need [Python 3](https://python.org) and
|
|
34
|
+
[Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
|
|
35
|
+
on Windows. See [Troubleshooting](#troubleshooting).
|
|
19
36
|
|
|
20
|
-
|
|
21
|
-
2. **Fix/Implement** - Write your code
|
|
22
|
-
3. **Create Tests** - Always test your changes
|
|
23
|
-
4. **Run Tests** - Tests must pass (GREEN)
|
|
24
|
-
5. **Document** - Update documentation
|
|
25
|
-
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)
|
|
26
|
-
7. **Release** - After the push succeeds, record the release details before closing out the task
|
|
37
|
+
### 2. Verify the server runs
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
```bash
|
|
40
|
+
node index.js call get_workflow_status
|
|
41
|
+
```
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
- **Organized Test Suite** – The 1k-line `tests/handlers.test.js` has been split into `handlers-*.test.js` files with shared helpers, reducing duplication and clarifying intent.
|
|
32
|
-
- **Shared Test Utilities** – New `tests/test-helpers.js` centralizes workflow state setup, request builders, and git mocks.
|
|
33
|
-
- **Documentation Refresh** – PRD moved to `docs/PRD.md` root, status bumped to v1.8.0, and release notes updated to reflect the current workflow.
|
|
34
|
-
- **Release Hygiene** – Recommended flow now includes `npm run release:<type>` followed by `git push --follow-tags origin main` to keep stages clean.
|
|
43
|
+
Expected output:
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
```
|
|
46
|
+
📊 Current Workflow Status:
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
Phase: idle
|
|
49
|
+
Task: (none)
|
|
50
|
+
Feature flow: ❌
|
|
51
|
+
...
|
|
52
|
+
```
|
|
39
53
|
|
|
40
|
-
|
|
54
|
+
### 3. Connect an MCP client
|
|
55
|
+
|
|
56
|
+
See [MCP client configuration](#mcp-client-configuration).
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Available Tools
|
|
61
|
+
|
|
62
|
+
22 tools.
|
|
63
|
+
|
|
64
|
+
| Tool | Purpose |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `start_task` | Begin a task (always the first step) |
|
|
67
|
+
| `create_feature_flow` | Record the feature flow as Mermaid |
|
|
68
|
+
| `mark_bug_fixed` | Mark the implementation done |
|
|
69
|
+
| `create_tests` | Mark tests as written |
|
|
70
|
+
| `skip_tests` | Skip tests with a justification |
|
|
71
|
+
| `run_tests` | Record test results (blocks commit when failing) |
|
|
72
|
+
| `create_documentation` | Mark docs as written |
|
|
73
|
+
| `check_ready_to_commit` | Verify every required step is complete |
|
|
74
|
+
| `commit_and_push` | `git add` → `commit` → `push` |
|
|
75
|
+
| `perform_release` | Record a release |
|
|
76
|
+
| `skip_release` | Skip the release step with a justification |
|
|
77
|
+
| `complete_task` | Finish and reset the workflow |
|
|
78
|
+
| `get_workflow_status` | Show the current phase |
|
|
79
|
+
| `continue_workflow` | Get guidance on the next step |
|
|
80
|
+
| `view_history` | List completed tasks |
|
|
81
|
+
| `run_full_workflow` | Run every step in one call |
|
|
82
|
+
| `rerun_workflow` | Restart the current task from the beginning |
|
|
83
|
+
| `drop_task` | Abandon the task without completing it |
|
|
84
|
+
| `force_complete_task` | Complete despite missing steps, with a reason |
|
|
85
|
+
| `project_summary` | Aggregate activity for the project |
|
|
86
|
+
| `project_summary_data` | Read the persisted `project-summary.json` |
|
|
87
|
+
| `project_summary_db` | Read the per-user summary from SQLite |
|
|
88
|
+
| `list_factory_tasks` | List your Factory task queue (requires config) |
|
|
89
|
+
| `claim_factory_task` | Claim a Factory task and start a local workflow |
|
|
90
|
+
| `sync_task_status` | Report a status change back to Factory |
|
|
91
|
+
|
|
92
|
+
### Factory task integration
|
|
93
|
+
|
|
94
|
+
Three tools connect this server to the **Factory** board at
|
|
95
|
+
`factory.programinglive.com`. They read and write the real task table
|
|
96
|
+
(`factory_tasks`), not the retired PocketBase `activity_tasks` collection
|
|
97
|
+
(which still exists but holds 0 records and never reached the board).
|
|
98
|
+
|
|
99
|
+
They stay **inert** until configured. With no configuration the server behaves
|
|
100
|
+
exactly as before, and the tools reply with setup instructions.
|
|
41
101
|
|
|
42
102
|
```bash
|
|
43
|
-
|
|
103
|
+
FACTORY_URL=https://factory.programinglive.com
|
|
104
|
+
FACTORY_EMAIL=<activity_users email>
|
|
105
|
+
FACTORY_PASSWORD=<password>
|
|
44
106
|
```
|
|
45
107
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Option 2: Install from Source
|
|
108
|
+
Or supply a ready token instead of a password:
|
|
49
109
|
|
|
50
110
|
```bash
|
|
51
|
-
|
|
52
|
-
cd dev-workflow-mcp-server
|
|
53
|
-
npm install
|
|
111
|
+
FACTORY_TOKEN=<PocketBase activity_users token>
|
|
54
112
|
```
|
|
55
113
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### Option 3: Install on Plesk Hosting
|
|
114
|
+
Optional:
|
|
59
115
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
git clone https://github.com/programinglive/dev-workflow-mcp-server.git
|
|
67
|
-
cd dev-workflow-mcp-server
|
|
68
|
-
```
|
|
69
|
-
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.
|
|
70
|
-
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.
|
|
71
|
-
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`.
|
|
72
|
-
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.
|
|
73
|
-
|
|
74
|
-
> **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.
|
|
116
|
+
```bash
|
|
117
|
+
FACTORY_PB_URL=https://pocketbase.programinglive.com # where the login happens
|
|
118
|
+
FACTORY_MACHINE_ID=<name shown on the device row> # defaults to the hostname
|
|
119
|
+
FACTORY_DEVICE_ID=<fixed device UUID> # else derived from the name
|
|
120
|
+
FACTORY_AGENT=dev-workflow-mcp # max 40 chars
|
|
121
|
+
```
|
|
75
122
|
|
|
76
|
-
|
|
123
|
+
Use an **`activity_users` account, not a PocketBase superuser**. Factory accepts
|
|
124
|
+
that token as `Authorization: Bearer <token>` for non-browser clients, and the
|
|
125
|
+
account only sees its own tasks.
|
|
77
126
|
|
|
78
|
-
|
|
127
|
+
| Tool | Writes? | What it does |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `list_factory_tasks` | no | Reads `GET /api/factory`, maps tasks plus their latest work session, and orders them status → priority. Defaults to `running, queued, backlog, review, blocked` |
|
|
130
|
+
| `claim_factory_task` | yes | Opens a work session (`POST /api/work {action:start}`), which is what turns the task `running` on the board, then starts a local workflow |
|
|
131
|
+
| `sync_task_status` | yes | Uses the only endpoint that can produce the status; see the table below |
|
|
79
132
|
|
|
80
|
-
|
|
133
|
+
#### Status mapping is not free-form
|
|
81
134
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
2. Run the setup script: `bash scripts/setup-gcp-instance.sh`
|
|
85
|
-
3. Clone the repository and configure `.env`
|
|
86
|
-
4. Start containers: `docker-compose up -d`
|
|
87
|
-
5. Update your local MCP client config to connect via SSH
|
|
135
|
+
Factory has no generic "set status" endpoint, so the tool routes each status to
|
|
136
|
+
the endpoint that actually supports it:
|
|
88
137
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
138
|
+
| Requested status | Endpoint used | Result |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `review`, `blocked`, `paused` | `POST /api/work {action:finish}` | Session closes, task changes accordingly |
|
|
141
|
+
| `backlog`, `queued`, `cancelled` | `POST /api/factory {action:move_task}` | Board column changes |
|
|
142
|
+
| `running` | — rejected | Point the caller at `claim_factory_task` |
|
|
143
|
+
| `done` | — rejected | A human approves the work in Factory |
|
|
94
144
|
|
|
95
|
-
|
|
145
|
+
`review` requires an active work session. Asking for it without one fails with
|
|
146
|
+
"no active work session" instead of silently doing nothing — the task must be
|
|
147
|
+
claimed first. Full behaviour, limits (summary 2000 chars, step 240 chars) and
|
|
148
|
+
troubleshooting live in [docs/factory-integration.md](docs/factory-integration.md).
|
|
96
149
|
|
|
97
150
|
|
|
98
|
-
|
|
151
|
+
### Example session
|
|
99
152
|
|
|
100
|
-
|
|
101
|
-
|
|
153
|
+
```
|
|
154
|
+
"Start a new task: add user authentication, type: feature"
|
|
155
|
+
→ start_task, phase moves to coding
|
|
102
156
|
|
|
103
|
-
|
|
157
|
+
[you write code]
|
|
104
158
|
|
|
105
|
-
|
|
159
|
+
"Mark as fixed: login with JWT token"
|
|
160
|
+
→ mark_bug_fixed, phase moves to testing
|
|
106
161
|
|
|
107
|
-
|
|
162
|
+
[you write tests]
|
|
108
163
|
|
|
109
|
-
|
|
164
|
+
"Create tests done"
|
|
165
|
+
→ create_tests
|
|
110
166
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"mcpServers": {
|
|
114
|
-
"dev-workflow": {
|
|
115
|
-
"command": "node",
|
|
116
|
-
"cwd": "<PROJECT_ROOT>",
|
|
117
|
-
"args": ["index.js"],
|
|
118
|
-
"env": {
|
|
119
|
-
"DEV_WORKFLOW_DB_TYPE": "postgres",
|
|
120
|
-
"DEV_WORKFLOW_DB_URL": "postgres://USER:PASS@HOST:5432/devworkflow"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
```
|
|
167
|
+
"Run tests: passed=true, command='npm test', details='12 tests passed'"
|
|
168
|
+
→ run_tests, phase moves to documentation
|
|
126
169
|
|
|
127
|
-
|
|
170
|
+
"Create docs: type=README, summary='Added auth section'"
|
|
171
|
+
→ create_documentation, phase moves to ready_to_commit
|
|
128
172
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"mcpServers": {
|
|
132
|
-
"dev-workflow": {
|
|
133
|
-
"command": "node",
|
|
134
|
-
"args": ["<PROJECT_ROOT>/index.js"]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
```
|
|
173
|
+
"Check if ready to commit"
|
|
174
|
+
→ check_ready_to_commit → READY
|
|
139
175
|
|
|
140
|
-
|
|
176
|
+
"Commit and push: message='feat(auth): add JWT authentication'"
|
|
177
|
+
→ commit_and_push, phase moves to release
|
|
141
178
|
|
|
142
|
-
|
|
179
|
+
"Perform release: command='npm run release:minor'"
|
|
180
|
+
→ perform_release, phase moves to ready_to_complete
|
|
143
181
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"mcpServers": {
|
|
147
|
-
"dev-workflow": {
|
|
148
|
-
"command": "node",
|
|
149
|
-
"args": ["<PROJECT_ROOT>\\index.js"]
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
182
|
+
"Complete task: commitMessage='feat(auth): add JWT authentication'"
|
|
183
|
+
→ complete_task, workflow reset to idle
|
|
153
184
|
```
|
|
154
185
|
|
|
155
|
-
|
|
186
|
+
---
|
|
156
187
|
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
"mcpServers": {
|
|
160
|
-
"dev-workflow": {
|
|
161
|
-
"command": "node",
|
|
162
|
-
"args": ["<PROJECT_ROOT>\\index.js"]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
```
|
|
188
|
+
## MCP client configuration
|
|
167
189
|
|
|
168
|
-
|
|
190
|
+
### OpenCode
|
|
169
191
|
|
|
170
|
-
|
|
192
|
+
OpenCode V2 nests servers under `mcp.servers` and does **not** accept an
|
|
193
|
+
`enabled` key there. Config path is reported by `opencode debug paths`
|
|
194
|
+
(`~/.config/opencode` on every platform, including Windows).
|
|
171
195
|
|
|
172
196
|
```json
|
|
173
197
|
{
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
|
|
198
|
+
"mcp": {
|
|
199
|
+
"servers": {
|
|
200
|
+
"dev-workflow": {
|
|
201
|
+
"type": "local",
|
|
202
|
+
"command": ["node", "C:\\path\\to\\dev-workflow-mcp-server\\index.js"]
|
|
203
|
+
}
|
|
178
204
|
}
|
|
179
205
|
}
|
|
180
206
|
}
|
|
181
207
|
```
|
|
182
208
|
|
|
183
|
-
|
|
209
|
+
The simplest way to write this correctly is to let OpenCode do it:
|
|
184
210
|
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
"mcpServers": {
|
|
188
|
-
"dev-workflow": {
|
|
189
|
-
"command": "node",
|
|
190
|
-
"args": ["<PROJECT_ROOT>/index.js"]
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
211
|
+
```bash
|
|
212
|
+
opencode mcp add dev-workflow --global -- node "C:\path\to\dev-workflow-mcp-server\index.js"
|
|
194
213
|
```
|
|
195
214
|
|
|
196
|
-
|
|
215
|
+
### Claude Desktop
|
|
197
216
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
If you keep this repository checked out at `/Users/alex/code/dev-workflow-mcp-server` and want to point Windsurf at a hosted PostgreSQL instance, drop the following into `~/Library/Application Support/Windsurf/mcp_config.json`:
|
|
217
|
+
`%APPDATA%\Claude\claude_desktop_config.json` (Windows) or
|
|
218
|
+
`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
201
219
|
|
|
202
220
|
```json
|
|
203
221
|
{
|
|
204
222
|
"mcpServers": {
|
|
205
223
|
"dev-workflow": {
|
|
206
224
|
"command": "node",
|
|
207
|
-
"
|
|
208
|
-
"args": ["index.js"],
|
|
209
|
-
"env": {
|
|
210
|
-
"DEV_WORKFLOW_DB_TYPE": "postgres",
|
|
211
|
-
"DEV_WORKFLOW_DB_URL": "postgres://devworkflow:devworkflow_secure_password@34.50.121.142:5432/devworkflow"
|
|
212
|
-
}
|
|
225
|
+
"args": ["C:\\path\\to\\dev-workflow-mcp-server\\index.js"]
|
|
213
226
|
}
|
|
214
227
|
}
|
|
215
228
|
}
|
|
216
229
|
```
|
|
217
230
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
### 4. Restart Windsurf/Claude Desktop
|
|
221
|
-
|
|
222
|
-
After adding the configuration, restart the application to load the MCP server.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
### 5. Configure in Antigravity
|
|
231
|
+
### Windsurf
|
|
226
232
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
**Windows:** `%APPDATA%\Antigravity\mcp_config.json` or `C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json`
|
|
233
|
+
`%APPDATA%\Windsurf\config.json` (Windows) or
|
|
234
|
+
`~/Library/Application Support/Windsurf/config.json` (macOS):
|
|
230
235
|
|
|
231
236
|
```json
|
|
232
237
|
{
|
|
233
238
|
"mcpServers": {
|
|
234
239
|
"dev-workflow": {
|
|
235
240
|
"command": "node",
|
|
236
|
-
"
|
|
241
|
+
"cwd": "C:\\path\\to\\dev-workflow-mcp-server",
|
|
242
|
+
"args": ["index.js"]
|
|
237
243
|
}
|
|
238
244
|
}
|
|
239
245
|
}
|
|
240
246
|
```
|
|
241
247
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
### ⚡ Performance Optimization (Recommended)
|
|
245
|
-
|
|
246
|
-
To ensure the fastest possible startup (critical for IDE-integrated clients like Claude Desktop), we recommend pointing directly to `index.js` using `node` rather than `npx`. This avoids the overhead of checking for package updates.
|
|
248
|
+
### Antigravity
|
|
247
249
|
|
|
248
|
-
|
|
250
|
+
`%APPDATA%\Antigravity\mcp_config.json`:
|
|
249
251
|
|
|
250
252
|
```json
|
|
251
253
|
{
|
|
252
254
|
"mcpServers": {
|
|
253
255
|
"dev-workflow": {
|
|
254
256
|
"command": "node",
|
|
255
|
-
"args": ["
|
|
256
|
-
"env": {
|
|
257
|
-
"DEV_WORKFLOW_USER_ID": "your_user_id"
|
|
258
|
-
}
|
|
257
|
+
"args": ["C:\\path\\to\\dev-workflow-mcp-server\\index.js"]
|
|
259
258
|
}
|
|
260
259
|
}
|
|
261
260
|
}
|
|
262
261
|
```
|
|
263
262
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
## ⚙️ Configuration
|
|
268
|
-
|
|
269
|
-
### Database Setup
|
|
263
|
+
> **Performance:** run `node index.js` directly rather than through `npx`.
|
|
264
|
+
> Startup is noticeably faster.
|
|
270
265
|
|
|
271
|
-
|
|
266
|
+
---
|
|
272
267
|
|
|
273
|
-
|
|
274
|
-
1. Copy `.env.example` to `.env`:
|
|
275
|
-
```bash
|
|
276
|
-
cp .env.example .env
|
|
277
|
-
```
|
|
278
|
-
2. Edit `.env` with your settings:
|
|
279
|
-
```ini
|
|
280
|
-
DEV_WORKFLOW_DB_TYPE=mysql
|
|
281
|
-
DEV_WORKFLOW_DB_URL=mysql://user:pass@localhost:3306/db
|
|
282
|
-
```
|
|
268
|
+
## Configuration
|
|
283
269
|
|
|
284
|
-
|
|
285
|
-
Alternatively, export variables directly:.
|
|
270
|
+
### Database
|
|
286
271
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
| `DEV_WORKFLOW_DB_TYPE` | Database driver (`sqlite`, `mysql`, `postgres`) | `sqlite` |
|
|
290
|
-
| `DEV_WORKFLOW_DB_URL` | Connection string for MySQL/Postgres | `null` |
|
|
291
|
-
| `DEV_WORKFLOW_DB_PATH` | Override path for the SQLite database file | `<project>/.state/dev-workflow.db` |
|
|
272
|
+
Defaults to **SQLite** (file-based, zero config). PostgreSQL and MySQL are also
|
|
273
|
+
supported:
|
|
292
274
|
|
|
293
|
-
#### Examples
|
|
294
|
-
|
|
295
|
-
**MySQL:**
|
|
296
|
-
```bash
|
|
297
|
-
export DEV_WORKFLOW_DB_TYPE=mysql
|
|
298
|
-
export DEV_WORKFLOW_DB_URL="mysql://user:password@localhost:3306/dev_workflow"
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
**PostgreSQL:**
|
|
302
275
|
```bash
|
|
303
|
-
|
|
304
|
-
|
|
276
|
+
# .env or environment variable
|
|
277
|
+
DEV_WORKFLOW_DB_TYPE=postgres
|
|
278
|
+
DEV_WORKFLOW_DB_URL=postgresql://user:pass@localhost:5432/devworkflow
|
|
305
279
|
```
|
|
306
280
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
If you use multiple AI coding tools simultaneously (e.g., Antigravity and Windsurf) on the same project, they will share the same workflow state by default.
|
|
281
|
+
| Variable | Default | Description |
|
|
282
|
+
|---|---|---|
|
|
283
|
+
| `DEV_WORKFLOW_DB_TYPE` | `sqlite` | `sqlite`, `mysql`, or `postgres` |
|
|
284
|
+
| `DEV_WORKFLOW_DB_URL` | — | Connection string (MySQL/Postgres) |
|
|
285
|
+
| `DEV_WORKFLOW_DB_PATH` | `.state/dev-workflow.db` | SQLite path (optional) |
|
|
286
|
+
| `DEV_WORKFLOW_USER_ID` | auto-generated | User ID for multi-user isolation |
|
|
287
|
+
| `DEV_WORKFLOW_STATE_FILE` | auto-resolved | Override for `workflow-state.json` |
|
|
288
|
+
| `FACTORY_URL` | - | Factory base URL, e.g. `https://factory.programinglive.com` |
|
|
289
|
+
| `FACTORY_TOKEN` | - | PocketBase `activity_users` token sent as a Bearer header |
|
|
290
|
+
| `FACTORY_EMAIL` | - | `activity_users` email, exchanged for a token on demand |
|
|
291
|
+
| `FACTORY_PASSWORD` | - | Password for that account |
|
|
292
|
+
| `FACTORY_PB_URL` | `https://pocketbase.programinglive.com` | Where the token is obtained |
|
|
293
|
+
| `FACTORY_MACHINE_ID` | hostname | Device name shown on the Factory board |
|
|
294
|
+
| `FACTORY_DEVICE_ID` | derived from the name | Stable device UUID |
|
|
295
|
+
|
|
296
|
+
### Project-specific state
|
|
297
|
+
|
|
298
|
+
Each project keeps its own state in `.state/users/<user-id>/workflow-state.json`.
|
|
299
|
+
The `.state/` directory is gitignored.
|
|
300
|
+
|
|
301
|
+
For multi-client isolation (for example separate state for Windsurf and
|
|
302
|
+
Antigravity), set a different user ID per client:
|
|
330
303
|
|
|
331
|
-
To maintain **separate, distinct sessions** for each tool, configure a unique `DEV_WORKFLOW_USER_ID` for each.
|
|
332
|
-
|
|
333
|
-
**Antigravity Config (`mcp_config.json`):**
|
|
334
304
|
```json
|
|
335
305
|
{
|
|
336
306
|
"mcpServers": {
|
|
337
307
|
"dev-workflow": {
|
|
338
308
|
"command": "node",
|
|
339
|
-
"args": ["path/to/
|
|
340
|
-
"env": {
|
|
341
|
-
"DEV_WORKFLOW_USER_ID": "antigravity_user"
|
|
342
|
-
}
|
|
309
|
+
"args": ["path/to/index.js"],
|
|
310
|
+
"env": { "DEV_WORKFLOW_USER_ID": "windsurf" }
|
|
343
311
|
}
|
|
344
312
|
}
|
|
345
313
|
}
|
|
346
314
|
```
|
|
347
315
|
|
|
348
|
-
|
|
349
|
-
Add the environment variable in your Windsurf MCP settings:
|
|
350
|
-
```json
|
|
351
|
-
{
|
|
352
|
-
"mcpServers": {
|
|
353
|
-
"dev-workflow": {
|
|
354
|
-
"command": "node",
|
|
355
|
-
"args": ["path/to/server/index.js"],
|
|
356
|
-
"env": {
|
|
357
|
-
"DEV_WORKFLOW_USER_ID": "windsurf_user"
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
```
|
|
316
|
+
---
|
|
363
317
|
|
|
318
|
+
## One-command stack setup (OpenCode V2)
|
|
364
319
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
The project uses Node.js native test runner (`node --test`).
|
|
320
|
+
`scripts/setup-stack.js` installs the whole agent stack: this MCP server,
|
|
321
|
+
[obra/superpowers](https://github.com/obra/superpowers) skills, and
|
|
322
|
+
[RTK](https://github.com/rtk-ai/rtk) token compression.
|
|
369
323
|
|
|
370
324
|
```bash
|
|
371
|
-
|
|
325
|
+
node scripts/setup-stack.js # any platform
|
|
372
326
|
```
|
|
373
327
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
- Integration tests for `.env` configuration
|
|
377
|
-
- DB Adapter tests (SQLite always; MySQL/Postgres if configured)
|
|
328
|
+
Platform wrappers install RTK, run `npm install`, then delegate to the same
|
|
329
|
+
script:
|
|
378
330
|
|
|
379
|
-
|
|
380
|
-
|
|
331
|
+
```powershell
|
|
332
|
+
pwsh scripts/bootstrap-windows.ps1
|
|
333
|
+
```
|
|
381
334
|
|
|
382
335
|
```bash
|
|
383
|
-
|
|
384
|
-
export DEV_WORKFLOW_DB_URL="mysql://root:pass@localhost:3306/test_db"
|
|
385
|
-
node --test tests/db-adapters.test.js
|
|
386
|
-
|
|
387
|
-
# Test PostgreSQL
|
|
388
|
-
export DEV_WORKFLOW_DB_URL="postgres://postgres:pass@localhost:5432/test_db"
|
|
389
|
-
node --test tests/db-adapters.test.js
|
|
336
|
+
bash scripts/bootstrap-unix.sh
|
|
390
337
|
```
|
|
391
338
|
|
|
392
|
-
###
|
|
339
|
+
### What it does
|
|
393
340
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
341
|
+
1. **Finds the real config directory.** Runs `opencode debug paths` and uses the
|
|
342
|
+
reported `config` path, falling back to `~/.config/opencode`. OpenCode V2
|
|
343
|
+
uses that path on Windows too — `%APPDATA%\opencode` is not read.
|
|
344
|
+
2. **Backs up `opencode.json`** to `secrets/opencode-backup-<timestamp>.json`
|
|
345
|
+
before touching it.
|
|
346
|
+
3. **Registers Superpowers** under the V2 `plugins` key. The V1 `plugin` key is
|
|
347
|
+
deprecated and ignored by V2.
|
|
348
|
+
4. **Registers the MCP server** via `opencode mcp add`, which writes a
|
|
349
|
+
schema-valid `mcp.servers` entry.
|
|
350
|
+
5. **Installs dependencies.** Without `npm install` the server dies at startup
|
|
351
|
+
with `ERR_MODULE_NOT_FOUND: Cannot find package 'dotenv'`.
|
|
352
|
+
6. **Smoke tests the server**, then verifies with `opencode mcp list` and
|
|
353
|
+
`opencode plugin list`. Exits non-zero when a check fails.
|
|
354
|
+
7. **Creates `AGENTS.md`** in the current project if missing.
|
|
398
355
|
|
|
399
|
-
|
|
356
|
+
---
|
|
400
357
|
|
|
401
|
-
|
|
358
|
+
## Tests
|
|
402
359
|
|
|
403
360
|
```bash
|
|
404
|
-
npm
|
|
405
|
-
|
|
361
|
+
npm test # full suite
|
|
362
|
+
node --test tests/setup-stack.test.js
|
|
406
363
|
```
|
|
407
364
|
|
|
408
|
-
- **Default port:** 3111 (or the next free port if occupied).
|
|
409
|
-
- **Environment overrides:** Honors `PORT` (common on hosts like Plesk/Render) or `DEV_WORKFLOW_WEB_PORT` before falling back to auto-selection.
|
|
410
|
-
- **Query parameter:** `?user=<id>` lets you inspect another user’s history (defaults to `default`).
|
|
411
|
-
- **API endpoints:**
|
|
412
|
-
- `GET /api/version` → current package version from `package.json` (used by dashboard to display version dynamically).
|
|
413
|
-
- `GET /api/summary?user=<id>` → overall stats for the user.
|
|
414
|
-
- `GET /api/history?user=<id>&page=1&pageSize=20&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD` → paginated task history.
|
|
415
|
-
- `GET /api/history-summary?user=<id>&frequency=daily|monthly|yearly` → aggregated counts over time.
|
|
416
|
-
|
|
417
|
-
Open `http://localhost:3111` in a browser to view the dashboard UI (`web/index.html`).
|
|
418
|
-
|
|
419
|
-
### Build Output
|
|
420
|
-
|
|
421
|
-
Running `npm run build` generates:
|
|
422
|
-
- `dist/index.mjs` - Optimized ES module bundle
|
|
423
|
-
- Source maps and other build artifacts
|
|
424
|
-
- `dist/docs/` - Pre-rendered HTML documentation generated from Markdown via `scripts/build-docs.js`
|
|
425
|
-
|
|
426
|
-
The build bundles all source files while externalizing Node.js built-in modules and dependencies, resulting in a single file distribution.
|
|
427
|
-
|
|
428
|
-
### Usage
|
|
429
|
-
|
|
430
|
-
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:
|
|
431
|
-
- npm package distribution
|
|
432
|
-
- Performance optimization
|
|
433
|
-
- Embedding in other projects
|
|
434
|
-
|
|
435
|
-
### MCP Tools Registry (Publishing)
|
|
436
|
-
|
|
437
|
-
This package is configured for the official MCP Tools Registry using **npm package deployment**:
|
|
438
|
-
|
|
439
|
-
- `package.json` declares `mcpName: "io.github.programinglive/dev-workflow-mcp-server"`.
|
|
440
|
-
- `server.json` describes the server and links it to the npm package `@programinglive/dev-workflow-mcp-server`.
|
|
441
|
-
|
|
442
|
-
To publish a new server version to the registry:
|
|
443
|
-
|
|
444
|
-
1. Release a new npm version (for example):
|
|
445
|
-
- `npm test`
|
|
446
|
-
- `npm run release:patch` (runs your existing release pipeline and publishes to npm)
|
|
447
|
-
2. Verify the new version exists on npm:
|
|
448
|
-
- `npm view @programinglive/dev-workflow-mcp-server version`
|
|
449
|
-
3. Install the MCP publisher CLI (once per machine):
|
|
450
|
-
- `brew install mcp-publisher` (or follow the docs at https://modelcontextprotocol.info/tools/registry/publishing/)
|
|
451
|
-
4. From this repo root, authenticate and publish:
|
|
452
|
-
- `mcp-publisher login github`
|
|
453
|
-
- `mcp-publisher publish`
|
|
454
|
-
5. Optionally verify in the registry:
|
|
455
|
-
- `curl "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.programinglive/dev-workflow-mcp-server"`
|
|
456
|
-
|
|
457
|
-
#### PowerShell CLI tip
|
|
458
|
-
|
|
459
|
-
When invoking the lightweight CLI from PowerShell, use `--%` to prevent PowerShell from rewriting JSON arguments, for example:
|
|
460
|
-
|
|
461
|
-
```powershell
|
|
462
|
-
node --% index.js call start_task --args "{\"description\":\"Convert docs to HTML during build\",\"type\":\"feature\"}"
|
|
463
365
|
```
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
When you install this package in a project, a `.state/workflow-state.json` file is automatically created in your project root. This file:
|
|
470
|
-
|
|
471
|
-
- **Stores workflow history** specific to that project
|
|
472
|
-
- **Tracks task progress** independently per project
|
|
473
|
-
- **Should be gitignored** (already in `.gitignore` by default)
|
|
474
|
-
- **Persists across sessions** so your workflow state is preserved
|
|
475
|
-
- **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.
|
|
476
|
-
|
|
477
|
-
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.
|
|
478
|
-
|
|
479
|
-
#### Choosing a User ID
|
|
480
|
-
|
|
481
|
-
Use cases:
|
|
482
|
-
|
|
483
|
-
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).
|
|
484
|
-
2. **Set an explicit ID** – Before starting the server, export `DEV_WORKFLOW_USER_ID`:
|
|
485
|
-
|
|
486
|
-
```bash
|
|
487
|
-
# macOS/Linux
|
|
488
|
-
export DEV_WORKFLOW_USER_ID=alice
|
|
489
|
-
node index.js
|
|
490
|
-
|
|
491
|
-
# Windows PowerShell
|
|
492
|
-
$env:DEV_WORKFLOW_USER_ID = "alice"
|
|
493
|
-
node index.js
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
Now all history for that session lands in `.state/users/alice/` and the dashboard can be filtered with `alice`.
|
|
497
|
-
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.
|
|
498
|
-
|
|
499
|
-
> **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>/`.
|
|
500
|
-
|
|
501
|
-
### Adding to .gitignore
|
|
502
|
-
|
|
503
|
-
If you're using this package, add this to your project's `.gitignore`:
|
|
504
|
-
|
|
505
|
-
```
|
|
506
|
-
.state/
|
|
366
|
+
ℹ tests 112
|
|
367
|
+
ℹ pass 110
|
|
368
|
+
ℹ fail 0
|
|
369
|
+
ℹ skipped 2
|
|
507
370
|
```
|
|
508
371
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
> **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.
|
|
372
|
+
The two skipped tests are the MySQL and PostgreSQL adapters. They run only when a
|
|
373
|
+
database is reachable:
|
|
512
374
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
- `create_tests` - Mark that tests have been created
|
|
518
|
-
- `skip_tests` - Skip tests with justification
|
|
519
|
-
- `run_tests` - Record test results (must pass to proceed)
|
|
520
|
-
- `create_documentation` - Mark documentation as created
|
|
521
|
-
- `check_ready_to_commit` - Verify all steps are complete
|
|
522
|
-
- `commit_and_push` - Commit and push changes
|
|
523
|
-
- `perform_release` - Record release details (or use `skip_release` when the project has no release automation)
|
|
524
|
-
- `complete_task` - Mark task as complete and reset
|
|
525
|
-
- `force_complete_task` - Force completion with reason
|
|
526
|
-
- `drop_task` - Abandon current task
|
|
527
|
-
- `get_workflow_status` - Show current status
|
|
528
|
-
- `view_history` - View completed tasks
|
|
529
|
-
- `continue_workflow` - Get next-step guidance
|
|
530
|
-
- `rerun_workflow` - Reset and restart the current task from the beginning
|
|
531
|
-
- `run_full_workflow` - Execute every workflow step in sequence with a single command (requires supplying the details for each phase)
|
|
375
|
+
```bash
|
|
376
|
+
TEST_MYSQL_URL=mysql://user:pass@localhost:3306/db npm test
|
|
377
|
+
TEST_POSTGRES_URL=postgres://user:pass@localhost:5432/db npm test
|
|
378
|
+
```
|
|
532
379
|
|
|
533
|
-
|
|
380
|
+
To exercise them against real servers without exposing them publicly:
|
|
534
381
|
|
|
535
|
-
|
|
382
|
+
```bash
|
|
383
|
+
# on the database host, once: creates isolated devworkflow_test databases
|
|
384
|
+
./scripts/setup-test-dbs.sh
|
|
536
385
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
"summary": "Add payment webhooks",
|
|
540
|
-
"testCommand": "npm test",
|
|
541
|
-
"documentationType": "README",
|
|
542
|
-
"documentationSummary": "Document webhook configuration",
|
|
543
|
-
"commitMessage": "feat: add payment webhooks",
|
|
544
|
-
"releaseCommand": "npm run release:minor",
|
|
545
|
-
"releaseNotes": "Release webhook support",
|
|
546
|
-
"branch": "feature/payments",
|
|
547
|
-
"testsPassed": true,
|
|
548
|
-
"testDetails": "node --test; 42 tests",
|
|
549
|
-
"releaseType": "minor",
|
|
550
|
-
"preset": "minor"
|
|
551
|
-
}
|
|
386
|
+
# locally: opens an SSH tunnel, runs only the adapter tests, closes the tunnel
|
|
387
|
+
TEST_POSTGRES_URL=... TEST_MYSQL_URL=... ./scripts/test-db-adapters.sh
|
|
552
388
|
```
|
|
553
389
|
|
|
554
|
-
|
|
390
|
+
Both adapters pass against live MySQL and PostgreSQL this way (19/19 tests, none
|
|
391
|
+
skipped). The tests **write real rows**, so `setup-test-dbs.sh` creates separate
|
|
392
|
+
`devworkflow_test` databases and grants the test role access only to those. Never
|
|
393
|
+
point these variables at a production database.
|
|
555
394
|
|
|
556
|
-
|
|
557
|
-
2. `create_tests`
|
|
558
|
-
3. `run_tests` with `testsPassed`, `testCommand`, and optional `testDetails`
|
|
559
|
-
4. `create_documentation` with `documentationType` and `documentationSummary`
|
|
560
|
-
- **Requires**: `docs/product/PRD.md` must exist before documentation can be marked complete
|
|
561
|
-
5. `check_ready_to_commit`
|
|
562
|
-
6. `commit_and_push` with `commitMessage` and optional `branch`
|
|
563
|
-
7. `perform_release` with `releaseCommand`, plus optional `releaseNotes`, `releaseType`, and `preset`
|
|
564
|
-
- Alternatively call `skip_release` with a justification when the repository has no Node-based release step (e.g., Python-only or docs-only tasks)
|
|
565
|
-
8. `complete_task` reusing `commitMessage`
|
|
395
|
+
Everything else, including the SQLite adapter, always runs.
|
|
566
396
|
|
|
567
|
-
|
|
397
|
+
`tests/test-helpers.js` exports `stripNpmNotices()`, which removes npm's own
|
|
398
|
+
`npm warn`/`npm notice` output and Rollup's third-party annotation warnings from
|
|
399
|
+
captured stderr before the build test asserts on it.
|
|
568
400
|
|
|
569
|
-
|
|
401
|
+
---
|
|
570
402
|
|
|
571
|
-
|
|
403
|
+
## CI
|
|
572
404
|
|
|
573
|
-
|
|
405
|
+
`.github/workflows/ci.yml` runs on the **self-hosted runner on MMCH**, not on
|
|
406
|
+
GitHub-hosted minutes:
|
|
574
407
|
|
|
575
|
-
|
|
408
|
+
```yaml
|
|
409
|
+
runs-on: [self-hosted, windows, mmch]
|
|
410
|
+
```
|
|
576
411
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
412
|
+
| Job | Steps |
|
|
413
|
+
|---|---|
|
|
414
|
+
| `test` | `npm ci` → `npm test` → `build:server` → **verify the bundle starts** → `npm audit --omit=dev --audit-level=high` → setup-stack suite |
|
|
415
|
+
| `web` | `npm ci` in `web/` → static export build → verify `out/index.html` and CSS size → `npm audit --audit-level=high` |
|
|
580
416
|
|
|
581
|
-
|
|
417
|
+
The bundle verification step exists because a successful build does not mean
|
|
418
|
+
the artefact runs. `dist/index.mjs` is the published package entry, and a
|
|
419
|
+
bundler upgrade once produced a green build whose output crashed on startup.
|
|
420
|
+
`scripts/verify-bundle.mjs` starts the bundle and requires the stdio startup
|
|
421
|
+
banner, so that class of failure fails the pull request instead of the release.
|
|
582
422
|
|
|
583
|
-
|
|
584
|
-
|
|
423
|
+
The `web` job exists because the dashboard is deployed to Netlify from `web/`.
|
|
424
|
+
The CSS size check catches a Tailwind regression that a green build would
|
|
425
|
+
otherwise hide.
|
|
585
426
|
|
|
586
|
-
###
|
|
427
|
+
### Tailwind stays on v3
|
|
587
428
|
|
|
588
|
-
|
|
429
|
+
`web/` uses Tailwind 3.4 and is **not** being migrated to v4. Tailwind 4 is a
|
|
430
|
+
rewrite of the CSS pipeline: the `@tailwind` directives become
|
|
431
|
+
`@import "tailwindcss"`, the config moves into CSS, and the PostCSS plugin is
|
|
432
|
+
replaced by `@tailwindcss/postcss`. The dashboard is finished and stable, so
|
|
433
|
+
rewriting its styling pipeline risks the entire visual design for no functional
|
|
434
|
+
gain.
|
|
589
435
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
4. Confirm `npm run build` succeeds locally; the workflow runs the build before publishing so broken bundles block the release.
|
|
594
|
-
5. GitHub provenance is enabled via `npm publish --provenance`. Leave GitHub Actions' default OIDC permissions enabled so the job can request an ID token.
|
|
595
|
-
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.
|
|
436
|
+
`dependabot.yml` ignores `tailwindcss`, `@tailwindcss/postcss` and
|
|
437
|
+
`@tailwindcss/cli` entirely — not just majors — so no v4 pull request
|
|
438
|
+
reappears.
|
|
596
439
|
|
|
597
|
-
|
|
440
|
+
Runner provisioning and troubleshooting: [docs/homelab/ci-runner.md](./docs/homelab/ci-runner.md).
|
|
598
441
|
|
|
599
|
-
|
|
442
|
+
---
|
|
600
443
|
|
|
601
|
-
|
|
444
|
+
## Release workflow
|
|
602
445
|
|
|
603
|
-
|
|
604
|
-
- Strings are parsed as JSON and must resolve to an object (key/value pairs).
|
|
605
|
-
- Passing non-object data (numbers, arrays, plain text) triggers a guidance error.
|
|
606
|
-
- Missing or malformed arguments safely default to empty input so the tool can respond with actionable reminders.
|
|
446
|
+
`.github/workflows/github-release.yml` runs on a `v*` tag, split in two:
|
|
607
447
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
"arguments": "{\"description\":\"Add reporting endpoint\",\"type\":\"feature\"}"
|
|
613
|
-
}
|
|
614
|
-
```
|
|
448
|
+
| Job | Runner | Work |
|
|
449
|
+
|---|---|---|
|
|
450
|
+
| `build` | self-hosted MMCH | `npm ci` → `npm test` → `build:server` → verify the bundle starts → `npm pack` → upload tarball |
|
|
451
|
+
| `publish` | `ubuntu-latest` | download tarball → `npm publish` → create/update the GitHub release |
|
|
615
452
|
|
|
616
|
-
|
|
617
|
-
|
|
453
|
+
Publishing uses **Trusted Publishing (OIDC)**: no long-lived npm token is stored
|
|
454
|
+
anywhere, and `id-token: write` plus `registry-url` on `setup-node` is the whole
|
|
455
|
+
configuration. The trusted publisher is registered with `npm trust`:
|
|
618
456
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
```
|
|
625
|
-
Use the start_task tool with:
|
|
626
|
-
- description: "Add user authentication to the login page"
|
|
627
|
-
- type: "feature"
|
|
457
|
+
```bash
|
|
458
|
+
npm trust github @programinglive/dev-workflow-mcp-server \
|
|
459
|
+
--file .github/workflows/github-release.yml \
|
|
460
|
+
--repo programinglive/dev-workflow-mcp-server \
|
|
461
|
+
--allow-publish -y
|
|
628
462
|
```
|
|
629
463
|
|
|
630
|
-
|
|
631
|
-
Mark that the bug/feature is fixed. **Reminder: Now you MUST create tests!**
|
|
632
|
-
|
|
633
|
-
**Parameters:**
|
|
634
|
-
- `summary` (string, required): Brief summary of what was fixed/implemented
|
|
635
|
-
|
|
636
|
-
### `create_tests`
|
|
637
|
-
Confirm that you've created the necessary tests covering your change. Required before recording test results.
|
|
638
|
-
|
|
639
|
-
**Parameters:** _none_
|
|
640
|
-
|
|
641
|
-
### `skip_tests`
|
|
642
|
-
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.
|
|
643
|
-
|
|
644
|
-
**Parameters:**
|
|
645
|
-
- `reason` (string, required): Why automated tests were skipped
|
|
464
|
+
The `file` must match the workflow filename exactly, or OIDC is rejected.
|
|
646
465
|
|
|
647
|
-
###
|
|
648
|
-
Record test results. **NEVER commit if tests fail!** Only proceed if all tests are green.
|
|
466
|
+
### No provenance
|
|
649
467
|
|
|
650
|
-
**
|
|
651
|
-
|
|
652
|
-
- `testCommand` (string, required): The test command that was run
|
|
653
|
-
- `details` (string, optional): Test results details
|
|
468
|
+
`--provenance` is intentionally **not** used. npm rejects provenance bundles
|
|
469
|
+
whose source repository is private:
|
|
654
470
|
|
|
655
|
-
**Example:**
|
|
656
471
|
```
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
- details: "All 15 tests passed"
|
|
472
|
+
422 Unprocessable Entity - Unsupported GitHub Actions source repository
|
|
473
|
+
visibility: "private". Only public source repositories are supported when
|
|
474
|
+
publishing with provenance.
|
|
661
475
|
```
|
|
662
476
|
|
|
663
|
-
|
|
664
|
-
|
|
477
|
+
This repository is private by policy, so provenance is unavailable. Consumers
|
|
478
|
+
cannot cryptographically verify which commit produced a published tarball.
|
|
665
479
|
|
|
666
|
-
|
|
667
|
-
- `documentationType` (enum, required): "PRD", "README", "RELEASE_NOTES", "inline-comments", "API-docs", "changelog", or "other"
|
|
668
|
-
- `summary` (string, required): What was documented
|
|
480
|
+
### What ships in the package
|
|
669
481
|
|
|
670
|
-
|
|
671
|
-
|
|
482
|
+
`.npmignore` limits the tarball to the runtime server: about 60 files and 66 kB.
|
|
483
|
+
It excludes `.env*` (only `.env.example` ships), `.state/`, tests, CI config,
|
|
484
|
+
`web/`, and docs.
|
|
672
485
|
|
|
673
|
-
|
|
674
|
-
|
|
486
|
+
`scripts/install-husky.js` runs from `prepare`. It installs git hooks only when a
|
|
487
|
+
`.git` directory is present, so installing the package as a dependency does not
|
|
488
|
+
fail on husky.
|
|
675
489
|
|
|
676
|
-
|
|
490
|
+
---
|
|
677
491
|
|
|
678
|
-
|
|
679
|
-
- `commitMessage` (string, required): Conventional commit message to use
|
|
680
|
-
- `branch` (string, optional): Target branch to push. If omitted, auto-detects primary branch (main or master)
|
|
492
|
+
## What this server prevents
|
|
681
493
|
|
|
682
|
-
|
|
683
|
-
|
|
494
|
+
- Committing without tests
|
|
495
|
+
- Committing with failing tests
|
|
496
|
+
- Committing without documentation
|
|
497
|
+
- Forgetting a workflow step
|
|
498
|
+
- Releasing without committing and pushing
|
|
684
499
|
|
|
685
|
-
|
|
686
|
-
- `command` (string, required): Release command that was executed (e.g., `npm run release`)
|
|
687
|
-
- `notes` (string, optional): Additional release notes
|
|
500
|
+
---
|
|
688
501
|
|
|
689
|
-
|
|
690
|
-
Mark the task as complete after successful commit & push. Resets workflow for next task.
|
|
502
|
+
## Tips
|
|
691
503
|
|
|
692
|
-
|
|
693
|
-
|
|
504
|
+
1. Always start with `start_task` — it sets the intent for the session
|
|
505
|
+
2. Do not skip tests unless it is genuinely impossible — use `skip_tests` with a clear reason
|
|
506
|
+
3. Call `get_workflow_status` whenever you lose track of the phase
|
|
507
|
+
4. `run_full_workflow` is a shortcut for simple tasks where all the data is already known
|
|
508
|
+
5. For docs-only work, use `skip_release` rather than forcing a release
|
|
694
509
|
|
|
695
|
-
|
|
696
|
-
Abandon the current task without completing the workflow. Preserves an audit entry with context, then resets the state so you can start fresh.
|
|
510
|
+
---
|
|
697
511
|
|
|
698
|
-
|
|
699
|
-
- `reason` (string, optional): Additional detail about why the task was dropped
|
|
512
|
+
## Troubleshooting
|
|
700
513
|
|
|
701
|
-
|
|
702
|
-
|
|
514
|
+
**`ERR_MODULE_NOT_FOUND: Cannot find package 'dotenv'`** — dependencies are not
|
|
515
|
+
installed. Run `npm install` in the repo.
|
|
703
516
|
|
|
704
|
-
|
|
705
|
-
|
|
517
|
+
**`gyp ERR! find VS` on Windows** — the native module is compiling from source
|
|
518
|
+
because there is no prebuild for your Node ABI. Either switch to a Node version
|
|
519
|
+
that has one, or install Visual Studio Build Tools.
|
|
706
520
|
|
|
707
|
-
|
|
708
|
-
|
|
521
|
+
**`EPERM ... better_sqlite3.node`** — a running process holds the file. Stop it,
|
|
522
|
+
then reinstall.
|
|
709
523
|
|
|
710
|
-
|
|
524
|
+
**OpenCode does not load the server** — check the config shape. V2 requires
|
|
525
|
+
`mcp.servers` and rejects `enabled`:
|
|
711
526
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
### `pre_commit_checklist`
|
|
716
|
-
Get a pre-commit checklist to ensure nothing is missed before committing.
|
|
717
|
-
|
|
718
|
-
## 🔄 Typical Workflow
|
|
719
|
-
|
|
720
|
-
Here's how you'd use this MCP server in a typical coding session:
|
|
721
|
-
|
|
722
|
-
1. **Start your task:**
|
|
723
|
-
```
|
|
724
|
-
Ask Cascade to use start_task:
|
|
725
|
-
"Start a new task: implementing user profile page, type: feature"
|
|
726
|
-
```
|
|
727
|
-
|
|
728
|
-
2. **Code your feature/fix**
|
|
729
|
-
- Write your code as usual
|
|
730
|
-
|
|
731
|
-
3. **Mark as fixed:**
|
|
732
|
-
```
|
|
733
|
-
"Mark the feature as fixed: User profile page with avatar and bio completed"
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
4. **Create tests:**
|
|
737
|
-
- Write your tests
|
|
738
|
-
- The server will remind you this is mandatory!
|
|
739
|
-
|
|
740
|
-
5. **Run tests:**
|
|
741
|
-
```
|
|
742
|
-
"Record test results: passed=true, command='npm test'"
|
|
743
|
-
```
|
|
744
|
-
- If tests fail, the server will **block** you from proceeding!
|
|
745
|
-
|
|
746
|
-
7. **Document:**
|
|
747
|
-
```
|
|
748
|
-
"Create documentation: type=README, summary='Added user profile section to docs'"
|
|
749
|
-
```
|
|
750
|
-
|
|
751
|
-
8. **Check readiness:**
|
|
752
|
-
```
|
|
753
|
-
"Check if I'm ready to commit"
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
9. **Commit & Push:**
|
|
757
|
-
```
|
|
758
|
-
"Commit and push: commitMessage='feat: add user profile page with tests and docs'"
|
|
759
|
-
```
|
|
760
|
-
|
|
761
|
-
10. **Record release:**
|
|
762
|
-
```
|
|
763
|
-
"Record release: command='npm run release', notes='v1.2.3'"
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
11. **Complete:**
|
|
767
|
-
```
|
|
768
|
-
"Complete the task with commit message: 'feat: add user profile page'"
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
12. **Drop task (optional):**
|
|
772
|
-
```
|
|
773
|
-
"Drop task: reason='Switching to a different feature'"
|
|
774
|
-
```
|
|
527
|
+
```bash
|
|
528
|
+
opencode mcp list # should show: dev-workflow connected
|
|
529
|
+
```
|
|
775
530
|
|
|
776
|
-
|
|
531
|
+
---
|
|
777
532
|
|
|
778
|
-
|
|
779
|
-
- **Test-driven**: Blocks commits if tests fail
|
|
780
|
-
- **Documentation reminder**: Ensures you document your work
|
|
781
|
-
- **State tracking**: Remembers where you are in the workflow
|
|
782
|
-
- **History**: Keeps track of completed tasks
|
|
783
|
-
- **Prompts**: Quick reminders of best practices
|
|
533
|
+
## Build
|
|
784
534
|
|
|
785
|
-
|
|
535
|
+
```bash
|
|
536
|
+
npm run build # → dist/index.mjs (optimized bundle, used for npm distribution)
|
|
537
|
+
npm run web # → dashboard on http://localhost:3000
|
|
538
|
+
```
|
|
786
539
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
- ❌ Committing without documentation
|
|
790
|
-
- ❌ Losing track of what you're working on
|
|
791
|
-
- ❌ Skipping important workflow steps
|
|
540
|
+
For MCP use, point the client at `index.js` directly — startup is faster than the
|
|
541
|
+
bundled `dist/index.mjs`.
|
|
792
542
|
|
|
793
|
-
|
|
543
|
+
---
|
|
794
544
|
|
|
795
|
-
|
|
796
|
-
2. **Never skip tests without justification** - Use `skip_tests` only when absolutely necessary and document the reason for manual QA
|
|
797
|
-
3. **Use `get_workflow_status`** - Check where you are anytime
|
|
798
|
-
4. **Review history** - Learn from your past tasks
|
|
799
|
-
5. **Follow the prompts** - They contain best practices
|
|
545
|
+
## Homelab Development Guide
|
|
800
546
|
|
|
801
|
-
|
|
547
|
+
This repository also documents the internal **programinglive** homelab: Tailscale
|
|
548
|
+
plus SSH across three machines (MMCH, HELLOWORLD, Mac).
|
|
802
549
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
-
|
|
807
|
-
-
|
|
550
|
+
| Document | Contents |
|
|
551
|
+
|---|---|
|
|
552
|
+
| [docs/homelab/README.md](./docs/homelab/README.md) | Overview and quick reference |
|
|
553
|
+
| [docs/homelab/infra-tailnet-ssh.md](./docs/homelab/infra-tailnet-ssh.md) | Tailnet and SSH setup |
|
|
554
|
+
| [docs/homelab/cli-tools.md](./docs/homelab/cli-tools.md) | CLI tools per machine |
|
|
555
|
+
| [docs/homelab/ci-runner.md](./docs/homelab/ci-runner.md) | Self-hosted CI runner on MMCH |
|
|
556
|
+
| [docs/homelab/security-rules.md](./docs/homelab/security-rules.md) | Security rules |
|
|
557
|
+
| [.agent/workflows/homelab-setup.md](./.agent/workflows/homelab-setup.md) | MCP workflow for onboarding a new machine |
|
|
808
558
|
|
|
809
|
-
|
|
559
|
+
> ⚠️ This repository is **private**. Do not share it publicly.
|
|
810
560
|
|
|
811
|
-
|
|
812
|
-
- Current phase
|
|
813
|
-
- Task description
|
|
814
|
-
- Completion status of each step
|
|
815
|
-
- History of completed tasks
|
|
561
|
+
---
|
|
816
562
|
|
|
817
|
-
|
|
818
|
-
It contains local, machine-specific progress and is ignored by git so each environment can manage its own workflow history without cross-contamination.
|
|
819
|
-
|
|
820
|
-
## 🤝 Integration with Your Rules
|
|
821
|
-
|
|
822
|
-
This MCP server aligns with your existing development rules:
|
|
823
|
-
- ✅ Enforces test-first discipline
|
|
824
|
-
- ✅ Prevents commits with failing tests
|
|
825
|
-
- ✅ Reminds about documentation
|
|
826
|
-
- ✅ Tracks workflow state
|
|
827
|
-
- ✅ Maintains history
|
|
828
|
-
|
|
829
|
-
## 📄 License
|
|
563
|
+
## License
|
|
830
564
|
|
|
831
565
|
MIT
|
|
832
|
-
|
|
833
|
-
## 🙏 Contributing
|
|
834
|
-
|
|
835
|
-
Feel free to customize this server to match your specific workflow needs!
|
|
836
|
-
|
|
837
|
-
## 📜 Project Governance
|
|
838
|
-
|
|
839
|
-
- [Code of Conduct](./CODE_OF_CONDUCT.md)
|
|
840
|
-
- [Contributing Guide](./CONTRIBUTING.md)
|
|
841
|
-
- [Security Policy](./SECURITY.md)
|
|
842
|
-
- [License](./LICENSE)
|