sdd-cli 0.1.5 → 0.1.6

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 CHANGED
@@ -12,6 +12,12 @@ Build the foundation once, then lift everything else. The tool provides a durabl
12
12
 
13
13
  Mission and vision live in `docs/MISSION.md` and `docs/VISION.md`.
14
14
 
15
+ Start with `docs/INDEX.md` for a full documentation map and `docs/STYLE.md` for formatting guidance.
16
+ Contributing guidelines live in `docs/CONTRIBUTING.md`.
17
+ Use the PR template in `.github/PULL_REQUEST_TEMPLATE.md`.
18
+ Maintenance guidance lives in `docs/MAINTENANCE.md`.
19
+ Install troubleshooting lives in `docs/TROUBLESHOOTING.md`.
20
+
15
21
  Deep process, commands, interactions, and diagrams live in:
16
22
  - `docs/PROCESS.md`
17
23
  - `docs/COMMANDS.md`
@@ -55,6 +61,10 @@ Examples and templates:
55
61
  - `examples/schemas/`
56
62
  - `examples/diagrams/`
57
63
  - `examples/packs/`
64
+ - `examples/README.md`
65
+ - `templates/README.md`
66
+ - `schemas/README.md`
67
+ - `flows/README.md`
58
68
  - `templates/`
59
69
  - `schemas/`
60
70
 
package/dist/cli.js CHANGED
@@ -46,6 +46,7 @@ const route_1 = require("./commands/route");
46
46
  const doctor_1 = require("./commands/doctor");
47
47
  const paths_1 = require("./paths");
48
48
  const flags_1 = require("./context/flags");
49
+ const prompt_1 = require("./ui/prompt");
49
50
  const program = new commander_1.Command();
50
51
  function getVersion() {
51
52
  try {
@@ -76,6 +77,9 @@ program.hook("preAction", (thisCommand, actionCommand) => {
76
77
  output: typeof opts.output === "string" ? opts.output : undefined
77
78
  });
78
79
  });
80
+ program.hook("postAction", () => {
81
+ (0, prompt_1.closePrompt)();
82
+ });
79
83
  program
80
84
  .command("hello")
81
85
  .description("Start an interactive session and route intent")
@@ -8,12 +8,30 @@ 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
10
  const flags_1 = require("../context/flags");
