Specification-driven delivery CLI that turns requirements into specs, architecture, tests, and traceable docs.
This repo hosts the CLI implementation, domain flows, templates, schemas, and structured documentation for the SDD workflow.
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.
Mission and vision live in docs/MISSION.md and docs/VISION.md.
Start with docs/INDEX.md for a full documentation map and docs/STYLE.md for formatting guidance.
Contributing guidelines live in docs/CONTRIBUTING.md.
Use the PR template in .github/PULL_REQUEST_TEMPLATE.md.
Maintenance guidance lives in docs/MAINTENANCE.md.
Install troubleshooting lives in docs/TROUBLESHOOTING.md.
Deep process, commands, interactions, and diagrams live in:
docs/PROCESS.mddocs/COMMANDS.mddocs/INTERACTIONS.mddocs/DIAGRAMS.mddocs/ARCHITECTURE.mddocs/SDD_CHECKLIST.mddocs/GLOSSARY.mddocs/VALIDATION_CHECKLIST.mddocs/FLOW_TEMPLATE_MAP.mddocs/GATE_PROMPT_MATRIX.mddocs/TEMPLATE_LINT_RULES.mddocs/FLOW_GATE_MAP.mddocs/FLOW_COMPLIANCE_CHECKLIST.mddocs/RELEASE_READINESS_CHECKLIST.mddocs/AUTOMATION_OUTLINE.mddocs/GATE_SCHEMA_MAP.mddocs/GATE_TEMPLATE_MAP.mddocs/KNOWLEDGE_MODE_CHECKLIST.mddocs/DOMAIN_COMPLETENESS_CHECKLIST.mddocs/IMPLEMENTATION_PLAN.mddocs/CLEAN_ARCHITECTURE_CHECKLIST.mddocs/REQUIREMENTS_ALIGNMENT.mddocs/GITFLOW.mddocs/RELEASE_PROCESS.md
Reports live in:
docs/reports/E2E_REPORT.mddocs/reports/FLOW_COVERAGE.mddocs/reports/GATE_COVERAGE_REPORT.mddocs/reports/GATE_TEMPLATE_COVERAGE_REPORT.mddocs/reports/PACK_COVERAGE_REPORT.mddocs/reports/PROMPT_AUDIT_REPORT.mddocs/reports/PROMPT_COVERAGE_REPORT.mddocs/reports/QUALITY_SCORE_RUBRIC.mddocs/reports/SPEC_COMPLETENESS_REPORT.md
Examples and templates:
examples/transcripts/examples/artifacts/examples/schemas/examples/diagrams/examples/packs/examples/README.mdtemplates/README.mdschemas/README.mdflows/README.mdtemplates/schemas/
Automation:
scripts/e2e.ps1scripts/e2e.sh
- Question banks enforce clarity before planning.
- Quality contracts enforce clean code across languages.
- Decision logs make trade-offs explicit.
- Proof gates ensure tests and acceptance criteria are met.
- Multi-agent roles ensure no single blind spot dominates.
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.
Key properties:
- Clear decisions and trade-offs.
- Traceability from requirement to design and tests.
- Versioned, auditable progress.
- Designed for real delivery, not just documentation.
- Requirements (functional + non-functional)
- Functional specs (flows, use cases, rules)
- Technical specs (stack, interfaces, data, security)
- Architecture (C4, containers, components, deployment)
- Best practices and quality gates
- Test plan and acceptance criteria
- Summary (objective, key decisions, open questions)
- Decision log (ADR-style)
- Progress log
- Project README aligned to the SDD
npm install -g sdd-cli
Then:
sdd-cli hello
Package name on npm is sdd-cli (CLI commands remain sdd-cli and sdd).
Project names must use letters, numbers, spaces, - or _, and cannot include path separators.
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.
-
Start
sdd-cli helloconnects to AI, shows active projects, and asks if you want to start new or continue. It also asks for project name, domain, output location, language profile, and quality level. -
Discover
Guided prompts producerequirements/backlog/REQ-0001/requirement.md. -
Refine
sdd-cli req refineresolves ambiguity, missing metrics, and risks. -
Plan (WIP)
sdd-cli req plancreates functional spec, tech spec, and architecture drafts. -
Implement
sdd-cli req startgenerates the implementation plan and activates quality gates. -
Verify
sdd-cli test plandefines scenarios and coverage targets. -
Finish
sdd-cli req finishseals the requirement, versioned docs, and decision logs.
sdd-cli hello-- interactive session, project picker, full guided flowsdd-cli init-- create SDD workspace and configsdd-cli list-- list flows, router flows, templates, prompt packs, and projectssdd-cli doctor-- validate completeness and consistency
sdd-cli route-- classify user intent and route to the right flow
sdd-cli req createsdd-cli req refinesdd-cli req plansdd-cli req startsdd-cli req finish
sdd-cli gen requirementssdd-cli gen functional-specsdd-cli gen technical-specsdd-cli gen architecturesdd-cli gen best-practicessdd-cli gen project-readme
sdd-cli test plan
sdd-cli learn startsdd-cli learn refinesdd-cli learn deliver
--approve-- run without extra confirmations--improve-- re-open and enhance existing docs--output <path>-- override workspace output--project <name>-- set project name--parallel-- generate in parallel--alias sdd-- optional alias to run assdd
By default, the tool writes to a dedicated workspace, not into your repo:
- Default (global workspace):
- Windows:
%APPDATA%/sdd-cli/workspaces/<project> - macOS/Linux:
~/.config/sdd-cli/workspaces/<project>
- Windows:
Optional:
--output ./docs/sddto keep SDD next to the repo--output ../_sdd/<project>for a separate shared directory
docs/
requirements/
backlog/
wip/
in-progress/
done/
archived/
wip/ is the planning and design stage. in-progress/ is optional for implementation-specific tracking.
- Clear objective (measurable)
- Users/actors
- Scope and out-of-scope
- Acceptance criteria
- Non-functional requirements (security, performance, availability)
- Data sensitivity and compliance requirements
- Vague adjectives require metrics ("fast", "secure", "scalable")
- Missing scale (traffic, data size, concurrency) is blocked
- External dependencies must be listed or the flow stops
- The question bank adapts to the selected flow (law, education, data science, etc.).
- Domain rules add extra checks (compliance, audit, bias, safety).
sdd-cli doctor ensures every requirement has matching specs, tests, and ADRs.
quality.yml defines global standards and language-specific toolchains.
General rules:
- Single responsibility per function/class
- Explicit error handling and consistent logging
- Formatting and linting required
- Tests for critical flows
- Max complexity threshold
Language profiles (opt-in):
- JS/TS: ESLint + Prettier + Vitest
- Python: Ruff/Black + Pytest
- Go: gofmt + golangci-lint + go test
- Java: Checkstyle/SpotBugs + JUnit
- Req Analyst -- clarity and acceptance criteria
- Solution Architect -- design and trade-offs
- Tech Lead -- implementation plan and quality
- QA -- test plan, edge cases, coverage
- Docs Scribe -- changelog, ADRs, progress log
Each agent must leave:
- Summary of work
- Changes made
- Risks and open questions
- Next steps
The tool is designed to work cleanly with Codex and other AI agents by providing:
- A consistent folder structure and artifact names
- Explicit question banks and ambiguity detection
- Clear agent roles and handoffs
- A required progress log and decision log
See skills/ for the agent protocol and prompt packs.
AI should not guess. It should be guided, constrained, and verified.
- Clarify -- ask missing questions
- Commit -- lock scope and acceptance criteria
- Design -- architecture and trade-offs
- Prove -- tests and validations
- Deliver -- clean code and docs
- Reflect -- changelog and decision log
The router identifies the user intent and routes to the correct flow, prompts, and artifacts.
User: sdd-cli hello
User input: "I have a bug: . How to solve?"
Router actions:
- Detect intent: bug fix
- Ask permission to fetch the link and read it
- If approved, read and summarize the issue
- Offer 5+ solution options with trade-offs
- Ask the user for their view of the bug and more context
- Continue into requirements -> functional spec -> technical spec -> architecture
- If not happy, user runs
--improveto trigger self-audit and regenerate
- Bug fix: "bug", "issue", "error", stack trace, repro steps
- Learning: "learn", "explain", "teach me", "what is"
- Design/creative: "logo", "brand", "layout", "art", "visual"
- Research: "study", "paper", "literature", "survey"
- Data science: "model", "dataset", "prediction"
- Business/economics: "market", "pricing", "forecast"
- Legal/civic: "court", "policy", "compliance"
- PR review: "PR", "pull request", "review comments", "code review"
- Selected flow
- Required prompts
- Required artifacts
- Quality gates
- Suggested agents
router/contains step-by-step conversation scripts by intent.schemas/defines JSON schemas for core artifacts and session data.
These files are the source of truth for the CLI behavior.
When a user reports a bug, the tool must:
- Gather the issue context (link, repo, environment)
- Ask for reproduction steps and severity
- Propose 5+ resolution paths (quick fix, rollback, root-cause, refactor, hotfix)
- Ask the user to confirm the preferred path
- Generate requirements and specs for the fix
- Gate implementation until tests and risk checks are defined
The router supports software and non-software flows:
- Software engineering (features, bugs, refactors)
- Data science (models, pipelines, experiments)
- Design and art (visual systems, branding, layout)
- Humanities (history, sociology, education)
- Business and economics (market, policy, pricing)
- PR review and code feedback workflows
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").
- Interview the user to understand depth, audience, purpose, and constraints.
- Build a research plan (outline, key questions, scope boundaries).
- Run multi-agent synthesis with specialized roles (historian, critic, summarizer).
- Deliver layered outputs: executive summary, deep dive, references, and follow-up prompts.
sdd-cli learn start-- begin a guided research sessionsdd-cli learn refine-- refine scope or depthsdd-cli learn deliver-- produce final output package
- Why do you want to learn this topic?
- What level of depth (overview, academic, expert)?
- What format do you want (summary, syllabus, report, Q&A)?
- Any focus areas (history, culture, economy, politics)?
- Time available to read or study?
- Bias checks and alternative viewpoints
- Source reliability scoring
- Clear assumptions and confidence levels
- A "what to read next" section
brief.md-- short explanationdeep-dive.md-- extended structured answerreading-list.md-- curated sourcesqa.md-- questions and answersprogress-log.md-- session history
This mode uses the same "AI wings" principle: clarify, commit, design, prove, deliver, reflect.
- One command to enter (hello), one command to finish (req finish).
- Always ask the right questions before planning or implementation.
- Always create a workspace, never contaminate dependencies.
Core:
sdd-cli hellosdd-cli initsdd-cli listsdd-cli doctor
Requirements:
sdd-cli req createsdd-cli req refinesdd-cli req plansdd-cli req startsdd-cli req finish
Generators:
sdd-cli gen requirementssdd-cli gen functional-specsdd-cli gen technical-specsdd-cli gen architecturesdd-cli gen best-practicessdd-cli gen project-readme
Discovery:
- Objective (measurable outcome)
- Users/actors and their needs
- Scope and out-of-scope
- Acceptance criteria
- NFRs: security, performance, availability
- Data sensitivity and compliance
- Constraints (budget, deadlines, platforms)
Persona-specific extensions:
- Legal: privilege, retention, audit, jurisdiction
- Education: rubric, accessibility, student privacy
- Data science: bias, drift, metrics, monitoring
- Software: dependencies, regression risk, rollout
- Bug fix: repro steps, severity, rollback
Planning:
- Minimal viable architecture
- Key integrations and dependencies
- Data model outline
- Error handling and logging strategy
- Observability requirements
Implementation readiness:
- Test plan (critical paths + edge cases)
- Quality contract profile
- Definition of Done checklist
requirement.mdfunctional-spec.mdtechnical-spec.mdarchitecture.mdtest-plan.mdquality.ymldecision-log/ADR-0001.mdprogress-log.mdproject-readme.md
- Connect to AI and load local workspace index.
- List active projects with status (backlog, wip, done).
- Choose: start new or continue.
- Context: ask domain and persona to load the right flow.
- Plan: run discovery prompts and generate backlog artifacts.
- Advance: offer refine, plan, or start automatically.
workspaces.jsontracks projects and last activity.- Each project has
metadata.jsonwith domain, status, language profile.
The goal is a single entry command that ends in a deliverable package:
- Documents are structured
- Decisions are logged
- Tests are planned
- Quality gates are in place
- Users can resume at any point
Each project is self-contained and resumable:
<workspace>/
metadata.json
requirements/
backlog/
wip/
in-progress/
done/
archived/
pr-reviews/
PR-123/
pr-comment-audit.md
pr-review-summary.md
pr-review-report.md
pr-metrics.md
pr-comment-lifecycle.md
guides/
responses/
decision-log/
progress-log.md
quality.yml
test-plan.md
project-readme.md
Every requirement has:
- A unique ID (REQ-XXXX)
- Linked specs and test plan
- Decision log references
- A progress log trail
The tool can generate C4-style diagrams using templates:
- Context diagram
- Container diagram
- Component diagram
These are exported as text (Mermaid/PlantUML) to keep them versionable.
The CLI is provider-agnostic:
- Local model
- Remote model
- Codex-compatible
The router selects agent roles, while the provider is configurable.
- Any external link access requires explicit user approval.
- All prompts and outputs are stored locally unless user opts in to sync.
- Single-entry "hello" flow
- Multi-domain router and role activation
- Persona-aware questions
- Workspace isolation and resumable state
- Diagram and architecture outputs
- Cross-language quality gates
See flows/ for detailed, domain-specific guides:
- Lawyer
- Teacher
- Admissions admin
- State admin
- Taxes admin
- Student (university)
- Data scientist
- Programmer
- Bug fix
- Ecommerce
- Retail store
- Court system
- Graphic design
- Art
- History
- Sociology
- Economics
These are opinionated, real-world flows that demonstrate how the CLI should be used in practice.
- IEEE 1016: Software Design Description (SDD)
- C4 Model: https://c4model.com
- ADRs: https://adr.github.io
- RFC 2119 (MUST/SHOULD): https://www.rfc-editor.org/rfc/rfc2119
- User Stories: https://www.atlassian.com/agile/project-management/user-stories
- INVEST: https://www.agilealliance.org/glossary/invest/
- Definition of Done: https://www.atlassian.com/agile/project-management/definition-of-done
- BDD: https://cucumber.io/docs/bdd/
- arc42: https://arc42.org
- OWASP ASVS: https://owasp.org/www-project-application-security-verification-standard/
- Jobs to be Done: https://www.intercom.com/blog/jtbd/
- Design Thinking: https://www.interaction-design.org/literature/topics/design-thinking
- CRISP-DM: https://www.ibm.com/docs/en/spss-modeler/18.2.2?topic=dm-crisp