stoa-mcp 0.1.0 → 0.1.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.
Files changed (159) hide show
  1. package/LICENSE +21 -65
  2. package/README.md +23 -9
  3. package/dist/cli/build.d.ts +0 -1
  4. package/dist/cli/build.js +0 -1
  5. package/dist/cli/review-loop.d.ts +0 -1
  6. package/dist/cli/review-loop.js +0 -1
  7. package/dist/cli/scenarios-runner.d.ts +0 -1
  8. package/dist/cli/scenarios-runner.js +0 -1
  9. package/dist/cli/verify.d.ts +0 -1
  10. package/dist/cli/verify.js +0 -1
  11. package/dist/cli.d.ts +0 -1
  12. package/dist/cli.js +123 -20
  13. package/dist/core/index.d.ts +0 -1
  14. package/dist/core/index.js +0 -1
  15. package/dist/core/parsers.d.ts +0 -1
  16. package/dist/core/parsers.js +0 -1
  17. package/dist/core/prompts.d.ts +0 -1
  18. package/dist/core/prompts.js +0 -1
  19. package/dist/core/refine.d.ts +0 -1
  20. package/dist/core/refine.js +0 -1
  21. package/dist/core/spec-score.d.ts +0 -1
  22. package/dist/core/spec-score.js +0 -1
  23. package/dist/formatters/index.d.ts +0 -1
  24. package/dist/formatters/index.js +0 -1
  25. package/dist/formatters/stage-formatters.d.ts +0 -1
  26. package/dist/formatters/stage-formatters.js +0 -1
  27. package/dist/guardrails/index.d.ts +0 -1
  28. package/dist/guardrails/index.js +0 -1
  29. package/dist/guardrails/loader.d.ts +0 -1
  30. package/dist/guardrails/loader.js +0 -1
  31. package/dist/guardrails/refine.d.ts +0 -1
  32. package/dist/guardrails/refine.js +0 -1
  33. package/dist/index.d.ts +0 -1
  34. package/dist/index.js +0 -1
  35. package/dist/storage/change-detection.d.ts +0 -1
  36. package/dist/storage/change-detection.js +0 -1
  37. package/dist/storage/index.d.ts +0 -1
  38. package/dist/storage/index.js +0 -1
  39. package/dist/storage/moodboard-describe.d.ts +0 -1
  40. package/dist/storage/moodboard-describe.js +0 -1
  41. package/dist/storage/moodboard-sync.d.ts +0 -1
  42. package/dist/storage/moodboard-sync.js +0 -1
  43. package/dist/storage/moodboard.d.ts +0 -1
  44. package/dist/storage/moodboard.js +0 -1
  45. package/dist/storage/project-scan.d.ts +0 -1
  46. package/dist/storage/project-scan.js +0 -1
  47. package/dist/storage/project.d.ts +0 -1
  48. package/dist/storage/project.js +0 -1
  49. package/dist/storage/roles-refine.d.ts +0 -1
  50. package/dist/storage/roles-refine.js +0 -1
  51. package/dist/storage/roles.d.ts +0 -1
  52. package/dist/storage/roles.js +0 -1
  53. package/dist/storage/scenarios-refine.d.ts +0 -1
  54. package/dist/storage/scenarios-refine.js +0 -1
  55. package/dist/storage/scenarios.d.ts +0 -1
  56. package/dist/storage/scenarios.js +0 -1
  57. package/dist/storage/specs.d.ts +0 -1
  58. package/dist/storage/specs.js +0 -1
  59. package/dist/tools/index.d.ts +0 -1
  60. package/dist/tools/index.js +0 -1
  61. package/dist/tools/rerefine.d.ts +0 -1
  62. package/dist/tools/rerefine.js +0 -1
  63. package/dist/utils/index.d.ts +0 -1
  64. package/dist/utils/index.js +0 -1
  65. package/dist/utils/slug.d.ts +0 -1
  66. package/dist/utils/slug.js +0 -1
  67. package/dist/utils/spec-helpers.d.ts +0 -1
  68. package/dist/utils/spec-helpers.js +0 -1
  69. package/package.json +8 -3
  70. package/dist/cli/build.d.ts.map +0 -1
  71. package/dist/cli/build.js.map +0 -1
  72. package/dist/cli/review-loop.d.ts.map +0 -1
  73. package/dist/cli/review-loop.js.map +0 -1
  74. package/dist/cli/scenarios-runner.d.ts.map +0 -1
  75. package/dist/cli/scenarios-runner.js.map +0 -1
  76. package/dist/cli/verify.d.ts.map +0 -1
  77. package/dist/cli/verify.js.map +0 -1
  78. package/dist/cli.d.ts.map +0 -1
  79. package/dist/cli.js.map +0 -1
  80. package/dist/core/index.d.ts.map +0 -1
  81. package/dist/core/index.js.map +0 -1
  82. package/dist/core/parsers.d.ts.map +0 -1
  83. package/dist/core/parsers.js.map +0 -1
  84. package/dist/core/parsers.test.d.ts +0 -2
  85. package/dist/core/parsers.test.d.ts.map +0 -1
  86. package/dist/core/parsers.test.js +0 -198
  87. package/dist/core/parsers.test.js.map +0 -1
  88. package/dist/core/prompts.d.ts.map +0 -1
  89. package/dist/core/prompts.js.map +0 -1
  90. package/dist/core/refine.d.ts.map +0 -1
  91. package/dist/core/refine.js.map +0 -1
  92. package/dist/core/spec-score.d.ts.map +0 -1
  93. package/dist/core/spec-score.js.map +0 -1
  94. package/dist/formatters/index.d.ts.map +0 -1
  95. package/dist/formatters/index.js.map +0 -1
  96. package/dist/formatters/stage-formatters.d.ts.map +0 -1
  97. package/dist/formatters/stage-formatters.js.map +0 -1
  98. package/dist/formatters/stage-formatters.test.d.ts +0 -2
  99. package/dist/formatters/stage-formatters.test.d.ts.map +0 -1
  100. package/dist/formatters/stage-formatters.test.js +0 -107
  101. package/dist/formatters/stage-formatters.test.js.map +0 -1
  102. package/dist/guardrails/index.d.ts.map +0 -1
  103. package/dist/guardrails/index.js.map +0 -1
  104. package/dist/guardrails/loader.d.ts.map +0 -1
  105. package/dist/guardrails/loader.js.map +0 -1
  106. package/dist/guardrails/refine.d.ts.map +0 -1
  107. package/dist/guardrails/refine.js.map +0 -1
  108. package/dist/index.d.ts.map +0 -1
  109. package/dist/index.js.map +0 -1
  110. package/dist/storage/change-detection.d.ts.map +0 -1
  111. package/dist/storage/change-detection.js.map +0 -1
  112. package/dist/storage/change-detection.test.d.ts +0 -2
  113. package/dist/storage/change-detection.test.d.ts.map +0 -1
  114. package/dist/storage/change-detection.test.js +0 -81
  115. package/dist/storage/change-detection.test.js.map +0 -1
  116. package/dist/storage/index.d.ts.map +0 -1
  117. package/dist/storage/index.js.map +0 -1
  118. package/dist/storage/moodboard-describe.d.ts.map +0 -1
  119. package/dist/storage/moodboard-describe.js.map +0 -1
  120. package/dist/storage/moodboard-sync.d.ts.map +0 -1
  121. package/dist/storage/moodboard-sync.js.map +0 -1
  122. package/dist/storage/moodboard.d.ts.map +0 -1
  123. package/dist/storage/moodboard.js.map +0 -1
  124. package/dist/storage/moodboard.test.d.ts +0 -2
  125. package/dist/storage/moodboard.test.d.ts.map +0 -1
  126. package/dist/storage/moodboard.test.js +0 -133
  127. package/dist/storage/moodboard.test.js.map +0 -1
  128. package/dist/storage/project-scan.d.ts.map +0 -1
  129. package/dist/storage/project-scan.js.map +0 -1
  130. package/dist/storage/project.d.ts.map +0 -1
  131. package/dist/storage/project.js.map +0 -1
  132. package/dist/storage/roles-refine.d.ts.map +0 -1
  133. package/dist/storage/roles-refine.js.map +0 -1
  134. package/dist/storage/roles.d.ts.map +0 -1
  135. package/dist/storage/roles.js.map +0 -1
  136. package/dist/storage/scenarios-refine.d.ts.map +0 -1
  137. package/dist/storage/scenarios-refine.js.map +0 -1
  138. package/dist/storage/scenarios.d.ts.map +0 -1
  139. package/dist/storage/scenarios.js.map +0 -1
  140. package/dist/storage/specs.d.ts.map +0 -1
  141. package/dist/storage/specs.js.map +0 -1
  142. package/dist/tools/index.d.ts.map +0 -1
  143. package/dist/tools/index.js.map +0 -1
  144. package/dist/tools/rerefine.d.ts.map +0 -1
  145. package/dist/tools/rerefine.js.map +0 -1
  146. package/dist/tools/rerefine.test.d.ts +0 -2
  147. package/dist/tools/rerefine.test.d.ts.map +0 -1
  148. package/dist/tools/rerefine.test.js +0 -123
  149. package/dist/tools/rerefine.test.js.map +0 -1
  150. package/dist/utils/index.d.ts.map +0 -1
  151. package/dist/utils/index.js.map +0 -1
  152. package/dist/utils/slug.d.ts.map +0 -1
  153. package/dist/utils/slug.js.map +0 -1
  154. package/dist/utils/spec-helpers.d.ts.map +0 -1
  155. package/dist/utils/spec-helpers.js.map +0 -1
  156. package/dist/utils/spec-helpers.test.d.ts +0 -2
  157. package/dist/utils/spec-helpers.test.d.ts.map +0 -1
  158. package/dist/utils/spec-helpers.test.js +0 -114
  159. package/dist/utils/spec-helpers.test.js.map +0 -1
