@kamkom/awb-mcp 0.0.2 → 0.0.4

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 (62) hide show
  1. package/.ai/backlog.md +151 -233
  2. package/AGENTS.md +3 -0
  3. package/README.md +90 -0
  4. package/dist/server.js +2 -5
  5. package/dist/server.js.map +1 -1
  6. package/dist/templates/.github/agents/architect.agent.md +3 -0
  7. package/dist/templates/.github/agents/implementer.agent.md +3 -0
  8. package/dist/templates/.github/agents/reviewer.agent.md +3 -0
  9. package/dist/templates/.github/copilot-instructions.md +3 -0
  10. package/dist/templates/.github/instructions/general.instructions.md +3 -0
  11. package/dist/templates/.github/instructions/testing.instructions.md +3 -0
  12. package/dist/templates/.github/prompts/change-summary.prompt.md +3 -0
  13. package/dist/templates/.github/prompts/onboarding.prompt.md +3 -0
  14. package/dist/templates/.github/prompts/readme.prompt.md +3 -0
  15. package/dist/templates/AGENTS.md +3 -0
  16. package/dist/templates/copilot-instructions-prompt.md +1 -0
  17. package/dist/tools/applyBootstrap.d.ts +28 -0
  18. package/dist/tools/applyBootstrap.d.ts.map +1 -0
  19. package/dist/tools/applyBootstrap.js +171 -0
  20. package/dist/tools/applyBootstrap.js.map +1 -0
  21. package/dist/tools/baseline.d.ts +19 -0
  22. package/dist/tools/baseline.d.ts.map +1 -0
  23. package/dist/tools/baseline.js +32 -0
  24. package/dist/tools/baseline.js.map +1 -0
  25. package/dist/tools/index.d.ts +3 -0
  26. package/dist/tools/index.d.ts.map +1 -0
  27. package/dist/tools/index.js +40 -0
  28. package/dist/tools/index.js.map +1 -0
  29. package/dist/tools/loadTemplates.d.ts +6 -0
  30. package/dist/tools/loadTemplates.d.ts.map +1 -0
  31. package/dist/tools/loadTemplates.js +29 -0
  32. package/dist/tools/loadTemplates.js.map +1 -0
  33. package/dist/tools/planBootstrap.d.ts +34 -0
  34. package/dist/tools/planBootstrap.d.ts.map +1 -0
  35. package/dist/tools/planBootstrap.js +194 -0
  36. package/dist/tools/planBootstrap.js.map +1 -0
  37. package/dist/tools/validateRootPath.d.ts +6 -0
  38. package/dist/tools/validateRootPath.d.ts.map +1 -0
  39. package/dist/tools/validateRootPath.js +26 -0
  40. package/dist/tools/validateRootPath.js.map +1 -0
  41. package/package.json +3 -2
  42. package/src/server.ts +2 -5
  43. package/src/templates/.github/agents/architect.agent.md +3 -0
  44. package/src/templates/.github/agents/implementer.agent.md +3 -0
  45. package/src/templates/.github/agents/reviewer.agent.md +3 -0
  46. package/src/templates/.github/copilot-instructions.md +3 -0
  47. package/src/templates/.github/instructions/general.instructions.md +3 -0
  48. package/src/templates/.github/instructions/testing.instructions.md +3 -0
  49. package/src/templates/.github/prompts/change-summary.prompt.md +3 -0
  50. package/src/templates/.github/prompts/onboarding.prompt.md +3 -0
  51. package/src/templates/.github/prompts/readme.prompt.md +3 -0
  52. package/src/templates/AGENTS.md +3 -0
  53. package/src/templates/copilot-instructions-prompt.md +1 -0
  54. package/src/tools/applyBootstrap.ts +219 -0
  55. package/src/tools/baseline.ts +35 -0
  56. package/src/tools/index.ts +52 -0
  57. package/src/tools/loadTemplates.ts +30 -0
  58. package/src/tools/planBootstrap.ts +262 -0
  59. package/src/tools/validateRootPath.ts +25 -0
  60. package/test/apply-bootstrap.ts +299 -0
  61. package/test/plan-bootstrap.ts +377 -0
  62. package/test/server-smoke.ts +60 -0
package/.ai/backlog.md CHANGED
@@ -10,30 +10,30 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
10
10
 
11
11
  **User story**
12
12
 
13
- - As a developer using VS Code with an MCP-capable agent/chat client
14
- - I want to run the AWB MCP server as a stdio-based server so that I can use its tools from my editor without extra infrastructure
13
+ - As a developer using VS Code with an MCP-capable agent/chat client
14
+ - I want to run the AWB MCP server as a stdio-based server so that I can use its tools from my editor without extra infrastructure
15
15
 
16
16
  **Acceptance criteria**
17
17
 