11
+ const route_1 = require("./route");
11
12
  async function runHello(input, runQuestions) {
12
- const workspace = (0, index_1.getWorkspaceInfo)();
13
- (0, index_1.ensureWorkspace)(workspace);
14
- const projects = (0, index_1.listProjects)(workspace);
13
+ function loadWorkspace() {
14
+ const workspace = (0, index_1.getWorkspaceInfo)();
15
+ (0, index_1.ensureWorkspace)(workspace);
16
+ const projects = (0, index_1.listProjects)(workspace);
17
+ return { workspace, projects };
18
+ }
19
+ let { workspace, projects } = loadWorkspace();
15
20
  console.log("Hello from sdd-cli.");
16
21
  console.log(`Workspace: ${workspace.root}`);
22
+ const useWorkspace = await (0, prompt_1.confirm)("Use this workspace path? (y/n) ");
23
+ if (!useWorkspace) {
24
+ const nextPath = await (0, prompt_1.ask)("Workspace path to use (blank to exit): ");
25
+ if (!nextPath) {
26
+ console.log("Run again from the desired folder or pass --output <path>.");
27
+ return;
28
+ }
29
+ (0, flags_1.setFlags)({ output: nextPath });
30
+ const reloaded = loadWorkspace();
31
+ workspace = reloaded.workspace;
32
+ projects = reloaded.projects;
33
+ console.log(`Workspace updated: ${workspace.root}`);
34
+ }
17
35
  const flags = (0, flags_1.getFlags)();
18
36
  if (projects.length > 0) {
19
37
  console.log("Active projects:");
@@ -49,8 +67,15 @@ async function runHello(input, runQuestions) {
49
67
  }
50
68
  const intent = (0, intent_1.classifyIntent)(text);
51
69
  console.log(`Detected intent: ${intent.intent} -> ${intent.flow}`);
52
- console.log("Next: run `sdd-cli route <your input>` to view details.");
53
- if (runQuestions) {
70
+ const showRoute = await (0, prompt_1.confirm)("View route details now? (y/n) ");
71
+ if (showRoute) {
72
+ (0, route_1.runRoute)(text);
73
+ }
74
+ else {
75
+ console.log("Next: run `sdd-cli route <your input>` to view details.");
76
+ }
77
+ const shouldRunQuestions = runQuestions ?? (await (0, prompt_1.confirm)("Run prompt questions now? (y/n) "));
78
+ if (shouldRunQuestions) {
54
79
  const packs = (0, prompt_packs_1.loadPromptPacks)();
55
80
  const packIds = intent_1.FLOW_PROMPT_PACKS[intent.flow] ?? [];
56
81
  const answers = {};
@@ -78,4 +103,9 @@ async function runHello(input, runQuestions) {
78
103
  }
79
104
  }
80
105
  }
106
+ else {
107
+ console.log("\nNext steps:");
108
+ console.log("- Run `sdd-cli route \"<your input>\"` to review the flow.");
109
+ console.log("- Run `sdd-cli req create` to draft a requirement.");
110
+ }
81
111
  }
@@ -1,3 +1,4 @@
1
+ export declare function closePrompt(): void;
1
2
  export declare function ask(question: string): Promise<string>;
2
3
  export declare function askProjectName(prompt?: string): Promise<string>;
3
4
  export declare function confirm(question: string): Promise<boolean>;
package/dist/ui/prompt.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.closePrompt = closePrompt;
6
7
  exports.ask = ask;
7
8
  exports.askProjectName = askProjectName;
8
9
  exports.confirm = confirm;
@@ -10,6 +11,7 @@ const fs_1 = __importDefault(require("fs"));
10
11
  const readline_1 = __importDefault(require("readline"));
11
12
  const flags_1 = require("../context/flags");
12
13
  let queuedAnswers = null;
14
+ let rl = null;
13
15
  function getQueuedAnswers() {
14
16
  if (queuedAnswers) {
15
17
  return queuedAnswers;
@@ -22,11 +24,24 @@ function getQueuedAnswers() {
22
24
  queuedAnswers = [];
23
25
  return queuedAnswers;
24
26
  }
25
- const rl = readline_1.default.createInterface({
26
- input: process.stdin,
27
- output: process.stdout
28
- });
29
- process.on("exit", () => rl.close());
27
+ function getInterface() {
28
+ if (rl) {
29
+ return rl;
30
+ }
31
+ rl = readline_1.default.createInterface({
32
+ input: process.stdin,
33
+ output: process.stdout
34
+ });
35
+ return rl;
36
+ }
37
+ function closePrompt() {
38
+ if (!rl) {
39
+ return;
40
+ }
41
+ rl.close();
42
+ rl = null;
43
+ }
44
+ process.on("exit", () => closePrompt());
30
45
  function ask(question) {
31
46
  if (!process.stdin.isTTY) {
32
47
  const queue = getQueuedAnswers();
@@ -34,7 +49,8 @@ function ask(question) {
34
49
  return Promise.resolve(answer.trim());
35
50
  }
36
51
  return new Promise((resolve) => {
37
- rl.question(question, (answer) => {
52
+ const prompt = getInterface();
53
+ prompt.question(question, (answer) => {
38
54
  resolve(answer.trim());
39
55
  });
40
56
  });
package/flows/README.md CHANGED
@@ -1,29 +1,3 @@
1
- # Flows (domain playbooks)
2
-
3
- These flows show how the tool should guide real users from discovery to completion.
4
-
5
- - `LAWYER.md`
6
- - `TEACHER.md`
7
- - `ADMISSIONS_ADMIN.md`
8
- - `STATE_ADMIN.md`
9
- - `TAXES_ADMIN.md`
10
- - `STUDENT_UNIVERSITY.md`
11
- - `DATA_SCIENTIST.md`
12
- - `PROGRAMMER.md`
13
- - `BUG_FIX.md`
14
- - `ECOMMERCE.md`
15
- - `RETAIL_STORE.md`
16
- - `COURT_SYSTEM.md`
17
- - `GRAPHIC_DESIGN.md`
18
- - `ART.md`
19
- - `HISTORY.md`
20
- - `SOCIOLOGY.md`
21
- - `ECONOMICS.md`
22
- - `PR_REVIEW.md`
23
-
24
- Each flow includes:
25
- - Discovery questions
26
- - Required artifacts
27
- - Risk and compliance notes
28
- - Acceptance criteria examples
29
- - Recommended outputs and handoff steps
1
+ # Flows
2
+
3
+ Domain playbooks used by the router and discovery flows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdd-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "SDD-first, AI-native CLI for end-to-end delivery.",
5
5
  "homepage": "https://github.com/jdsalasca/sdd-tool#readme",
6
6
  "repository": {
@@ -27,6 +27,7 @@
27
27
  "build": "tsc -p tsconfig.json",
28
28
  "start": "node dist/cli.js",
29
29
  "dev": "ts-node src/cli.ts",
30
+ "preinstall": "node scripts/preinstall.js",
30
31
  "pretest": "npm run build",
31
32
  "test": "node --test tests/*.test.js"
32
33
  },
package/router/README.md CHANGED
@@ -1,23 +1,25 @@
1
- # Router scripts
2
-
3
- These scripts define intent detection and the step-by-step conversation for each flow.
4
-
5
- Each script includes:
6
- - Entry signals
7
- - Required questions
8
- - Required outputs
9
- - Gate checks
10
- - Suggested agent roles
11
- - Scripted Q/A tree with optional branches
12
-
13
- Available flows:
14
- - BUG_FIX
15
- - LEARN
16
- - SOFTWARE_FEATURE
17
- - DATA_SCIENCE
18
- - DESIGN
19
- - HUMANITIES
20
- - BUSINESS
21
- - LEGAL
22
- - PR_REVIEW
23
- - GENERIC
1
+ # Router scripts
2
+
3
+ These scripts define intent detection and the step-by-step conversation for each flow.
4
+
5
+ See `flows/README.md` for the domain playbooks.
6
+
7
+ Each script includes:
8
+ - Entry signals
9
+ - Required questions
10
+ - Required outputs
11
+ - Gate checks
12
+ - Suggested agent roles
13
+ - Scripted Q/A tree with optional branches
14
+
15
+ Available flows:
16
+ - BUG_FIX
17
+ - LEARN
18
+ - SOFTWARE_FEATURE
19
+ - DATA_SCIENCE
20
+ - DESIGN
21
+ - HUMANITIES
22
+ - BUSINESS
23
+ - LEGAL
24
+ - PR_REVIEW
25
+ - GENERIC
@@ -0,0 +1,7 @@
1
+ # Schemas
2
+
3
+ JSON schemas for artifacts and workspace state.
4
+
5
+ ## Usage
6
+ - Used by `sdd-cli doctor` and validators.
7
+ - Keep schema filenames consistent with artifact names.
@@ -0,0 +1,12 @@
1
+ # Templates
2
+
3
+ Markdown and YAML templates used to generate SDD artifacts.
4
+
5
+ ## Index
6
+ - `templates/template-index.json` lists all templates and placeholders.
7
+ - `templates/gate-index.json` lists gate prompt templates.
8
+ - `templates/prompt-pack-index.json` lists prompt packs.
9
+
10
+ ## Rules
11
+ - Keep placeholders aligned with `templates/validate` rules.
12
+ - Use lowercase file names with dashes (`functional-spec.md`).