package/LICENSE CHANGED
@@ -1,65 +1,21 @@
1
- Business Source License 1.1
2
-
3
- Licensor: Lambis Stratoudakis
4
-
5
- Licensed Work: Stoa MCP
6
- The Licensed Work is (c) 2026 Lambis Stratoudakis.
7
-
8
- Additional Use Grant: You may make production use of the Licensed Work,
9
- provided your use does not include offering the
10
- Licensed Work to third parties on a hosted or
11
- embedded basis which is competitive with the
12
- Licensor's products.
13
-
14
- Change Date: 2030-03-11
15
-
16
- Change License: MIT
17
-
18
- For information about alternative licensing arrangements, please visit:
19
- https://stoa.dev
20
-
21
- --------------------------------------------------------------------------
22
-
23
- Business Source License 1.1
24
-
25
- Terms
26
-
27
- The Licensor hereby grants you the right to copy, modify, create derivative
28
- works, redistribute, and make non-production use of the Licensed Work. The
29
- Licensor may make an Additional Use Grant, above, permitting limited
30
- production use.
31
-
32
- Effective on the Change Date, or the fourth anniversary of the first publicly
33
- available distribution of a specific version of the Licensed Work under this
34
- License, whichever comes first, the Licensor hereby grants you rights under
35
- the terms of the Change License, and the rights granted in the paragraph
36
- above terminate.
37
-
38
- If your use of the Licensed Work does not comply with the requirements
39
- currently in effect as described in this License, you must purchase a
40
- commercial license from the Licensor, its affiliated entities, or authorized
41
- resellers, or you must refrain from using the Licensed Work.
42
-
43
- All copies of the original and modified Licensed Work, and derivative works
44
- of the Licensed Work, are subject to this License. This License applies
45
- separately for each version of the Licensed Work and the Change Date may vary
46
- for each version of the Licensed Work released by Licensor.
47
-
48
- You must conspicuously display this License on each original or modified copy
49
- of the Licensed Work. If you receive the Licensed Work in original or
50
- modified form from a third party, the terms and conditions set forth in this
51
- License apply to your use of that work.
52
-
53
- Any use of the Licensed Work in violation of this License will automatically
54
- terminate your rights under this License for the current and all other
55
- versions of the Licensed Work.
56
-
57
- This License does not grant you any right in any trademark or logo of
58
- Licensor or its affiliates (provided that you may use a trademark or logo of
59
- Licensor as expressly required by this License).
60
-
61
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
62
- AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
63
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
64
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
65
- TITLE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lambis Stratoudakis
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
@@ -92,34 +92,46 @@ Stoa runs 5 stages:
92
92
  After refining, Stoa:
93
93
  - Saves the spec as readable markdown files in `.stoa/specs/`
94
94
  - Copies Stage 1 to your clipboard automatically
95
- - Prints a build command you can use with Claude Code
95
+ - Shows an interactive menu:
96
96
 
97
97
  ```
98
98
  Spec saved to .stoa/specs/personal-finance-tracker/
99
- Score: 5/5 Executable
99
+ Spec Score: 5 / 5
100
100
 
101
101
  → Stage 1 description copied to clipboard
102
102
  Paste into Lovable, Bolt, v0, or any AI tool
103
103
 
104
- Build prompt for Claude Code:
105
- Read the spec in .stoa/specs/personal-finance-tracker/ and build it.
106
-
107
- Scenarios saved. Run: stoa scenarios run
104
+ What next?
105
+ [b] Build with Claude Code
106
+ [c] Copy spec to clipboard
107
+ [e] Export as single markdown
108
+ [v] View spec files
109
+ [q] Done
108
110
  ```
109
111
 
112
+ - **[b] Build** — launches Claude Code with the spec pre-loaded
113
+ - **[c] Copy** — re-copies the full spec to clipboard (useful if you copied something else)
114
+ - **[e] Export** — writes all 5 stages as a single markdown to `specs/<slug>/spec.md` in your project root (visible, not hidden inside `.stoa/`)
115
+ - **[v] View** — opens the spec directory in Finder
116
+ - **[q] Done** — exits
117
+
110
118
  ### 4. Build