18
- - Given a Windows or macOS machine with Node.js and VS Code configured for MCP
19
- - When I install the package (e.g. `npm i -g awb-mcp`) and add the server to my MCP settings with the command path
20
- - Then the server starts over stdio, responds to MCP protocol messages, and exposes tools (e.g. list_tools returns AWB tools)
18
+ - Given a Windows or macOS machine with Node.js and VS Code configured for MCP
19
+ - When I install the package (e.g. `npm i -g awb-mcp`) and add the server to my MCP settings with the command path
20
+ - Then the server starts over stdio, responds to MCP protocol messages, and exposes tools (e.g. list_tools returns AWB tools)
21
21
 
22
22
  **Edge cases**
23
23
 
24
- - Linux: document as optional; no hard requirement to fix Linux-only issues in v0.1
25
- - Invalid or missing `rootPath`: server returns clear error, does not crash
26
- - Server receives malformed or unexpected JSON: responds with protocol error, does not exit ungracefully
24
+ - Linux: document as optional; no hard requirement to fix Linux-only issues in v0.1
25
+ - Invalid or missing `rootPath`: server returns clear error, does not crash
26
+ - Server receives malformed or unexpected JSON: responds with protocol error, does not exit ungracefully
27
27
 
28
28
  **Technical considerations**
29
29
 
30
- - Use `@modelcontextprotocol/sdk` StdioServerTransport; single executable entrypoint (e.g. `awb-mcp` or `npx awb-mcp`)
31
- - No network listener; stdio only
32
- - Package `bin` in package.json so `awb-mcp` is on PATH after global install
30
+ - Use `@modelcontextprotocol/sdk` StdioServerTransport; single executable entrypoint (e.g. `awb-mcp` or `npx awb-mcp`)
31
+ - No network listener; stdio only
32
+ - Package `bin` in package.json so `awb-mcp` is on PATH after global install
33
33
 
34
34
  **Design notes**
35
35
 
36
- - Keep VS Code MCP config minimal: only the command (e.g. `awb-mcp` or `npx awb-mcp`). No required env vars or args for basic use
36
+ - Keep VS Code MCP config minimal: only the command (e.g. `awb-mcp` or `npx awb-mcp`). No required env vars or args for basic use
37
37
 
38
38
  ---
39
39
 
@@ -41,39 +41,39 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
41
41
 
42
42
  **User story**
43
43
 
44
- - As a user in an agentic workflow
45
- - I want to call `awb.plan_bootstrap` with a repo root and options so that I get a clear, deterministic plan of file operations (create/update/skip) with full file contents and warnings for existing files
44
+ - As a user in an agentic workflow
45
+ - I want to call `awb.plan_bootstrap` with a repo root and options so that I get a clear, deterministic plan of file operations (create/update/skip) with full file contents and warnings for existing files
46
46
 
47
47
  **Acceptance criteria**
48
48
 
49
- - Given a valid `rootPath` (existing directory) and optional `options` (mode, includeReadmeProposal, overwritePolicy, files allowlist)
50
- - When I call the tool `awb.plan_bootstrap` with those inputs
51
- - Then I receive a response containing: a unique `planId`; an `operations[]` array with for each path: `path`, `action` (CREATE | UPDATE_MANAGED | SKIP), `content` when action is CREATE or UPDATE_MANAGED, `reason` (especially for SKIP), and `warnings[]`; optional `repoHints` and `readmeProposal` when requested
49
+ - Given a valid `rootPath` (existing directory) and optional `options` (mode, includeReadmeProposal, overwritePolicy, files allowlist)
50
+ - When I call the tool `awb.plan_bootstrap` with those inputs
51
+ - Then I receive a response containing: a unique `planId`; an `operations[]` array with for each path: `path`, `action` (CREATE | UPDATE_MANAGED | SKIP), `content` when action is CREATE or UPDATE_MANAGED, `reason` (especially for SKIP), and `warnings[]`; optional `repoHints` and `readmeProposal` when requested
52
52
 
53
- - Given a path that does not exist on disk
54
- - When the plan is computed
55
- - Then that path has action CREATE and includes full static template content
53
+ - Given a path that does not exist on disk
54
+ - When the plan is computed
55
+ - Then that path has action CREATE and includes full static template content
56
56
 
57
- - Given a path that exists and has no AWB managed block and overwritePolicy is not "overwrite"
58
- - When the plan is computed
59
- - Then that path has action SKIP, a reason, and a warning that the file exists and is not being overwritten
57
+ - Given a path that exists and has no AWB managed block and overwritePolicy is not "overwrite"
58
+ - When the plan is computed
59
+ - Then that path has action SKIP, a reason, and a warning that the file exists and is not being overwritten
60
60
 
61
61
  **Edge cases**
62
62
 
63
- - `rootPath` is a file or non-existent: return clear error, no plan
64
- - `files` allowlist: only those paths appear in operations; others are omitted
65
- - Empty repo (no existing scaffold): all scaffold paths are CREATE
66
- - overwritePolicy `"skip"`: existing files always SKIP (even if they contain a managed block). `"managed-only"`: SKIP unless file has AWB managed block (then UPDATE_MANAGED)
63
+ - `rootPath` is a file or non-existent: return clear error, no plan
64
+ - `files` allowlist: only those paths appear in operations; others are omitted
65
+ - Empty repo (no existing scaffold): all scaffold paths are CREATE
66
+ - overwritePolicy `"skip"`: existing files always SKIP (even if they contain a managed block). `"managed-only"`: SKIP unless file has AWB managed block (then UPDATE_MANAGED)
67
67
 
