sdd-cli 0.1.2 → 0.1.3

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 (66) hide show
  1. package/README.md +126 -89
  2. package/dist/cli.js +7 -3
  3. package/dist/commands/doctor.js +11 -2
  4. package/dist/commands/gen-architecture.js +14 -4
  5. package/dist/commands/gen-best-practices.js +12 -2
  6. package/dist/commands/gen-functional-spec.js +13 -3
  7. package/dist/commands/gen-project-readme.js +15 -5
  8. package/dist/commands/gen-technical-spec.js +13 -3
  9. package/dist/commands/gen-utils.js +9 -1
  10. package/dist/commands/hello.js +21 -3
  11. package/dist/commands/learn-deliver.js +17 -3
  12. package/dist/commands/learn-refine.js +32 -11
  13. package/dist/commands/learn-start.js +9 -2
  14. package/dist/commands/learn-utils.js +7 -4
  15. package/dist/commands/pr-audit.js +17 -3
  16. package/dist/commands/pr-finish.js +17 -3
  17. package/dist/commands/pr-report.js +17 -3
  18. package/dist/commands/pr-respond.js +17 -3
  19. package/dist/commands/pr-start.js +9 -2
  20. package/dist/commands/pr-utils.js +8 -5
  21. package/dist/commands/req-archive.js +14 -6
  22. package/dist/commands/req-create.js +71 -14
  23. package/dist/commands/req-export.js +11 -3
  24. package/dist/commands/req-finish.js +28 -13
  25. package/dist/commands/req-lint.js +10 -2
  26. package/dist/commands/req-list.js +10 -2
  27. package/dist/commands/req-plan.js +34 -12
  28. package/dist/commands/req-refine.js +54 -5
  29. package/dist/commands/req-report.js +10 -2
  30. package/dist/commands/req-start.js +29 -12
  31. package/dist/commands/req-status.js +10 -2
  32. package/dist/commands/test-plan.js +13 -5
  33. package/dist/context/flags.d.ts +2 -0
  34. package/dist/context/flags.js +5 -1
  35. package/dist/providers/codex.js +2 -2
  36. package/dist/router/prompt-map.js +17 -5
  37. package/dist/ui/prompt.d.ts +1 -0
  38. package/dist/ui/prompt.js +8 -0
  39. package/dist/validation/gates.d.ts +19 -0
  40. package/dist/validation/gates.js +41 -0
  41. package/dist/validation/validate.js +24 -4
  42. package/dist/workspace/index.d.ts +6 -0
  43. package/dist/workspace/index.js +41 -10
  44. package/flows/ADMISSIONS_ADMIN.md +34 -33
  45. package/flows/ART.md +34 -33
  46. package/flows/COURT_SYSTEM.md +34 -33
  47. package/flows/DATA_SCIENTIST.md +34 -33
  48. package/flows/ECOMMERCE.md +34 -33
  49. package/flows/ECONOMICS.md +34 -33
  50. package/flows/GRAPHIC_DESIGN.md +34 -33
  51. package/flows/HISTORY.md +34 -33
  52. package/flows/LAWYER.md +35 -34
  53. package/flows/PROGRAMMER.md +34 -33
  54. package/flows/RETAIL_STORE.md +34 -33
  55. package/flows/SOCIOLOGY.md +34 -33
  56. package/flows/STATE_ADMIN.md +34 -33
  57. package/flows/STUDENT_UNIVERSITY.md +34 -33
  58. package/flows/TAXES_ADMIN.md +34 -33
  59. package/flows/TEACHER.md +34 -33
  60. package/package.json +13 -3
  61. package/router/BUSINESS.flow.md +58 -57
  62. package/router/DATA_SCIENCE.flow.md +59 -58
  63. package/router/DESIGN.flow.md +59 -58
  64. package/router/HUMANITIES.flow.md +59 -58
  65. package/router/LEGAL.flow.md +59 -58
  66. package/router/SOFTWARE_FEATURE.flow.md +60 -59
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # sdd-tool
1
+ # sdd-cli
2
2
 
3
3
  SDD-first, AI-native CLI to take a requirement from discovery to "done" with clean code, tests, and traceable docs. Built for teams that want a repeatable, end-to-end delivery framework powered by intelligent prompts and multi-agent coordination.
4
4
 
@@ -6,41 +6,41 @@ SDD-first, AI-native CLI to take a requirement from discovery to "done" with cle
6
6
 
