@programinglive/dev-workflow-mcp-server 1.0.0 โ†’ 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve
4
+ labels: bug
5
+ ---
6
+
7
+ ## Describe the bug
8
+
9
+ A clear and concise description of what the bug is.
10
+
11
+ ## To Reproduce
12
+
13
+ Steps to reproduce the behavior:
14
+ 1. Go to '...'
15
+ 2. Run command '...'
16
+ 3. See error
17
+
18
+ ## Expected behavior
19
+
20
+ A clear and concise description of what you expected to happen.
21
+
22
+ ## Screenshots / Logs
23
+
24
+ If applicable, add screenshots or paste logs to help explain your problem.
25
+
26
+ ## Environment (please complete the following information):
27
+
28
+ - OS: [e.g. macOS 14.5]
29
+ - Node version: [e.g. 20.14.0]
30
+ - npm version: [e.g. 10.8.2]
31
+
32
+ ## Additional context
33
+
34
+ Add any other context about the problem here.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest an idea for this project
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Summary
8
+
9
+ Describe the feature you'd like to see added.
10
+
11
+ ## Problem Statement
12
+
13
+ What problem does this feature solve? Why is it important?
14
+
15
+ ## Proposed Solution
16
+
17
+ Describe how you think this should work.
18
+
19
+ ## Alternatives Considered
20
+
21
+ List any alternative solutions or features you've considered.
22
+
23
+ ## Additional context
24
+
25
+ Add any other context, screenshots, or references about the feature request here.
@@ -0,0 +1,22 @@
1
+ # Summary
2
+
3
+ - Describe the changes introduced by this PR.
4
+ - Reference any related issues (e.g., `Closes #123`).
5
+
6
+ # Testing
7
+
8
+ - [ ] `npm test`
9
+ - [ ] Other (specify):
10
+
11
+ # Documentation
12
+
13
+ - [ ] README updated
14
+ - [ ] Other docs updated (specify):
15
+
16
+ # Checklist
17
+
18
+ - [ ] Followed the development workflow enforced by the MCP server
19
+ - [ ] Added/updated tests as needed
20
+ - [ ] Verified single data/event/command/effect/validation/permission/authorization/error/success/warning/info flows remain intact
21
+ - [ ] Removed unused imports and console statements
22
+ - [ ] Ready for review
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ npx --no -- commitlint --edit "$1"
@@ -0,0 +1 @@
1
+ npm test
package/CHANGELOG.md ADDED
@@ -0,0 +1,61 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.0.2](https://github.com/programinglive/dev-workflow-mcp-server/compare/v1.0.1...v1.0.2) (2025-10-19)
6
+
7
+
8
+ ### ๐Ÿ› Bug Fixes
9
+
10
+ * guard run_tests arguments ([2004c59](https://github.com/programinglive/dev-workflow-mcp-server/commit/2004c590fabe359d068122cf240a731382f81ca0))
11
+ * normalize tool call arguments ([44d5a3d](https://github.com/programinglive/dev-workflow-mcp-server/commit/44d5a3d35f191012445fa02cee6254afbc993c98))
12
+
13
+
14
+ ### ๐Ÿ“ Documentation
15
+
16
+ * clarify tool argument requirements ([4528614](https://github.com/programinglive/dev-workflow-mcp-server/commit/45286146661ad850eccb04849c11819e91ddd580))
17
+
18
+ ### [1.0.1](https://github.com/programinglive/dev-workflow-mcp-server/compare/v1.0.0...v1.0.1) (2025-10-18)
19
+
20
+
21
+ ### ๐Ÿงน Chores
22
+
23
+ * configure release tooling ([772fc64](https://github.com/programinglive/dev-workflow-mcp-server/commit/772fc6400fb7d2d481992f6f03f25c094cb3924c))
24
+
25
+ ## 1.0.0 (2025-10-18)
26
+
27
+
28
+ ### โœจ Features
29
+
30
+ * initial release ([9bd5835](https://github.com/programinglive/dev-workflow-mcp-server/commit/9bd5835af92776d9247efa50238ac5d71b00b492))
31
+
32
+
33
+ ### ๐Ÿ“ Documentation
34
+
35
+ * add governance and contribution guidelines ([cfa78ea](https://github.com/programinglive/dev-workflow-mcp-server/commit/cfa78ea592788257f703d84974d78145a5312ca4))
36
+
37
+
38
+ ### ๐Ÿงน Chores
39
+
40
+ * ensure clean staging before completing tasks ([7186629](https://github.com/programinglive/dev-workflow-mcp-server/commit/7186629fc2415b2d279a8a8d3451f52839dd2d28))
41
+ * revert @modelcontextprotocol/sdk to ^1.0.0 ([305d71f](https://github.com/programinglive/dev-workflow-mcp-server/commit/305d71f330027d8466828af53c939b4491cccee9))
42
+ * scope package under programinglive ([7388773](https://github.com/programinglive/dev-workflow-mcp-server/commit/7388773a50f0e06450558115edb367749245c31b))
43
+
44
+ ## 1.0.0 (2025-10-18)
45
+
46
+
47
+ ### โœจ Features
48
+
49
+ * initial release ([9bd5835](https://github.com/programinglive/dev-workflow-mcp-server/commit/9bd5835af92776d9247efa50238ac5d71b00b492))
50
+
51
+
52
+ ### ๐Ÿ“ Documentation
53
+
54
+ * add governance and contribution guidelines ([cfa78ea](https://github.com/programinglive/dev-workflow-mcp-server/commit/cfa78ea592788257f703d84974d78145a5312ca4))
55
+
56
+
57
+ ### ๐Ÿงน Chores
58
+
59
+ * ensure clean staging before completing tasks ([7186629](https://github.com/programinglive/dev-workflow-mcp-server/commit/7186629fc2415b2d279a8a8d3451f52839dd2d28))
60
+ * revert @modelcontextprotocol/sdk to ^1.0.0 ([305d71f](https://github.com/programinglive/dev-workflow-mcp-server/commit/305d71f330027d8466828af53c939b4491cccee9))
61
+ * scope package under programinglive ([7388773](https://github.com/programinglive/dev-workflow-mcp-server/commit/7388773a50f0e06450558115edb367749245c31b))
@@ -0,0 +1,79 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We, as members, contributors, and leaders, pledge to make participation in the dev-workflow-mcp-server project and our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best for the community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks
23
+ - Public or private harassment
24
+ - Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all project spaces, and it also applies when an individual is officially representing the project or community in public spaces. Examples of representing our community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers at `opensource@programinglive.com`. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All project maintainers are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from project maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the project community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
76
+
77
+ For answers to common questions about this code of conduct, see the [Contributor Covenant FAQ](https://www.contributor-covenant.org/faq). Translations are available at the [Contributor Covenant Translations](https://www.contributor-covenant.org/translations) page.
78
+
79
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,60 @@
1
+ # Contributing to dev-workflow-mcp-server
2
+
3
+ Thanks for your interest in contributing! Follow the guidelines below to keep the development process smooth and aligned with the workflow enforced by this project.
4
+
5
+ ## Development Workflow
6
+
7
+ 1. **Start a task** using the MCP server's `start_task` tool with a clear description and task type.
8
+ 2. **Implement the change** following the single flow rules documented in the README.
9
+ 3. **Write or update tests**. All code changes must include tests when applicable.
10
+ 4. **Run tests** with `npm test` and ensure they pass.
11
+ 5. **Document changes**. Update `README.md` or other docs as needed.
12
+ 6. **Commit** following conventional commits (e.g., `feat: add new tool`).
13
+ 7. **Push** your branch and open a pull request using the provided template.
14
+
15
+ ## Getting Started
16
+
17
+ - Fork the repository and clone it locally.
18
+ - Install dependencies:
19
+
20
+ ```bash
21
+ npm install
22
+ ```
23
+
24
+ - Run the test suite to verify your setup:
25
+
26
+ ```bash
27
+ npm test
28
+ ```
29
+
30
+ ## Pull Requests
31
+
32
+ - Use a descriptive branch name (e.g., `feat/new-tool` or `fix/workflow-reset`).
33
+ - Fill out the pull request template completely, including tests and documentation details.
34
+ - Link related issues in the PR description.
35
+ - Ensure CI checks pass before requesting review.
36
+
37
+ ## Coding Standards
38
+
39
+ - Use TypeScript-friendly patterns even in JavaScript (avoid dynamic typing pitfalls).
40
+ - Remove unused imports and variables before committing.
41
+ - Follow existing code style and formatting.
42
+
43
+ ## Commit Messages
44
+
45
+ - Follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
46
+ - Example: `feat: enforce documentation reminder before commit`.
47
+
48
+ ## Reporting Issues
49
+
50
+ - Search open issues to avoid duplicates.
51
+ - When filing a bug, include reproduction steps, expected behavior, and environment details.
52
+ - Feature requests should explain the problem being solved and potential benefits.
53
+
54
+ ## Code of Conduct
55
+
56
+ By participating, you agree to abide by the [Code of Conduct](./CODE_OF_CONDUCT.md).
57
+
58
+ ## Contact
59
+
60
+ Questions? Reach out at `opensource@programinglive.com`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 programinglive
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -57,6 +57,21 @@ After adding the configuration, restart the application to load the MCP server.
57
57
 
58
58
  ## ๐Ÿ› ๏ธ Available Tools
59
59
 
60
+ ### Tool Argument Requirements
61
+
62
+ All tool invocations validate their `arguments` payload before running:
63
+ - Strings are parsed as JSON and must resolve to an object (key/value pairs).
64
+ - Passing non-object data (numbers, arrays, plain text) triggers a guidance error.
65
+ - Missing or malformed arguments safely default to empty input so the tool can respond with actionable reminders.
66
+
67
+ Example (stringified JSON object):
68
+ ```
69
+ {
70
+ "name": "start_task",
71
+ "arguments": "{\"description\":\"Add reporting endpoint\",\"type\":\"feature\"}"
72
+ }
73
+ ```
74
+
60
75
  ### `start_task`
61
76
  Start a new coding task. This is your first step - be conscious about what you're coding.
62
77
 
@@ -235,3 +250,10 @@ MIT
235
250
  ## ๐Ÿ™ Contributing
236
251
 
237
252
  Feel free to customize this server to match your specific workflow needs!
253
+
254
+ ## ๐Ÿ“œ Project Governance
255
+
256
+ - [Code of Conduct](./CODE_OF_CONDUCT.md)
257
+ - [Contributing Guide](./CONTRIBUTING.md)
258
+ - [Security Policy](./SECURITY.md)
259
+ - [License](./LICENSE)
package/SECURITY.md ADDED
@@ -0,0 +1,20 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We release patches for security vulnerabilities under new minor or patch versions. Always use the latest release.
6
+
7
+ ## Reporting a Vulnerability
8
+
9
+ If you discover a vulnerability, please email `security@programinglive.com` with:
10
+
11
+ - Description of the issue
12
+ - Steps to reproduce
13
+ - Potential impact
14
+ - Suggested remediation (if known)
15
+
16
+ We aim to acknowledge reports within 72 hours and will keep you informed as we work on a fix. Please do not disclose the vulnerability publicly until we have released an update.
17
+
18
+ ## Disclosure Policy
19
+
20
+ Once a fix is available, we will publish a security advisory in the repository releases and notify contributors via the README.
@@ -0,0 +1,3 @@
1
+ export default {
2
+ extends: ["@commitlint/config-conventional"],
3
+ };
package/index.js CHANGED
@@ -8,9 +8,11 @@ import {
8
8
  ListPromptsRequestSchema,
9
9
  GetPromptRequestSchema,
10
10
  } from "@modelcontextprotocol/sdk/types.js";
11
+ import { exec as execCallback } from "child_process";
11
12
  import fs from "fs/promises";
12
13
  import path from "path";
13
14
  import { fileURLToPath } from "url";
15
+ import { promisify } from "util";
14
16
 
15
17
  const __filename = fileURLToPath(import.meta.url);
16
18
  const __dirname = path.dirname(__filename);
@@ -66,6 +68,59 @@ export class WorkflowState {
66
68
  export const workflowState = new WorkflowState();
67
69
  await workflowState.load();
68
70
 
71
+ const exec = promisify(execCallback);
72
+
73
+ function normalizeRequestArgs(rawArgs) {
74
+ if (rawArgs === undefined || rawArgs === null) {
75
+ return { args: {}, error: null };
76
+ }
77
+
78
+ if (typeof rawArgs === "string") {
79
+ try {
80
+ const parsed = JSON.parse(rawArgs);
81
+ if (parsed && typeof parsed === "object") {
82
+ return { args: parsed, error: null };
83
+ }
84
+
85
+ return {
86
+ args: {},
87
+ error:
88
+ "โš ๏ธ Tool arguments must be a JSON object. Please provide key/value pairs.",
89
+ };
90
+ } catch (parseError) {
91
+ return {
92
+ args: {},
93
+ error:
94
+ "โš ๏ธ Unable to parse tool arguments. Please provide valid JSON-formatted data.",
95
+ };
96
+ }
97
+ }
98
+
99
+ if (typeof rawArgs === "object") {
100
+ return { args: rawArgs, error: null };
101
+ }
102
+
103
+ return {
104
+ args: {},
105
+ error: "โš ๏ธ Unsupported tool arguments format. Expected a JSON object.",
106
+ };
107
+ }
108
+
109
+ async function hasStagedChanges() {
110
+ try {
111
+ const { stdout } = await exec("git status --porcelain");
112
+ return stdout
113
+ .split("\n")
114
+ .filter(Boolean)
115
+ .some((line) => {
116
+ const indexStatus = line[0];
117
+ return indexStatus && indexStatus !== " " && indexStatus !== "?";
118
+ });
119
+ } catch (error) {
120
+ return false;
121
+ }
122
+ }
123
+
69
124
  // Create MCP server
70
125
  export const server = new Server(
71
126
  {
@@ -213,96 +268,127 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
213
268
 
214
269
  // Handle tool calls
215
270
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
216
- const { name, arguments: args } = request.params;
217
-
218
- switch (name) {
219
- case "start_task": {
220
- workflowState.reset();
221
- workflowState.state.currentPhase = "coding";
222
- workflowState.state.taskDescription = args.description;
223
- workflowState.state.taskType = args.type;
224
- await workflowState.save();
271
+ try {
272
+ const { name } = request.params;
273
+ const { args, error: argumentsError } = normalizeRequestArgs(
274
+ request.params.arguments
275
+ );
225
276
 
277
+ if (argumentsError) {
226
278
  return {
227
279
  content: [
228
280
  {
229
281
  type: "text",
230
- text: `โœ… 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\n3. โณ Create tests\n4. โณ Run tests (must pass!)\n5. โณ Create documentation\n6. โณ Commit & push\n\nReminder: Focus on writing clean, maintainable code!`,
282
+ text: argumentsError,
231
283
  },
232
284
  ],
233
285
  };
234
286
  }
235
287
 
236
- case "mark_bug_fixed": {
237
- if (workflowState.state.currentPhase === "idle") {
288
+ switch (name) {
289
+ case "start_task": {
290
+ workflowState.reset();
291
+ workflowState.state.currentPhase = "coding";
292
+ workflowState.state.taskDescription = args.description;
293
+ workflowState.state.taskType = args.type;
294
+ await workflowState.save();
295
+
238
296
  return {
239
297
  content: [
240
298
  {
241
299
  type: "text",
242
- text: "โš ๏ธ Please start a task first using 'start_task'!",
300
+ text: `โœ… 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\n3. โณ Create tests\n4. โณ Run tests (must pass!)\n5. โณ Create documentation\n6. โณ Commit & push\n\nReminder: Focus on writing clean, maintainable code!`,
243
301
  },
244
302
  ],
245
303
  };
246
304
  }
247
305
 
248
- workflowState.state.bugFixed = true;
249
- workflowState.state.currentPhase = "testing";
250
- workflowState.state.fixSummary = args.summary;
251
- await workflowState.save();
252
-
253
- return {
254
- content: [
255
- {
256
- type: "text",
257
- text: `โœ… Feature/Bug marked as fixed!\n\nโš ๏ธ CRITICAL REMINDER: You MUST create tests now!\n\nNext Steps:\n1. โœ“ Fix/implement feature\n2. โณ Create tests for: ${args.summary}\n3. โณ Run tests (must be green!)\n4. โณ Create documentation\n5. โณ Commit & push\n\n๐Ÿšซ DO NOT SKIP TESTING!`,
258
- },
259
- ],
260
- };
261
- }
306
+ case "mark_bug_fixed": {
307
+ if (workflowState.state.currentPhase === "idle") {
308
+ return {
309
+ content: [
310
+ {
311
+ type: "text",
312
+ text: "โš ๏ธ Please start a task first using 'start_task'!",
313
+ },
314
+ ],
315
+ };
316
+ }
317
+
318
+ workflowState.state.bugFixed = true;
319
+ workflowState.state.currentPhase = "testing";
320
+ workflowState.state.fixSummary = args.summary;
321
+ await workflowState.save();
262
322
 
263
- case "run_tests": {
264
- if (!workflowState.state.bugFixed) {
265
323
  return {
266
324
  content: [
267
325
  {
268
326
  type: "text",
269
- text: "โš ๏ธ Please mark your feature/bug as fixed first using 'mark_bug_fixed'!",
327
+ text: `โœ… Feature/Bug marked as fixed!\n\nโš ๏ธ CRITICAL REMINDER: You MUST create tests now!\n\nNext Steps:\n1. โœ“ Fix/implement feature\n2. โณ Create tests for: ${args.summary}\n3. โณ Run tests (must be green!)\n4. โณ Create documentation\n5. โณ Commit & push\n\n๐Ÿšซ DO NOT SKIP TESTING!`,
270
328
  },
271
329
  ],
272
330
  };
273
331
  }
274
332
 
275
- workflowState.state.testsPassed = args.passed;
276
- workflowState.state.testCommand = args.testCommand;
277
- workflowState.state.testDetails = args.details || "";
278
-
279
- if (!args.passed) {
280
- workflowState.state.currentPhase = "testing";
333
+ case "run_tests": {
334
+ if (!workflowState.state.bugFixed) {
335
+ return {
336
+ content: [
337
+ {
338
+ type: "text",
339
+ text: "โš ๏ธ Please mark your feature/bug as fixed first using 'mark_bug_fixed'!",
340
+ },
341
+ ],
342
+ };
343
+ }
344
+
345
+ if (
346
+ typeof args.passed !== "boolean" ||
347
+ typeof args.testCommand !== "string" ||
348
+ args.testCommand.trim() === ""
349
+ ) {
350
+ return {
351
+ content: [
352
+ {
353
+ type: "text",
354
+ text: "โš ๏ธ Please provide both 'passed' (boolean) and 'testCommand' (non-empty string) when recording test results.",
355
+ },
356
+ ],
357
+ };
358
+ }
359
+
360
+ workflowState.state.testsPassed = args.passed;
361
+ workflowState.state.testCommand = args.testCommand;
362
+ workflowState.state.testDetails =
363
+ typeof args.details === "string" ? args.details : "";
364
+
365
+ if (!args.passed) {
366
+ workflowState.state.currentPhase = "testing";
367
+ await workflowState.save();
368
+
369
+ return {
370
+ content: [
371
+ {
372
+ type: "text",
373
+ text: `โŒ TESTS FAILED!\n\n๐Ÿšซ STOP! DO NOT COMMIT OR PUSH!\n\nYou must:\n1. Fix the failing tests\n2. Run tests again until they pass\n\nTest command: ${args.testCommand}\n\nNever skip or ignore failing tests!`,
374
+ },
375
+ ],
376
+ };
377
+ }
378
+
379
+ workflowState.state.currentPhase = "documentation";
281
380
  await workflowState.save();
282
381
 
283
382
  return {
284
383
  content: [
285
384
  {
286
385
  type: "text",
287
- text: `โŒ TESTS FAILED!\n\n๐Ÿšซ STOP! DO NOT COMMIT OR PUSH!\n\nYou must:\n1. Fix the failing tests\n2. Run tests again until they pass\n\nTest command: ${args.testCommand}\n\nNever skip or ignore failing tests!`,
386
+ text: `โœ… All tests passed! ๐ŸŽ‰\n\nTest command: ${args.testCommand}\n\nNext Steps:\n1. โœ“ Fix/implement feature\n2. โœ“ Create tests\n3. โœ“ Run tests (GREEN!)\n4. โณ Create/update documentation\n5. โณ Commit & push\n\nReminder: Document what you did before committing!`,
288
387
  },
289
388
  ],
290
389
  };
291
390
  }
292
391
 
293
- workflowState.state.currentPhase = "documentation";
294
- await workflowState.save();
295
-
296
- return {
297
- content: [
298
- {
299
- type: "text",
300
- text: `โœ… All tests passed! ๐ŸŽ‰\n\nTest command: ${args.testCommand}\n\nNext Steps:\n1. โœ“ Fix/implement feature\n2. โœ“ Create tests\n3. โœ“ Run tests (GREEN!)\n4. โณ Create/update documentation\n5. โณ Commit & push\n\nReminder: Document what you did before committing!`,
301
- },
302
- ],
303
- };
304
- }
305
-
306
392
  case "create_documentation": {
307
393
  if (!workflowState.state.testsPassed) {
308
394
  return {
@@ -379,6 +465,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
379
465
  };
380
466
  }
381
467
 
468
+ if (await hasStagedChanges()) {
469
+ return {
470
+ content: [
471
+ {
472
+ type: "text",
473
+ text: "โš ๏ธ Staged files detected! Please commit or unstage all files before pushing. Run 'git status' to confirm a clean working tree, then try again.",
474
+ },
475
+ ],
476
+ };
477
+ }
478
+
382
479
  workflowState.addToHistory({
383
480
  taskDescription: workflowState.state.taskDescription,
384
481
  taskType: workflowState.state.taskType,
@@ -466,8 +563,19 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
466
563
  };
467
564
  }
468
565
 
469
- default:
470
- throw new Error(`Unknown tool: ${name}`);
566
+ default:
567
+ throw new Error(`Unknown tool: ${name}`);
568
+ }
569
+ } catch (error) {
570
+ console.error("Tool handler error:", error);
571
+ return {
572
+ content: [
573
+ {
574
+ type: "text",
575
+ text: "โš ๏ธ Internal server error while processing the tool request. Please try again.",
576
+ },
577
+ ],
578
+ };
471
579
  }
472
580
  });
473
581
 
package/package.json CHANGED
@@ -1,17 +1,22 @@
1
1
  {
2
2
  "name": "@programinglive/dev-workflow-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server to enforce development workflow discipline",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
- "dev-workflow-mcp": "./index.js"
8
+ "dev-workflow-mcp": "index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "node --test",
12
12
  "check": "node --check index.js",
13
13
  "start": "node index.js",
14
- "dev": "node --watch index.js"
14
+ "dev": "node --watch index.js",
15
+ "prepare": "husky",
16
+ "release": "standard-version",
17
+ "release:major": "npm run release -- --release-as major",
18
+ "release:minor": "npm run release -- --release-as minor",
19
+ "release:patch": "npm run release -- --release-as patch"
15
20
  },
16
21
  "keywords": [
17
22
  "mcp",
@@ -22,9 +27,65 @@
22
27
  "author": "",
23
28
  "license": "MIT",
24
29
  "dependencies": {
25
- "@modelcontextprotocol/sdk": "^1.0.4"
30
+ "@modelcontextprotocol/sdk": "^1.0.0"
26
31
  },
27
32
  "publishConfig": {
28
33
  "access": "public"
34
+ },
35
+ "devDependencies": {
36
+ "@commitlint/cli": "^20.1.0",
37
+ "@commitlint/config-conventional": "^20.0.0",
38
+ "@programinglive/commiter": "^1.0.0",
39
+ "husky": "^9.1.7",
40
+ "standard-version": "^9.5.0"
41
+ },
42
+ "standard-version": {
43
+ "releaseCommitMessageFormat": "chore(release): {{currentTag}} ๐Ÿš€",
44
+ "types": [
45
+ {
46
+ "type": "feat",
47
+ "section": "โœจ Features"
48
+ },
49
+ {
50
+ "type": "fix",
51
+ "section": "๐Ÿ› Bug Fixes"
52
+ },
53
+ {
54
+ "type": "perf",
55
+ "section": "โšก Performance"
56
+ },
57
+ {
58
+ "type": "refactor",
59
+ "section": "โ™ป๏ธ Refactors"
60
+ },
61
+ {
62
+ "type": "docs",
63
+ "section": "๐Ÿ“ Documentation"
64
+ },
65
+ {
66
+ "type": "style",
67
+ "section": "๐Ÿ’„ Styles"
68
+ },
69
+ {
70
+ "type": "test",
71
+ "section": "โœ… Tests"
72
+ },
73
+ {
74
+ "type": "build",
75
+ "section": "๐Ÿ—๏ธ Build System"
76
+ },
77
+ {
78
+ "type": "ci",
79
+ "section": "๐Ÿ‘ท Continuous Integration"
80
+ },
81
+ {
82
+ "type": "chore",
83
+ "section": "๐Ÿงน Chores"
84
+ },
85
+ {
86
+ "type": "revert",
87
+ "section": "โช Reverts"
88
+ }
89
+ ]
29
90
  }
30
91
  }