68
68
  **Technical considerations**
69
69
 
70
- - planId: UUID or timestamp-based unique string; same inputs produce same plan content (deterministic)
71
- - Read only: directory listing and file existence (and optionally small config files for hints). No writes in plan
72
- - Input schema: validate rootPath (string), options optional with zod or equivalent
70
+ - planId: UUID or timestamp-based unique string; same inputs produce same plan content (deterministic)
71
+ - Read only: directory listing and file existence (and optionally small config files for hints). No writes in plan
72
+ - Input schema: validate rootPath (string), options optional with zod or equivalent
73
73
 
74
74
  **Design notes**
75
75
 
76
- - Static mode default: all templates are prefilled content from server bundle. No LLM calls in server
76
+ - Static mode default: all templates are prefilled content from server bundle. No LLM calls in server
77
77
 
78
78
  ---
79
79
 
@@ -81,38 +81,38 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
81
81
 
82
82
  **User story**
83
83
 
84
- - As a user who has reviewed a bootstrap plan
85
- - I want to call `awb.apply_bootstrap` with the planId and operations so that only approved changes are written to disk using atomic writes and explicit conflict handling
84
+ - As a user who has reviewed a bootstrap plan
85
+ - I want to call `awb.apply_bootstrap` with the planId and operations so that only approved changes are written to disk using atomic writes and explicit conflict handling
86
86
 
87
87
  **Acceptance criteria**
88
88
 
89
- - Given a valid `rootPath`, the `planId` from a prior `plan_bootstrap` call, and the same `operations[]` (or server-validated subset)
90
- - When I call `awb.apply_bootstrap` without dryRun
91
- - Then each CREATE/UPDATE_MANAGED operation is written to disk; each SKIP is not written; the response includes `results[]` with per-path `status` (WRITTEN | SKIPPED | FAILED) and `details`
89
+ - Given a valid `rootPath`, the `planId` from a prior `plan_bootstrap` call, and the same `operations[]` (or server-validated subset)
90
+ - When I call `awb.apply_bootstrap` without dryRun
91
+ - Then each CREATE/UPDATE_MANAGED operation is written to disk; each SKIP is not written; the response includes `results[]` with per-path `status` (WRITTEN | SKIPPED | FAILED) and `details`
92
92
 
93
- - Given applyOptions.dryRun is true
94
- - When I call `awb.apply_bootstrap`
95
- - Then no files are modified and the response describes what would have been done (e.g. same result structure with WRITTEN/SKIPPED/FAILED as if applied)
93
+ - Given applyOptions.dryRun is true
94
+ - When I call `awb.apply_bootstrap`
95
+ - Then no files are modified and the response describes what would have been done (e.g. same result structure with WRITTEN/SKIPPED/FAILED as if applied)
96
96
 
97
- - Given writeMode is "atomic" (default)
98
- - When a file is written
99
- - Then content is written to a temp file in the same directory and then renamed into place so that partial writes are not visible
97
+ - Given writeMode is "atomic" (default)
98
+ - When a file is written
99
+ - Then content is written to a temp file in the same directory and then renamed into place so that partial writes are not visible
100
100
 
101
101
  **Edge cases**
102
102
 
103
- - planId or operations do not match a recent plan: server may validate and return FAILED for mismatches if failOnConflict is true
104
- - Disk full or permission error: that path returns status FAILED with details; other paths still attempted where possible
105
- - apply_bootstrap called with operations from a different rootPath: server validates and rejects or marks FAILED
103
+ - planId or operations do not match a recent plan: server may validate and return FAILED for mismatches if failOnConflict is true
104
+ - Disk full or permission error: that path returns status FAILED with details; other paths still attempted where possible
105
+ - apply_bootstrap called with operations from a different rootPath: server validates and rejects or marks FAILED
106
106
 
107
107
  **Technical considerations**
108
108
 
109
- - Atomic write: write to `*.tmp` (or similar) in same directory, fs.rename to final path
110
- - Idempotency: applying the same plan twice with same overwrite policy should yield same outcome (second run no unexpected changes)
111
- - applyOptions: dryRun, writeMode "atomic", failOnConflict (default true)
109
+ - Atomic write: write to `*.tmp` (or similar) in same directory, fs.rename to final path
110
+ - Idempotency: applying the same plan twice with same overwrite policy should yield same outcome (second run no unexpected changes)
111
+ - applyOptions: dryRun, writeMode "atomic", failOnConflict (default true)
112
112
 
113
113
  **Design notes**
114
114
 
115
- - Server does not re-read disk to “re-plan”; it applies the operations as given, enforcing overwrite policy per operation
115
+ - Server does not re-read disk to “re-plan”; it applies the operations as given, enforcing overwrite policy per operation
116
116
 