7
7
  Build the foundation once, then lift everything else. The tool provides a durable structure: requirements, architecture, technical specs, quality gates, test plans, and decision logs. AI gets "wings" by being guided, constrained, and accountable at every step.
8
8
 
9
- Mission and vision live in `MISSION.md` and `VISION.md`.
9
+ Mission and vision live in `docs/MISSION.md` and `docs/VISION.md`.
10
10
 
11
11
  Deep process, commands, interactions, and diagrams live in:
12
- - `PROCESS.md`
13
- - `COMMANDS.md`
14
- - `INTERACTIONS.md`
15
- - `DIAGRAMS.md`
16
- - `ARCHITECTURE.md`
17
- - `SDD_CHECKLIST.md`
18
- - `GLOSSARY.md`
19
- - `FLOW_COVERAGE.md`
20
- - `VALIDATION_CHECKLIST.md`
21
- - `FLOW_TEMPLATE_MAP.md`
22
- - `GATE_PROMPT_MATRIX.md`
23
- - `TEMPLATE_LINT_RULES.md`
24
- - `GATE_COVERAGE_REPORT.md`
25
- - `FLOW_GATE_MAP.md`
26
- - `SPEC_COMPLETENESS_REPORT.md`
27
- - `FLOW_COMPLIANCE_CHECKLIST.md`
28
- - `RELEASE_READINESS_CHECKLIST.md`
29
- - `QUALITY_SCORE_RUBRIC.md`
30
- - `AUTOMATION_OUTLINE.md`
31
- - `PROMPT_COVERAGE_REPORT.md`
32
- - `GATE_SCHEMA_MAP.md`
33
- - `GATE_TEMPLATE_MAP.md`
34
- - `KNOWLEDGE_MODE_CHECKLIST.md`
35
- - `GATE_TEMPLATE_COVERAGE_REPORT.md`
36
- - `DOMAIN_COMPLETENESS_CHECKLIST.md`
37
- - `PROMPT_AUDIT_REPORT.md`
38
- - `PACK_COVERAGE_REPORT.md`
39
- - `IMPLEMENTATION_PLAN.md`
40
- - `CLEAN_ARCHITECTURE_CHECKLIST.md`
41
- - `REQUIREMENTS_ALIGNMENT.md`
42
- - `GITFLOW.md`
43
- - `RELEASE_PROCESS.md`
12
+ - `docs/PROCESS.md`
13
+ - `docs/COMMANDS.md`
14
+ - `docs/INTERACTIONS.md`
15
+ - `docs/DIAGRAMS.md`
16
+ - `docs/ARCHITECTURE.md`
17
+ - `docs/SDD_CHECKLIST.md`
18
+ - `docs/GLOSSARY.md`
19
+ - `docs/FLOW_COVERAGE.md`
20
+ - `docs/VALIDATION_CHECKLIST.md`
21
+ - `docs/FLOW_TEMPLATE_MAP.md`
22
+ - `docs/GATE_PROMPT_MATRIX.md`
23
+ - `docs/TEMPLATE_LINT_RULES.md`
24
+ - `docs/GATE_COVERAGE_REPORT.md`
25
+ - `docs/FLOW_GATE_MAP.md`
26
+ - `docs/SPEC_COMPLETENESS_REPORT.md`
27
+ - `docs/FLOW_COMPLIANCE_CHECKLIST.md`
28
+ - `docs/RELEASE_READINESS_CHECKLIST.md`
29
+ - `docs/QUALITY_SCORE_RUBRIC.md`
30
+ - `docs/AUTOMATION_OUTLINE.md`
31
+ - `docs/PROMPT_COVERAGE_REPORT.md`
32
+ - `docs/GATE_SCHEMA_MAP.md`
33
+ - `docs/GATE_TEMPLATE_MAP.md`
34
+ - `docs/KNOWLEDGE_MODE_CHECKLIST.md`
35
+ - `docs/GATE_TEMPLATE_COVERAGE_REPORT.md`
36
+ - `docs/DOMAIN_COMPLETENESS_CHECKLIST.md`
37
+ - `docs/PROMPT_AUDIT_REPORT.md`
38
+ - `docs/PACK_COVERAGE_REPORT.md`
39
+ - `docs/IMPLEMENTATION_PLAN.md`
40
+ - `docs/CLEAN_ARCHITECTURE_CHECKLIST.md`
41
+ - `docs/REQUIREMENTS_ALIGNMENT.md`
42
+ - `docs/GITFLOW.md`
43
+ - `docs/RELEASE_PROCESS.md`
44
44
 