111
119
 
112
- **Option A — Paste into any AI tool:**
120
+ **Option A — Press [b] after refine:**
121
+
122
+ The fastest path. Press `b` in the post-refine menu and Claude Code starts building immediately.
123
+
124
+ **Option B — Paste into any AI tool:**
113
125
 
114
126
  Open Lovable, Bolt, v0, or any AI coding tool. Press Cmd+V. The spec is already on your clipboard. The AI builds exactly what you specified.
115
127
 
116
- **Option B — Use Claude Code:**
128
+ **Option C — Use Claude Code manually:**
117
129
 
118
130
  ```bash
119
131
  claude "Read the spec in .stoa/specs/personal-finance-tracker/ and build it. Follow all constraints and subtasks."
120
132
  ```
121
133
 
122
- **Option C — Use Cursor with Claude Code extension:**
134
+ **Option D — Use Cursor with Claude Code extension:**
123
135
 
124
136
  Open the project folder in Cursor. Open Claude Code from the sidebar. Paste the build prompt.
125
137
 
@@ -261,6 +273,8 @@ stoa refine "task" --mode clipboard # Get prompts without AI calls
261
273
  # Specs
262
274
  stoa specs list # List all saved specs
263
275
  stoa specs show <name> # View a spec's contents
276
+ # Export (also available as [e] in the post-refine menu)
277
+ # Writes to specs/<slug>/spec.md in your project root
264
278
 
265
279
  # Scenarios
266
280
  stoa scenarios list # List scenarios for latest spec
@@ -36,4 +36,3 @@ export declare function parseSubtasks(specContent: string): Subtask[];
36
36
  * Returns "all", "q", or a 1-based subtask number.
37
37
  */
38
38
  export declare function promptSubtaskChoice(subtasks: Subtask[]): Promise<string>;
39
- //# sourceMappingURL=build.d.ts.map
package/dist/cli/build.js CHANGED
@@ -285,4 +285,3 @@ export function promptSubtaskChoice(subtasks) {
285
285
  });
286
286
  });
287
287
  }
288
- //# sourceMappingURL=build.js.map
@@ -1,2 +1 @@
1
1
  export declare function runReviewLoop(specDir: string): Promise<void>;
2
- //# sourceMappingURL=review-loop.d.ts.map
@@ -94,4 +94,3 @@ export async function runReviewLoop(specDir) {
94
94
  await appendFile(join(specDir, "user-notes.md"), entry, "utf-8");
95
95
  }
96
96
  }
97
- //# sourceMappingURL=review-loop.js.map
@@ -9,4 +9,3 @@ export declare function loadSpecScenarios(specName?: string): Promise<{
9
9
  }>;
10
10
  export declare function runSpecScenarios(specName?: string): Promise<void>;
11
11
  export {};
12
- //# sourceMappingURL=scenarios-runner.d.ts.map
@@ -155,4 +155,3 @@ export async function runSpecScenarios(specName) {
155
155
  }
156
156
  }
157
157
  }
158
- //# sourceMappingURL=scenarios-runner.js.map
@@ -10,4 +10,3 @@ export interface VerifyResult {
10
10
  failures: VerifyFailure[];
11
11
  }
12
12
  export declare function runVerify(name: string): Promise<VerifyResult>;
13
- //# sourceMappingURL=verify.d.ts.map
@@ -146,4 +146,3 @@ export async function runVerify(name) {
146
146
  process.stdout.write(`\nPassed: ${result.passed} | Failed: ${result.failed} | Skipped: ${result.skipped}\n`);
147
147
  return result;
148
148
  }
149
- //# sourceMappingURL=verify.js.map
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import { listGuardrails, addGuardrail, showGuardrail, removeGuardrail, } from ".
14
14
  import { refinePipeline as refineGuardrail } from "./guardrails/refine.js";
15
15
  import { refinePipeline as refineRole } from "./storage/roles-refine.js";
16
16
  import { toSlug, resolveSlug } from "./utils/slug.js";
17
- import { readMoodboard, writeSpecFiles, writeRefineMeta, listSpecs, showSpec } from "./storage/index.js";
17
+ import { readMoodboard, writeSpecFiles, writeRefineMeta, listSpecs, showSpec, STAGE_FILENAMES } from "./storage/index.js";
18
18
  import { listRoles, addRole, showRole, removeRole, loadRole, } from "./storage/roles.js";