117
117
  ---
118
118
 
@@ -120,40 +120,40 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
120
120
 
121
121
  **User story**
122
122
 
123
- - As a user running bootstrap in a repo that may already have some files
124
- - I want the server to never overwrite my content unless a file is under AWB management or I explicitly allow overwrite so that I do not lose work
123
+ - As a user running bootstrap in a repo that may already have some files
124
+ - I want the server to never overwrite my content unless a file is under AWB management or I explicitly allow overwrite so that I do not lose work
125
125
 
126
126
  **Acceptance criteria**
127
127
 
128
- - Given a target path where the file does not exist
129
- - When the plan is computed and applied
130
- - Then the action is CREATE and the file is created
128
+ - Given a target path where the file does not exist
129
+ - When the plan is computed and applied
130
+ - Then the action is CREATE and the file is created
131
131
 
132
- - Given a target path where the file exists and does not contain the AWB managed block marker
133
- - When overwritePolicy is "skip" or "managed-only" (default)
134
- - Then the action is SKIP, reason and warnings are set, and the file is not modified on apply
132
+ - Given a target path where the file exists and does not contain the AWB managed block marker
133
+ - When overwritePolicy is "skip" or "managed-only" (default)
134
+ - Then the action is SKIP, reason and warnings are set, and the file is not modified on apply
135
135
 
136
- - Given a target path where the file exists and contains the AWB managed block marker
137
- - When overwritePolicy is "managed-only" (default)
138
- - Then the action is UPDATE_MANAGED, content is the new managed block content, and on apply only the managed section is updated (or full file replace per implementation)
136
+ - Given a target path where the file exists and contains the AWB managed block marker
137
+ - When overwritePolicy is "managed-only" (default)
138
+ - Then the action is UPDATE_MANAGED, content is the new managed block content, and on apply only the managed section is updated (or full file replace per implementation)
139
139
 
140
- - Given the user passes overwrite: true for a specific file (or overwritePolicy "overwrite")
141
- - When the plan is computed and applied
142
- - Then that path can be CREATE/UPDATE and existing content may be replaced; user has explicitly opted in
140
+ - Given the user passes overwrite: true for a specific file (or overwritePolicy "overwrite")
141
+ - When the plan is computed and applied
142
+ - Then that path can be CREATE/UPDATE and existing content may be replaced; user has explicitly opted in
143
143
 
144
144
  **Edge cases**
145
145
 
146
- - Managed block marker missing or malformed: treat as unmanaged, SKIP unless overwrite
147
- - Partial file (e.g. only start marker): define behavior (e.g. SKIP or treat as managed); document
146
+ - Managed block marker missing or malformed: treat as unmanaged, SKIP unless overwrite
147
+ - Partial file (e.g. only start marker): define behavior (e.g. SKIP or treat as managed); document
148
148
 
149
149
  **Technical considerations**
150
150
 
151
- - Define a single, documented AWB managed block format (e.g. `<!-- AWB MANAGED BEGIN -->` … `<!-- AWB MANAGED END -->` or similar)
152
- - plan_bootstrap decides CREATE | UPDATE_MANAGED | SKIP per path based on existence and overwrite policy; apply_bootstrap enforces the same policy
151
+ - Define a single, documented AWB managed block format (e.g. `<!-- AWB MANAGED BEGIN -->` … `<!-- AWB MANAGED END -->` or similar)
152
+ - plan_bootstrap decides CREATE | UPDATE_MANAGED | SKIP per path based on existence and overwrite policy; apply_bootstrap enforces the same policy
153
153
 
154
154
  **Design notes**
155
155
 
156
- - Safe-by-default: “plan first, then apply” with clear SKIP behavior and no blind overwrites
156
+ - Safe-by-default: “plan first, then apply” with clear SKIP behavior and no blind overwrites
157
157
 
158
158
  ---
159
159
 
@@ -161,118 +161,36 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
161
161
 
162
162
  **User story**
163
163
 
164
- - As a user bootstrapping a repo for agentic workflows
165
- - I want the server to generate a fixed set of high-quality, generic template files so that my repo has a standard structure for instructions, prompts, and agents without me creating them by hand
164
+ - As a user bootstrapping a repo for agentic workflows
165
+ - I want the server to generate a fixed set of high-quality, generic template files so that my repo has a standard structure for instructions, prompts, and agents without me creating them by hand
166
166
 
167
167
  **Acceptance criteria**
168
168
 
