How mouredev/hello-sdd works
Repository Scope
This is an educational Spec-Driven Development repository. It contains reusable SDD course materials in samples/ and a complete reference implementation, habits-cli/: a Python command-line application for tracking study habits and consecutive-day streaks.
Application Entry Points
The runnable application is the habits Python package:
• Module execution entry point: habits-cli/habits/__main__.py
• Command-line parsing and command dispatch: habits-cli/habits/cli.py
• Package metadata and console-script/runtime definition: habits-cli/pyproject.toml
The CLI exposes the application boundary through habits add, habits done, and habits list.
CLI Adapter and Control Flow
habits-cli/habits/cli.py translates command-line arguments into application operations, presents results/errors to the terminal, and determines process outcomes. It should not own persistence or streak rules.
Typical flow is: shell invocation → __main__ → CLI parser/dispatcher → domain operations → storage read/write → formatted terminal output.
Paths:
• habits-cli/habits/__main__.py
• habits-cli/habits/cli.py
• habits-cli/habits/core.py
Domain Model and Streak Logic
habits-cli/habits/core.py is the business-logic boundary. It defines the habit-oriented operations and computes consecutive-day streaks from completion dates. This isolates behavioral rules from both CLI formatting and JSON/file representation.
Core operations support creating habits, recording completion, listing habits, and deriving current streak information.
Paths:
• habits-cli/habits/core.py
• habits-cli/specs/001-habits-mvp/spec.md
• habits-cli/specs/001-habits-mvp/plan.md
Persistence Boundary
habits-cli/habits/storage.py owns durable local state: loading existing habits and saving mutations. The application uses local filesystem persistence rather than a database, network API, or hosted service. Domain code should consume this through storage-oriented operations rather than directly manipulating files.
Paths:
• habits-cli/habits/storage.py
• habits-cli/habits/core.py
Runtime and Dependencies
The implementation targets Python and intentionally uses only the standard library. Packaging and execution configuration are in habits-cli/pyproject.toml; there is no web server, browser client, cloud infrastructure, database, or third-party external service in the application architecture.
Paths:
• habits-cli/pyproject.toml
• habits-cli/habits/__init__.py
SDD Artifact Chain
The repository treats specifications as upstream architectural inputs. The governing principles, MVP requirements, planned module contracts/data model, and decomposed implementation tasks form the change-control chain before code changes.
Paths:
• habits-cli/docs/constitution.md
• habits-cli/specs/001-habits-mvp/spec.md
• habits-cli/specs/001-habits-mvp/plan.md
Reusable Specification Generation
A reusable agent skill guides requirements interviews and creates specifications using the project’s SDD conventions. It is development-process infrastructure, not part of the habits runtime, and is mirrored for different coding-agent environments.
Paths:
• habits-cli/.claude/skills/spec-generator/SKILL.md
• habits-cli/.claude/skills/spec-generator/spec-template.md
• habits-cli/.opencode/skill/spec-generator
Main entry points: cli.py CLI parser & dispatcher · plan.md Implementation plan · SKILL.md Spec generator skill · __main__.py Module entry point
Components 12
Habits CLI Runtime
- Python package config · Defines runtime and console-script metadata.
habits-cli/pyproject.toml - Module entry point
habits-cli/habits/__main__.py - CLI parser & dispatcher · Maps commands and terminal outcomes.
habits-cli/habits/cli.py - Habit domain operations · Creates habits, records completions, and derives streaks.
habits-cli/habits/core.py - Local state storage · Loads and saves durable local habit state.
habits-cli/habits/storage.py - Shell user
SDD Change Control
- SDD constitution
habits-cli/docs/constitution.md - MVP specification
habits-cli/specs/001-habits-mvp/spec.md - Implementation plan · Defines planned module contracts and data model.
habits-cli/specs/001-habits-mvp/plan.md
Specification Generation
- Spec generator skill · Guides requirements interviews and specification creation.
habits-cli/.claude/skills/spec-generator/SKILL.md - Specification template
habits-cli/.claude/skills/spec-generator/spec-template.md - OpenCode skill mirror
habits-cli/.opencode/skill/spec-generator
Connections 13
- Python package config → Module entry point: defines runtime
- Shell user → Module entry point: invokes
- Module entry point → CLI parser & dispatcher: starts
- CLI parser & dispatcher → Habit domain operations: dispatches add / done / list
- Habit domain operations → Local state storage: loads and saves habits
- CLI parser & dispatcher → Shell user: prints results and errors
- SDD constitution → MVP specification: governs
- MVP specification → Implementation plan: drives
- Implementation plan → Habit domain operations: specifies contracts
- Implementation plan → Local state storage: specifies data model
- Spec generator skill → Specification template: uses
- Spec generator skill → MVP specification: generates
- OpenCode skill mirror → Spec generator skill: mirrors