@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/tools/definitions.js
CHANGED
|
@@ -35,6 +35,25 @@ export function getToolList() {
|
|
|
35
35
|
required: ["summary"],
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
name: "create_feature_flow",
|
|
40
|
+
description:
|
|
41
|
+
"Record the feature flow using Mermaid syntax. This helps visualize the implementation plan.",
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
mermaidCode: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "The Mermaid code representing the feature flow",
|
|
48
|
+
},
|
|
49
|
+
description: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "A brief description of this flow",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ["mermaidCode", "description"],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
38
57
|
{
|
|
39
58
|
name: "create_tests",
|
|
40
59
|
description: "Mark that tests covering the change have been created.",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { textResponse, isReleaseSatisfied, formatChecklist
|
|
1
|
+
import { textResponse, isReleaseSatisfied, formatChecklist } from "./shared.js";
|
|
2
|
+
import { handleReadyCheck } from "./status-handlers.js";
|
|
2
3
|
import { containsTestFilesInStatus } from "../../git-helpers.js";
|
|
3
4
|
|
|
4
5
|
export async function handleCommitAndPush(args, context) {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { textResponse, isReleaseSatisfied } from "./shared.js";
|
|
2
|
-
import { handleStartTask, handleMarkBugFixed, handleCreateTests, handleSkipTests, handleRunTests, handleCreateDocumentation } from "./workflow-handlers.js";
|
|
1
|
+
import { textResponse, isReleaseSatisfied, isErrorResponse } from "./shared.js";
|
|
2
|
+
import { handleStartTask, handleMarkBugFixed, handleCreateTests, handleSkipTests, handleRunTests, handleCreateDocumentation, handleCreateFeatureFlow } from "./workflow-handlers.js";
|
|
3
3
|
import { handleSkipRelease, handlePerformRelease } from "./release-handlers.js";
|
|
4
4
|
import { handleCommitAndPush, handleCompleteTask, handleForceCompleteTask, handleDropTask } from "./commit-handlers.js";
|
|
5
5
|
import { handleProjectSummary, handleProjectSummaryData, handleProjectSummaryDb, handleViewHistory } from "./summary-handlers.js";
|
|
6
6
|
import { handleGetWorkflowStatus, handleReadyCheck, handleContinueWorkflow, handleRerunWorkflow } from "./status-handlers.js";
|
|
7
7
|
|
|
8
|
-
function isErrorResponse(response) {
|
|
9
|
-
const text = response?.content?.[0]?.text || "";
|
|
10
|
-
return /^\s*[⚠️❌]/u.test(text);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
8
|
function summarizeResponse(label, response) {
|
|
14
9
|
const text = response?.content?.[0]?.text || "";
|
|
15
10
|
const firstLine = text.split("\n")[0] || "";
|
|
@@ -84,6 +79,15 @@ async function handleRunFullWorkflow(args, { workflowState, exec, git, utils })
|
|
|
84
79
|
continue;
|
|
85
80
|
}
|
|
86
81
|
|
|
82
|
+
if (!state.featureFlowCreated) {
|
|
83
|
+
if (!args.mermaidCode || !args.featureFlowDescription) {
|
|
84
|
+
return textResponse("⚠️ 'run_full_workflow' now requires 'mermaidCode' and 'featureFlowDescription' to support the Mermaid step.");
|
|
85
|
+
}
|
|
86
|
+
const resp = await executeStep("create_feature_flow", handleCreateFeatureFlow, [{ mermaidCode: args.mermaidCode, description: args.featureFlowDescription }, workflowState]);
|
|
87
|
+
if (isErrorResponse(resp)) return resp;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
|
|
87
91
|
if (!state.testsCreated) {
|
|
88
92
|
const resp = await executeStep("create_tests", handleCreateTests, [workflowState]);
|
|
89
93
|
if (isErrorResponse(resp)) return resp;
|
|
@@ -172,6 +176,8 @@ export async function handleToolCall({
|
|
|
172
176
|
return handleStartTask(args, workflowState);
|
|
173
177
|
case "mark_bug_fixed":
|
|
174
178
|
return handleMarkBugFixed(args, workflowState);
|
|
179
|
+
case "create_feature_flow":
|
|
180
|
+
return handleCreateFeatureFlow(args, workflowState);
|
|
175
181
|
case "create_tests":
|
|
176
182
|
return handleCreateTests(workflowState);
|
|
177
183
|
case "skip_tests":
|
|
@@ -21,6 +21,11 @@ export function isReleaseSatisfied(state) {
|
|
|
21
21
|
return Boolean(state?.released || state?.releaseSkipped);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export function isErrorResponse(response) {
|
|
25
|
+
const text = response?.content?.[0]?.text || "";
|
|
26
|
+
return /^\s*[⚠️❌]/u.test(text);
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
export async function resetToCommitIfWorkingChanges(workflowState, git) {
|
|
25
30
|
if (!workflowState.state.commitAndPushCompleted) {
|
|
26
31
|
return false;
|
|
@@ -92,7 +97,7 @@ export function getContinueGuidance(status) {
|
|
|
92
97
|
switch (status.currentPhase) {
|
|
93
98
|
case "coding": {
|
|
94
99
|
const task = status.taskDescription ? ` "${status.taskDescription}"` : "";
|
|
95
|
-
return `
|
|
100
|
+
return `Describe your feature flow with Mermaid using 'create_feature_flow', then finish implementing${task} and run 'mark_bug_fixed' with a brief summary of the change.`;
|
|
96
101
|
}
|
|
97
102
|
case "testing":
|
|
98
103
|
if (!status.testsCreated) {
|
|
@@ -127,45 +132,6 @@ export function getContinueGuidance(status) {
|
|
|
127
132
|
}
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
export async function handleReadyCheck(workflowState) {
|
|
131
|
-
const status = workflowState.state;
|
|
132
|
-
const testsCreatedDone = status.testsSkipped || status.testsCreated;
|
|
133
|
-
const testsPassedDone = status.testsSkipped || status.testsPassed;
|
|
134
|
-
const checks = [
|
|
135
|
-
{ name: "Task started", done: status.currentPhase !== "idle" },
|
|
136
|
-
{ name: "Feature/bug fixed", done: status.bugFixed },
|
|
137
|
-
{
|
|
138
|
-
name: status.testsSkipped ? "Tests skipped (manual QA documented)" : "Tests created",
|
|
139
|
-
done: testsCreatedDone,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: status.testsSkipped ? "Tests skipped acknowledged" : "Tests passed",
|
|
143
|
-
done: testsPassedDone,
|
|
144
|
-
},
|
|
145
|
-
{ name: "Documentation created", done: status.documentationCreated },
|
|
146
|
-
];
|
|
147
|
-
|
|
148
|
-
const allDone = checks.every((c) => c.done);
|
|
149
|
-
const checkList = formatChecklist(checks);
|
|
150
|
-
|
|
151
|
-
workflowState.state.readyCheckCompleted = allDone;
|
|
152
|
-
if (allDone) {
|
|
153
|
-
if (workflowState.state.commitAndPushCompleted) {
|
|
154
|
-
workflowState.state.currentPhase = isReleaseSatisfied(workflowState.state) ? "ready_to_complete" : "release";
|
|
155
|
-
} else {
|
|
156
|
-
workflowState.state.currentPhase = "commit";
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
await workflowState.save();
|
|
160
|
-
|
|
161
|
-
if (allDone) {
|
|
162
|
-
return textResponse(
|
|
163
|
-
`🎉 ALL CHECKS PASSED!\n\n${checkList}\n\n✅ Next actions:\n1. Run 'commit_and_push' (commits and pushes your changes)\n2. Run 'perform_release' (handles versioning, tags, and final push)\n3. Finish with 'complete_task'\n\nTip: Provide the optional 'branch' argument to 'commit_and_push' to push to a non-default branch.\n\nTask: ${status.taskDescription}`
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return textResponse(`⚠️ NOT READY TO COMMIT!\n\n${checkList}\n\nPlease complete all steps before committing.`);
|
|
168
|
-
}
|
|
169
135
|
|
|
170
136
|
export async function loadProjectSummary(workflowState) {
|
|
171
137
|
const summaryPath = path.join(path.dirname(workflowState.stateFile), PROJECT_SUMMARY_FILENAME);
|
|
@@ -180,7 +146,7 @@ export async function loadProjectSummary(workflowState) {
|
|
|
180
146
|
}
|
|
181
147
|
}
|
|
182
148
|
|
|
183
|
-
export const prdPath = path.join(__dirname, "..", "
|
|
149
|
+
export const prdPath = path.join(__dirname, "..", "..", "docs", "PRD.md");
|
|
184
150
|
|
|
185
151
|
export function ensurePrdExists() {
|
|
186
152
|
return existsSync(prdPath);
|
|
@@ -10,6 +10,7 @@ export function handleGetWorkflowStatus(workflowState) {
|
|
|
10
10
|
|
|
11
11
|
Phase: ${status.currentPhase}
|
|
12
12
|
Task: ${status.taskDescription || "(none)"}
|
|
13
|
+
Feature flow: ${status.featureFlowCreated ? "✅" : "❌"}
|
|
13
14
|
Bug fixed: ${status.bugFixed ? "✅" : "❌"}
|
|
14
15
|
Tests created: ${status.testsCreated ? "✅" : "❌"}
|
|
15
16
|
Tests passed: ${status.testsPassed ? "✅" : "❌"}
|
|
@@ -28,6 +29,7 @@ export async function handleReadyCheck(workflowState) {
|
|
|
28
29
|
const testsPassedDone = status.testsSkipped || status.testsPassed;
|
|
29
30
|
const checks = [
|
|
30
31
|
{ name: "Task started", done: status.currentPhase !== "idle" },
|
|
32
|
+
{ name: "Feature flow described", done: status.featureFlowCreated },
|
|
31
33
|
{ name: "Feature/bug fixed", done: status.bugFixed },
|
|
32
34
|
{
|
|
33
35
|
name: status.testsSkipped ? "Tests skipped (manual QA documented)" : "Tests created",
|
|
@@ -129,6 +131,6 @@ export async function handleRerunWorkflow(workflowState) {
|
|
|
129
131
|
await workflowState.save();
|
|
130
132
|
|
|
131
133
|
return textResponse(
|
|
132
|
-
`🔄 Rerunning workflow from the start!\n\nTask: ${currentDescription}\nType: ${currentType}\n\nWorkflow Steps:\n1. ✓ Start task (current)\n2. ⏳ Fix/implement the feature\
|
|
134
|
+
`🔄 Rerunning workflow from the start!\n\nTask: ${currentDescription}\nType: ${currentType}\n\nWorkflow Steps:\n1. ✓ Start task (current)\n2. ⏳ Describe feature flow with Mermaid\n3. ⏳ Fix/implement the feature\n4. ⏳ Create tests\n5. ⏳ Run tests (must pass!)\n6. ⏳ Create documentation\n7. ⏳ Run 'check_ready_to_commit'\n8. ⏳ Run 'commit_and_push' (commits and pushes)\n9. ⏳ Run 'perform_release' (handles versioning and tags)\n10. ⏳ Complete task\n\n🎯 Be conscious about what you're coding!`
|
|
133
135
|
);
|
|
134
136
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { existsSync } from "fs";
|
|
3
|
-
import { textResponse, isReleaseSatisfied, resetToCommitIfWorkingChanges } from "./shared.js";
|
|
1
|
+
import { textResponse, isReleaseSatisfied, isErrorResponse, ensurePrdExists } from "./shared.js";
|
|
4
2
|
|
|
5
3
|
export async function handleStartTask(args, workflowState) {
|
|
6
4
|
workflowState.reset();
|
|
@@ -15,7 +13,7 @@ export async function handleStartTask(args, workflowState) {
|
|
|
15
13
|
await workflowState.save();
|
|
16
14
|
|
|
17
15
|
return textResponse(
|
|
18
|
-
`✅ Task Started: ${args.description}\n\n🎯 Be conscious about what you're coding!\n\nWorkflow Steps:\n1. ✓ Start task (current)\n2. ⏳ Fix/implement the feature\
|
|
16
|
+
`✅ Task Started: ${args.description}\n\n🎯 Be conscious about what you're coding!\n\nWorkflow Steps:\n1. ✓ Start task (current)\n2. ⏳ Describe feature flow with Mermaid\n3. ⏳ Fix/implement the feature\n4. ⏳ Create tests\n5. ⏳ Run tests (must pass!)\n6. ⏳ Create documentation\n7. ⏳ Run 'check_ready_to_commit'\n8. ⏳ Run 'commit_and_push' (commits and pushes)\n9. ⏳ Run 'perform_release' (handles versioning and tags) or 'skip_release' (when no release is needed)\n10. ⏳ Complete task\n\nReminder: Focus on writing clean, maintainable code!`
|
|
19
17
|
);
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -67,6 +65,29 @@ export async function handleMarkBugFixed(args, workflowState) {
|
|
|
67
65
|
);
|
|
68
66
|
}
|
|
69
67
|
|
|
68
|
+
export async function handleCreateFeatureFlow(args, workflowState) {
|
|
69
|
+
if (workflowState.state.currentPhase === "idle") {
|
|
70
|
+
return textResponse("⚠️ Please start a task first using 'start_task'!");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const mermaidCode = typeof args.mermaidCode === "string" ? args.mermaidCode.trim() : "";
|
|
74
|
+
const description = typeof args.description === "string" ? args.description.trim() : "";
|
|
75
|
+
|
|
76
|
+
if (!mermaidCode || !description) {
|
|
77
|
+
return textResponse("⚠️ Please provide both 'mermaidCode' and 'description' when creating a feature flow.");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
workflowState.state.featureFlowCreated = true;
|
|
81
|
+
workflowState.state.mermaidCode = mermaidCode;
|
|
82
|
+
workflowState.state.featureFlowDescription = description;
|
|
83
|
+
workflowState.state.readyCheckCompleted = false;
|
|
84
|
+
await workflowState.save();
|
|
85
|
+
|
|
86
|
+
return textResponse(
|
|
87
|
+
`✅ Feature flow recorded!\n\nDescription: ${description}\n\nNext Steps:\n1. ✓ Start task\n2. ✓ Describe feature flow\n3. ⏳ Fix/implement the feature\n4. ⏳ Create tests\n5. ⏳ Run tests\n6. ⏳ Create documentation\n7. ⏳ Run 'check_ready_to_commit'\n8. ⏳ Run 'commit_and_push'\n9. ⏳ Run 'perform_release'\n10. ⏳ Complete task`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
70
91
|
export async function handleCreateTests(workflowState) {
|
|
71
92
|
if (!workflowState.state.bugFixed) {
|
|
72
93
|
return textResponse("⚠️ Please mark your feature/bug as fixed first using 'mark_bug_fixed'!");
|
|
@@ -190,10 +211,7 @@ export async function handleCreateDocumentation(args, workflowState) {
|
|
|
190
211
|
return textResponse("⚠️ Please ensure tests are passing first! Run 'run_tests' with passed=true.");
|
|
191
212
|
}
|
|
192
213
|
|
|
193
|
-
|
|
194
|
-
const prdExists = existsSync(prdPath);
|
|
195
|
-
|
|
196
|
-
if (!prdExists) {
|
|
214
|
+
if (!ensurePrdExists()) {
|
|
197
215
|
return textResponse(
|
|
198
216
|
`⚠️ PRD file not found!\n\nExpected location: docs/PRD.md\n\nPlease create or update the PRD before marking documentation as complete.`
|
|
199
217
|
);
|
package/workflow-state.js
CHANGED
|
@@ -447,6 +447,8 @@ export class WorkflowState {
|
|
|
447
447
|
commitAndPushCompleted: false,
|
|
448
448
|
lastCommitMessage: "",
|
|
449
449
|
lastPushBranch: "",
|
|
450
|
+
featureFlowCreated: false,
|
|
451
|
+
featureFlowDescription: "",
|
|
450
452
|
history: [],
|
|
451
453
|
taskType: "",
|
|
452
454
|
};
|
|
@@ -500,6 +502,12 @@ export class WorkflowState {
|
|
|
500
502
|
if (typeof this.state.lastPushBranch !== "string") {
|
|
501
503
|
this.state.lastPushBranch = "";
|
|
502
504
|
}
|
|
505
|
+
if (typeof this.state.featureFlowCreated !== "boolean") {
|
|
506
|
+
this.state.featureFlowCreated = false;
|
|
507
|
+
}
|
|
508
|
+
if (typeof this.state.featureFlowDescription !== "string") {
|
|
509
|
+
this.state.featureFlowDescription = "";
|
|
510
|
+
}
|
|
503
511
|
} catch (error) {
|
|
504
512
|
if (error?.code !== "ENOENT") {
|
|
505
513
|
throw error;
|
|
@@ -637,6 +645,8 @@ export class WorkflowState {
|
|
|
637
645
|
commitAndPushCompleted: false,
|
|
638
646
|
lastCommitMessage: "",
|
|
639
647
|
lastPushBranch: "",
|
|
648
|
+
featureFlowCreated: false,
|
|
649
|
+
featureFlowDescription: "",
|
|
640
650
|
history: this.state.history,
|
|
641
651
|
};
|
|
642
652
|
}
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Bug fix workflow using dev-workflow MCP server
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Bug Fix Workflow
|
|
6
|
-
|
|
7
|
-
This workflow guides you through fixing bugs with the dev-workflow MCP server, ensuring proper testing and documentation.
|
|
8
|
-
|
|
9
|
-
## When to Use
|
|
10
|
-
|
|
11
|
-
- Fixing defects
|
|
12
|
-
-修复 unexpected behavior
|
|
13
|
-
- Addressing user-reported issues
|
|
14
|
-
- Fixing regressions
|
|
15
|
-
|
|
16
|
-
## Workflow Steps
|
|
17
|
-
|
|
18
|
-
### 1. Start the Task
|
|
19
|
-
|
|
20
|
-
Begin by defining the bug:
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
Use start_task tool:
|
|
24
|
-
- description: "Fix [bug description]"
|
|
25
|
-
- type: "bugfix"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. Reproduce and Fix
|
|
29
|
-
|
|
30
|
-
1. **Reproduce** the bug locally
|
|
31
|
-
2. **Identify** the root cause
|
|
32
|
-
3. **Fix** the issue
|
|
33
|
-
4. **Verify** the fix works
|
|
34
|
-
|
|
35
|
-
Tips:
|
|
36
|
-
- Document expected vs actual behavior
|
|
37
|
-
- Take notes on the root cause
|
|
38
|
-
- Test edge cases
|
|
39
|
-
|
|
40
|
-
### 3. Mark as Fixed
|
|
41
|
-
|
|
42
|
-
Once the fix is implemented:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
Use mark_bug_fixed tool:
|
|
46
|
-
- summary: "[Brief description of the fix]"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### 4. Create Regression Tests
|
|
50
|
-
|
|
51
|
-
**Critical:** Write tests that would have caught this bug!
|
|
52
|
-
|
|
53
|
-
Create regression tests:
|
|
54
|
-
- Test the specific bug scenario
|
|
55
|
-
- Test edge cases around the bug
|
|
56
|
-
- Update existing tests if needed
|
|
57
|
-
|
|
58
|
-
Then mark tests as created:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
Use create_tests tool
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### 5. Run Tests
|
|
65
|
-
|
|
66
|
-
// turbo
|
|
67
|
-
Execute your test suite:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npm test
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Ensure the new regression tests pass:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
Use run_tests tool:
|
|
77
|
-
- passed: true
|
|
78
|
-
- testCommand: "npm test"
|
|
79
|
-
- details: "[Include regression test results]"
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 6. Document the Fix
|
|
83
|
-
|
|
84
|
-
Update documentation:
|
|
85
|
-
- **CHANGELOG** - Add bug fix entry
|
|
86
|
-
- **Code comments** - Explain why the fix was necessary
|
|
87
|
-
- **Issue tracker** - Reference issue number
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Use create_documentation tool:
|
|
91
|
-
- documentationType: "changelog"
|
|
92
|
-
- summary: "[What you documented]"
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 7. Commit and Push
|
|
96
|
-
|
|
97
|
-
Use conventional commit with `fix` type:
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
Use commit_and_push tool:
|
|
101
|
-
- commitMessage: "fix([scope]): [description]"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Examples:
|
|
105
|
-
- `fix(auth): prevent token expiration edge case`
|
|
106
|
-
- `fix(ui): correct button alignment on mobile`
|
|
107
|
-
|
|
108
|
-
### 8. Perform Release
|
|
109
|
-
|
|
110
|
-
Bug fixes are patch releases:
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
Use perform_release tool:
|
|
114
|
-
- command: "npm run release:patch"
|
|
115
|
-
- notes: "v[X.Y.Z] - Bugfix for [issue]"
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### 9. Complete Task
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
Use complete_task tool:
|
|
122
|
-
- commitMessage: "fix([scope]): [description]"
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Example: Date Formatting Bug
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
1. start_task:
|
|
129
|
-
description: "Fix incorrect date format in transaction history"
|
|
130
|
-
type: "bugfix"
|
|
131
|
-
|
|
132
|
-
2. [Reproduce bug, find issue in formatDate.js, implement fix]
|
|
133
|
-
|
|
134
|
-
3. mark_bug_fixed:
|
|
135
|
-
summary: "Corrected date formatting to use ISO 8601 format"
|
|
136
|
-
|
|
137
|
-
4. [Write regression test in formatDate.test.js]
|
|
138
|
-
|
|
139
|
-
5. create_tests
|
|
140
|
-
|
|
141
|
-
6. Run: npm test
|
|
142
|
-
|
|
143
|
-
7. run_tests:
|
|
144
|
-
passed: true
|
|
145
|
-
testCommand: "npm test -- utils/formatDate.test.js"
|
|
146
|
-
details: "2 new regression tests pass, all 45 tests pass"
|
|
147
|
-
|
|
148
|
-
8. [Update CHANGELOG.md with fix entry]
|
|
149
|
-
|
|
150
|
-
9. create_documentation:
|
|
151
|
-
documentationType: "changelog"
|
|
152
|
-
summary: "Added bug fix entry for date formatting issue"
|
|
153
|
-
|
|
154
|
-
10. commit_and_push:
|
|
155
|
-
commitMessage: "fix(utils): correct date formatting to use ISO 8601"
|
|
156
|
-
|
|
157
|
-
11. perform_release:
|
|
158
|
-
command: "npm run release:patch"
|
|
159
|
-
notes: "v1.2.1 - Date formatting hotfix"
|
|
160
|
-
|
|
161
|
-
12. complete_task:
|
|
162
|
-
commitMessage: "fix(utils): correct date formatting to use ISO 8601"
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## Handling Test Failures
|
|
166
|
-
|
|
167
|
-
If tests fail during development:
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
run_tests:
|
|
171
|
-
passed: false
|
|
172
|
-
testCommand: "npm test"
|
|
173
|
-
details: "3 tests failed in auth module"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Response:
|
|
177
|
-
```
|
|
178
|
-
❌ Tests FAILED!
|
|
179
|
-
🚫 Cannot proceed with failing tests
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Fix the issues, then re-run:
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
run_tests:
|
|
186
|
-
passed: true
|
|
187
|
-
testCommand: "npm test"
|
|
188
|
-
details: "All tests now pass"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## Quick Reference
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
1. start_task → 2. Reproduce & fix → 3. mark_bug_fixed
|
|
195
|
-
→ 4. Write regression tests → 5. create_tests → 6. run_tests
|
|
196
|
-
→ 7. Document → 8. create_documentation → 9. commit_and_push
|
|
197
|
-
→ 10. perform_release → 11. complete_task
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Tips
|
|
201
|
-
|
|
202
|
-
- **Regression tests** - Always write tests that would catch this bug
|
|
203
|
-
- **Root cause** - Fix the underlying issue, not just symptoms
|
|
204
|
-
- **Documentation** - Update CHANGELOG for user visibility
|
|
205
|
-
- **Patch versions** - Bug fixes bump patch version (X.Y.Z)
|
|
206
|
-
- **Conventional commits** - Use `fix` prefix
|
|
207
|
-
|
|
208
|
-
## Hotfix Workflow
|
|
209
|
-
|
|
210
|
-
For critical production bugs:
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
start_task:
|
|
214
|
-
description: "HOTFIX: [critical issue]"
|
|
215
|
-
type: "bugfix"
|
|
216
|
-
|
|
217
|
-
[Implement minimal fix]
|
|
218
|
-
|
|
219
|
-
mark_bug_fixed:
|
|
220
|
-
summary: "[Fix description]"
|
|
221
|
-
|
|
222
|
-
[Focused regression test]
|
|
223
|
-
|
|
224
|
-
create_tests
|
|
225
|
-
|
|
226
|
-
run_tests:
|
|
227
|
-
passed: true
|
|
228
|
-
testCommand: "npm test -- [critical-path]"
|
|
229
|
-
details: "[Critical tests pass]"
|
|
230
|
-
|
|
231
|
-
create_documentation:
|
|
232
|
-
documentationType: "changelog"
|
|
233
|
-
summary: "HOTFIX: [issue] - [fix]"
|
|
234
|
-
|
|
235
|
-
commit_and_push:
|
|
236
|
-
commitMessage: "fix([scope])!: HOTFIX - [description]"
|
|
237
|
-
|
|
238
|
-
perform_release:
|
|
239
|
-
command: "npm run release:patch"
|
|
240
|
-
notes: "v[X.Y.Z] - HOTFIX: [issue]"
|
|
241
|
-
|
|
242
|
-
complete_task:
|
|
243
|
-
commitMessage: "fix([scope])!: HOTFIX - [description]"
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## Need Help?
|
|
247
|
-
|
|
248
|
-
- `get_workflow_status` - Check current phase
|
|
249
|
-
- [EXAMPLES.md](../docs/antigravity/EXAMPLES.md) - Detailed examples
|
|
250
|
-
- [TROUBLESHOOTING.md](../docs/antigravity/TROUBLESHOOTING.md) - Common issues
|