sdd-cli 0.1.2 → 0.1.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.
- package/README.md +126 -89
- package/dist/cli.js +7 -3
- package/dist/commands/doctor.js +11 -2
- package/dist/commands/gen-architecture.js +13 -3
- package/dist/commands/gen-best-practices.js +12 -2
- package/dist/commands/gen-functional-spec.js +13 -3
- package/dist/commands/gen-project-readme.js +14 -4
- package/dist/commands/gen-technical-spec.js +13 -3
- package/dist/commands/gen-utils.js +9 -1
- package/dist/commands/hello.js +21 -3
- package/dist/commands/learn-deliver.js +17 -3
- package/dist/commands/learn-refine.js +32 -11
- package/dist/commands/learn-start.js +9 -2
- package/dist/commands/learn-utils.js +7 -4
- package/dist/commands/pr-audit.js +17 -3
- package/dist/commands/pr-finish.js +17 -3
- package/dist/commands/pr-report.js +17 -3
- package/dist/commands/pr-respond.js +17 -3
- package/dist/commands/pr-start.js +9 -2
- package/dist/commands/pr-utils.js +8 -5
- package/dist/commands/req-archive.js +14 -6
- package/dist/commands/req-create.js +71 -14
- package/dist/commands/req-export.js +11 -3
- package/dist/commands/req-finish.js +26 -11
- package/dist/commands/req-lint.js +10 -2
- package/dist/commands/req-list.js +10 -2
- package/dist/commands/req-plan.js +33 -11
- package/dist/commands/req-refine.js +54 -5
- package/dist/commands/req-report.js +10 -2
- package/dist/commands/req-start.js +29 -12
- package/dist/commands/req-status.js +10 -2
- package/dist/commands/test-plan.js +13 -5
- package/dist/context/flags.d.ts +2 -0
- package/dist/context/flags.js +5 -1
- package/dist/providers/codex.js +2 -2
- package/dist/router/prompt-map.js +17 -5
- package/dist/ui/prompt.d.ts +1 -0
- package/dist/ui/prompt.js +8 -0
- package/dist/validation/gates.d.ts +19 -0
- package/dist/validation/gates.js +41 -0
- package/dist/validation/validate.js +24 -4
- package/dist/workspace/index.d.ts +6 -0
- package/dist/workspace/index.js +41 -10
- package/flows/ADMISSIONS_ADMIN.md +35 -33
- package/flows/ART.md +35 -33
- package/flows/COURT_SYSTEM.md +35 -33
- package/flows/DATA_SCIENTIST.md +35 -33
- package/flows/ECOMMERCE.md +35 -33
- package/flows/ECONOMICS.md +35 -33
- package/flows/GRAPHIC_DESIGN.md +35 -33
- package/flows/HISTORY.md +35 -33
- package/flows/LAWYER.md +36 -34
- package/flows/PROGRAMMER.md +35 -33
- package/flows/RETAIL_STORE.md +35 -33
- package/flows/SOCIOLOGY.md +35 -33
- package/flows/STATE_ADMIN.md +35 -33
- package/flows/STUDENT_UNIVERSITY.md +35 -33
- package/flows/TAXES_ADMIN.md +35 -33
- package/flows/TEACHER.md +35 -33
- package/package.json +13 -3
- package/router/BUSINESS.flow.md +59 -57
- package/router/DATA_SCIENCE.flow.md +60 -58
- package/router/DESIGN.flow.md +60 -58
- package/router/HUMANITIES.flow.md +60 -58
- package/router/LEGAL.flow.md +60 -58
- package/router/SOFTWARE_FEATURE.flow.md +61 -59
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# sdd-
|
|
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-
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Package name on npm is `sdd-cli` (CLI commands remain `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-
|
|
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-
|
|
115
|
+
`sdd-cli req refine` resolves ambiguity, missing metrics, and risks.
|
|
113
116
|
|
|
114
117
|
4) **Plan (WIP)**
|
|
115
|
-
`sdd-
|
|
118
|
+
`sdd-cli req plan` creates functional spec, tech spec, and architecture drafts.
|
|
116
119
|
|
|
117
120
|
5) **Implement**
|
|
118
|
-
`sdd-
|
|
121
|
+
`sdd-cli req start` generates the implementation plan and activates quality gates.
|
|
119
122
|
|
|
120
123
|
6) **Verify**
|
|
121
|
-
`sdd-
|
|
124
|
+
`sdd-cli test plan` defines scenarios and coverage targets.
|
|
122
125
|
|
|
123
126
|
7) **Finish**
|
|
124
|
-
`sdd-
|
|
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-
|
|
130
|
-
- `sdd-
|
|
131
|
-
- `sdd-
|
|
132
|
-
- `sdd-
|
|
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-
|
|
138
|
+
- `sdd-cli route` -- classify user intent and route to the right flow
|
|
136
139
|
|
|
137
140
|
### Requirement lifecycle
|
|
138
|
-
- `sdd-
|
|
139
|
-
- `sdd-
|
|
140
|
-
- `sdd-
|
|
141
|
-
- `sdd-
|
|
142
|
-
- `sdd-
|
|
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-
|
|
146
|
-
- `sdd-
|
|
147
|
-
- `sdd-
|
|
148
|
-
- `sdd-
|
|
149
|
-
- `sdd-
|
|
150
|
-
- `sdd-
|
|
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-
|
|
156
|
+
- `sdd-cli test plan`
|
|
154
157
|
|
|
155
158
|
### Learning mode
|
|
156
|
-
- `sdd-
|
|
157
|
-
- `sdd-
|
|
158
|
-
- `sdd-
|
|
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-
|
|
174
|
-
- macOS/Linux: `~/.config/sdd-
|
|
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-
|
|
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-
|
|
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-
|
|
344
|
-
- `sdd-
|
|
345
|
-
- `sdd-
|
|
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-
|
|
379
|
-
- `sdd-
|
|
380
|
-
- `sdd-
|
|
381
|
-
- `sdd-
|
|
381
|
+
- `sdd-cli hello`
|
|
382
|
+
- `sdd-cli init`
|
|
383
|
+
- `sdd-cli list`
|
|
384
|
+
- `sdd-cli doctor`
|
|
382
385
|
|
|
383
386
|
Requirements:
|
|
384
|
-
- `sdd-
|
|
385
|
-
- `sdd-
|
|
386
|
-
- `sdd-
|
|
387
|
-
- `sdd-
|
|
388
|
-
- `sdd-
|
|
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-
|
|
392
|
-
- `sdd-
|
|
393
|
-
- `sdd-
|
|
394
|
-
- `sdd-
|
|
395
|
-
- `sdd-
|
|
396
|
-
- `sdd-
|
|
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-
|
|
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
|
package/dist/commands/doctor.js
CHANGED
|
@@ -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 =
|
|
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(
|
|
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.
|
|
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
|
|
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,7 +56,7 @@ 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:
|
|
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),
|
|
@@ -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.
|
|
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
|
|
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.
|
|
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
|
|
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:
|
|
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.
|
|
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
|
|
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",
|
|
@@ -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:
|
|
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.
|
|
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
|
|
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:
|
|
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
|
-
|
|
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);
|
package/dist/commands/hello.js
CHANGED
|
@@ -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-
|
|
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
|
-
|
|
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-
|
|
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] ?? [];
|
|
@@ -10,12 +10,19 @@ const prompt_1 = require("../ui/prompt");
|
|
|
10
10
|
const list_1 = require("../utils/list");
|
|
11
11
|
const learn_utils_1 = require("./learn-utils");
|
|
12
12
|
async function runLearnDeliver() {
|
|
13
|
-
const projectName = await (0, prompt_1.
|
|
13
|
+
const projectName = await (0, prompt_1.askProjectName)();
|
|
14
14
|
if (!projectName) {
|
|
15
15
|
console.log("Project name is required.");
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
let sessions = [];
|
|
19
|
+
try {
|
|
20
|
+
sessions = (0, learn_utils_1.listLearnSessions)(projectName);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.log(error.message);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
19
26
|
if (sessions.length > 0) {
|
|
20
27
|
console.log("Available sessions:");
|
|
21
28
|
sessions.forEach((session) => console.log(`- ${session}`));
|
|
@@ -25,7 +32,14 @@ async function runLearnDeliver() {
|
|
|
25
32
|
console.log("Session ID is required.");
|
|
26
33
|
return;
|
|
27
34
|
}
|
|
28
|
-
|
|
35
|
+
let loaded;
|
|
36
|
+
try {
|
|
37
|
+
loaded = (0, learn_utils_1.loadLearnSession)(projectName, sessionId);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.log(error.message);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
29
43
|
if (!loaded) {
|
|
30
44
|
console.log("Learning session not found.");
|
|
31
45
|
return;
|