@schilling.mark.a/atdd-guardian 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/CONTRIBUTING.md +154 -0
  3. package/DISTRIBUTION.md +366 -0
  4. package/LICENSE +21 -0
  5. package/QUICKSTART.md +194 -0
  6. package/README.md +406 -0
  7. package/SHARING.md +223 -0
  8. package/dist/constants.d.ts +19 -0
  9. package/dist/constants.d.ts.map +1 -0
  10. package/dist/constants.js +38 -0
  11. package/dist/constants.js.map +1 -0
  12. package/dist/index.d.ts +23 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +72 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/schemas/tool-schemas.d.ts +404 -0
  17. package/dist/schemas/tool-schemas.d.ts.map +1 -0
  18. package/dist/schemas/tool-schemas.js +267 -0
  19. package/dist/schemas/tool-schemas.js.map +1 -0
  20. package/dist/services/context-review.d.ts +65 -0
  21. package/dist/services/context-review.d.ts.map +1 -0
  22. package/dist/services/context-review.js +300 -0
  23. package/dist/services/context-review.js.map +1 -0
  24. package/dist/services/formatter.d.ts +10 -0
  25. package/dist/services/formatter.d.ts.map +1 -0
  26. package/dist/services/formatter.js +173 -0
  27. package/dist/services/formatter.js.map +1 -0
  28. package/dist/services/phase-gate.d.ts +38 -0
  29. package/dist/services/phase-gate.d.ts.map +1 -0
  30. package/dist/services/phase-gate.js +309 -0
  31. package/dist/services/phase-gate.js.map +1 -0
  32. package/dist/services/review-engine.d.ts +26 -0
  33. package/dist/services/review-engine.d.ts.map +1 -0
  34. package/dist/services/review-engine.js +235 -0
  35. package/dist/services/review-engine.js.map +1 -0
  36. package/dist/services/rule-loader.d.ts +19 -0
  37. package/dist/services/rule-loader.d.ts.map +1 -0
  38. package/dist/services/rule-loader.js +91 -0
  39. package/dist/services/rule-loader.js.map +1 -0
  40. package/dist/services/session-manager.d.ts +75 -0
  41. package/dist/services/session-manager.d.ts.map +1 -0
  42. package/dist/services/session-manager.js +244 -0
  43. package/dist/services/session-manager.js.map +1 -0
  44. package/dist/services/test-runner.d.ts +53 -0
  45. package/dist/services/test-runner.d.ts.map +1 -0
  46. package/dist/services/test-runner.js +199 -0
  47. package/dist/services/test-runner.js.map +1 -0
  48. package/dist/tools/review-tools.d.ts +26 -0
  49. package/dist/tools/review-tools.d.ts.map +1 -0
  50. package/dist/tools/review-tools.js +904 -0
  51. package/dist/tools/review-tools.js.map +1 -0
  52. package/dist/types.d.ts +339 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +13 -0
  55. package/dist/types.js.map +1 -0
  56. package/examples/README.md +119 -0
  57. package/examples/mcp-config.json +11 -0
  58. package/examples/test-config.json +7 -0
  59. package/package.json +48 -0