45
45
  Examples and templates:
46
46
  - `examples/transcripts/`
@@ -80,6 +80,7 @@ Key properties:
80
80
  - Architecture (C4, containers, components, deployment)
81
81
  - Best practices and quality gates
82
82
  - Test plan and acceptance criteria
83
+ - Summary (objective, key decisions, open questions)
83
84
  - Decision log (ADR-style)
84
85
  - Progress log
85
86
  - Project README aligned to the SDD
@@ -87,75 +88,77 @@ Key properties:
87
88
  ## Install and run (cross-platform)
88
89
 
89
90
  ```
90
- npm install -g sdd-cli
91
+ npm install -g sdd-cli
91
92
  ```
92
93
 
93
- Then:
94
- ```
95
- sdd-tool hello
96
- ```
97
-
98
- Package name on npm is `sdd-cli` (CLI commands remain `sdd-tool` and `sdd`).
94
+ Then:
95
+ ```
96
+ sdd-cli hello
97
+ ```
98
+
99
+ Package name on npm is `sdd-cli` (CLI commands remain `sdd-cli` and `sdd`).
100
+
101
+ Project names must use letters, numbers, spaces, `-` or `_`, and cannot include path separators.
99
102
 
100
103
  The `hello` command is the entry point: it connects to AI, lists active projects, and offers to create a new one or continue. It then runs a guided, happy-path sequence from discovery to completion.
101
104
 
102
105
  ## The happy path (end-to-end flow)
103
106
 
104
107
  1) **Start**
105
- `sdd-tool hello` connects to AI, shows active projects, and asks if you want to start new or continue.
108
+ `sdd-cli hello` connects to AI, shows active projects, and asks if you want to start new or continue.
106
109
  It also asks for project name, domain, output location, language profile, and quality level.
107
110
 
108
111
  2) **Discover**
109
112
  Guided prompts produce `requirements/backlog/REQ-0001/requirement.md`.
110
113
 
111
114
  3) **Refine**
112
- `sdd-tool req refine` resolves ambiguity, missing metrics, and risks.
115
+ `sdd-cli req refine` resolves ambiguity, missing metrics, and risks.
113
116
 
114
117
  4) **Plan (WIP)**
115
- `sdd-tool req plan` creates functional spec, tech spec, and architecture drafts.
118
+ `sdd-cli req plan` creates functional spec, tech spec, and architecture drafts.
116
119
 
117
120
  5) **Implement**
118
- `sdd-tool req start` generates the implementation plan and activates quality gates.
121
+ `sdd-cli req start` generates the implementation plan and activates quality gates.
119
122
 
120
123
  6) **Verify**
121
- `sdd-tool test plan` defines scenarios and coverage targets.
124
+ `sdd-cli test plan` defines scenarios and coverage targets.
122
125
 
123
126
  7) **Finish**
124
- `sdd-tool req finish` seals the requirement, versioned docs, and decision logs.
127
+ `sdd-cli req finish` seals the requirement, versioned docs, and decision logs.
125
128
 
126
129
  ## Commands (proposed)
127
130
 
128
131
  ### Core
129
- - `sdd-tool hello` -- interactive session, project picker, full guided flow
130
- - `sdd-tool init` -- create SDD workspace and config
131
- - `sdd-tool list` -- list flows, router flows, templates, prompt packs, and projects
132
- - `sdd-tool doctor` -- validate completeness and consistency
132
+ - `sdd-cli hello` -- interactive session, project picker, full guided flow
133
+ - `sdd-cli init` -- create SDD workspace and config
134
+ - `sdd-cli list` -- list flows, router flows, templates, prompt packs, and projects
135
+ - `sdd-cli doctor` -- validate completeness and consistency
133
136
 
134
137
  ### Router
135
- - `sdd-tool route` -- classify user intent and route to the right flow
138
+ - `sdd-cli route` -- classify user intent and route to the right flow
136
139
 
137
140
  ### Requirement lifecycle
138
- - `sdd-tool req create`
139
- - `sdd-tool req refine`
140
- - `sdd-tool req plan`
141
- - `sdd-tool req start`
142
- - `sdd-tool req finish`
141
+ - `sdd-cli req create`
142
+ - `sdd-cli req refine`
143
+ - `sdd-cli req plan`
144
+ - `sdd-cli req start`
145
+ - `sdd-cli req finish`
143
146
 