169
- - Given a successful `plan_bootstrap` in static mode with no files allowlist (or allowlist including the baseline paths)
170
- - When the plan is generated
171
- - Then operations include the full baseline tree: `.github/copilot-instructions.md`, `.github/instructions/general.instructions.md`, `.github/instructions/testing.instructions.md`, `.github/prompts/readme.prompt.md`, `.github/prompts/onboarding.prompt.md`, `.github/prompts/change-summary.prompt.md`, `.github/agents/architect.agent.md`, `.github/agents/implementer.agent.md`, `.github/agents/reviewer.agent.md`, `AGENTS.md`
169
+ - Given a successful `plan_bootstrap` in static mode with no files allowlist (or allowlist including the baseline paths)
170
+ - When the plan is generated
171
+ - Then operations include the full baseline tree: `.github/copilot-instructions.md`, `.github/instructions/general.instructions.md`, `.github/instructions/testing.instructions.md`, `.github/prompts/readme.prompt.md`, `.github/prompts/onboarding.prompt.md`, `.github/prompts/change-summary.prompt.md`, `.github/agents/architect.agent.md`, `.github/agents/implementer.agent.md`, `.github/agents/reviewer.agent.md`, `AGENTS.md`
172
172
 
173
- - Given the template content returned in the plan
174
- - When I read it
175
- - Then it is generic, high-signal, and safe: emphasizes “don’t guess,” “prefer repo scripts,” “write tests,” “avoid destructive commands”
176
- - And placeholders (e.g. `{{packageManager}}`, `{{testCommand}}`) are minimal and optional; may be left as defaults in v0.1
173
+ - Given the template content returned in the plan
174
+ - When I read it
175
+ - Then it is generic, high-signal, and safe: emphasizes “don’t guess,” “prefer repo scripts,” “write tests,” “avoid destructive commands”
176
+ - And placeholders (e.g. `{{packageManager}}`, `{{testCommand}}`) are minimal and optional; may be left as defaults in v0.1
177
177
 
178
178
  **Edge cases**
179
179
 
180
- - `files` allowlist provided: only listed paths that belong to the baseline appear in operations
181
- - Paths outside repo root (e.g. `..` in path): server rejects or normalizes
180
+ - `files` allowlist provided: only listed paths that belong to the baseline appear in operations
181
+ - Paths outside repo root (e.g. `..` in path): server rejects or normalizes
182
182
 
183
183
  **Technical considerations**
184
184
 
185
- - Templates shipped as static files in the server package (e.g. in a `templates/` directory); no runtime fetch
186
- - Use path.join(rootPath, ...) for all paths; normalize and reject paths not under rootPath
185
+ - Templates shipped as static files in the server package (e.g. in a `templates/` directory); no runtime fetch
186
+ - Use path.join(rootPath, ...) for all paths; normalize and reject paths not under rootPath
187
187
 
188
188
  **Design notes**
189
189
 
190
- - Templates work for any repo/stack; no stack-specific logic required in v0.1
190
+ - Templates work for any repo/stack; no stack-specific logic required in v0.1
191
191
 
192
192
  ---
193
193
 
194
- ### Story 6: Safety — no network, no shell, minimal reads, atomic writes
195
-
196
- **User story**
197
-
198
- - As a user running the AWB MCP server
199
- - I want it to never perform network calls, shell execution, or broad filesystem reads so that I can trust it in sensitive or offline environments
200
-
201
- **Acceptance criteria**
202
-
203
- - Given the server is running
204
- - When any tool is invoked
205
- - Then the server does not open outbound network connections or spawn shell/child processes
206
-
207
- - Given plan_bootstrap or apply_bootstrap is called
208
- - When the server needs to check files
209
- - Then it only checks existence of target paths and, if needed, reads small config files (e.g. package.json) for hints; it does not read arbitrary or sensitive paths beyond what is documented
210
-
211
- - Given apply_bootstrap writes a file
212
- - When writeMode is atomic
213
- - Then content is written to a temp file and then renamed; no partial content is visible at the final path on failure
214
-
215
- - Given a file already exists and policy says SKIP
216
- - When apply_bootstrap runs
217
- - Then the user sees clear warnings in the plan and the apply result reflects SKIPPED with a reason
218
-
219
- **Edge cases**
220
-
221
- - Symlinks: document whether we follow or reject; prefer not following symlinks outside rootPath
222
- - Very long paths or huge files: avoid reading large files; existence check only where sufficient
223
-
224
- **Technical considerations**
225
-
226
- - No require('child_process') or fetch/axios; no external HTTP
227
- - Atomic write: temp file in same directory as target, then rename
228
- - Explicit allowlist of files that may be read for hints (e.g. package.json, pyproject.toml) in v0.2
229
-
230
- **Design notes**
231
-
232
- - Security section of PRD is non-negotiable for MVP; tests or checklist can enforce “no network, no shell”
233
-
234
- ---
235
-
236
- ### Story 7: Early deployment and validation — works on other computers
237
-
238
- **User story**
239
-
240
- - As a maintainer or a user trying the package on a clean machine
241
- - I want a clear packaging, install, and validation flow so that we can confirm the server runs on other computers (Windows and macOS) and works with VS Code MCP
242
-
243
- **Acceptance criteria**
244
-
245
- - Given the project is built and published (e.g. to npm as `awb-mcp` or installed from tarball)
246
- - When another user on a clean Windows or macOS machine runs `npm i -g awb-mcp` (or equivalent)
247
- - Then the install completes and the `awb-mcp` (or documented) command is on PATH
248
-
249
- - Given the server is installed globally
250
- - When the user adds the server to VS Code MCP settings (e.g. in settings.json or Cursor MCP config) with only the command path
251
- - Then VS Code/Cursor can start the server over stdio and list tools
252
-
253
- - Given the server is running in VS Code
254
- - When the user (or a script) invokes `awb.plan_bootstrap` with a valid repo root
255
- - Then the tool returns a valid plan (planId, operations array, no crash)
256
-
257
- - Given a release checklist exists (in repo or docs)
258
- - When preparing a release
259
- - Then the checklist includes: build, pack or publish, install on clean Windows, install on clean macOS, configure VS Code MCP, run smoke test (plan_bootstrap + optional apply_bootstrap in a temp dir)
260
-
261
- **Edge cases**
262
-
263
- - Node version: document minimum (e.g. Node 18+); package.json engines optional
264
- - npx vs global install: both documented; smoke test covers at least one
265
-
266
- **Technical considerations**
267
-
268
- - package.json: `bin` entry for the executable; `main` or type module and entrypoint that runs the MCP server
269
- - Build step that produces runnable code (e.g. tsc + node, or tsx in bin); ensure dependencies are bundled or declared so install is self-contained
270
- - Optional: simple smoke script (e.g. node -e "call MCP list_tools") or doc that says “run plan_bootstrap from client”
271
-
272
- **Design notes**
273
-
274
- - Early deployment is crucial: first milestone should include “works on another machine” validation; checklist prevents regressions
275
-
276
194
  ---
