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.
- package/LICENSE +21 -65
- package/README.md +23 -9
- package/dist/cli/build.d.ts +0 -1
- package/dist/cli/build.js +0 -1
- package/dist/cli/review-loop.d.ts +0 -1
- package/dist/cli/review-loop.js +0 -1
- package/dist/cli/scenarios-runner.d.ts +0 -1
- package/dist/cli/scenarios-runner.js +0 -1
- package/dist/cli/verify.d.ts +0 -1
- package/dist/cli/verify.js +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +123 -20
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -1
- package/dist/core/parsers.d.ts +0 -1
- package/dist/core/parsers.js +0 -1
- package/dist/core/prompts.d.ts +0 -1
- package/dist/core/prompts.js +0 -1
- package/dist/core/refine.d.ts +0 -1
- package/dist/core/refine.js +0 -1
- package/dist/core/spec-score.d.ts +0 -1
- package/dist/core/spec-score.js +0 -1
- package/dist/formatters/index.d.ts +0 -1
- package/dist/formatters/index.js +0 -1
- package/dist/formatters/stage-formatters.d.ts +0 -1
- package/dist/formatters/stage-formatters.js +0 -1
- package/dist/guardrails/index.d.ts +0 -1
- package/dist/guardrails/index.js +0 -1
- package/dist/guardrails/loader.d.ts +0 -1
- package/dist/guardrails/loader.js +0 -1
- package/dist/guardrails/refine.d.ts +0 -1
- package/dist/guardrails/refine.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/storage/change-detection.d.ts +0 -1
- package/dist/storage/change-detection.js +0 -1
- package/dist/storage/index.d.ts +0 -1
- package/dist/storage/index.js +0 -1
- package/dist/storage/moodboard-describe.d.ts +0 -1
- package/dist/storage/moodboard-describe.js +0 -1
- package/dist/storage/moodboard-sync.d.ts +0 -1
- package/dist/storage/moodboard-sync.js +0 -1
- package/dist/storage/moodboard.d.ts +0 -1
- package/dist/storage/moodboard.js +0 -1
- package/dist/storage/project-scan.d.ts +0 -1
- package/dist/storage/project-scan.js +0 -1
- package/dist/storage/project.d.ts +0 -1
- package/dist/storage/project.js +0 -1
- package/dist/storage/roles-refine.d.ts +0 -1
- package/dist/storage/roles-refine.js +0 -1
- package/dist/storage/roles.d.ts +0 -1
- package/dist/storage/roles.js +0 -1
- package/dist/storage/scenarios-refine.d.ts +0 -1
- package/dist/storage/scenarios-refine.js +0 -1
- package/dist/storage/scenarios.d.ts +0 -1
- package/dist/storage/scenarios.js +0 -1
- package/dist/storage/specs.d.ts +0 -1
- package/dist/storage/specs.js +0 -1
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.js +0 -1
- package/dist/tools/rerefine.d.ts +0 -1
- package/dist/tools/rerefine.js +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/slug.d.ts +0 -1
- package/dist/utils/slug.js +0 -1
- package/dist/utils/spec-helpers.d.ts +0 -1
- package/dist/utils/spec-helpers.js +0 -1
- package/package.json +8 -3
- package/dist/cli/build.d.ts.map +0 -1
- package/dist/cli/build.js.map +0 -1
- package/dist/cli/review-loop.d.ts.map +0 -1
- package/dist/cli/review-loop.js.map +0 -1
- package/dist/cli/scenarios-runner.d.ts.map +0 -1
- package/dist/cli/scenarios-runner.js.map +0 -1
- package/dist/cli/verify.d.ts.map +0 -1
- package/dist/cli/verify.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/parsers.d.ts.map +0 -1
- package/dist/core/parsers.js.map +0 -1
- package/dist/core/parsers.test.d.ts +0 -2
- package/dist/core/parsers.test.d.ts.map +0 -1
- package/dist/core/parsers.test.js +0 -198
- package/dist/core/parsers.test.js.map +0 -1
- package/dist/core/prompts.d.ts.map +0 -1
- package/dist/core/prompts.js.map +0 -1
- package/dist/core/refine.d.ts.map +0 -1
- package/dist/core/refine.js.map +0 -1
- package/dist/core/spec-score.d.ts.map +0 -1
- package/dist/core/spec-score.js.map +0 -1
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/stage-formatters.d.ts.map +0 -1
- package/dist/formatters/stage-formatters.js.map +0 -1
- package/dist/formatters/stage-formatters.test.d.ts +0 -2
- package/dist/formatters/stage-formatters.test.d.ts.map +0 -1
- package/dist/formatters/stage-formatters.test.js +0 -107
- package/dist/formatters/stage-formatters.test.js.map +0 -1
- package/dist/guardrails/index.d.ts.map +0 -1
- package/dist/guardrails/index.js.map +0 -1
- package/dist/guardrails/loader.d.ts.map +0 -1
- package/dist/guardrails/loader.js.map +0 -1
- package/dist/guardrails/refine.d.ts.map +0 -1
- package/dist/guardrails/refine.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/storage/change-detection.d.ts.map +0 -1
- package/dist/storage/change-detection.js.map +0 -1
- package/dist/storage/change-detection.test.d.ts +0 -2
- package/dist/storage/change-detection.test.d.ts.map +0 -1
- package/dist/storage/change-detection.test.js +0 -81
- package/dist/storage/change-detection.test.js.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/moodboard-describe.d.ts.map +0 -1
- package/dist/storage/moodboard-describe.js.map +0 -1
- package/dist/storage/moodboard-sync.d.ts.map +0 -1
- package/dist/storage/moodboard-sync.js.map +0 -1
- package/dist/storage/moodboard.d.ts.map +0 -1
- package/dist/storage/moodboard.js.map +0 -1
- package/dist/storage/moodboard.test.d.ts +0 -2
- package/dist/storage/moodboard.test.d.ts.map +0 -1
- package/dist/storage/moodboard.test.js +0 -133
- package/dist/storage/moodboard.test.js.map +0 -1
- package/dist/storage/project-scan.d.ts.map +0 -1
- package/dist/storage/project-scan.js.map +0 -1
- package/dist/storage/project.d.ts.map +0 -1
- package/dist/storage/project.js.map +0 -1
- package/dist/storage/roles-refine.d.ts.map +0 -1
- package/dist/storage/roles-refine.js.map +0 -1
- package/dist/storage/roles.d.ts.map +0 -1
- package/dist/storage/roles.js.map +0 -1
- package/dist/storage/scenarios-refine.d.ts.map +0 -1
- package/dist/storage/scenarios-refine.js.map +0 -1
- package/dist/storage/scenarios.d.ts.map +0 -1
- package/dist/storage/scenarios.js.map +0 -1
- package/dist/storage/specs.d.ts.map +0 -1
- package/dist/storage/specs.js.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/rerefine.d.ts.map +0 -1
- package/dist/tools/rerefine.js.map +0 -1
- package/dist/tools/rerefine.test.d.ts +0 -2
- package/dist/tools/rerefine.test.d.ts.map +0 -1
- package/dist/tools/rerefine.test.js +0 -123
- package/dist/tools/rerefine.test.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/slug.d.ts.map +0 -1
- package/dist/utils/slug.js.map +0 -1
- package/dist/utils/spec-helpers.d.ts.map +0 -1
- package/dist/utils/spec-helpers.js.map +0 -1
- package/dist/utils/spec-helpers.test.d.ts +0 -2
- package/dist/utils/spec-helpers.test.d.ts.map +0 -1
- package/dist/utils/spec-helpers.test.js +0 -114
- package/dist/utils/spec-helpers.test.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,65 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
-
|
|
95
|
+
- Shows an interactive menu:
|
|
96
96
|
|
|
97
97
|
```
|
|
98
98
|
Spec saved to .stoa/specs/personal-finance-tracker/
|
|
99
|
-
Score: 5/5
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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 —
|
|
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
|
|
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
|
|
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
|
package/dist/cli/build.d.ts
CHANGED
package/dist/cli/build.js
CHANGED
package/dist/cli/review-loop.js
CHANGED
package/dist/cli/verify.d.ts
CHANGED
package/dist/cli/verify.js
CHANGED
package/dist/cli.d.ts
CHANGED
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
|
-
|
|
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
|
-
|
|
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
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
package/dist/core/parsers.d.ts
CHANGED
package/dist/core/parsers.js
CHANGED
package/dist/core/prompts.d.ts
CHANGED
|
@@ -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
|
package/dist/core/prompts.js
CHANGED
package/dist/core/refine.d.ts
CHANGED
package/dist/core/refine.js
CHANGED
package/dist/core/spec-score.js
CHANGED
package/dist/formatters/index.js
CHANGED
|
@@ -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
|
package/dist/guardrails/index.js
CHANGED
|
@@ -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
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/storage/index.d.ts
CHANGED
package/dist/storage/index.js
CHANGED
package/dist/storage/project.js
CHANGED
package/dist/storage/roles.d.ts
CHANGED
package/dist/storage/roles.js
CHANGED
|
@@ -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
|