sdd-cli 0.1.0

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 (186) hide show
  1. package/README.md +566 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +308 -0
  4. package/dist/commands/ai-exec.d.ts +1 -0
  5. package/dist/commands/ai-exec.js +18 -0
  6. package/dist/commands/ai-status.d.ts +1 -0
  7. package/dist/commands/ai-status.js +12 -0
  8. package/dist/commands/doctor.d.ts +1 -0
  9. package/dist/commands/doctor.js +101 -0
  10. package/dist/commands/gen-architecture.d.ts +1 -0
  11. package/dist/commands/gen-architecture.js +61 -0
  12. package/dist/commands/gen-best-practices.d.ts +1 -0
  13. package/dist/commands/gen-best-practices.js +64 -0
  14. package/dist/commands/gen-functional-spec.d.ts +1 -0
  15. package/dist/commands/gen-functional-spec.js +67 -0
  16. package/dist/commands/gen-project-readme.d.ts +1 -0
  17. package/dist/commands/gen-project-readme.js +72 -0
  18. package/dist/commands/gen-requirements.d.ts +1 -0
  19. package/dist/commands/gen-requirements.js +7 -0
  20. package/dist/commands/gen-technical-spec.d.ts +1 -0
  21. package/dist/commands/gen-technical-spec.js +67 -0
  22. package/dist/commands/gen-utils.d.ts +4 -0
  23. package/dist/commands/gen-utils.js +44 -0
  24. package/dist/commands/hello.d.ts +1 -0
  25. package/dist/commands/hello.js +63 -0
  26. package/dist/commands/init.d.ts +1 -0
  27. package/dist/commands/init.js +9 -0
  28. package/dist/commands/learn-deliver.d.ts +1 -0
  29. package/dist/commands/learn-deliver.js +55 -0
  30. package/dist/commands/learn-refine.d.ts +1 -0
  31. package/dist/commands/learn-refine.js +71 -0
  32. package/dist/commands/learn-start.d.ts +1 -0
  33. package/dist/commands/learn-start.js +63 -0
  34. package/dist/commands/learn-utils.d.ts +22 -0
  35. package/dist/commands/learn-utils.js +78 -0
  36. package/dist/commands/list.d.ts +1 -0
  37. package/dist/commands/list.js +69 -0
  38. package/dist/commands/pr-audit.d.ts +1 -0
  39. package/dist/commands/pr-audit.js +59 -0
  40. package/dist/commands/pr-finish.d.ts +1 -0
  41. package/dist/commands/pr-finish.js +51 -0
  42. package/dist/commands/pr-report.d.ts +1 -0
  43. package/dist/commands/pr-report.js +59 -0
  44. package/dist/commands/pr-respond.d.ts +1 -0
  45. package/dist/commands/pr-respond.js +65 -0
  46. package/dist/commands/pr-start.d.ts +1 -0
  47. package/dist/commands/pr-start.js +79 -0
  48. package/dist/commands/pr-utils.d.ts +8 -0
  49. package/dist/commands/pr-utils.js +54 -0
  50. package/dist/commands/req-archive.d.ts +1 -0
  51. package/dist/commands/req-archive.js +33 -0
  52. package/dist/commands/req-create.d.ts +10 -0
  53. package/dist/commands/req-create.js +94 -0
  54. package/dist/commands/req-export.d.ts +1 -0
  55. package/dist/commands/req-export.js +37 -0
  56. package/dist/commands/req-finish.d.ts +1 -0
  57. package/dist/commands/req-finish.js +120 -0
  58. package/dist/commands/req-lint.d.ts +1 -0
  59. package/dist/commands/req-lint.js +58 -0
  60. package/dist/commands/req-list.d.ts +1 -0
  61. package/dist/commands/req-list.js +36 -0
  62. package/dist/commands/req-plan.d.ts +1 -0
  63. package/dist/commands/req-plan.js +200 -0
  64. package/dist/commands/req-refine.d.ts +1 -0
  65. package/dist/commands/req-refine.js +108 -0
  66. package/dist/commands/req-report.d.ts +1 -0
  67. package/dist/commands/req-report.js +44 -0
  68. package/dist/commands/req-start.d.ts +1 -0
  69. package/dist/commands/req-start.js +131 -0
  70. package/dist/commands/req-status.d.ts +1 -0
  71. package/dist/commands/req-status.js +29 -0
  72. package/dist/commands/route.d.ts +1 -0
  73. package/dist/commands/route.js +30 -0
  74. package/dist/commands/test-plan.d.ts +1 -0
  75. package/dist/commands/test-plan.js +81 -0
  76. package/dist/context/flags.d.ts +7 -0
  77. package/dist/context/flags.js +17 -0
  78. package/dist/paths.d.ts +1 -0
  79. package/dist/paths.js +10 -0
  80. package/dist/providers/codex.d.ts +7 -0
  81. package/dist/providers/codex.js +19 -0
  82. package/dist/router/flow.d.ts +1 -0
  83. package/dist/router/flow.js +17 -0
  84. package/dist/router/intent.d.ts +3 -0
  85. package/dist/router/intent.js +69 -0
  86. package/dist/router/prompt-map.d.ts +1 -0
  87. package/dist/router/prompt-map.js +20 -0
  88. package/dist/router/prompt-packs.d.ts +8 -0
  89. package/dist/router/prompt-packs.js +20 -0
  90. package/dist/router/validate-prompt-packs.d.ts +4 -0
  91. package/dist/router/validate-prompt-packs.js +16 -0
  92. package/dist/templates/render.d.ts +2 -0
  93. package/dist/templates/render.js +25 -0
  94. package/dist/templates/validate.d.ts +4 -0
  95. package/dist/templates/validate.js +58 -0
  96. package/dist/types.d.ts +7 -0
  97. package/dist/types.js +2 -0
  98. package/dist/ui/prompt.d.ts +2 -0
  99. package/dist/ui/prompt.js +49 -0
  100. package/dist/utils/list.d.ts +2 -0
  101. package/dist/utils/list.js +20 -0
  102. package/dist/validation/validate.d.ts +4 -0
  103. package/dist/validation/validate.js +20 -0
  104. package/dist/workspace/index.d.ts +21 -0
  105. package/dist/workspace/index.js +103 -0
  106. package/flows/ADMISSIONS_ADMIN.md +33 -0
  107. package/flows/ART.md +33 -0
  108. package/flows/BUG_FIX.md +32 -0
  109. package/flows/COURT_SYSTEM.md +33 -0
  110. package/flows/DATA_SCIENTIST.md +33 -0
  111. package/flows/ECOMMERCE.md +33 -0
  112. package/flows/ECONOMICS.md +33 -0
  113. package/flows/GRAPHIC_DESIGN.md +33 -0
  114. package/flows/HISTORY.md +33 -0
  115. package/flows/LAWYER.md +34 -0
  116. package/flows/PROGRAMMER.md +33 -0
  117. package/flows/PR_REVIEW.md +33 -0
  118. package/flows/README.md +29 -0
  119. package/flows/RETAIL_STORE.md +33 -0
  120. package/flows/SOCIOLOGY.md +33 -0
  121. package/flows/STATE_ADMIN.md +33 -0
  122. package/flows/STUDENT_UNIVERSITY.md +33 -0
  123. package/flows/TAXES_ADMIN.md +33 -0
  124. package/flows/TEACHER.md +33 -0
  125. package/package.json +32 -0
  126. package/router/BUG_FIX.flow.md +63 -0
  127. package/router/BUSINESS.flow.md +57 -0
  128. package/router/DATA_SCIENCE.flow.md +58 -0
  129. package/router/DESIGN.flow.md +58 -0
  130. package/router/FLOW_TEMPLATE.md +26 -0
  131. package/router/GENERIC.flow.md +37 -0
  132. package/router/HUMANITIES.flow.md +58 -0
  133. package/router/LEARN.flow.md +52 -0
  134. package/router/LEGAL.flow.md +58 -0
  135. package/router/PR_REVIEW.flow.md +55 -0
  136. package/router/README.md +23 -0
  137. package/router/SOFTWARE_FEATURE.flow.md +59 -0
  138. package/schemas/architecture.schema.json +13 -0
  139. package/schemas/decision-log.schema.json +16 -0
  140. package/schemas/diagram.schema.json +11 -0
  141. package/schemas/domain.schema.json +20 -0
  142. package/schemas/functional-spec.schema.json +15 -0
  143. package/schemas/gate.schema.json +10 -0
  144. package/schemas/learn-session.schema.json +15 -0
  145. package/schemas/pr-review.schema.json +20 -0
  146. package/schemas/progress-log.schema.json +21 -0
  147. package/schemas/project-readme.schema.json +23 -0
  148. package/schemas/project.schema.json +16 -0
  149. package/schemas/prompt-pack.schema.json +12 -0
  150. package/schemas/quality.schema.json +23 -0
  151. package/schemas/requirement.schema.json +34 -0
  152. package/schemas/role.schema.json +17 -0
  153. package/schemas/router-flow.schema.json +15 -0
  154. package/schemas/router-intent.schema.json +13 -0
  155. package/schemas/technical-spec.schema.json +15 -0
  156. package/schemas/template.schema.json +10 -0
  157. package/schemas/test-plan.schema.json +13 -0
  158. package/schemas/workspace.schema.json +12 -0
  159. package/templates/architecture.md +16 -0
  160. package/templates/changelog.md +3 -0
  161. package/templates/ci-checklist.md +14 -0
  162. package/templates/decision-log.md +16 -0
  163. package/templates/diagrams/component.mmd +3 -0
  164. package/templates/diagrams/container.mmd +3 -0
  165. package/templates/diagrams/context.mmd +3 -0
  166. package/templates/functional-spec.md +22 -0
  167. package/templates/gate-index.json +20 -0
  168. package/templates/implementation-plan.md +13 -0
  169. package/templates/pr-comment-audit.md +19 -0
  170. package/templates/pr-comment-lifecycle.md +11 -0
  171. package/templates/pr-comment-severity.md +13 -0
  172. package/templates/pr-dispute-resolution.md +16 -0
  173. package/templates/pr-metrics.md +10 -0
  174. package/templates/pr-response-generator.md +11 -0
  175. package/templates/pr-response-style.md +13 -0
  176. package/templates/pr-review-report.md +22 -0
  177. package/templates/pr-review-summary.md +16 -0
  178. package/templates/progress-log.md +6 -0
  179. package/templates/project-readme.md +19 -0
  180. package/templates/prompt-pack-index.json +127 -0
  181. package/templates/quality.yml +17 -0
  182. package/templates/requirement.md +33 -0
  183. package/templates/summary.md +10 -0
  184. package/templates/technical-spec.md +22 -0
  185. package/templates/template-index.json +212 -0
  186. package/templates/test-plan.md +16 -0