277
195
 
278
196
  ## v0.2 — Repo hints and README proposal
@@ -281,37 +199,37 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
281
199
 
282
200
  **User story**
283
201
 
284
- - As a user with an existing repo (e.g. with package.json or pyproject.toml)
285
- - I want the server to run lightweight heuristics to detect hints (e.g. package manager, test command) so that bootstrap templates can be filled with sensible defaults without deep stack detection
202
+ - As a user with an existing repo (e.g. with package.json or pyproject.toml)
203
+ - I want the server to run lightweight heuristics to detect hints (e.g. package manager, test command) so that bootstrap templates can be filled with sensible defaults without deep stack detection
286
204
 
287
205
  **Acceptance criteria**
288
206
 
289
- - Given a repo root that contains one or more of: package.json, lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml), pyproject.toml
290
- - When `awb.detect_repo_hints` (or plan_bootstrap with hint detection) runs
291
- - Then the result includes a small `repoHints` object with fields such as preferred package manager, test command placeholder, or similar; no heavy or framework-specific detection
207
+ - Given a repo root that contains one or more of: package.json, lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml), pyproject.toml
208
+ - When `awb.detect_repo_hints` (or plan_bootstrap with hint detection) runs
209
+ - Then the result includes a small `repoHints` object with fields such as preferred package manager, test command placeholder, or similar; no heavy or framework-specific detection
292
210
 
293
- - Given repoHints are available
294
- - When plan_bootstrap returns template content
295
- - Then optional placeholders (e.g. `{{packageManager}}`, `{{testCommand}}`) are replaced with hint values where possible; otherwise left as safe defaults
211
+ - Given repoHints are available
212
+ - When plan_bootstrap returns template content
213
+ - Then optional placeholders (e.g. `{{packageManager}}`, `{{testCommand}}`) are replaced with hint values where possible; otherwise left as safe defaults
296
214
 
297
- - Given a repo with no known config files
298
- - When detect runs
299
- - Then repoHints is empty or has defaults; no error
215
+ - Given a repo with no known config files
216
+ - When detect runs
217
+ - Then repoHints is empty or has defaults; no error
300
218
 
301
219
  **Edge cases**
302
220
 
303
- - Multiple lockfiles: define precedence (e.g. pnpm > yarn > npm) and document
304
- - Malformed package.json: do not throw; return partial or empty hints
305
- - Must not become a “stack detection framework”: only a small, fixed set of heuristics
221
+ - Multiple lockfiles: define precedence (e.g. pnpm > yarn > npm) and document
222
+ - Malformed package.json: do not throw; return partial or empty hints
223
+ - Must not become a “stack detection framework”: only a small, fixed set of heuristics
306
224
 
307
225
  **Technical considerations**
308
226
 
309
- - detect_repo_hints: read only package.json, pyproject.toml, lockfile presence; no install or parse of dependencies
310
- - Keep logic in one place; call from plan_bootstrap when options request hints
227
+ - detect_repo_hints: read only package.json, pyproject.toml, lockfile presence; no install or parse of dependencies
228
+ - Keep logic in one place; call from plan_bootstrap when options request hints
311
229
 
312
230
  **Design notes**
313
231
 
314
- - v0.2 scope: minimal placeholders; avoid scope creep into full stack detection
232
+ - v0.2 scope: minimal placeholders; avoid scope creep into full stack detection
315
233
 
316
234
  ---
317
235
 
@@ -319,37 +237,37 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
319
237
 
320
238
  **User story**
321
239
 