19
19
  import { listScenarios, showScenarios, addScenario, removeScenario, } from "./storage/scenarios.js";
20
20
  import { generateScenarios } from "./storage/scenarios-refine.js";
@@ -130,11 +130,130 @@ function copyToClipboard(text) {
130
130
  // Clipboard unavailable — skip silently
131
131
  }
132
132
  }
133
+ async function buildExportMarkdown(specsDir, slug) {
134
+ const specDir = join(specsDir, slug);
135
+ const sections = [];
136
+ for (const stageNum of [1, 2, 3, 4, 5]) {
137
+ const filename = STAGE_FILENAMES[stageNum];
138
+ if (!filename)
139
+ continue;
140
+ try {
141
+ const content = await readFile(join(specDir, filename), "utf-8");
142
+ const displayName = STAGE_DISPLAY_NAMES[stageNum] ?? `Stage ${stageNum}`;
143
+ sections.push(`## Stage ${stageNum}: ${displayName}\n\n${content.trimEnd()}`);
144
+ }
145
+ catch {
146
+ // stage file missing — skip
147
+ }
148
+ }
149
+ return sections.join("\n\n") + "\n";
150
+ }
151
+ function waitForKeypress() {
152
+ return new Promise((resolve) => {
153
+ const { stdin } = process;
154
+ if (!stdin.isTTY || typeof stdin.setRawMode !== "function") {
155
+ resolve("q");
156
+ return;
157
+ }
158
+ const wasRaw = stdin.isRaw;
159
+ stdin.setRawMode(true);
160
+ stdin.resume();
161
+ stdin.once("data", (data) => {
162
+ stdin.setRawMode(wasRaw);
163
+ stdin.pause();
164
+ resolve(data.toString());
165
+ });
166
+ });
167
+ }
168
+ async function showPostRefineMenu(slug) {
169
+ const specsDir = join(process.cwd(), ".stoa", "specs");
170
+ const specDir = join(specsDir, slug);
171
+ const printMenu = () => {
172
+ writeln();
173
+ writeln(chalk.bold("What next?"));
174
+ writeln(` ${chalk.cyan("[b]")} Build with Claude Code`);
175
+ writeln(` ${chalk.cyan("[c]")} Copy spec to clipboard`);
176
+ writeln(` ${chalk.cyan("[e]")} Export as single markdown`);
177
+ writeln(` ${chalk.cyan("[v]")} View spec files`);
178
+ writeln(` ${chalk.cyan("[q]")} Done`);
179
+ writeln();
180
+ };
181
+ if (!process.stdin.isTTY) {
182
+ writeln();
183
+ writeln(chalk.bold("Next steps:"));
184
+ writeln(` ${chalk.cyan("stoa export")} ${slug} — export spec as markdown`);
185
+ writeln(` ${chalk.cyan("stoa build")} ${slug} — build with Claude Code`);
186
+ writeln();
187
+ return;
188
+ }
189
+ printMenu();
190
+ while (true) {
191
+ const key = await waitForKeypress();
192
+ // Handle Ctrl+C
193
+ if (key === "\x03") {
194
+ process.exit(0);
195
+ }
196
+ switch (key.toLowerCase()) {
197
+ case "b": {
198
+ // Verify spec dir exists
199
+ try {
200
+ await access(specDir);
201
+ }
202
+ catch {
203
+ writeln(chalk.red(`Error: spec directory not found: .stoa/specs/${slug}/`));
204
+ printMenu();
205
+ break;
206
+ }
207
+ const buildPrompt = `Read the spec in .stoa/specs/${slug}/ and build it. Follow all constraints and subtasks. Do not modify or delete the .stoa/ directory — it is not part of the project.`;
208
+ spawn("claude", [buildPrompt], { stdio: "inherit", detached: true });
209
+ return;
210
+ }
211
+ case "c": {
212
+ const markdown = await buildExportMarkdown(specsDir, slug);
213
+ copyToClipboard(markdown);
214
+ writeln(chalk.green("Spec copied to clipboard."));
215
+ printMenu();
216
+ break;
217
+ }
218
+ case "e": {
219
+ const markdown = await buildExportMarkdown(specsDir, slug);
220
+ const exportDir = join(process.cwd(), "specs", slug);
221
+ await mkdir(exportDir, { recursive: true });
222
+ const exportPath = join(exportDir, "spec.md");
223
+ await writeFile(exportPath, markdown, "utf-8");
224
+ writeln(chalk.green(`Exported to specs/${slug}/spec.md`));
225
+ printMenu();
226
+ break;
227
+ }
228
+ case "v": {
229
+ // Verify spec dir exists
230
+ try {
231
+ await access(specDir);
232
+ }
233
+ catch {
234
+ writeln(chalk.red(`Error: spec directory not found: .stoa/specs/${slug}/`));
235
+ printMenu();
236
+ break;
237
+ }
238
+ const opener = process.platform === "darwin" ? "open" : "xdg-open";
239
+ spawn(opener, [specDir], { stdio: "ignore", detached: true });
240
+ writeln(chalk.dim(specDir));
241
+ printMenu();
242
+ break;
243
+ }
244
+ case "q": {
245
+ process.exit(0);
246
+ }
247
+ default:
248
+ // Ignore unrecognized keys
249
+ break;
250
+ }
251
+ }
252
+ }
133
253
  async function printPostRefineOutput(slug, specScore) {
134
254
  const specsDir = join(process.cwd(), ".stoa", "specs");
135
255
  const descPath = join(specsDir, slug, "01-problem-statement.md");
136
- const scenariosPath = join(specsDir, slug, "05-evaluation-design.md");
137
- // Copy Stage 1 to clipboard
256
+ // Copy Stage 1 to clipboard (preserved behavior)
138
257
  let copiedToClipboard = false;
139
258
  try {
140
259
  const descContent = await readFile(descPath, "utf-8");
@@ -144,15 +263,6 @@ async function printPostRefineOutput(slug, specScore) {
144
263
  catch {
145
264
  // description file missing — skip
146
265
  }
147
- // Check if scenarios exist
148
- let hasScenarios = false;
149
- try {
150
- const scenariosContent = await readFile(scenariosPath, "utf-8");
151
- hasScenarios = scenariosContent.trim().length > 0;
152
- }
153
- catch {
154
- // no scenarios file
155
- }
156
266
  writeln();
157
267
  writeln(chalk.cyan(`Spec saved to .stoa/specs/${slug}/`));
158
268
  printScoreBadge(specScore);
@@ -161,13 +271,7 @@ async function printPostRefineOutput(slug, specScore) {
161
271
  writeln(chalk.green("→ Stage 1 description copied to clipboard"));
162
272
  writeln(chalk.dim(" Paste into Lovable, Bolt, v0, or any AI tool"));
163
273
  }
164
- writeln();
165
- writeln(chalk.green("→ Build prompt for Claude Code:"));
166
- writeln(chalk.dim(` Read the spec in .stoa/specs/${slug}/ and build it. Follow all constraints and subtasks.`));
167
- if (hasScenarios) {
168
- writeln();
169
- writeln(chalk.green(`→ Scenarios saved. Run: ${chalk.white(`stoa scenarios run ${slug}`)}`));
170
- }
274
+ await showPostRefineMenu(slug);
171
275
  }
172
276
  function resolveStages(stagesArg) {
173
277
  const names = stagesArg.split(",").map((s) => s.trim());
@@ -1132,4 +1236,3 @@ program
1132
1236
  });
1133
1237
  // ── Parse ─────────────────────────────────────────────────────────────
1134
1238
  program.parse();
1135
- //# sourceMappingURL=cli.js.map
@@ -1,3 +1,2 @@
1
1
  export { computeSpecScore } from "./spec-score.js";
2
2
  export type { SpecScoreInput, SpecScoreResult } from "./spec-score.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { computeSpecScore } from "./spec-score.js";
2
- //# sourceMappingURL=index.js.map
@@ -26,4 +26,3 @@ interface ScenarioItem {
26
26
  }
27
27
  export declare function parseScenarios(raw: string): ScenarioItem[];
28
28
  export {};
29
- //# sourceMappingURL=parsers.d.ts.map
@@ -293,4 +293,3 @@ export function parseScenarios(raw) {
293
293
  return [];
294
294
  return parsed;
295
295
  }
296
- //# sourceMappingURL=parsers.js.map
@@ -27,4 +27,3 @@ export declare function buildConstraintPrompt(title: string, refinedDescription:
27
27
  export declare function buildDecompositionPrompt(title: string, refinedDescription: string, acceptanceCriteria: string, constraints: string, options?: PromptOptions): PromptResult;
28
28
  export declare function buildEvaluationDesignPrompt(title: string, refinedDescription: string, acceptanceCriteria: string, constraints: string, options?: PromptOptions): PromptResult;
29
29
  export {};
30
- //# sourceMappingURL=prompts.d.ts.map
@@ -343,4 +343,3 @@ Return ONLY the JSON array. No preamble, no explanation.`;
343
343
  userPrompt: buildUserPrompt(fields),
344
344
  };
345
345
  }
346
- //# sourceMappingURL=prompts.js.map
@@ -35,4 +35,3 @@ export interface RefineResult {
35
35
  executionMode: "api" | "claude-code" | "clipboard";
36
36
  }
37
37
  export declare function refinePipeline(input: RefineInput, options?: RefineOptions): Promise<RefineResult>;
38
- //# sourceMappingURL=refine.d.ts.map
@@ -230,4 +230,3 @@ export async function refinePipeline(input, options = {}) {
230
230
  executionMode: mode,
231
231
  };
232
232
  }
233
- //# sourceMappingURL=refine.js.map
@@ -14,4 +14,3 @@ export interface SpecScoreResult {
14
14
  missing: string[];
15
15
  }
16
16
  export declare function computeSpecScore(input: SpecScoreInput): SpecScoreResult;
17
- //# sourceMappingURL=spec-score.d.ts.map
@@ -56,4 +56,3 @@ export function computeSpecScore(input) {
56
56
  }
57
57
  return { score, level, missing };
58
58
  }
59
- //# sourceMappingURL=spec-score.js.map
@@ -1,2 +1 @@
1
1
  export { formatDescription, formatAcceptanceCriteria, formatConstraints, formatSubtasks, formatScenarios, } from "./stage-formatters.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { formatDescription, formatAcceptanceCriteria, formatConstraints, formatSubtasks, formatScenarios, } from "./stage-formatters.js";
2
- //# sourceMappingURL=index.js.map
@@ -7,4 +7,3 @@ export declare function formatAcceptanceCriteria(raw: string): string;
7
7
  export declare function formatConstraints(raw: string): string;
8
8
  export declare function formatSubtasks(raw: string): string;
9
9
  export declare function formatScenarios(raw: string): string;
10
- //# sourceMappingURL=stage-formatters.d.ts.map
@@ -97,4 +97,3 @@ export function formatScenarios(raw) {
97
97
  return raw;
98
98
  }
99
99
  }
100
- //# sourceMappingURL=stage-formatters.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@ export declare function addGuardrail(title: string): void;
6
6
  export declare function showGuardrail(slug: string): string;
7
7
  export declare function removeGuardrail(slug: string): void;
8
8
  export declare function loadAllGuardrails(): string;
9
- //# sourceMappingURL=loader.d.ts.map
@@ -53,4 +53,3 @@ export function loadAllGuardrails() {
53
53
  .map((file) => readFileSync(join(guardrailsDir(), file), "utf-8"))
54
54
  .join("\n---\n");
55
55
  }
56
- //# sourceMappingURL=loader.js.map
@@ -50,4 +50,3 @@ export interface GuardrailRefineResult {
50
50
  * @throws If the guardrail file does not exist.
51
51
  */
52
52
  export declare function refinePipeline(options: GuardrailRefineOptions): Promise<GuardrailRefineResult>;
53
- //# sourceMappingURL=refine.d.ts.map
@@ -181,4 +181,3 @@ export async function refinePipeline(options) {
181
181
  }
182
182
  return { prompts, finalOutput: currentInput };
183
183
  }
184
- //# sourceMappingURL=refine.js.map
package/dist/index.d.ts CHANGED
@@ -3,4 +3,3 @@
3
3
  * Registers refine_task, score_spec tools, guardrails resource, and refine prompt.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -193,4 +193,3 @@ main().catch((err) => {
193
193
  process.stderr.write(`Fatal: ${err}\n`);
194
194
  process.exit(1);
195
195
  });
196
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export declare function detectChanges(specDir: string, snapshot: Record<string, string>): Promise<number[]>;
2
- //# sourceMappingURL=change-detection.d.ts.map
@@ -44,4 +44,3 @@ export async function detectChanges(specDir, snapshot) {
44
44
  const stages = new Set(results.flat());
45
45
  return [...stages].sort((a, b) => a - b);
46
46
  }
47
- //# sourceMappingURL=change-detection.js.map
@@ -6,4 +6,3 @@ export { detectChanges } from "./change-detection.js";
6
6
  export { scanProject } from "./project-scan.js";
7
7
  export type { ProjectContext } from "./project-scan.js";
8
8
  export { syncMoodboard } from "./moodboard-sync.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ export { readMoodboard } from "./moodboard.js";
3
3
  export { detectChanges } from "./change-detection.js";
4
4
  export { scanProject } from "./project-scan.js";
5
5
  export { syncMoodboard } from "./moodboard-sync.js";
6
- //# sourceMappingURL=index.js.map
@@ -11,4 +11,3 @@ export interface DescribeResult {
11
11
  written: boolean;
12
12
  }
13
13
  export declare function describeMoodboard(dir: string, options: DescribeOptions): Promise<DescribeResult>;
14
- //# sourceMappingURL=moodboard-describe.d.ts.map
@@ -182,4 +182,3 @@ export async function describeMoodboard(dir, options) {
182
182
  }
183
183
  return { mode: "api", output, imageCount: imageFiles.length, written: true };
184
184
  }
185
- //# sourceMappingURL=moodboard-describe.js.map
@@ -8,4 +8,3 @@ interface TokensResult {
8
8
  }
9
9
  export declare function syncMoodboard(dir: string): TokensResult;
10
10
  export {};
11
- //# sourceMappingURL=moodboard-sync.d.ts.map
@@ -202,4 +202,3 @@ export function syncMoodboard(dir) {
202
202
  writeFileSync(tokensPath, JSON.stringify(tokens, null, 2) + "\n", "utf-8");
203
203
  return tokens;
204
204
  }
205
- //# sourceMappingURL=moodboard-sync.js.map
@@ -1,4 +1,3 @@
1
1
  import type { MoodboardContext } from "../core/prompts.js";
2
2
  export type { MoodboardContext } from "../core/prompts.js";
3
3
  export declare function readMoodboard(projectRoot: string): Promise<MoodboardContext | null>;
4
- //# sourceMappingURL=moodboard.d.ts.map
@@ -65,4 +65,3 @@ export async function readMoodboard(projectRoot) {
65
65
  await writeFile(join(moodboardDir, ".snapshot"), snapshot, "utf-8");
66
66
  return context;
67
67
  }
68
- //# sourceMappingURL=moodboard.js.map
@@ -9,4 +9,3 @@ export interface ProjectContext {
9
9
  lessons?: string;
10
10
  }
11
11
  export declare function scanProject(dir: string): ProjectContext;
12
- //# sourceMappingURL=project-scan.d.ts.map
@@ -115,4 +115,3 @@ export function scanProject(dir) {
115
115
  context.lessons = readFileSafe(join(dir, ".stoa", "lessons.md"));
116
116
  return context;
117
117
  }
118
- //# sourceMappingURL=project-scan.js.map
@@ -7,4 +7,3 @@ interface ProjectConfig {
7
7
  export declare function initProject(name: string, type: string, noTemplates?: boolean): Promise<boolean>;
8
8
  export declare function loadConfig(): Promise<ProjectConfig>;
9
9
  export {};
10
- //# sourceMappingURL=project.d.ts.map
@@ -98,4 +98,3 @@ export async function loadConfig() {
98
98
  const raw = await readFile(configPath, "utf-8");
99
99
  return JSON.parse(raw);
100
100
  }
101
- //# sourceMappingURL=project.js.map
@@ -56,4 +56,3 @@ export interface RoleRefineResult {
56
56
  * @throws If the role file does not exist.
57
57
  */
58
58
  export declare function refinePipeline(options: RoleRefineOptions): Promise<RoleRefineResult>;
59
- //# sourceMappingURL=roles-refine.d.ts.map
@@ -220,4 +220,3 @@ export async function refinePipeline(options) {
220
220
  // Stage 3 output is NOT written to any file — it's advisory only
221
221
  return { prompts, finalOutput: currentInput };
222
222
  }
223
- //# sourceMappingURL=roles-refine.js.map
@@ -3,4 +3,3 @@ export declare function addRole(displayName: string): void;
3
3
  export declare function showRole(slug: string): string;
4
4
  export declare function removeRole(slug: string): void;
5
5
  export declare function loadRole(slug: string): string;
6
- //# sourceMappingURL=roles.d.ts.map
@@ -38,4 +38,3 @@ export function removeRole(slug) {
38
38
  export function loadRole(slug) {
39
39
  return showRole(slug);
40
40
  }
41
- //# sourceMappingURL=roles.js.map
@@ -44,4 +44,3 @@ export declare function buildValidationCommandPrompt(structuredScenarios: string
44
44
  * @param mode - Execution mode: "api", "clipboard", or "cli".
45
45
  */
46
46
  export declare function generateScenarios(taskName: string, mode: "api" | "clipboard" | "cli"): Promise<void>;
47
- //# sourceMappingURL=scenarios-refine.d.ts.map
@@ -308,4 +308,3 @@ export async function generateScenarios(taskName, mode) {
308
308
  writeFileSync(outPath, JSON.stringify(finalScenarios, null, 2) + "\n", "utf-8");
309
309
  process.stderr.write(`\nWritten: .stoa/scenarios/${taskName}.json (${finalScenarios.length} scenarios)\n`);
310
310
  }
311
- //# sourceMappingURL=scenarios-refine.js.map