package/SHARING.md ADDED
@@ -0,0 +1,223 @@
1
+ # Sharing the ATDD Guardian MCP Server
2
+
3
+ ## Overview
4
+
5
+ This document provides recommendations on how to share this MCP server with others. Multiple distribution methods are available, each suited for different use cases.
6
+
7
+ ## Quick Decision Guide
8
+
9
+ **Choose the right distribution method:**
10
+
11
+ | If you want to... | Use this method | See |
12
+ |-------------------|-----------------|-----|
13
+ | Share with the public, make it easy to install | **npm package** | [DISTRIBUTION.md - npm](DISTRIBUTION.md#publishing-to-npm) |
14
+ | Enable open source collaboration | **GitHub repository** | [DISTRIBUTION.md - GitHub](DISTRIBUTION.md#sharing-via-github) |
15
+ | Share internally or in air-gapped environments | **Tarball distribution** | [DISTRIBUTION.md - Direct](DISTRIBUTION.md#direct-distribution) |
16
+ | Help others get started quickly | **Quick start guide** | [QUICKSTART.md](QUICKSTART.md) |
17
+
18
+ ## Recommended Distribution Steps
19
+
20
+ ### 1. Prepare for Distribution ✅ (Done)
21
+
22
+ - [x] Add proper npm package configuration
23
+ - [x] Create LICENSE file (MIT)
24
+ - [x] Create comprehensive README
25
+ - [x] Add CONTRIBUTING guidelines
26
+ - [x] Add CHANGELOG
27
+ - [x] Create example configurations
28
+ - [x] Add .npmignore to exclude dev files
29
+ - [x] Test package build
30
+
31
+ ### 2. Publish to npm (When Ready)
32
+
33
+ ```bash
34
+ # 1. Login to npm
35
+ npm login
36
+
37
+ # 2. Build the project
38
+ npm run build
39
+
40
+ # 3. Test locally
41
+ npm pack
42
+ # Install the .tgz in a test project
43
+
44
+ # 4. Publish
45
+ npm publish
46
+ ```
47
+
48
+ See [DISTRIBUTION.md](DISTRIBUTION.md) for detailed publishing instructions.
49
+
50
+ ### 3. Create GitHub Release
51
+
52
+ ```bash
53
+ # 1. Tag the version
54
+ git tag -a v1.0.0 -m "Release version 1.0.0"
55
+ git push origin v1.0.0
56
+
57
+ # 2. Create release on GitHub
58
+ # Go to: https://github.com/MarkSchilling/atdd-guardian/releases
59
+ # Create new release, add changelog notes
60
+ ```
61
+
62
+ ### 4. Share with Users
63
+
64
+ Provide users with:
65
+
66
+ 1. **Installation instructions** from [QUICKSTART.md](QUICKSTART.md)
67
+ 2. **Configuration examples** from [examples/](examples/)
68
+ 3. **Full documentation** from [README.md](README.md)
69
+ 4. **Contribution guide** from [CONTRIBUTING.md](CONTRIBUTING.md)
70
+
71
+ ## Distribution Files Reference
72
+
73
+ This repository now includes everything needed for distribution:
74
+
75
+ ### Core Files
76
+ - `package.json` - npm package configuration with all metadata
77
+ - `README.md` - Comprehensive documentation
78
+ - `LICENSE` - MIT license
79
+
80
+ ### Distribution Documentation
81
+ - `DISTRIBUTION.md` - Detailed guide for all distribution methods
82
+ - `QUICKSTART.md` - Quick start guide for new users
83
+ - `CONTRIBUTING.md` - Guidelines for contributors
84
+ - `CHANGELOG.md` - Version history
85
+
86
+ ### Configuration Examples
87
+ - `examples/mcp-config.json` - VS Code MCP configuration
88
+ - `examples/test-config.json` - Test framework configuration
89
+ - `examples/README.md` - Example usage guide
90
+
91
+ ### Package Control
92
+ - `.npmignore` - Files to exclude from npm package
93
+ - `.gitignore` - Files to exclude from git (including .tgz files)
94
+
95
+ ## Installation Methods for Users
96
+
97
+ ### Method 1: npm (after publishing)
98
+
99
+ ```bash
100
+ npm install -g atdd-guardian-mcp-server
101
+ ```
102
+
103
+ Configure VS Code `.vscode/mcp.json`:
104
+ ```json
105
+ {
106
+ "servers": {
107
+ "atdd-guardian": {
108
+ "type": "stdio",
109
+ "command": "atdd-guardian-mcp"
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ ### Method 2: GitHub
116
+
117
+ ```bash
118
+ git clone https://github.com/MarkSchilling/atdd-guardian.git
119
+ cd atdd-guardian
120
+ npm install
121
+ npm run build
122
+ ```
123
+
124
+ Configure VS Code `.vscode/mcp.json`:
125
+ ```json
126
+ {
127
+ "servers": {
128
+ "atdd-guardian": {
129
+ "type": "stdio",
130
+ "command": "node",
131
+ "args": ["/absolute/path/to/atdd-guardian/dist/index.js"]
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ ### Method 3: Tarball
138
+
139
+ ```bash
140
+ # Create tarball
141
+ npm pack
142
+
143
+ # Share .tgz file, users install with:
144
+ npm install atdd-guardian-mcp-server-1.0.0.tgz
145
+ ```
146
+
147
+ ## What's Included in the npm Package
148
+
149
+ The package includes:
150
+ - ✅ Compiled JavaScript (dist/)
151
+ - ✅ TypeScript declarations (.d.ts files)
152
+ - ✅ Team standards rules (src/rules/team-standards.json)
153
+ - ✅ README documentation
154
+ - ✅ LICENSE file
155
+
156
+ Excluded from package (development only):
157
+ - ❌ Source TypeScript files (src/*.ts)
158
+ - ❌ Configuration files (tsconfig.json)
159
+ - ❌ Git files
160
+ - ❌ Examples directory
161
+ - ❌ Test files
162
+
163
+ ## Next Steps
164
+
165
+ 1. **Test the distribution:**
166
+ - Install the package locally using `npm pack`
167
+ - Verify it works in a clean environment
168
+ - Test with actual VS Code + Copilot setup
169
+
170
+ 2. **Publish to npm:**
171
+ - Follow [DISTRIBUTION.md - Publishing to npm](DISTRIBUTION.md#publishing-to-npm)
172
+ - Create npm account if needed
173
+ - Run `npm publish`
174
+
175
+ 3. **Create GitHub release:**
176
+ - Tag version: `git tag -a v1.0.0`
177
+ - Push tag: `git push origin v1.0.0`
178
+ - Create release with notes from CHANGELOG.md
179
+
180
+ 4. **Announce and share:**
181
+ - Share on social media
182
+ - Post in relevant communities
183
+ - Update any related documentation
184
+
185
+ ## Maintenance
186
+
187
+ For ongoing distribution:
188
+
189
+ 1. **Version updates:**
190
+ - Update package.json version
191
+ - Update CHANGELOG.md
192
+ - Create git tag
193
+ - Publish to npm
194
+ - Create GitHub release
195
+
196
+ 2. **Documentation:**
197
+ - Keep README up to date
198
+ - Update examples as needed
199
+ - Respond to issues and questions
200
+
201
+ 3. **Community:**
202
+ - Review pull requests
203
+ - Address bug reports
204
+ - Consider feature requests
205
+
206
+ ## Resources
207
+
208
+ - **Full Distribution Guide:** [DISTRIBUTION.md](DISTRIBUTION.md)
209
+ - **Quick Start for Users:** [QUICKSTART.md](QUICKSTART.md)
210
+ - **Contributing:** [CONTRIBUTING.md](CONTRIBUTING.md)
211
+ - **Examples:** [examples/](examples/)
212
+ - **Changelog:** [CHANGELOG.md](CHANGELOG.md)
213
+
214
+ ## Summary
215
+
216
+ ✅ **The repository is now ready for distribution!**
217
+
218
+ All necessary files and documentation have been added to enable sharing through:
219
+ - npm package registry
220
+ - GitHub repository
221
+ - Direct tarball distribution
222
+
223
+ Choose the method that best fits your needs and follow the guides in DISTRIBUTION.md.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Shared Constants
3
+ *
4
+ * Constants used across the MCP server modules.
5
+ */
6
+ /**
7
+ * Default directories and patterns to exclude from code review
8
+ */
9
+ export declare const DEFAULT_EXCLUDES: string[];
10
+ /**
11
+ * File extensions that should be reviewed
12
+ */
13
+ export declare const REVIEWABLE_EXTENSIONS: string[];
14
+ /**
15
+ * Maximum character limit for formatted output
16
+ * to prevent overwhelming the MCP client
17
+ */
18
+ export declare const CHARACTER_LIMIT = 50000;
19
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAQ5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,UAWjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Shared Constants
3
+ *
4
+ * Constants used across the MCP server modules.
5
+ */
6
+ /**
7
+ * Default directories and patterns to exclude from code review
8
+ */
9
+ export const DEFAULT_EXCLUDES = [
10
+ "**/node_modules/**",
11
+ "**/dist/**",
12
+ "**/build/**",
13
+ "**/.git/**",
14
+ "**/coverage/**",
15
+ "**/*.min.js",
16
+ "**/*.bundle.js",
17
+ ];
18
+ /**
19
+ * File extensions that should be reviewed
20
+ */
21
+ export const REVIEWABLE_EXTENSIONS = [
22
+ ".ts",
23
+ ".tsx",
24
+ ".js",
25
+ ".jsx",
26
+ ".vue",
27
+ ".svelte",
28
+ ".html",
29
+ ".css",
30
+ ".scss",
31
+ ".less",
32
+ ];
33
+ /**
34
+ * Maximum character limit for formatted output
35
+ * to prevent overwhelming the MCP client
36
+ */
37
+ export const CHARACTER_LIMIT = 50000;
38
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oBAAoB;IACpB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,gBAAgB;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC"}
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ATDD Guardian MCP Server
4
+ *
5
+ * An ATDD-enforcing code reviewer that validates code against
6
+ * team standards before submission. Designed to catch the issues
7
+ * teammates flag in PR reviews BEFORE the PR is created.
8
+ *
9
+ * ATDD Workflow Integration:
10
+ * 1. Generate tests from Jira stories (your existing ATDD MCP server)
11
+ * 2. Make tests pass (Copilot + SKILL.md context)
12
+ * 3. Run `review_code` (THIS server — catches standards violations)
13
+ * 4. Fix findings, re-review until verdict = pass
14
+ * 5. Submit PR with confidence
15
+ *
16
+ * PDCA Cycle:
17
+ * - PLAN: Define rules in team-standards.json
18
+ * - DO: Write code, run review_code
19
+ * - CHECK: Examine findings, compare to PR feedback
20
+ * - ACT: Use add_rule to capture new patterns from rejected PRs
21
+ */
22
+ export {};
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG"}
package/dist/index.js ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ATDD Guardian MCP Server
4
+ *
5
+ * An ATDD-enforcing code reviewer that validates code against
6
+ * team standards before submission. Designed to catch the issues
7
+ * teammates flag in PR reviews BEFORE the PR is created.
8
+ *
9
+ * ATDD Workflow Integration:
10
+ * 1. Generate tests from Jira stories (your existing ATDD MCP server)
11
+ * 2. Make tests pass (Copilot + SKILL.md context)
12
+ * 3. Run `review_code` (THIS server — catches standards violations)
13
+ * 4. Fix findings, re-review until verdict = pass
14
+ * 5. Submit PR with confidence
15
+ *
16
+ * PDCA Cycle:
17
+ * - PLAN: Define rules in team-standards.json
18
+ * - DO: Write code, run review_code
19
+ * - CHECK: Examine findings, compare to PR feedback
20
+ * - ACT: Use add_rule to capture new patterns from rejected PRs
21
+ */
22
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
23
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
24
+ import { registerTools } from "./tools/review-tools.js";
25
+ // ─── Server Setup ────────────────────────────────────────────────
26
+ const server = new McpServer({
27
+ name: "atdd-guardian-mcp-server",
28
+ version: "1.0.0",
29
+ });
30
+ // Register all review tools
31
+ registerTools(server);
32
+ // ─── Transport: stdio (for VS Code / Copilot integration) ───────
33
+ async function runStdio() {
34
+ const transport = new StdioServerTransport();
35
+ await server.connect(transport);
36
+ console.error("ATDD Guardian MCP Server running on stdio");
37
+ }
38
+ // ─── Transport: HTTP (for remote / shared use) ──────────────────
39
+ async function runHTTP() {
40
+ const express = await import("express");
41
+ const { StreamableHTTPServerTransport } = await import("@modelcontextprotocol/sdk/server/streamableHttp.js");
42
+ const app = express.default();
43
+ app.use(express.default.json());
44
+ app.post("/mcp", async (req, res) => {
45
+ const transport = new StreamableHTTPServerTransport({
46
+ sessionIdGenerator: undefined,
47
+ enableJsonResponse: true,
48
+ });
49
+ res.on("close", () => transport.close());
50
+ await server.connect(transport);
51
+ await transport.handleRequest(req, res, req.body);
52
+ });
53
+ const port = parseInt(process.env.PORT || "3001");
54
+ app.listen(port, () => {
55
+ console.error(`ATDD Guardian MCP Server running on http://localhost:${port}/mcp`);
56
+ });
57
+ }
58
+ // ─── Start ───────────────────────────────────────────────────────
59
+ const transport = process.env.TRANSPORT || "stdio";
60
+ if (transport === "http") {
61
+ runHTTP().catch((error) => {
62
+ console.error("Server error:", error);
63
+ process.exit(1);
64
+ });
65
+ }
66
+ else {
67
+ runStdio().catch((error) => {
68
+ console.error("Server error:", error);
69
+ process.exit(1);
70
+ });
71
+ }
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH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