322
- - As a user who has an existing README.md
323
- - I want the server to optionally suggest README content or a patch (e.g. README.agentic.md or a patch output) so that I can choose whether to integrate it without ever overwriting README.md by default
240
+ - As a user who has an existing README.md
241
+ - I want the server to optionally suggest README content or a patch (e.g. README.agentic.md or a patch output) so that I can choose whether to integrate it without ever overwriting README.md by default
324
242
 
325
243
  **Acceptance criteria**
326
244
 
327
- - Given plan_bootstrap is called with includeReadmeProposal: false (default)
328
- - When the plan is returned
329
- - Then no readmeProposal field or README-related write is included; README.md is never in operations as an overwrite
245
+ - Given plan_bootstrap is called with includeReadmeProposal: false (default)
246
+ - When the plan is returned
247
+ - Then no readmeProposal field or README-related write is included; README.md is never in operations as an overwrite
330
248
 
331
- - Given plan_bootstrap is called with includeReadmeProposal: true
332
- - When the plan is returned
333
- - Then the response includes a readmeProposal (e.g. suggested content or a separate file path like README.agentic.md or a patch); README.md is still not in operations unless user explicitly opts in elsewhere
334
- - And the client (LLM/user) decides whether to apply any README changes
249
+ - Given plan_bootstrap is called with includeReadmeProposal: true
250
+ - When the plan is returned
251
+ - Then the response includes a readmeProposal (e.g. suggested content or a separate file path like README.agentic.md or a patch); README.md is still not in operations unless user explicitly opts in elsewhere
252
+ - And the client (LLM/user) decides whether to apply any README changes
335
253
 
336
- - Given the server suggests README content
337
- - When the suggestion is returned
338
- - Then it is clearly a proposal (e.g. “suggested addition” or separate file); default behavior never modifies README.md
254
+ - Given the server suggests README content
255
+ - When the suggestion is returned
256
+ - Then it is clearly a proposal (e.g. “suggested addition” or separate file); default behavior never modifies README.md
339
257
 
340
258
  **Edge cases**
341
259
 
342
- - No README.md exists: readmeProposal can still suggest initial README content
343
- - Very long README: server may suggest a patch or appendix only; avoid loading huge files unnecessarily
260
+ - No README.md exists: readmeProposal can still suggest initial README content
261
+ - Very long README: server may suggest a patch or appendix only; avoid loading huge files unnecessarily
344
262
 
345
263
  **Technical considerations**
346
264
 
347
- - readmeProposal: string content or { path, content } for a separate file; optional patch format
348
- - If README.md is ever in operations, it is only when overwritePolicy or explicit overwrite is set and documented
265
+ - readmeProposal: string content or { path, content } for a separate file; optional patch format
266
+ - If README.md is ever in operations, it is only when overwritePolicy or explicit overwrite is set and documented
349
267
 
350
268
  **Design notes**
351
269
 
352
- - Narrow MVP: README handling is optional and safe-by-default; no automatic overwrite
270
+ - Narrow MVP: README handling is optional and safe-by-default; no automatic overwrite
353
271
 
354
272
  ---
355
273
 
@@ -359,33 +277,33 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
359
277
 
360
278
  **User story**
361
279
 
362
- - As a user who wants AI-generated bootstrap content tailored to my repo
363
- - I want the server to support a “prompt” mode where it returns prompts and minimal skeleton files so that my client LLM (e.g. Copilot) can refine content before I apply it, without the server calling any external LLM
280
+ - As a user who wants AI-generated bootstrap content tailored to my repo
281
+ - I want the server to support a “prompt” mode where it returns prompts and minimal skeleton files so that my client LLM (e.g. Copilot) can refine content before I apply it, without the server calling any external LLM
364
282
 
365
283
  **Acceptance criteria**
366
284
 
367
- - Given plan_bootstrap is called with mode: "prompt"
368
- - When the plan is computed
369
- - Then the server returns either (a) prompts plus minimal skeleton file content, or (b) static templates with a note that the client LLM may refine them before apply
370
- - And the server does not call any third-party LLM API; any generation is done by the client using the user’s model
285
+ - Given plan_bootstrap is called with mode: "prompt"
286
+ - When the plan is computed
287
+ - Then the server returns either (a) prompts plus minimal skeleton file content, or (b) static templates with a note that the client LLM may refine them before apply
288
+ - And the server does not call any third-party LLM API; any generation is done by the client using the user’s model
371
289
 
372
- - Given the client has refined or generated content
373
- - When the user calls apply_bootstrap with the modified plan/operations
374
- - Then the server applies the provided content with the same overwrite and atomic-write rules as static mode
290
+ - Given the client has refined or generated content
291
+ - When the user calls apply_bootstrap with the modified plan/operations
292
+ - Then the server applies the provided content with the same overwrite and atomic-write rules as static mode
375
293
 
376
294
  **Edge cases**
377
295
 
378
- - mode "prompt" with no client LLM: user can still apply skeletons as-is
379
- - Mixed mode (some static, some prompt): v0.3 can define per-file or global; keep simple
296
+ - mode "prompt" with no client LLM: user can still apply skeletons as-is
297
+ - Mixed mode (some static, some prompt): v0.3 can define per-file or global; keep simple
380
298
 