144
147
  ### Generators
145
- - `sdd-tool gen requirements`
146
- - `sdd-tool gen functional-spec`
147
- - `sdd-tool gen technical-spec`
148
- - `sdd-tool gen architecture`
149
- - `sdd-tool gen best-practices`
150
- - `sdd-tool gen project-readme`
148
+ - `sdd-cli gen requirements`
149
+ - `sdd-cli gen functional-spec`
150
+ - `sdd-cli gen technical-spec`
151
+ - `sdd-cli gen architecture`
152
+ - `sdd-cli gen best-practices`
153
+ - `sdd-cli gen project-readme`
151
154
 
152
155
  ### Test planning
153
- - `sdd-tool test plan`
156
+ - `sdd-cli test plan`
154
157
 
155
158
  ### Learning mode
156
- - `sdd-tool learn start`
157
- - `sdd-tool learn refine`
158
- - `sdd-tool learn deliver`
159
+ - `sdd-cli learn start`
160
+ - `sdd-cli learn refine`
161
+ - `sdd-cli learn deliver`
159
162
 
160
163
  ### Flags
161
164
  - `--approve` -- run without extra confirmations
@@ -170,8 +173,8 @@ The `hello` command is the entry point: it connects to AI, lists active projects
170
173
  By default, the tool writes to a dedicated workspace, not into your repo:
171
174
 
172
175
  - Default (global workspace):
173
- - Windows: `%APPDATA%/sdd-tool/workspaces/<project>`
174
- - macOS/Linux: `~/.config/sdd-tool/workspaces/<project>`
176
+ - Windows: `%APPDATA%/sdd-cli/workspaces/<project>`
177
+ - macOS/Linux: `~/.config/sdd-cli/workspaces/<project>`
175
178
 
176
179
  Optional:
177
180
  - `--output ./docs/sdd` to keep SDD next to the repo
@@ -211,7 +214,7 @@ docs/
211
214
  - Domain rules add extra checks (compliance, audit, bias, safety).
212
215
 
213
216
  ### Consistency gate
214
- `sdd-tool doctor` ensures every requirement has matching specs, tests, and ADRs.
217
+ `sdd-cli doctor` ensures every requirement has matching specs, tests, and ADRs.
215
218
 
216
219
  ## Clean code across any language
217
220
 
@@ -273,7 +276,7 @@ AI should not guess. It should be guided, constrained, and verified.
273
276
  The router identifies the user intent and routes to the correct flow, prompts, and artifacts.
274
277
 
275
278
  ### Example
276
- User: `sdd-tool hello`
279
+ User: `sdd-cli hello`
277
280
  User input: "I have a bug: <link>. How to solve?"
278
281
 
279
282
  Router actions:
@@ -340,9 +343,9 @@ The tool is not only for software requirements. It can also run **knowledge jour
340
343
  4) **Deliver layered outputs**: executive summary, deep dive, references, and follow-up prompts.
341
344
 
342
345
  ### Commands (proposed)
343
- - `sdd-tool learn start` -- begin a guided research session
344
- - `sdd-tool learn refine` -- refine scope or depth
345
- - `sdd-tool learn deliver` -- produce final output package
346
+ - `sdd-cli learn start` -- begin a guided research session
347
+ - `sdd-cli learn refine` -- refine scope or depth
348
+ - `sdd-cli learn deliver` -- produce final output package
346
349
 
347
350
  ### Interview prompts (examples)
348
351
  - Why do you want to learn this topic?
@@ -375,25 +378,25 @@ This mode uses the same "AI wings" principle: clarify, commit, design, prove, de
375
378
 
376
379
  ### MVP commands
377
380
  Core:
378
- - `sdd-tool hello`
379
- - `sdd-tool init`
380
- - `sdd-tool list`
381
- - `sdd-tool doctor`
381
+ - `sdd-cli hello`
382
+ - `sdd-cli init`
383
+ - `sdd-cli list`
384
+ - `sdd-cli doctor`
382
385
 
383
386
  Requirements:
384
- - `sdd-tool req create`
385
- - `sdd-tool req refine`
386
- - `sdd-tool req plan`
387
- - `sdd-tool req start`
388
- - `sdd-tool req finish`
387
+ - `sdd-cli req create`
388
+ - `sdd-cli req refine`
389
+ - `sdd-cli req plan`
390
+ - `sdd-cli req start`
391
+ - `sdd-cli req finish`
389
392
 
