7.0 KiB
7.0 KiB
Epic 1: Project Initialization & Core Setup
Goal: Initialize the project using the "bmad-boilerplate", manage dependencies, setup .env and config loading, establish basic CLI entry point, setup basic logging and output directory structure. This provides the foundational setup for all subsequent development work.
Story List
Story 1.1: Initialize Project from Boilerplate
- User Story / Goal: As a developer, I want to set up the initial project structure using the
bmad-boilerplate, so that I have the standard tooling (TS, Jest, ESLint, Prettier), configurations, and scripts in place. - Detailed Requirements:
- Copy or clone the contents of the
bmad-boilerplateinto the new project's root directory. - Initialize a git repository in the project root directory (if not already done by cloning).
- Ensure the
.gitignorefile from the boilerplate is present. - Run
npm installto download and install alldevDependenciesspecified in the boilerplate'spackage.json. - Verify that the core boilerplate scripts (
lint,format,test,build) execute without errors on the initial codebase.
- Copy or clone the contents of the
- Acceptance Criteria (ACs):
- AC1: The project directory contains the files and structure from
bmad-boilerplate. - AC2: A
node_modulesdirectory exists and contains packages corresponding todevDependencies. - AC3:
npm run lintcommand completes successfully without reporting any linting errors. - AC4:
npm run formatcommand completes successfully, potentially making formatting changes according to Prettier rules. Running it a second time should result in no changes. - AC5:
npm run testcommand executes Jest successfully (it may report "no tests found" which is acceptable at this stage). - AC6:
npm run buildcommand executes successfully, creating adistdirectory containing compiled JavaScript output. - AC7: The
.gitignorefile exists and includes entries fornode_modules/,.env,dist/, etc. as specified in the boilerplate.
- AC1: The project directory contains the files and structure from
Story 1.2: Setup Environment Configuration
- User Story / Goal: As a developer, I want to establish the environment configuration mechanism using
.envfiles, so that secrets and settings (like output paths) can be managed outside of version control, following boilerplate conventions. - Detailed Requirements:
- Verify the
.env.examplefile exists (from boilerplate). - Add an initial configuration variable
OUTPUT_DIR_PATH=./outputto.env.example. - Create the
.envfile locally by copying.env.example. PopulateOUTPUT_DIR_PATHif needed (can keep default). - Implement a utility module (e.g.,
src/config.ts) that loads environment variables from the.envfile at application startup. - The utility should export the loaded configuration values (initially just
OUTPUT_DIR_PATH). - Ensure the
.envfile is listed in.gitignoreand is not committed.
- Verify the
- Acceptance Criteria (ACs):
- AC1: Handle
.envfiles with native node 22 support, no need fordotenv - AC2: The
.env.examplefile exists, is tracked by git, and contains the lineOUTPUT_DIR_PATH=./output. - AC3: The
.envfile exists locally but is NOT tracked by git. - AC4: A configuration module (
src/config.tsor similar) exists and successfully loads theOUTPUT_DIR_PATHvalue from.envwhen the application starts. - AC5: The loaded
OUTPUT_DIR_PATHvalue is accessible within the application code.
- AC1: Handle
Story 1.3: Implement Basic CLI Entry Point & Execution
- User Story / Goal: As a developer, I want a basic
src/index.tsentry point that can be executed via the boilerplate'sdevandstartscripts, providing a working foundation for the application logic. - Detailed Requirements:
- Create the main application entry point file at
src/index.ts. - Implement minimal code within
src/index.tsto:- Import the configuration loading mechanism (from Story 1.2).
- Log a simple startup message to the console (e.g., "BMad Hacker Daily Digest - Starting Up...").
- (Optional) Log the loaded
OUTPUT_DIR_PATHto verify config loading.
- Confirm execution using boilerplate scripts.
- Create the main application entry point file at
- Acceptance Criteria (ACs):
- AC1: The
src/index.tsfile exists. - AC2: Running
npm run devexecutessrc/index.tsviats-nodeand logs the startup message to the console. - AC3: Running
npm run buildsuccessfully compilessrc/index.ts(and any imports) into thedistdirectory. - AC4: Running
npm start(after a successful build) executes the compiled code fromdistand logs the startup message to the console.
- AC1: The
Story 1.4: Setup Basic Logging and Output Directory
- User Story / Goal: As a developer, I want a basic console logging mechanism and the dynamic creation of a date-stamped output directory, so that the application can provide execution feedback and prepare for storing data artifacts in subsequent epics.
- Detailed Requirements:
- Implement a simple, reusable logging utility module (e.g.,
src/logger.ts). Initially, it can wrapconsole.log,console.warn,console.error. - Refactor
src/index.tsto use thisloggerfor its startup message(s). - In
src/index.ts(or a setup function called by it):- Retrieve the
OUTPUT_DIR_PATHfrom the configuration (loaded in Story 1.2). - Determine the current date in 'YYYY-MM-DD' format.
- Construct the full path for the date-stamped subdirectory (e.g.,
${OUTPUT_DIR_PATH}/YYYY-MM-DD). - Check if the base output directory exists; if not, create it.
- Check if the date-stamped subdirectory exists; if not, create it recursively. Use Node.js
fsmodule (e.g.,fs.mkdirSync(path, { recursive: true })). - Log (using the logger) the full path of the output directory being used for the current run (e.g., "Output directory for this run: ./output/2025-05-04").
- Retrieve the
- Implement a simple, reusable logging utility module (e.g.,
- Acceptance Criteria (ACs):
- AC1: A logger utility module (
src/logger.tsor similar) exists and is used for console output insrc/index.ts. - AC2: Running
npm run devornpm startlogs the startup message via the logger. - AC3: Running the application creates the base output directory (e.g.,
./outputdefined in.env) if it doesn't already exist. - AC4: Running the application creates a date-stamped subdirectory (e.g.,
./output/2025-05-04) within the base output directory if it doesn't already exist. - AC5: The application logs a message indicating the full path to the date-stamped output directory created/used for the current execution.
- AC6: The application exits gracefully after performing these setup steps (for now).
- AC1: A logger utility module (
Change Log
| Change | Date | Version | Description | Author |
|---|---|---|---|---|
| Initial Draft | 2025-05-04 | 0.1 | First draft of Epic 1 | 2-pm |