@programinglive/dev-workflow-mcp-server 1.8.1 β 1.9.1
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 +257 -672
- package/index.js +5 -4
- package/package.json +11 -6
- 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/tools/definitions.js +19 -0
- package/tools/handler-modules/commit-handlers.js +2 -1
- package/tools/handler-modules/index.js +13 -7
- package/tools/handler-modules/shared.js +7 -41
- package/tools/handler-modules/status-handlers.js +3 -1
- package/tools/handler-modules/workflow-handlers.js +26 -8
- package/workflow-state.js +10 -0
- 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/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,51 +1,26 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
This MCP server guides you through a disciplined development workflow:
|
|
19
|
-
|
|
20
|
-
1. **Start Conscious** - Be clear about what you're coding
|
|
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
|
|
27
|
-
|
|
28
|
-
## π What's New in v1.8.0
|
|
29
|
-
|
|
30
|
-
- **Modular Handler Architecture** β `tools/handlers.js` now re-exports focused handler modules, improving maintainability and bundler behavior.
|
|
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.
|
|
35
|
-
|
|
36
|
-
## π Installation
|
|
37
|
-
|
|
38
|
-
### Option 1: Install as Dependency in Your Project (Recommended)
|
|
39
|
-
|
|
40
|
-
Each project gets its own isolated workflow state file.
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm install @programinglive/dev-workflow-mcp-server
|
|
1
|
+
# Dev Workflow MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server yang memaksa kamu mengikuti disiplin development workflow: **test β dokumentasi β commit β release**, tanpa bisa dilewatkan.
|
|
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]
|
|
44
17
|
```
|
|
45
18
|
|
|
46
|
-
|
|
19
|
+
---
|
|
47
20
|
|
|
48
|
-
|
|
21
|
+
## Quick Start β 3 Menit
|
|
22
|
+
|
|
23
|
+
### 1. Clone & Install
|
|
49
24
|
|
|
50
25
|
```bash
|
|
51
26
|
git clone https://github.com/programinglive/dev-workflow-mcp-server.git
|
|
@@ -53,790 +28,400 @@ cd dev-workflow-mcp-server
|
|
|
53
28
|
npm install
|
|
54
29
|
```
|
|
55
30
|
|
|
56
|
-
> **Windows
|
|
31
|
+
> **Windows**: `better-sqlite3` butuh native build. Install [Python 3](https://python.org) + [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) dulu sebelum `npm install`.
|
|
57
32
|
|
|
58
|
-
###
|
|
33
|
+
### 2. Test Server Berjalan
|
|
59
34
|
|
|
60
|
-
|
|
35
|
+
```bash
|
|
36
|
+
node index.js call get_workflow_status
|
|
37
|
+
```
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
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:
|
|
64
|
-
```bash
|
|
65
|
-
cd httpdocs
|
|
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.
|
|
39
|
+
Output:
|
|
73
40
|
|
|
74
|
-
|
|
41
|
+
```
|
|
42
|
+
π Current Workflow Status:
|
|
43
|
+
Phase: idle
|
|
44
|
+
Task: (none)
|
|
45
|
+
Next step: idle
|
|
46
|
+
```
|
|
75
47
|
|
|
76
|
-
|
|
48
|
+
### 3. Hubungkan ke MCP Client
|
|
77
49
|
|
|
78
|
-
|
|
50
|
+
Lihat bagian [Konfigurasi MCP Client](#-konfigurasi-mcp-client) di bawah.
|
|
79
51
|
|
|
80
|
-
|
|
52
|
+
---
|
|
81
53
|
|
|
82
|
-
|
|
83
|
-
1. SSH into your GCP instance
|
|
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
|
|
54
|
+
## π οΈ Available Tools
|
|
88
55
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
56
|
+
| Tool | Fungsi |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `start_task` | Mulai task baru (wajib pertama) |
|
|
59
|
+
| `create_feature_flow` | Catat alur fitur dengan Mermaid |
|
|
60
|
+
| `mark_bug_fixed` | Tandai implementasi selesai |
|
|
61
|
+
| `create_tests` | Tandai tests sudah dibuat |
|
|
62
|
+
| `skip_tests` | Lewati tests dengan alasan |
|
|
63
|
+
| `run_tests` | Catat hasil test (blokir commit jika fail) |
|
|
64
|
+
| `create_documentation` | Tandai docs sudah dibuat |
|
|
65
|
+
| `check_ready_to_commit` | Verifikasi semua step selesai |
|
|
66
|
+
| `commit_and_push` | `git add` β `commit` β `push` otomatis |
|
|
67
|
+
| `perform_release` | Catat release version |
|
|
68
|
+
| `skip_release` | Lewati release (docs-only task) |
|
|
69
|
+
| `complete_task` | Selesai & reset workflow |
|
|
70
|
+
| `get_workflow_status` | Cek fase saat ini |
|
|
71
|
+
| `view_history` | Lihat riwayat task selesai |
|
|
72
|
+
| `run_full_workflow` | Jalankan semua step sekaligus (1 command) |
|
|
73
|
+
| `project_summary` | Ringkasan aktivitas project |
|
|
74
|
+
|
|
75
|
+
### Contoh Percakapan
|
|
94
76
|
|
|
95
|
-
|
|
77
|
+
```
|
|
78
|
+
"Start a new task: add user authentication, type: feature"
|
|
79
|
+
β start_task called, phase moves to coding
|
|
96
80
|
|
|
81
|
+
[kamu ngoding]
|
|
97
82
|
|
|
98
|
-
|
|
83
|
+
"Mark as fixed: login with JWT token"
|
|
84
|
+
β mark_bug_fixed, phase moves to testing
|
|
99
85
|
|
|
100
|
-
|
|
101
|
-
- **Production (built)**: Run `npm run build` once to generate `dist/`. This creates an optimized bundle but isnβt needed for MCP usage.
|
|
86
|
+
[tulis test]
|
|
102
87
|
|
|
103
|
-
|
|
88
|
+
"Create tests done"
|
|
89
|
+
β create_tests
|
|
104
90
|
|
|
105
|
-
|
|
91
|
+
"Run tests: passed=true, command='npm test', details='12 tests passed'"
|
|
92
|
+
β run_tests, phase moves to documentation
|
|
106
93
|
|
|
107
|
-
|
|
94
|
+
"Create docs: type=README, summary='Added auth section'"
|
|
95
|
+
β create_documentation, phase moves to ready_to_commit
|
|
108
96
|
|
|
109
|
-
|
|
97
|
+
"Check if ready to commit"
|
|
98
|
+
β check_ready_to_commit β β
READY
|
|
110
99
|
|
|
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
|
-
```
|
|
100
|
+
"Commit and push: message='feat(auth): add JWT authentication'"
|
|
101
|
+
β commit_and_push (auto git add/commit/push), phase moves to release
|
|
126
102
|
|
|
127
|
-
|
|
103
|
+
"Perform release: command='npm run release:minor'"
|
|
104
|
+
β perform_release, phase moves to ready_to_complete
|
|
128
105
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"mcpServers": {
|
|
132
|
-
"dev-workflow": {
|
|
133
|
-
"command": "node",
|
|
134
|
-
"args": ["<PROJECT_ROOT>/index.js"]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
106
|
+
"Complete task: commitMessage='feat(auth): add JWT authentication'"
|
|
107
|
+
β complete_task, workflow reset to idle
|
|
138
108
|
```
|
|
139
109
|
|
|
140
|
-
|
|
110
|
+
---
|
|
141
111
|
|
|
142
|
-
|
|
112
|
+
## βοΈ Konfigurasi MCP Client
|
|
143
113
|
|
|
144
|
-
|
|
145
|
-
{
|
|
146
|
-
"mcpServers": {
|
|
147
|
-
"dev-workflow": {
|
|
148
|
-
"command": "node",
|
|
149
|
-
"args": ["<PROJECT_ROOT>\\index.js"]
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
```
|
|
114
|
+
### OpenCode
|
|
154
115
|
|
|
155
|
-
|
|
116
|
+
Tambahkan ke `~/.config/opencode/opencode.json`:
|
|
156
117
|
|
|
157
118
|
```json
|
|
158
119
|
{
|
|
159
|
-
"
|
|
120
|
+
"mcp": {
|
|
160
121
|
"dev-workflow": {
|
|
161
|
-
"
|
|
162
|
-
"
|
|
122
|
+
"type": "local",
|
|
123
|
+
"command": ["node", "C:\\path\\to\\dev-workflow-mcp-server\\index.js"],
|
|
124
|
+
"enabled": true
|
|
163
125
|
}
|
|
164
126
|
}
|
|
165
127
|
}
|
|
166
128
|
```
|
|
167
129
|
|
|
168
|
-
|
|
130
|
+
### Claude Desktop
|
|
169
131
|
|
|
170
|
-
|
|
132
|
+
File: `%APPDATA%\Claude\claude_desktop_config.json` (Windows) atau `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
171
133
|
|
|
172
134
|
```json
|
|
173
135
|
{
|
|
174
136
|
"mcpServers": {
|
|
175
137
|
"dev-workflow": {
|
|
176
138
|
"command": "node",
|
|
177
|
-
"args": ["
|
|
139
|
+
"args": ["C:\\path\\to\\dev-workflow-mcp-server\\index.js"]
|
|
178
140
|
}
|
|
179
141
|
}
|
|
180
142
|
}
|
|
181
143
|
```
|
|
182
144
|
|
|
183
|
-
|
|
145
|
+
### Windsurf
|
|
184
146
|
|
|
185
|
-
|
|
186
|
-
{
|
|
187
|
-
"mcpServers": {
|
|
188
|
-
"dev-workflow": {
|
|
189
|
-
"command": "node",
|
|
190
|
-
"args": ["<PROJECT_ROOT>/index.js"]
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
> **Note:** On Windows paths in JSON require escaped backslashes (e.g., `"C:\\path\\to\\project"`).
|
|
197
|
-
|
|
198
|
-
#### Full Windsurf MCP Config Example (macOS)
|
|
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`:
|
|
147
|
+
File: `%APPDATA%\Windsurf\config.json` (Windows) atau `~/Library/Application Support/Windsurf/config.json` (macOS)
|
|
201
148
|
|
|
202
149
|
```json
|
|
203
150
|
{
|
|
204
151
|
"mcpServers": {
|
|
205
152
|
"dev-workflow": {
|
|
206
153
|
"command": "node",
|
|
207
|
-
"cwd": "
|
|
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
|
-
}
|
|
154
|
+
"cwd": "C:\\path\\to\\dev-workflow-mcp-server",
|
|
155
|
+
"args": ["index.js"]
|
|
213
156
|
}
|
|
214
157
|
}
|
|
215
158
|
}
|
|
216
159
|
```
|
|
217
160
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
### 4. Restart Windsurf/Claude Desktop
|
|
221
|
-
|
|
222
|
-
After adding the configuration, restart the application to load the MCP server.
|
|
223
|
-
|
|
161
|
+
### Antigravity
|
|
224
162
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
Antigravity users should configure the MCP server in their `mcp_config.json`.
|
|
228
|
-
|
|
229
|
-
**Windows:** `%APPDATA%\Antigravity\mcp_config.json` or `C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json`
|
|
163
|
+
File: `%APPDATA%\Antigravity\mcp_config.json`
|
|
230
164
|
|
|
231
165
|
```json
|
|
232
166
|
{
|
|
233
167
|
"mcpServers": {
|
|
234
168
|
"dev-workflow": {
|
|
235
169
|
"command": "node",
|
|
236
|
-
"args": ["
|
|
170
|
+
"args": ["C:\\path\\to\\dev-workflow-mcp-server\\index.js"]
|
|
237
171
|
}
|
|
238
172
|
}
|
|
239
173
|
}
|
|
240
174
|
```
|
|
241
175
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
### β‘ Performance Optimization (Recommended)
|
|
176
|
+
> **Performance tip**: Gunakan `node index.js` langsung, jangan `npx`, agar startup lebih cepat.
|
|
245
177
|
|
|
246
|
-
|
|
178
|
+
---
|
|
247
179
|
|
|
248
|
-
|
|
180
|
+
## π§ Configuration
|
|
249
181
|
|
|
250
|
-
|
|
251
|
-
{
|
|
252
|
-
"mcpServers": {
|
|
253
|
-
"dev-workflow": {
|
|
254
|
-
"command": "node",
|
|
255
|
-
"args": ["<PROJECT_ROOT>\\index.js"],
|
|
256
|
-
"env": {
|
|
257
|
-
"DEV_WORKFLOW_USER_ID": "your_user_id"
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
```
|
|
182
|
+
### Database
|
|
263
183
|
|
|
264
|
-
|
|
265
|
-
`Dev Workflow MCP Server running on stdio (startup took 15ms)`
|
|
184
|
+
Default pakai **SQLite** (file-based, zero config). Bisa ganti ke PostgreSQL/MySQL:
|
|
266
185
|
|
|
267
|
-
## βοΈ Configuration
|
|
268
|
-
|
|
269
|
-
### Database Setup
|
|
270
|
-
|
|
271
|
-
The server supports **SQLite** (default), **MySQL**, and **PostgreSQL**.
|
|
272
|
-
|
|
273
|
-
#### Configuration via `.env`
|
|
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
|
-
```
|
|
283
|
-
|
|
284
|
-
#### Configuration via Environment Variables
|
|
285
|
-
Alternatively, export variables directly:.
|
|
286
|
-
|
|
287
|
-
| Variable | Description | Default |
|
|
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` |
|
|
292
|
-
|
|
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
186
|
```bash
|
|
303
|
-
|
|
304
|
-
|
|
187
|
+
# .env atau environment variable
|
|
188
|
+
DEV_WORKFLOW_DB_TYPE=postgres
|
|
189
|
+
DEV_WORKFLOW_DB_URL=postgresql://user:pass@localhost:5432/devworkflow
|
|
305
190
|
```
|
|
306
191
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
#### π€ User ID Handling (Postgres/MySQL)
|
|
315
|
-
These databases use an `INTEGER` column for `user_id`.
|
|
316
|
-
- **Numeric strings** (e.g., `"1"`) are parsed directly into integers.
|
|
317
|
-
- **Non-numeric strings** (e.g., `"programinglive"`) are automatically hashed into a consistent, positive integer to ensure compatibility with the schema while maintaining unique user isolation.
|
|
192
|
+
| Var | Default | Deskripsi |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| `DEV_WORKFLOW_DB_TYPE` | `sqlite` | `sqlite`, `mysql`, atau `postgres` |
|
|
195
|
+
| `DEV_WORKFLOW_DB_URL` | β | Connection string (untuk MySQL/Postgres) |
|
|
196
|
+
| `DEV_WORKFLOW_DB_PATH` | `.state/dev-workflow.db` | Path SQLite (opsional) |
|
|
197
|
+
| `DEV_WORKFLOW_USER_ID` | auto-generated | ID user untuk isolasi multi-user |
|
|
198
|
+
| `DEV_WORKFLOW_STATE_FILE` | auto-resolve | Path override workflow-state.json |
|
|
318
199
|
|
|
200
|
+
### Project-Specific State
|
|
319
201
|
|
|
320
|
-
|
|
202
|
+
Setiap project punya workflow state sendiri di `.state/users/<user-id>/workflow-state.json`. File ini otomatis di-gitignore.
|
|
321
203
|
|
|
322
|
-
|
|
323
|
-
|----------|-------------|
|
|
324
|
-
| `DEV_WORKFLOW_USER_ID` | Override the auto-generated user ID (e.g., set to your name/email) |
|
|
325
|
-
| `DEV_WORKFLOW_STATE_FILE` | Override the location of the `workflow-state.json` file |
|
|
326
|
-
|
|
327
|
-
### Using Multiple Clients (Antigravity & Windsurf)
|
|
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.
|
|
330
|
-
|
|
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
|
-
```json
|
|
335
|
-
{
|
|
336
|
-
"mcpServers": {
|
|
337
|
-
"dev-workflow": {
|
|
338
|
-
"command": "node",
|
|
339
|
-
"args": ["path/to/server/index.js"],
|
|
340
|
-
"env": {
|
|
341
|
-
"DEV_WORKFLOW_USER_ID": "antigravity_user"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
204
|
+
Untuk isolasi multi-client (misal Windsurf + Antigravity pakai state terpisah):
|
|
347
205
|
|
|
348
|
-
**Windsurf Config:**
|
|
349
|
-
Add the environment variable in your Windsurf MCP settings:
|
|
350
206
|
```json
|
|
351
207
|
{
|
|
352
208
|
"mcpServers": {
|
|
353
209
|
"dev-workflow": {
|
|
354
210
|
"command": "node",
|
|
355
|
-
"args": ["path/to/
|
|
356
|
-
"env": {
|
|
357
|
-
"DEV_WORKFLOW_USER_ID": "windsurf_user"
|
|
358
|
-
}
|
|
211
|
+
"args": ["path/to/index.js"],
|
|
212
|
+
"env": { "DEV_WORKFLOW_USER_ID": "windsurf" }
|
|
359
213
|
}
|
|
360
214
|
}
|
|
361
215
|
}
|
|
362
216
|
```
|
|
363
217
|
|
|
218
|
+
---
|
|
364
219
|
|
|
220
|
+
## π§° One-Command Stack Setup (OpenCode V2)
|
|
365
221
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
222
|
+
`scripts/setup-stack.js` installs the whole AI agent stack: the dev-workflow MCP
|
|
223
|
+
server, [obra/superpowers](https://github.com/obra/superpowers) skills, and
|
|
224
|
+
[RTK](https://github.com/rtk-ai/rtk) token compression.
|
|
369
225
|
|
|
370
226
|
```bash
|
|
371
|
-
|
|
227
|
+
node scripts/setup-stack.js # any platform
|
|
372
228
|
```
|
|
373
229
|
|
|
374
|
-
|
|
375
|
-
- Unit tests for workflow logic
|
|
376
|
-
- Integration tests for `.env` configuration
|
|
377
|
-
- DB Adapter tests (SQLite always; MySQL/Postgres if configured)
|
|
230
|
+
Platform wrappers (they only install RTK, run `npm install`, then delegate):
|
|
378
231
|
|
|
379
|
-
|
|
380
|
-
|
|
232
|
+
```powershell
|
|
233
|
+
pwsh scripts/bootstrap-windows.ps1
|
|
234
|
+
```
|
|
381
235
|
|
|
382
236
|
```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
|
|
237
|
+
bash scripts/bootstrap-unix.sh
|
|
390
238
|
```
|
|
391
239
|
|
|
392
|
-
###
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
240
|
+
### What it does
|
|
241
|
+
|
|
242
|
+
1. **Finds the real config directory.** Runs `opencode debug paths` and uses the
|
|
243
|
+
reported `config` path. OpenCode V2 resolves this to `~/.config/opencode` on
|
|
244
|
+
**every** platform, including Windows - `%APPDATA%\opencode` is not read.
|
|
245
|
+
2. **Backs up `opencode.json`** to `secrets/opencode-backup-<timestamp>.json`
|
|
246
|
+
before touching it.
|
|
247
|
+
3. **Registers Superpowers** under the V2 `plugins` key (the V1 `plugin` key is
|
|
248
|
+
deprecated and ignored by V2).
|
|
249
|
+
4. **Registers the MCP server** under `mcp.servers` via `opencode mcp add`, which
|
|
250
|
+
writes a schema-valid `Mcp.LocalConfigEncoded` entry.
|
|
251
|
+
5. **Installs dependencies.** Without `npm install` the server dies at startup
|
|
252
|
+
with `ERR_MODULE_NOT_FOUND: Cannot find package 'dotenv'`.
|
|
253
|
+
6. **Smoke tests the server**, then verifies with `opencode mcp list` and
|
|
254
|
+
`opencode plugin list`. Exits non-zero when any check fails, so a broken
|
|
255
|
+
install can no longer report success.
|
|
256
|
+
7. **Creates `AGENTS.md`** in the current project if missing.
|
|
257
|
+
|
|
258
|
+
### Tests
|
|
402
259
|
|
|
403
260
|
```bash
|
|
404
|
-
npm
|
|
405
|
-
|
|
261
|
+
npm test # full suite
|
|
262
|
+
node --test tests/setup-stack.test.js
|
|
406
263
|
```
|
|
407
264
|
|
|
408
|
-
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
-
|
|
412
|
-
|
|
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.
|
|
265
|
+
`tests/test-helpers.js` exports `stripNpmNotices()`, which removes npm's own
|
|
266
|
+
`npm warn`/`npm notice` chatter and Rollup's third-party annotation warnings from
|
|
267
|
+
captured stderr before the build test asserts on it. Without it, a clean build
|
|
268
|
+
could look broken on machines with a user-level `.npmrc` or with dependency
|
|
269
|
+
versions that emit annotation warnings.
|
|
427
270
|
|
|
428
|
-
###
|
|
271
|
+
### CI
|
|
429
272
|
|
|
430
|
-
|
|
431
|
-
-
|
|
432
|
-
- Performance optimization
|
|
433
|
-
- Embedding in other projects
|
|
273
|
+
`.github/workflows/ci.yml` runs on the **self-hosted runner on MMCH**, not on
|
|
274
|
+
GitHub-hosted minutes:
|
|
434
275
|
|
|
435
|
-
|
|
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\"}"
|
|
276
|
+
```yaml
|
|
277
|
+
runs-on: [self-hosted, windows, mmch]
|
|
463
278
|
```
|
|
464
279
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
## π Project-Specific Workflow State
|
|
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.
|
|
280
|
+
Two jobs:
|
|
478
281
|
|
|
479
|
-
|
|
282
|
+
| Job | Steps |
|
|
283
|
+
|---|---|
|
|
284
|
+
| `test` | `npm ci` β `npm test` β `build:server` β `npm audit --omit=dev --audit-level=high` β setup-stack suite |
|
|
285
|
+
| `web` | `npm ci` in `web/` β static export build β verify `out/index.html` and CSS size β `npm audit --audit-level=high` |
|
|
480
286
|
|
|
481
|
-
|
|
287
|
+
The `web` job exists because the dashboard is deployed to Netlify from `web/`
|
|
288
|
+
and previously had no CI coverage at all. The CSS size check catches a Tailwind
|
|
289
|
+
regression that a green build would otherwise hide.
|
|
482
290
|
|
|
483
|
-
|
|
484
|
-
2. **Set an explicit ID** β Before starting the server, export `DEV_WORKFLOW_USER_ID`:
|
|
291
|
+
A pull request cannot merge green if either job fails.
|
|
485
292
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
export DEV_WORKFLOW_USER_ID=alice
|
|
489
|
-
node index.js
|
|
293
|
+
Runner provisioning and troubleshooting are documented in
|
|
294
|
+
[docs/homelab/ci-runner.md](./docs/homelab/ci-runner.md).
|
|
490
295
|
|
|
491
|
-
|
|
492
|
-
$env:DEV_WORKFLOW_USER_ID = "alice"
|
|
493
|
-
node index.js
|
|
494
|
-
```
|
|
296
|
+
### Dependency hygiene
|
|
495
297
|
|
|
496
|
-
|
|
497
|
-
|
|
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/
|
|
298
|
+
```bash
|
|
299
|
+
npm audit # full tree (production + dev)
|
|
300
|
+
npm audit --omit=dev # production only
|
|
507
301
|
```
|
|
508
302
|
|
|
509
|
-
|
|
303
|
+
Both report `0 vulnerabilities`. `tar` is pinned via `overrides` in
|
|
304
|
+
`package.json`; bump that pin when a new advisory lands rather than relying on
|
|
305
|
+
the transitive range.
|
|
510
306
|
|
|
511
|
-
|
|
307
|
+
The root `tailwindcss` devDependency was removed: it was added when the web
|
|
308
|
+
dashboard still shipped a static HTML page, but that build step no longer
|
|
309
|
+
exists. The dashboard under `web/` has its own Tailwind setup
|
|
310
|
+
(`web/tailwind.config.ts`). The root `tailwind.config.js` pointed `content` at
|
|
311
|
+
`web/public/**/*.{html,js}`, a directory that holds only SVG icons, so it
|
|
312
|
+
generated nothing and was referenced by no script.
|
|
512
313
|
|
|
513
|
-
|
|
314
|
+
---
|
|
514
315
|
|
|
515
|
-
|
|
516
|
-
- `mark_bug_fixed` - Mark the feature/bug as fixed (requires tests next)
|
|
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)
|
|
532
|
-
|
|
533
|
-
### `run_full_workflow`
|
|
534
|
-
|
|
535
|
-
Use this when you already have all the information needed for each workflow phase and want to execute them in one go.
|
|
316
|
+
## Release Workflow
|
|
536
317
|
|
|
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
|
-
}
|
|
552
|
-
```
|
|
318
|
+
`.github/workflows/github-release.yml` runs on a `v*` tag and is split in two:
|
|
553
319
|
|
|
554
|
-
|
|
320
|
+
| Job | Runner | What it does |
|
|
321
|
+
|---|---|---|
|
|
322
|
+
| `build` | self-hosted MMCH | `npm ci` -> `npm test` -> `build:server` -> verify the built bundle starts -> `npm pack` -> upload tarball + metadata |
|
|
323
|
+
| `publish` | `ubuntu-latest` | download tarball -> `npm publish --provenance` -> create/update the GitHub release |
|
|
555
324
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
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`
|
|
325
|
+
**Why publish is not on MMCH:** npm provenance requires a supported cloud CI/CD
|
|
326
|
+
provider with a **cloud-hosted** runner
|
|
327
|
+
([docs](https://docs.npmjs.com/generating-provenance-statements)). A self-hosted
|
|
328
|
+
runner cannot produce an attestation, so `--provenance` would have to be dropped
|
|
329
|
+
and consumers would lose the ability to verify which commit the package was
|
|
330
|
+
built from.
|
|
566
331
|
|
|
567
|
-
|
|
332
|
+
The split keeps the expensive part - install, test, build, pack - on our own
|
|
333
|
+
hardware, and spends hosted minutes only on a single publish step that runs when
|
|
334
|
+
a release tag is pushed. Pull requests never touch the hosted runner.
|
|
568
335
|
|
|
569
|
-
|
|
336
|
+
Publishing authenticates through **npm Trusted Publishing (OIDC)** - no
|
|
337
|
+
`NPM_TOKEN` secret is required, and `id-token: write` plus `registry-url` on
|
|
338
|
+
`setup-node` is the whole configuration.
|
|
570
339
|
|
|
571
|
-
|
|
340
|
+
### What goes into the package
|
|
572
341
|
|
|
573
|
-
|
|
342
|
+
`.npmignore` keeps the published tarball to the runtime server: roughly 60 files
|
|
343
|
+
and 65 kB. It excludes `.env*` (only `.env.example` ships), `.state/`, tests,
|
|
344
|
+
CI config, `web/`, and docs. Without it npm falls back to `.gitignore`, which
|
|
345
|
+
still allows tracked files such as `.env.production` into the tarball.
|
|
574
346
|
|
|
575
|
-
|
|
347
|
+
`scripts/install-husky.js` runs from `prepare`. It installs git hooks only when
|
|
348
|
+
a `.git` directory is present, so installing the package from the registry as a
|
|
349
|
+
dependency does not fail on husky. The `husky || true` idiom is not portable to
|
|
350
|
+
Windows, where npm runs scripts through `cmd.exe`.
|
|
576
351
|
|
|
577
|
-
|
|
578
|
-
- `check_ready_to_commit` and `commit_and_push` have been completed
|
|
579
|
-
- A release has not already been recorded for the active task
|
|
352
|
+
---
|
|
580
353
|
|
|
581
|
-
|
|
354
|
+
## π Homelab Development Guide
|
|
582
355
|
|
|
583
|
-
|
|
584
|
-
2. The guard runs automatically, verifies the workflow state, and records the release before letting you finish with `complete_task`.
|
|
356
|
+
Repo ini juga berisi panduan konfigurasi homelab internal **programinglive** β Tailscale + SSH antar 3 mesin (MMCH, HELLOWORLD, Mac).
|
|
585
357
|
|
|
586
|
-
|
|
358
|
+
| Dokumen | Isi |
|
|
359
|
+
|---|---|
|
|
360
|
+
| [docs/homelab/README.md](./docs/homelab/README.md) | Overview & quick reference |
|
|
361
|
+
| [docs/homelab/infra-tailnet-ssh.md](./docs/homelab/infra-tailnet-ssh.md) | Tailnet + SSH setup lengkap |
|
|
362
|
+
| [docs/homelab/cli-tools.md](./docs/homelab/cli-tools.md) | CLI tools per machine |
|
|
363
|
+
| [docs/homelab/ci-runner.md](./docs/homelab/ci-runner.md) | Self-hosted CI runner di MMCH |
|
|
364
|
+
| [docs/homelab/security-rules.md](./docs/homelab/security-rules.md) | Aturan keamanan |
|
|
365
|
+
| [.agent/workflows/homelab-setup.md](./.agent/workflows/homelab-setup.md) | Workflow MCP untuk onboarding mesin baru |
|
|
587
366
|
|
|
588
|
-
|
|
367
|
+
> β οΈ Repo ini **private**. Jangan bagikan ke publik.
|
|
589
368
|
|
|
590
|
-
|
|
591
|
-
2. In the repository settings, add a secret named **`NPM_TOKEN`** containing that token.
|
|
592
|
-
3. Ensure your release process pushes tags after running `npm run release:<type>` so the workflow triggers.
|
|
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.
|
|
369
|
+
---
|
|
596
370
|
|
|
597
|
-
|
|
371
|
+
## π« What This Server Prevents
|
|
598
372
|
|
|
599
|
-
|
|
373
|
+
- β Commit tanpa tests
|
|
374
|
+
- β Commit dengan tests yang fail
|
|
375
|
+
- β Commit tanpa dokumentasi
|
|
376
|
+
- β Lupa langkah workflow
|
|
377
|
+
- β Release tanpa commit & push
|
|
600
378
|
|
|
601
|
-
|
|
379
|
+
---
|
|
602
380
|
|
|
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.
|
|
381
|
+
## π‘ Tips
|
|
607
382
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
```
|
|
383
|
+
1. Selalu mulai dengan `start_task` β ini yang set intention kamu
|
|
384
|
+
2. Jangan skip tests kecuali darurat β pakai `skip_tests` dengan alasan jelas
|
|
385
|
+
3. Pakai `get_workflow_status` kapanpun untuk cek progress
|
|
386
|
+
4. `run_full_workflow` = shortcut untuk task sederhana yang semua datanya sudah siap
|
|
387
|
+
5. Untuk docs-only task, gunakan `skip_release` daripada memaksakan release
|
|
615
388
|
|
|
616
|
-
|
|
617
|
-
Start a new coding task. This is your first step - be conscious about what you're coding.
|
|
389
|
+
---
|
|
618
390
|
|
|
619
|
-
|
|
620
|
-
- `description` (string, required): Clear description of what you're going to code
|
|
621
|
-
- `type` (enum, required): Type of task - "feature", "bugfix", "refactor", or "other"
|
|
391
|
+
## π§ͺ Run Tests
|
|
622
392
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
Use the start_task tool with:
|
|
626
|
-
- description: "Add user authentication to the login page"
|
|
627
|
-
- type: "feature"
|
|
393
|
+
```bash
|
|
394
|
+
npm test
|
|
628
395
|
```
|
|
629
396
|
|
|
630
|
-
### `mark_bug_fixed`
|
|
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
|
|
646
|
-
|
|
647
|
-
### `run_tests`
|
|
648
|
-
Record test results. **NEVER commit if tests fail!** Only proceed if all tests are green.
|
|
649
|
-
|
|
650
|
-
**Parameters:**
|
|
651
|
-
- `passed` (boolean, required): Did all tests pass?
|
|
652
|
-
- `testCommand` (string, required): The test command that was run
|
|
653
|
-
- `details` (string, optional): Test results details
|
|
654
|
-
|
|
655
|
-
**Example:**
|
|
656
397
|
```
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
398
|
+
βΉ tests 112
|
|
399
|
+
βΉ pass 110
|
|
400
|
+
βΉ fail 0
|
|
401
|
+
βΉ skipped 2
|
|
661
402
|
```
|
|
662
403
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
**Parameters:**
|
|
667
|
-
- `documentationType` (enum, required): "PRD", "README", "RELEASE_NOTES", "inline-comments", "API-docs", "changelog", or "other"
|
|
668
|
-
- `summary` (string, required): What was documented
|
|
669
|
-
|
|
670
|
-
### `check_ready_to_commit`
|
|
671
|
-
Check if all workflow steps are completed and you're ready to commit & push.
|
|
672
|
-
|
|
673
|
-
### `commit_and_push`
|
|
674
|
-
Automatically run `git add`, `git commit`, and `git push` after the ready check passes.
|
|
675
|
-
|
|
676
|
-
**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.
|
|
677
|
-
|
|
678
|
-
**Parameters:**
|
|
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)
|
|
681
|
-
|
|
682
|
-
### `perform_release`
|
|
683
|
-
Record the release after you've committed and pushed. Required before you can complete the task.
|
|
684
|
-
|
|
685
|
-
**Parameters:**
|
|
686
|
-
- `command` (string, required): Release command that was executed (e.g., `npm run release`)
|
|
687
|
-
- `notes` (string, optional): Additional release notes
|
|
688
|
-
|
|
689
|
-
### `complete_task`
|
|
690
|
-
Mark the task as complete after successful commit & push. Resets workflow for next task.
|
|
691
|
-
|
|
692
|
-
**Parameters:**
|
|
693
|
-
- `commitMessage` (string, required): The commit message used
|
|
694
|
-
|
|
695
|
-
### `drop_task`
|
|
696
|
-
Abandon the current task without completing the workflow. Preserves an audit entry with context, then resets the state so you can start fresh.
|
|
697
|
-
|
|
698
|
-
**Parameters:**
|
|
699
|
-
- `reason` (string, optional): Additional detail about why the task was dropped
|
|
700
|
-
|
|
701
|
-
### `get_workflow_status`
|
|
702
|
-
Get current workflow status and what needs to be done next.
|
|
703
|
-
|
|
704
|
-
### `view_history`
|
|
705
|
-
View workflow history of completed tasks.
|
|
706
|
-
|
|
707
|
-
**Parameters:**
|
|
708
|
-
- `limit` (number, optional): Number of recent tasks to show (default: 10)
|
|
709
|
-
|
|
710
|
-
## π Available Prompts
|
|
711
|
-
|
|
712
|
-
### `workflow_reminder`
|
|
713
|
-
Get a complete reminder of the development workflow discipline.
|
|
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
|
|
404
|
+
The two skipped tests are the MySQL and PostgreSQL adapters, which need a real
|
|
405
|
+
database connection (`MYSQL_URL` / `PG_URL`). Everything else, including the
|
|
406
|
+
SQLite adapter, runs.
|
|
730
407
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
```
|
|
408
|
+
If a Windows install fails on a native module, it is almost always a missing
|
|
409
|
+
prebuild for your Node ABI rather than a broken test - see
|
|
410
|
+
[docs/homelab/ci-runner.md](./docs/homelab/ci-runner.md#troubleshooting).
|
|
735
411
|
|
|
736
|
-
|
|
737
|
-
- Write your tests
|
|
738
|
-
- The server will remind you this is mandatory!
|
|
412
|
+
---
|
|
739
413
|
|
|
740
|
-
|
|
741
|
-
```
|
|
742
|
-
"Record test results: passed=true, command='npm test'"
|
|
743
|
-
```
|
|
744
|
-
- If tests fail, the server will **block** you from proceeding!
|
|
414
|
+
## π¦ Build
|
|
745
415
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
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
|
-
```
|
|
775
|
-
|
|
776
|
-
## π― Key Features
|
|
777
|
-
|
|
778
|
-
- **Enforces discipline**: Won't let you skip steps
|
|
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
|
|
784
|
-
|
|
785
|
-
## π« What This Server Prevents
|
|
786
|
-
|
|
787
|
-
- β Committing without tests
|
|
788
|
-
- β Committing with failing tests
|
|
789
|
-
- β Committing without documentation
|
|
790
|
-
- β Losing track of what you're working on
|
|
791
|
-
- β Skipping important workflow steps
|
|
792
|
-
|
|
793
|
-
## π‘ Tips
|
|
794
|
-
|
|
795
|
-
1. **Always start with `start_task`** - This sets your intention
|
|
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
|
|
800
|
-
|
|
801
|
-
## π§ Customization
|
|
802
|
-
|
|
803
|
-
You can modify the workflow in `index.js`:
|
|
804
|
-
- Add more workflow phases
|
|
805
|
-
- Customize reminders
|
|
806
|
-
- Add integration with your test runner
|
|
807
|
-
- Add custom validation rules
|
|
808
|
-
|
|
809
|
-
## π State Management
|
|
810
|
-
|
|
811
|
-
The server maintains state in `.state/workflow-state.json`:
|
|
812
|
-
- Current phase
|
|
813
|
-
- Task description
|
|
814
|
-
- Completion status of each step
|
|
815
|
-
- History of completed tasks
|
|
816
|
-
|
|
817
|
-
This file is automatically created and managed by the server.
|
|
818
|
-
It contains local, machine-specific progress and is ignored by git so each environment can manage its own workflow history without cross-contamination.
|
|
416
|
+
```bash
|
|
417
|
+
npm run build # β dist/index.mjs (optimized bundle)
|
|
418
|
+
npm run web # β dashboard di http://localhost:3111
|
|
419
|
+
```
|
|
819
420
|
|
|
820
|
-
|
|
421
|
+
Build outputδΈ»θ¦η¨δΊ npm distribution. Untuk MCP usage, gunakan source `index.js` langsung (lebih cepat startup).
|
|
821
422
|
|
|
822
|
-
|
|
823
|
-
- β
Enforces test-first discipline
|
|
824
|
-
- β
Prevents commits with failing tests
|
|
825
|
-
- β
Reminds about documentation
|
|
826
|
-
- β
Tracks workflow state
|
|
827
|
-
- β
Maintains history
|
|
423
|
+
---
|
|
828
424
|
|
|
829
425
|
## π License
|
|
830
426
|
|
|
831
427
|
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)
|