package/README.md ADDED
@@ -0,0 +1,566 @@
1
+ # sdd-tool
2
+
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
+
5
+ ## Vision (think pyramids)
6
+
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
+
9
+ Mission and vision live in `MISSION.md` and `VISION.md`.
10
+
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`
44
+
45
+ Examples and templates:
46
+ - `examples/transcripts/`
47
+ - `examples/artifacts/`
48
+ - `examples/schemas/`
49
+ - `examples/diagrams/`
50
+ - `examples/packs/`
51
+ - `templates/`
52
+ - `schemas/`
53
+
54
+ Automation:
55
+ - `scripts/e2e.ps1`
56
+ - `scripts/e2e.sh`
57
+
58
+ ### AI gets wings through structure
59
+ - **Question banks** enforce clarity before planning.
60
+ - **Quality contracts** enforce clean code across languages.
61
+ - **Decision logs** make trade-offs explicit.
62
+ - **Proof gates** ensure tests and acceptance criteria are met.
63
+ - **Multi-agent roles** ensure no single blind spot dominates.
64
+
65
+ ## Why SDD matters
66
+
67
+ An SDD (Software Design Document) translates requirements into architecture and technical design decisions. It exists to reduce ambiguity, drive alignment, and protect quality across the lifecycle.
68
+
69
+ Key properties:
70
+ - Clear decisions and trade-offs.
71
+ - Traceability from requirement to design and tests.
72
+ - Versioned, auditable progress.
73
+ - Designed for real delivery, not just documentation.
74
+
75
+ ## What this tool generates
76
+
77
+ - Requirements (functional + non-functional)
78
+ - Functional specs (flows, use cases, rules)
79
+ - Technical specs (stack, interfaces, data, security)
80
+ - Architecture (C4, containers, components, deployment)
81
+ - Best practices and quality gates
82
+ - Test plan and acceptance criteria
83
+ - Decision log (ADR-style)
84
+ - Progress log
85
+ - Project README aligned to the SDD
86
+
87
+ ## Install and run (cross-platform)
88
+
89
+ ```
90
+ npm install -g sdd-cli
91
+ ```
92
+
93
+ Then:
94
+ ```
95
+ sdd-tool hello
96
+ ```
97
+
98
+ Package name on npm is `sdd-cli` (CLI commands remain `sdd-tool` and `sdd`).
99
+
100
+ 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
+
102
+ ## The happy path (end-to-end flow)
103
+
104
+ 1) **Start**
105
+ `sdd-tool hello` connects to AI, shows active projects, and asks if you want to start new or continue.
106
+ It also asks for project name, domain, output location, language profile, and quality level.
107
+
108
+ 2) **Discover**
109
+ Guided prompts produce `requirements/backlog/REQ-0001/requirement.md`.
110
+
111
+ 3) **Refine**
112
+ `sdd-tool req refine` resolves ambiguity, missing metrics, and risks.
113
+
114
+ 4) **Plan (WIP)**
115
+ `sdd-tool req plan` creates functional spec, tech spec, and architecture drafts.
116
+
117
+ 5) **Implement**
118
+ `sdd-tool req start` generates the implementation plan and activates quality gates.
119
+
120
+ 6) **Verify**
121
+ `sdd-tool test plan` defines scenarios and coverage targets.
122
+
123
+ 7) **Finish**
124
+ `sdd-tool req finish` seals the requirement, versioned docs, and decision logs.
125
+
126
+ ## Commands (proposed)
127
+
128
+ ### 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
133
+
134
+ ### Router
135
+ - `sdd-tool route` -- classify user intent and route to the right flow
136
+
137
+ ### 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`
143
+
144
+ ### 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`
151
+
152
+ ### Test planning
153
+ - `sdd-tool test plan`
154
+
155
+ ### Learning mode
156
+ - `sdd-tool learn start`
157
+ - `sdd-tool learn refine`
158
+ - `sdd-tool learn deliver`
159
+
160
+ ### Flags
161
+ - `--approve` -- run without extra confirmations
162
+ - `--improve` -- re-open and enhance existing docs
163
+ - `--output <path>` -- override workspace output
164
+ - `--project <name>` -- set project name
165
+ - `--parallel` -- generate in parallel
166
+ - `--alias sdd` -- optional alias to run as `sdd`
167
+
168
+ ## Where files are stored (clean repos)
169
+
170
+ By default, the tool writes to a dedicated workspace, not into your repo:
171
+
172
+ - Default (global workspace):
173
+ - Windows: `%APPDATA%/sdd-tool/workspaces/<project>`
174
+ - macOS/Linux: `~/.config/sdd-tool/workspaces/<project>`
175
+
176
+ Optional:
177
+ - `--output ./docs/sdd` to keep SDD next to the repo
178
+ - `--output ../_sdd/<project>` for a separate shared directory
179
+
180
+ ## Lifecycle folders
181
+
182
+ ```
183
+ docs/
184
+ requirements/
185
+ backlog/
186
+ wip/
187
+ in-progress/
188
+ done/
189
+ archived/
190
+ ```
191
+
192
+ `wip/` is the planning and design stage. `in-progress/` is optional for implementation-specific tracking.
193
+
194
+ ## How we ensure the right questions get asked
195
+
196
+ ### Mandatory discovery fields
197
+ - Clear objective (measurable)
198
+ - Users/actors
199
+ - Scope and out-of-scope
200
+ - Acceptance criteria
201
+ - Non-functional requirements (security, performance, availability)
202
+ - Data sensitivity and compliance requirements
203
+
204
+ ### Ambiguity detection
205
+ - Vague adjectives require metrics ("fast", "secure", "scalable")
206
+ - Missing scale (traffic, data size, concurrency) is blocked
207
+ - External dependencies must be listed or the flow stops
208
+
209
+ ### Persona-aware questions
210
+ - The question bank adapts to the selected flow (law, education, data science, etc.).
211
+ - Domain rules add extra checks (compliance, audit, bias, safety).
212
+
213
+ ### Consistency gate
214
+ `sdd-tool doctor` ensures every requirement has matching specs, tests, and ADRs.
215
+
216
+ ## Clean code across any language
217
+
218
+ ### Quality contract
219
+ `quality.yml` defines global standards and language-specific toolchains.
220
+
221
+ General rules:
222
+ - Single responsibility per function/class
223
+ - Explicit error handling and consistent logging
224
+ - Formatting and linting required
225
+ - Tests for critical flows
226
+ - Max complexity threshold
227
+
228
+ Language profiles (opt-in):
229
+ - JS/TS: ESLint + Prettier + Vitest
230
+ - Python: Ruff/Black + Pytest
231
+ - Go: gofmt + golangci-lint + go test
232
+ - Java: Checkstyle/SpotBugs + JUnit
233
+
234
+ ## Multi-agent coordination
235
+
236
+ ### Roles
237
+ - **Req Analyst** -- clarity and acceptance criteria
238
+ - **Solution Architect** -- design and trade-offs
239
+ - **Tech Lead** -- implementation plan and quality
240
+ - **QA** -- test plan, edge cases, coverage
241
+ - **Docs Scribe** -- changelog, ADRs, progress log
242
+
243
+ ### Agent exit contract
244
+ Each agent must leave:
245
+ - Summary of work
246
+ - Changes made
247
+ - Risks and open questions
248
+ - Next steps
249
+
250
+ ## Codex-ready workflow (skills)
251
+
252
+ The tool is designed to work cleanly with Codex and other AI agents by providing:
253
+ - A consistent folder structure and artifact names
254
+ - Explicit question banks and ambiguity detection
255
+ - Clear agent roles and handoffs
256
+ - A required progress log and decision log
257
+
258
+ See `skills/` for the agent protocol and prompt packs.
259
+
260
+ ## AI "wings": the framework
261
+
262
+ AI should not guess. It should be guided, constrained, and verified.
263
+
264
+ 1) **Clarify** -- ask missing questions
265
+ 2) **Commit** -- lock scope and acceptance criteria
266
+ 3) **Design** -- architecture and trade-offs
267
+ 4) **Prove** -- tests and validations
268
+ 5) **Deliver** -- clean code and docs
269
+ 6) **Reflect** -- changelog and decision log
270
+
271
+ ## Intent router (multi-domain)
272
+
273
+ The router identifies the user intent and routes to the correct flow, prompts, and artifacts.
274
+
275
+ ### Example
276
+ User: `sdd-tool hello`
277
+ User input: "I have a bug: <link>. How to solve?"
278
+
279
+ Router actions:
280
+ 1) Detect intent: **bug fix**
281
+ 2) Ask permission to fetch the link and read it
282
+ 3) If approved, read and summarize the issue
283
+ 4) Offer **5+ solution options** with trade-offs
284
+ 5) Ask the user for their view of the bug and more context
285
+ 6) Continue into requirements -> functional spec -> technical spec -> architecture
286
+ 7) If not happy, user runs `--improve` to trigger self-audit and regenerate
287
+
288
+ ### Router signals (high level)
289
+ - **Bug fix**: "bug", "issue", "error", stack trace, repro steps
290
+ - **Learning**: "learn", "explain", "teach me", "what is"
291
+ - **Design/creative**: "logo", "brand", "layout", "art", "visual"
292
+ - **Research**: "study", "paper", "literature", "survey"
293
+ - **Data science**: "model", "dataset", "prediction"
294
+ - **Business/economics**: "market", "pricing", "forecast"
295
+ - **Legal/civic**: "court", "policy", "compliance"
296
+ - **PR review**: "PR", "pull request", "review comments", "code review"
297
+
298
+ ### Router output
299
+ - Selected flow
300
+ - Required prompts
301
+ - Required artifacts
302
+ - Quality gates
303
+ - Suggested agents
304
+
305
+ ## Router scripts and schemas
306
+
307
+ - `router/` contains step-by-step conversation scripts by intent.
308
+ - `schemas/` defines JSON schemas for core artifacts and session data.
309
+
310
+ These files are the source of truth for the CLI behavior.
311
+
312
+ ## Bug-first workflow (deep detail)
313
+
314
+ When a user reports a bug, the tool must:
315
+ - Gather the issue context (link, repo, environment)
316
+ - Ask for reproduction steps and severity
317
+ - Propose 5+ resolution paths (quick fix, rollback, root-cause, refactor, hotfix)
318
+ - Ask the user to confirm the preferred path
319
+ - Generate requirements and specs for the fix
320
+ - Gate implementation until tests and risk checks are defined
321
+
322
+ ## Cross-domain coverage
323
+
324
+ The router supports **software and non-software** flows:
325
+ - Software engineering (features, bugs, refactors)
326
+ - Data science (models, pipelines, experiments)
327
+ - Design and art (visual systems, branding, layout)
328
+ - Humanities (history, sociology, education)
329
+ - Business and economics (market, policy, pricing)
330
+ - PR review and code feedback workflows
331
+
332
+ ## Knowledge-first mode (deep research sessions)
333
+
334
+ The tool is not only for software requirements. It can also run **knowledge journeys** where the user wants to learn a topic deeply (e.g., "I want to know more about Egypt").
335
+
336
+ ### How it works
337
+ 1) **Interview** the user to understand depth, audience, purpose, and constraints.
338
+ 2) **Build a research plan** (outline, key questions, scope boundaries).
339
+ 3) **Run multi-agent synthesis** with specialized roles (historian, critic, summarizer).
340
+ 4) **Deliver layered outputs**: executive summary, deep dive, references, and follow-up prompts.
341
+
342
+ ### 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
+
347
+ ### Interview prompts (examples)
348
+ - Why do you want to learn this topic?
349
+ - What level of depth (overview, academic, expert)?
350
+ - What format do you want (summary, syllabus, report, Q&A)?
351
+ - Any focus areas (history, culture, economy, politics)?
352
+ - Time available to read or study?
353
+
354
+ ### Quality framework for answers
355
+ - Bias checks and alternative viewpoints
356
+ - Source reliability scoring
357
+ - Clear assumptions and confidence levels
358
+ - A "what to read next" section
359
+
360
+ ### Outputs (knowledge workspace)
361
+ - `brief.md` -- short explanation
362
+ - `deep-dive.md` -- extended structured answer
363
+ - `reading-list.md` -- curated sources
364
+ - `qa.md` -- questions and answers
365
+ - `progress-log.md` -- session history
366
+
367
+ This mode uses the same "AI wings" principle: clarify, commit, design, prove, deliver, reflect.
368
+
369
+ ## MVP v1 (exhaustive command and prompt scope)
370
+
371
+ ### MVP goals
372
+ - One command to enter (hello), one command to finish (req finish).
373
+ - Always ask the right questions before planning or implementation.
374
+ - Always create a workspace, never contaminate dependencies.
375
+
376
+ ### MVP commands
377
+ Core:
378
+ - `sdd-tool hello`
379
+ - `sdd-tool init`
380
+ - `sdd-tool list`
381
+ - `sdd-tool doctor`
382
+
383
+ 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`
389
+
390
+ 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`
397
+
398
+ ### MVP prompts (must-ask list)
399
+ Discovery:
400
+ - Objective (measurable outcome)
401
+ - Users/actors and their needs
402
+ - Scope and out-of-scope
403
+ - Acceptance criteria
404
+ - NFRs: security, performance, availability
405
+ - Data sensitivity and compliance
406
+ - Constraints (budget, deadlines, platforms)
407
+
408
+ Persona-specific extensions:
409
+ - Legal: privilege, retention, audit, jurisdiction
410
+ - Education: rubric, accessibility, student privacy
411
+ - Data science: bias, drift, metrics, monitoring
412
+ - Software: dependencies, regression risk, rollout
413
+ - Bug fix: repro steps, severity, rollback
414
+
415
+ Planning:
416
+ - Minimal viable architecture
417
+ - Key integrations and dependencies
418
+ - Data model outline
419
+ - Error handling and logging strategy
420
+ - Observability requirements
421
+
422
+ Implementation readiness:
423
+ - Test plan (critical paths + edge cases)
424
+ - Quality contract profile
425
+ - Definition of Done checklist
426
+
427
+ ### MVP outputs (required)
428
+ - `requirement.md`
429
+ - `functional-spec.md`
430
+ - `technical-spec.md`
431
+ - `architecture.md`
432
+ - `test-plan.md`
433
+ - `quality.yml`
434
+ - `decision-log/ADR-0001.md`
435
+ - `progress-log.md`
436
+ - `project-readme.md`
437
+
438
+ ## Interactive session (hello) design
439
+
440
+ ### Steps
441
+ 1) **Connect** to AI and load local workspace index.
442
+ 2) **List active projects** with status (backlog, wip, done).
443
+ 3) **Choose**: start new or continue.
444
+ 4) **Context**: ask domain and persona to load the right flow.
445
+ 5) **Plan**: run discovery prompts and generate backlog artifacts.
446
+ 6) **Advance**: offer refine, plan, or start automatically.
447
+
448
+ ### Data model (concept)
449
+ - `workspaces.json` tracks projects and last activity.
450
+ - Each project has `metadata.json` with domain, status, language profile.
451
+
452
+ ## End-to-end framework (single command experience)
453
+
454
+ The goal is a single entry command that ends in a deliverable package:
455
+ - Documents are structured
456
+ - Decisions are logged
457
+ - Tests are planned
458
+ - Quality gates are in place
459
+ - Users can resume at any point
460
+
461
+ ## Workspace layout (canonical)
462
+
463
+ Each project is self-contained and resumable:
464
+ ```
465
+ <workspace>/
466
+ metadata.json
467
+ requirements/
468
+ backlog/
469
+ wip/
470
+ in-progress/
471
+ done/
472
+ archived/
473
+ pr-reviews/
474
+ PR-123/
475
+ pr-comment-audit.md
476
+ pr-review-summary.md
477
+ pr-review-report.md
478
+ pr-metrics.md
479
+ pr-comment-lifecycle.md
480
+ guides/
481
+ responses/
482
+ decision-log/
483
+ progress-log.md
484
+ quality.yml
485
+ test-plan.md
486
+ project-readme.md
487
+ ```
488
+
489
+ ## Artifact traceability
490
+
491
+ Every requirement has:
492
+ - A unique ID (REQ-XXXX)
493
+ - Linked specs and test plan
494
+ - Decision log references
495
+ - A progress log trail
496
+
497
+ ## Diagram generation (planned)
498
+
499
+ The tool can generate C4-style diagrams using templates:
500
+ - Context diagram
501
+ - Container diagram
502
+ - Component diagram
503
+
504
+ These are exported as text (Mermaid/PlantUML) to keep them versionable.
505
+
506
+ ## Provider abstraction (AI)
507
+
508
+ The CLI is provider-agnostic:
509
+ - Local model
510
+ - Remote model
511
+ - Codex-compatible
512
+
513
+ The router selects agent roles, while the provider is configurable.
514
+
515
+ ## Privacy and approvals
516
+
517
+ - Any external link access requires explicit user approval.
518
+ - All prompts and outputs are stored locally unless user opts in to sync.
519
+
520
+ ## Gaps now covered
521
+
522
+ - Single-entry "hello" flow
523
+ - Multi-domain router and role activation
524
+ - Persona-aware questions
525
+ - Workspace isolation and resumable state
526
+ - Diagram and architecture outputs
527
+ - Cross-language quality gates
528
+
529
+ ## Flows (domain playbooks)
530
+
531
+ See `flows/` for detailed, domain-specific guides:
532
+ - Lawyer
533
+ - Teacher
534
+ - Admissions admin
535
+ - State admin
536
+ - Taxes admin
537
+ - Student (university)
538
+ - Data scientist
539
+ - Programmer
540
+ - Bug fix
541
+ - Ecommerce
542
+ - Retail store
543
+ - Court system
544
+ - Graphic design
545
+ - Art
546
+ - History
547
+ - Sociology
548
+ - Economics
549
+
550
+ These are opinionated, real-world flows that demonstrate how the CLI should be used in practice.
551
+
552
+ ## References (public sources)
553
+
554
+ - IEEE 1016: Software Design Description (SDD)
555
+ - C4 Model: https://c4model.com
556
+ - ADRs: https://adr.github.io
557
+ - RFC 2119 (MUST/SHOULD): https://www.rfc-editor.org/rfc/rfc2119
558
+ - User Stories: https://www.atlassian.com/agile/project-management/user-stories
559
+ - INVEST: https://www.agilealliance.org/glossary/invest/
560
+ - Definition of Done: https://www.atlassian.com/agile/project-management/definition-of-done
561
+ - BDD: https://cucumber.io/docs/bdd/
562
+ - arc42: https://arc42.org
563
+ - OWASP ASVS: https://owasp.org/www-project-application-security-verification-standard/
564
+ - Jobs to be Done: https://www.intercom.com/blog/jtbd/
565
+ - Design Thinking: https://www.interaction-design.org/literature/topics/design-thinking
566
+ - CRISP-DM: https://www.ibm.com/docs/en/spss-modeler/18.2.2?topic=dm-crisp
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};