Initialization Scripts Guide
Overview
Initialization scripts are essential components of the BIG BRAIN Memory Bank system, responsible for creating the required directory structure, setting up core memory files, and establishing the rule framework. These scripts ensure that the system can be quickly deployed in a consistent manner across different environments.
Available Initialization Scripts
The BIG BRAIN Memory Bank system provides initialization scripts in both PowerShell and Bash formats:
Script | Location | Description |
---|---|---|
Initialize-MemoryBank.ps1 |
scripts/ and scripts/Init/ |
PowerShell initialization script |
Initialize-MemoryBank.sh |
scripts/ and scripts/Init/ |
Bash initialization script |
These scripts are maintained in two locations for backward compatibility and accessibility.
Running Initialization Scripts
PowerShell Initialization
To initialize the system using PowerShell:
# From the root directory
./scripts/Initialize-MemoryBank.ps1
# Or using the categorized path
./scripts/Init/Initialize-MemoryBank.ps1
Bash Initialization
To initialize the system using Bash:
# From the root directory
./scripts/Initialize-MemoryBank.sh
# Or using the categorized path
./scripts/Init/Initialize-MemoryBank.sh
Initialization Options
The initialization scripts support the following options:
Option | Description |
---|---|
-Force |
Overwrite existing files (PowerShell only) |
-NoPrompt |
Skip confirmation prompts (PowerShell only) |
-Minimal |
Create only the essential directory structure and core files |
-Full |
Create the complete directory structure with example files |
-LogLevel |
Set the level of log detail (Normal, Verbose, Debug) |
Example usage with options:
./scripts/Initialize-MemoryBank.ps1 -Full -NoPrompt
What Gets Initialized
The initialization scripts create:
-
Directory Structure:
memory-bank/
- The main memory bank directorymemory-bank/core/
- Core memory componentsmemory-bank/core/active/
- Active memory filesmemory-bank/core/short-term/
- Short-term memory storagememory-bank/core/long-term/
- Long-term memory storage.cursor/rules/
- Rules directory structuredocs/
- Documentation structure
-
Core Memory Files:
activeContext.md
- Current work focus and recent changessystemPatterns.md
- System architecture and design patternstechContext.md
- Technologies and technical setupprogress.md
- Progress trackingprojectbrief.md
- Core requirements and goalsproductContext.md
- Project purpose and user experience goals
-
Rule Framework:
- Base rule structure
- System behavior rules
- Core framework rules
- Workflow rules
-
Documentation Files:
- Index file
- Essential guides
- Reference documentation
Updating Initialization Scripts
The initialization scripts are maintained by the
Update-InitializationScript.ps1
script, which:
- Analyzes the current repository structure
- Updates both PowerShell and Bash initialization scripts
- Ensures compatibility with the most recent system organization
To update the initialization scripts:
./scripts/Update/Update-InitializationScript.ps1
Script Organization Integration
The initialization scripts work seamlessly with the script organization structure:
- Path Resolution: The initialization scripts use path resolution to find and execute other scripts regardless of where they are stored
- Dual Location: Critical initialization scripts are maintained in both the
root
scripts/
directory and thescripts/Init/
category for backward compatibility - Cross-Platform Support: Both PowerShell and Bash versions are provided for cross-platform initialization
Troubleshooting
If you encounter issues with initialization:
-
Permission Issues: Ensure you have appropriate permissions to create directories and files
# For Bash scripts chmod +x ./scripts/Initialize-MemoryBank.sh
-
Path Resolution: If the initialization script cannot find referenced files, ensure the script organization structure is intact
# Run the script organization script first ./scripts/Organize-ScriptsFolder.ps1
-
Missing Templates: If template files are missing, run the initialization script updater
./scripts/Update/Update-InitializationScript.ps1
Version History
Version | Date | Changes |
---|---|---|
1.0.0 | 2025-01-15 | Initial implementation |
2.0.0 | 2025-03-24 | Enhanced with script organization integration |
2.1.0 | 2025-03-25 | Updated with cross-platform improvements |