390
393
  Generators:
391
- - `sdd-tool gen requirements`
392
- - `sdd-tool gen functional-spec`
393
- - `sdd-tool gen technical-spec`
394
- - `sdd-tool gen architecture`
395
- - `sdd-tool gen best-practices`
396
- - `sdd-tool gen project-readme`
394
+ - `sdd-cli gen requirements`
395
+ - `sdd-cli gen functional-spec`
396
+ - `sdd-cli gen technical-spec`
397
+ - `sdd-cli gen architecture`
398
+ - `sdd-cli gen best-practices`
399
+ - `sdd-cli gen project-readme`
397
400
 
398
401
  ### MVP prompts (must-ask list)
399
402
  Discovery:
@@ -564,3 +567,37 @@ These are opinionated, real-world flows that demonstrate how the CLI should be u
564
567
  - Jobs to be Done: https://www.intercom.com/blog/jtbd/
565
568
  - Design Thinking: https://www.interaction-design.org/literature/topics/design-thinking
566
569
  - CRISP-DM: https://www.ibm.com/docs/en/spss-modeler/18.2.2?topic=dm-crisp
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
package/dist/cli.js CHANGED
@@ -58,18 +58,22 @@ function getVersion() {
58
58
  }
59
59
  }
60
60
  program
61
- .name("sdd-tool")
61
+ .name("sdd-cli")
62
62
  .description("SDD-first, AI-native CLI")
63
63
  .version(getVersion())
64
64
  .option("--approve", "Skip confirmations if gates pass")
65
65
  .option("--improve", "Trigger self-audit and regenerate")
66
- .option("--parallel", "Generate in parallel when supported");
66
+ .option("--parallel", "Generate in parallel when supported")
67
+ .option("--project <name>", "Select or name the project")
68
+ .option("--output <path>", "Override workspace output root");
67
69
  program.hook("preAction", (thisCommand, actionCommand) => {
68
70
  const opts = typeof actionCommand.optsWithGlobals === "function" ? actionCommand.optsWithGlobals() : thisCommand.opts();
69
71
  (0, flags_1.setFlags)({
70
72
  approve: Boolean(opts.approve),
71
73
  improve: Boolean(opts.improve),
72
- parallel: Boolean(opts.parallel)
74
+ parallel: Boolean(opts.parallel),
75
+ project: typeof opts.project === "string" ? opts.project : undefined,
76
+ output: typeof opts.output === "string" ? opts.output : undefined
73
77
  });
74
78
  });
75
79
  program
@@ -46,9 +46,18 @@ function inferSchema(filePath) {
46
46
  }