381
299
  **Technical considerations**
382
300
 
383
- - No fetch to OpenAI/Anthropic/etc. in server; prompts are strings returned to client
384
- - Client is responsible for calling LLM and passing back refined content in the plan/operations
301
+ - No fetch to OpenAI/Anthropic/etc. in server; prompts are strings returned to client
302
+ - Client is responsible for calling LLM and passing back refined content in the plan/operations
385
303
 
386
304
  **Design notes**
387
305
 
388
- - MVP: prompt mode is optional; static mode remains default and primary
306
+ - MVP: prompt mode is optional; static mode remains default and primary
389
307
 
390
308
  ---
391
309
 
@@ -393,43 +311,43 @@ Stories and acceptance criteria derived from [.ai/prd.md](.ai/prd.md), grouped b
393
311
 
394
312
  **User story**
395
313
 
396
- - As a user or client LLM
397
- - I want to discover bootstrap-related prompts and read template resources via MCP so that I can run guided workflows (e.g. “bootstrap_agentic_repo”) or preview templates without calling tools
314
+ - As a user or client LLM
315
+ - I want to discover bootstrap-related prompts and read template resources via MCP so that I can run guided workflows (e.g. “bootstrap_agentic_repo”) or preview templates without calling tools
398
316
 
399
317
  **Acceptance criteria**
400
318
 
401
- - Given the server supports optional Prompts
402
- - When the client lists prompts
403
- - Then at least one prompt is available (e.g. bootstrap_agentic_repo) that instructs the client to call plan_bootstrap, review output, then call apply_bootstrap
319
+ - Given the server supports optional Prompts
320
+ - When the client lists prompts
321
+ - Then at least one prompt is available (e.g. bootstrap_agentic_repo) that instructs the client to call plan_bootstrap, review output, then call apply_bootstrap
404
322
 
405
- - Given the server supports optional Resources
406
- - When the client requests a resource URI (e.g. awb://templates/copilot-instructions.md or awb://templates/AGENTS.md)
407
- - Then the server returns read-only template content for that path
323
+ - Given the server supports optional Resources
324
+ - When the client requests a resource URI (e.g. awb://templates/copilot-instructions.md or awb://templates/AGENTS.md)
325
+ - Then the server returns read-only template content for that path
408
326
 
409
- - Given tools already return full template content in plan_bootstrap
410
- - When implementing resources
411
- - Then resources are optional; same content can be exposed via tools only
327
+ - Given tools already return full template content in plan_bootstrap
328
+ - When implementing resources
329
+ - Then resources are optional; same content can be exposed via tools only
412
330
 
413
331
  **Edge cases**
414
332
 
415
- - Client does not support prompts/resources: server still works with tools only
416
- - Unknown resource URI: return 404 or equivalent error
333
+ - Client does not support prompts/resources: server still works with tools only
334
+ - Unknown resource URI: return 404 or equivalent error
417
335
 
418
336
  **Technical considerations**
419
337
 
420
- - MCP Prompts: register with the SDK; bootstrap_agentic_repo and optionally draft_readme_patch
421
- - MCP Resources: register template URIs; resolve to static files from package
338
+ - MCP Prompts: register with the SDK; bootstrap_agentic_repo and optionally draft_readme_patch
339
+ - MCP Resources: register template URIs; resolve to static files from package
422
340
 
423
341
  **Design notes**
424
342
 
425
- - v0.3 “only if needed”; if ship is faster without resources, tools-only is acceptable
343
+ - v0.3 “only if needed”; if ship is faster without resources, tools-only is acceptable
426
344
 
427
345
  ---
428
346
 
429
347
  ## Coverage and consistency
430
348
 
431
- - All PRD MVP goals and tool contracts (plan_bootstrap, apply_bootstrap, overwrite rules, baseline scaffold, safety, distribution) are covered by v0.1 stories.
432
- - v0.2 covers detect_repo_hints and README proposal.
433
- - v0.3 covers prompt mode and optional prompts/resources.
434
- - Early deployment (Story 7) is part of v0.1 so that “works on other computers” is validated before or with the first usable release.
435
- - Acceptance criteria are written in Given/When/Then form and are testable (manual or automated).
349
+ - All PRD MVP goals and tool contracts (plan_bootstrap, apply_bootstrap, overwrite rules, baseline scaffold, safety, distribution) are covered by v0.1 stories.
350
+ - v0.2 covers detect_repo_hints and README proposal.
351
+ - v0.3 covers prompt mode and optional prompts/resources.
352
+ - Early deployment (Story 7) is part of v0.1 so that “works on other computers” is validated before or with the first usable release.
353
+ - Acceptance criteria are written in Given/When/Then form and are testable (manual or automated).
package/AGENTS.md ADDED
@@ -0,0 +1,3 @@
1
+ # Agents
2
+
3
+ This repo uses agentic workflows. Prefer repo scripts, write tests, and avoid destructive commands.