47
47
  function runDoctor(projectName, reqId) {
48
48
  const workspace = (0, index_1.getWorkspaceInfo)();
49
- let root = projectName ? path_1.default.join(workspace.root, projectName) : workspace.root;
49
+ let root = workspace.root;
50
+ if (projectName) {
51
+ try {
52
+ root = (0, index_1.getProjectInfo)(workspace, projectName).root;
53
+ }
54
+ catch (error) {
55
+ console.log(error.message);
56
+ return;
57
+ }
58
+ }
50
59
  if (projectName && reqId) {
51
- const base = path_1.default.join(workspace.root, projectName, "requirements");
60
+ const base = path_1.default.join(root, "requirements");
52
61
  const candidates = [
53
62
  path_1.default.join(base, "backlog", reqId),
54
63
  path_1.default.join(base, "wip", reqId),
@@ -12,14 +12,24 @@ const list_1 = require("../utils/list");
12
12
  const validate_1 = require("../validation/validate");
13
13
  const gen_utils_1 = require("./gen-utils");
14
14
  const flags_1 = require("../context/flags");
15
+ const index_1 = require("../workspace/index");
15
16
  async function runGenArchitecture() {
16
- const projectName = await (0, prompt_1.ask)("Project name: ");
17
+ const projectName = await (0, prompt_1.askProjectName)();
17
18
  const reqId = await (0, prompt_1.ask)("Requirement ID (REQ-...): ");
18
19
  if (!projectName || !reqId) {
19
20
  console.log("Project name and requirement ID are required.");
20
21
  return;
21
22
  }
22
- const requirementDir = (0, gen_utils_1.findRequirementDir)(projectName, reqId);
23
+ const workspace = (0, index_1.getWorkspaceInfo)();
24
+ let project;
25
+ try {
26
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
27
+ }
28
+ catch (error) {
29
+ console.log(error.message);
30
+ return;
31
+ }
32
+ const requirementDir = (0, gen_utils_1.findRequirementDir)(project.name, reqId);
23
33
  if (!requirementDir) {
24
34
  console.log("Requirement not found.");
25
35
  return;
@@ -46,14 +56,14 @@ async function runGenArchitecture() {
46
56
  }
47
57
  const template = (0, render_1.loadTemplate)("architecture");
48
58
  const rendered = (0, render_1.renderTemplate)(template, {
49
- title: projectName,
59
+ title: project.name,
50
60
  context: context || "N/A",
51
61
  containers: (0, list_1.formatList)(containers),
52
62
  components: (0, list_1.formatList)(components),
53
63
  deployment: (0, list_1.formatList)(deployment),
54
64
  diagrams: (0, list_1.formatList)(diagrams)
55
65
  });
56
- fs_1.default.writeFileSync(path_1.default.join(requirementDir, "architecture.md"), rendered, "utf-8");
66
+ fs_1.default.writeFileSync(path_1.default.join(requirementDir, "docs/ARCHITECTURE.md"), rendered, "utf-8");
57
67
  fs_1.default.writeFileSync(path_1.default.join(requirementDir, "architecture.json"), JSON.stringify(architectureJson, null, 2), "utf-8");
58
68
  (0, gen_utils_1.appendProgress)(requirementDir, `generated architecture for ${reqId}`);
59
69
  (0, gen_utils_1.appendImprove)(requirementDir, improveNote);
@@ -10,6 +10,7 @@ const prompt_1 = require("../ui/prompt");
10
10
  const validate_1 = require("../validation/validate");
11
11
  const gen_utils_1 = require("./gen-utils");
12
12
  const flags_1 = require("../context/flags");
13
+ const index_1 = require("../workspace/index");
13
14
  function renderQualityYaml(rules, coverage, complexity) {
14
15
  const ruleLines = rules.length > 0 ? rules.map((rule) => ` - ${rule}`).join("\n") : " - N/A";
15
16
  return [
@@ -23,13 +24,22 @@ function renderQualityYaml(rules, coverage, complexity) {
23
24
  ].join("\n");
24
25
  }
25
26
  async function runGenBestPractices() {
26
- const projectName = await (0, prompt_1.ask)("Project name: ");
27
+ const projectName = await (0, prompt_1.askProjectName)();
27
28
  const reqId = await (0, prompt_1.ask)("Requirement ID (REQ-...): ");
28
29
  if (!projectName || !reqId) {
29
30
  console.log("Project name and requirement ID are required.");
30
31
  return;
31
32
  }
32
- const requirementDir = (0, gen_utils_1.findRequirementDir)(projectName, reqId);
33
+ const workspace = (0, index_1.getWorkspaceInfo)();
34
+ let project;
35
+ try {
36
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
37
+ }
38
+ catch (error) {
39
+ console.log(error.message);
40
+ return;
41
+ }
42
+ const requirementDir = (0, gen_utils_1.findRequirementDir)(project.name, reqId);
33
43
  if (!requirementDir) {
34
44
  console.log("Requirement not found.");
35
45
  return;
@@ -12,14 +12,24 @@ const list_1 = require("../utils/list");
12
12
  const validate_1 = require("../validation/validate");
13
13
  const gen_utils_1 = require("./gen-utils");
14
14
  const flags_1 = require("../context/flags");
15
+ const index_1 = require("../workspace/index");
15
16
  async function runGenFunctionalSpec() {
16
- const projectName = await (0, prompt_1.ask)("Project name: ");
17
+ const projectName = await (0, prompt_1.askProjectName)();
17
18
  const reqId = await (0, prompt_1.ask)("Requirement ID (REQ-...): ");
18
19
  if (!projectName || !reqId) {
19
20
  console.log("Project name and requirement ID are required.");
20
21
  return;
21
22
  }
22
- const requirementDir = (0, gen_utils_1.findRequirementDir)(projectName, reqId);
23
+ const workspace = (0, index_1.getWorkspaceInfo)();
24
+ let project;
25
+ try {
26
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
27
+ }
28
+ catch (error) {
29
+ console.log(error.message);
30
+ return;
31
+ }
32
+ const requirementDir = (0, gen_utils_1.findRequirementDir)(project.name, reqId);
23
33
  if (!requirementDir) {
24
34
  console.log("Requirement not found.");
25
35
  return;
@@ -50,7 +60,7 @@ async function runGenFunctionalSpec() {
50
60
  }
51
61
  const template = (0, render_1.loadTemplate)("functional-spec");
52
62
  const rendered = (0, render_1.renderTemplate)(template, {
53
- title: projectName,
63
+ title: project.name,
54
64
  overview: overview || "N/A",
55
65
  actors: (0, list_1.formatList)(actors),
56
66
  use_cases: (0, list_1.formatList)(useCases),
@@ -11,14 +11,24 @@ const render_1 = require("../templates/render");
11
11
  const validate_1 = require("../validation/validate");
12
12
  const gen_utils_1 = require("./gen-utils");
13
13
  const flags_1 = require("../context/flags");
14
+ const index_1 = require("../workspace/index");
14
15
  async function runGenProjectReadme() {
15
- const projectName = await (0, prompt_1.ask)("Project name: ");
16
+ const projectName = await (0, prompt_1.askProjectName)();
16
17
  const reqId = await (0, prompt_1.ask)("Requirement ID (REQ-...): ");
17
18
  if (!projectName || !reqId) {
18
19
  console.log("Project name and requirement ID are required.");
19
20
  return;
20
21
  }
21
- const requirementDir = (0, gen_utils_1.findRequirementDir)(projectName, reqId);
22
+ const workspace = (0, index_1.getWorkspaceInfo)();
23
+ let project;
24
+ try {
25
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
26
+ }
27
+ catch (error) {
28
+ console.log(error.message);
29
+ return;
30
+ }
31
+ const requirementDir = (0, gen_utils_1.findRequirementDir)(project.name, reqId);
22
32
  if (!requirementDir) {
23
33
  console.log("Requirement not found.");
24
34
  return;
@@ -34,7 +44,7 @@ async function runGenProjectReadme() {
34
44
  const flags = (0, flags_1.getFlags)();
35
45
  const improveNote = flags.improve ? await (0, prompt_1.ask)("Improve focus (optional): ") : "";
36
46
  const projectReadmeJson = {
37
- projectName,
47
+ projectName: project.name,
38
48
  overview: overview || "N/A",
39
49
  howToRun: howToRun || "N/A",
40
50
  architectureSummary: architectureSummary || "N/A",
@@ -42,7 +52,7 @@ async function runGenProjectReadme() {
42
52
  requirements: requirementsLink || "requirements/requirement.md",
43
53
  functionalSpec: functionalSpecLink || "requirements/functional-spec.md",
44
54
  technicalSpec: technicalSpecLink || "requirements/technical-spec.md",
45
- architecture: architectureLink || "requirements/architecture.md"
55
+ architecture: architectureLink || "requirements/docs/ARCHITECTURE.md"
46
56
  },
47
57
  testingNotes: testingNotes || "N/A"
48
58
  };
@@ -54,7 +64,7 @@ async function runGenProjectReadme() {
54
64
  }
55
65
  const template = (0, render_1.loadTemplate)("project-readme");
56
66
  const rendered = (0, render_1.renderTemplate)(template, {
57
- project_name: projectName,
67
+ project_name: project.name,
58
68
  overview: projectReadmeJson.overview,
59
69
  how_to_run: projectReadmeJson.howToRun,
60
70
  architecture_summary: projectReadmeJson.architectureSummary,
@@ -12,14 +12,24 @@ const list_1 = require("../utils/list");
12
12
  const validate_1 = require("../validation/validate");
13
13
  const gen_utils_1 = require("./gen-utils");
14
14
  const flags_1 = require("../context/flags");
15
+ const index_1 = require("../workspace/index");
15
16
  async function runGenTechnicalSpec() {
16
- const projectName = await (0, prompt_1.ask)("Project name: ");
17
+ const projectName = await (0, prompt_1.askProjectName)();
17
18
  const reqId = await (0, prompt_1.ask)("Requirement ID (REQ-...): ");
18
19
  if (!projectName || !reqId) {
19
20
  console.log("Project name and requirement ID are required.");
20
21
  return;
21
22
  }
22
- const requirementDir = (0, gen_utils_1.findRequirementDir)(projectName, reqId);
23
+ const workspace = (0, index_1.getWorkspaceInfo)();
24
+ let project;
25
+ try {
26
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
27
+ }
28
+ catch (error) {
29
+ console.log(error.message);
30
+ return;
31
+ }
32
+ const requirementDir = (0, gen_utils_1.findRequirementDir)(project.name, reqId);
23
33
  if (!requirementDir) {
24
34
  console.log("Requirement not found.");
25
35
  return;
@@ -50,7 +60,7 @@ async function runGenTechnicalSpec() {
50
60
  }
51
61
  const template = (0, render_1.loadTemplate)("technical-spec");
52
62
  const rendered = (0, render_1.renderTemplate)(template, {
53
- title: projectName,
63
+ title: project.name,
54
64
  stack: (0, list_1.formatList)(stack),
55
65
  interfaces: (0, list_1.formatList)(interfaces),
56
66
  data_model: (0, list_1.formatList)(dataModel),
@@ -13,7 +13,15 @@ const index_1 = require("../workspace/index");
13
13
  const flags_1 = require("../context/flags");
14
14
  function findRequirementDir(projectName, reqId) {
15
15
  const workspace = (0, index_1.getWorkspaceInfo)();
16
- const base = path_1.default.join(workspace.root, projectName, "requirements");
16
+ let project;
17
+ try {
18
+ project = (0, index_1.getProjectInfo)(workspace, projectName);
19
+ }
20
+ catch (error) {
21
+ console.log(error.message);
22
+ return null;
23
+ }
24
+ const base = path_1.default.join(project.root, "requirements");
17
25
  const statuses = ["backlog", "wip", "in-progress", "done", "archived"];
18
26
  for (const status of statuses) {
19
27
  const candidate = path_1.default.join(base, status, reqId);
@@ -7,19 +7,37 @@ const prompt_1 = require("../ui/prompt");
7
7
  const prompt_packs_1 = require("../router/prompt-packs");
8
8
  const prompt_map_1 = require("../router/prompt-map");
9
9
  const req_create_1 = require("./req-create");
10
+ const flags_1 = require("../context/flags");
10
11
  async function runHello(input, runQuestions) {
11
12
  const workspace = (0, index_1.getWorkspaceInfo)();
12
13
  (0, index_1.ensureWorkspace)(workspace);
13
14
  const projects = (0, index_1.listProjects)(workspace);
14
- console.log("Hello from sdd-tool.");
15
+ console.log("Hello from sdd-cli.");
15
16
  console.log(`Workspace: ${workspace.root}`);
17
+ const flags = (0, flags_1.getFlags)();
16
18
  if (projects.length > 0) {
17
19
  console.log("Active projects:");
18
20
  projects.forEach((project) => {
19
21
  console.log(`- ${project.name} (${project.status})`);
20
22
  });
21
23
  const choice = await (0, prompt_1.ask)("Start new or continue? (new/continue) ");
22
- console.log(`Selected: ${choice || "new"}`);
24
+ const normalized = choice.trim().toLowerCase();
25
+ if (normalized === "continue") {
26
+ const selected = flags.project || (await (0, prompt_1.ask)("Project to continue: "));
27
+ if (!selected) {
28
+ console.log("No project selected. Continuing with new flow.");
29
+ }
30
+ else if (!projects.find((project) => project.name === selected)) {
31
+ console.log(`Project not found: ${selected}. Continuing with new flow.`);
32
+ }
33
+ else {
34
+ (0, flags_1.setFlags)({ project: selected });
35
+ console.log(`Continuing: ${selected}`);
36
+ }
37
+ }
38
+ else {
39
+ console.log(`Selected: ${choice || "new"}`);
40
+ }
23
41
  }
24
42
  else {
25
43
  console.log("No active projects found.");
@@ -31,7 +49,7 @@ async function runHello(input, runQuestions) {
31
49
  }
32
50
  const intent = (0, intent_1.classifyIntent)(text);
33
51
  console.log(`Detected intent: ${intent.intent} -> ${intent.flow}`);
34
- console.log("Next: run `sdd-tool route <your input>` to view details.");
52
+ console.log("Next: run `sdd-cli route <your input>` to view details.");
35
53
  if (runQuestions) {
36
54
  const packs = (0, prompt_packs_1.loadPromptPacks)();
37
55
  const packIds = intent_1.FLOW_PROMPT_PACKS[intent.flow] ?? [];