-
-
Notifications
You must be signed in to change notification settings - Fork 34
Memory System
The memory system is your project's persistent knowledge base - six structured files that automatically track every aspect of your development process.
The memory system (Σ) consists of six core files:
| Symbol | File | Purpose | Updated By |
|---|---|---|---|
| σ₁ | projectbrief.md |
Requirements & scope | Research, Planning |
| σ₂ | systemPatterns.md |
Architecture & design | Innovate, Planning |
| σ₃ | techContext.md |
Technology stack | Research, Execute |
| σ₄ | activeContext.md |
Current focus & context | All modes |
| σ₅ | progress.md |
Status & milestones | Execute, Review |
| σ₆ | protection.md |
Protected code registry | Execute, Review |
/memory-bank/
├── projectbrief.md (σ₁)
├── systemPatterns.md (σ₂)
├── techContext.md (σ₃)
├── activeContext.md (σ₄)
├── progress.md (σ₅)
├── protection.md (σ₆)
└── backups/
└── YYYY-MM-DD/
└── *.bak
Purpose: Central requirements document
Structure:
# σ₁: Project Brief
*v1.0 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 🏆 Overview
[High-level project description]
## 📋 Requirements
- [R₁] User authentication required
- [R₂] Data must be encrypted
- [R₃] API response time <200ms
...
## 🎯 Success Criteria
- [C₁] All tests passing
- [C₂] Performance benchmarks met
- [C₃] Security audit passed
## 🚫 Out of Scope
- Mobile app development
- Third-party integrationsUpdated During:
- 🔍 Research: Requirements gathered
- 📝 Plan: Requirements refined
- 🔎 Review: Requirements validated
Key Sections:
- Overview: Project vision
- Requirements: Numbered list (R₁, R₂...)
- Success Criteria: Measurable goals
- Scope Boundaries: What's excluded
- Stakeholders: Key people
- Constraints: Limitations
Purpose: Architecture and design decisions
Structure:
# σ₂: System Patterns
*v1.0 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 🏛️ Architecture Overview
[High-level architecture diagram in ASCII]
## 🧩 Core Components
### Authentication Service
- Pattern: JWT with refresh tokens
- Rationale: Stateless, scalable
- Dependencies: jsonwebtoken, bcrypt
### Data Layer
- Pattern: Repository pattern
- Rationale: Abstraction, testability
- Implementation: TypeORM
## 🔄 Design Patterns
- [P₁] Singleton: Database connection
- [P₂] Factory: User creation
- [P₃] Observer: Event system
## 🏗️ Architectural Decisions
- [D₁] Microservices over monolith
- [D₂] PostgreSQL over MongoDB
- [D₃] REST over GraphQLUpdated During:
- 💡 Innovate: Patterns explored
- 📝 Plan: Architecture defined
- ⚙️ Execute: Patterns implemented
Key Sections:
- Architecture: System design
- Components: Major parts
- Patterns: Design patterns used
- Decisions: ADRs (Architecture Decision Records)
- Interfaces: API contracts
- Dependencies: Component relationships
Purpose: Technology stack and environment
Structure:
# σ₃: Technical Context
*v1.0 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 🛠️ Technology Stack
### Backend
- Runtime: Node.js v18.x
- Framework: Express 4.x
- Database: PostgreSQL 14
- ORM: TypeORM
### Frontend
- Framework: React 18
- State: Redux Toolkit
- Styling: Tailwind CSS
## 🌍 Environment Setup
### Development
- Node.js 18.x required
- PostgreSQL local instance
- Redis for caching
### Production
- AWS EC2 deployment
- RDS PostgreSQL
- ElastiCache Redis
## 📦 Dependencies
### Core
- express: ^4.18.0
- typeorm: ^0.3.0
- jsonwebtoken: ^9.0.0
### Development
- jest: ^29.0.0
- eslint: ^8.0.0Updated During:
- 🔍 Research: Stack identified
- ⚙️ Execute: Dependencies added
- 🔎 Review: Versions verified
Key Sections:
- Stack: Technologies used
- Environment: Setup requirements
- Dependencies: Package list
- Configuration: Settings
- Infrastructure: Deployment details
- Tools: Development tools
Purpose: Current focus and context references
Structure:
# σ₄: Active Context
*v1.1 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 🔮 Current Focus
Working on JWT authentication implementation
## 📝 Recent Changes
- Implemented token generation
- Added refresh token endpoint
- Updated middleware
## 🎯 Next Steps
1. Add token rotation
2. Implement rate limiting
3. Write integration tests
## 📎 Context References
### 📄 Active Files
- src/auth/jwt.service.ts 🟢
- src/auth/auth.controller.ts 🟢
- src/middleware/auth.middleware.ts 🟡
### 💻 Active Code
- generateToken() 🟢
- verifyToken() 🟢
- refreshToken() 🟣
### 📚 Active Docs
- JWT Best Practices 🟢
- OAuth2 Specification 🟡
## 📡 Context Status
- 🟢 Active: Currently working
- 🟡 Partially Relevant: May need
- 🟣 Essential: Core reference
- 🔴 Deprecated: No longer neededUpdated During:
- All modes continuously
Key Sections:
- Current Focus: What we're doing
- Recent Changes: What was done
- Next Steps: What's coming
- Context References: Active items
- Context Status: Relevance indicators
- Notes: Quick thoughts
Purpose: Project status and milestones
Structure:
# σ₅: Progress Tracker
*v1.0 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 📈 Project Status
Overall Completion: 45%
### 🎯 Milestones
- [M₁] Project Setup ✅ 100%
- [M₂] Authentication ⏳ 75%
- [M₃] Core API 🔜 0%
- [M₄] Testing 🔜 0%
## ✅ Completed Features
- [F₁] Database schema
- [F₂] User registration
- [F₃] Login endpoint
## 🚧 In Progress
- [F₄] JWT refresh tokens (75%)
- [F₅] Rate limiting (25%)
## 🐛 Known Issues
- [I₁] Token expiry not configurable
- [I₂] Missing password validation
## 📊 Metrics
- Tests: 24 passing, 2 failing
- Coverage: 67%
- Performance: API avg 125msUpdated During:
- ⚙️ Execute: Progress logged
- 🔎 Review: Status verified
Key Sections:
- Overall Status: Completion percentage
- Milestones: Major checkpoints
- Features: Completed/In-progress
- Issues: Known problems
- Metrics: Measurable data
- Timeline: Schedule tracking
Purpose: Track protected code regions
Structure:
# σ₆: Protection Registry
*v1.0 | Created: {DATE} | Updated: {DATE}*
*Π: {PHASE} | Ω: {MODE}*
## 🛡️ Protected Regions
### 🔒 PROTECTED (Ψ₁)
Never modify these sections:
- `src/auth/jwt.service.ts:15-25` - JWT secret handling
- `src/config/database.ts:8-20` - Database credentials
### 🛡️ GUARDED (Ψ₂)
Ask before modifying:
- `src/models/user.model.ts:30-45` - User schema
- `src/utils/crypto.ts:*` - Encryption utilities
### ⚠️ CRITICAL (Ψ₆)
Business logic protection:
- `src/services/payment.ts:50-120` - Payment processing
- `src/services/auth.ts:200-250` - Auth validation
## 📜 Protection History
- 2024-01-15: Added JWT secret protection
- 2024-01-16: Protected payment logic
## ✅ Modification Approvals
- 2024-01-17: Approved update to user schema
- Reason: Added email verification field
- Approved by: Team Lead
## ⚠️ Permission Violations
- 2024-01-18 14:30: Attempted modification of protected JWT secret
- Mode: EXECUTE
- Action: Blocked, reverted to safe stateUpdated During:
- ⚙️ Execute: Protections added
- 🔎 Review: Registry verified
Key Sections:
- Protected Regions: By level
- History: Protection timeline
- Approvals: Authorized changes
- Violations: Blocked attempts
- Guidelines: Protection rules
The framework automatically updates memory based on mode:
Σ_update(mode) = {
Ω₁: σ₃ += findings, σ₄ = focus,
Ω₂: σ₄ += ideas, σ₂ += patterns,
Ω₃: σ₄ += plan, σ₅ += milestones,
Ω₄: σ₅ += progress, σ₄ += completed,
Ω₅: σ₅ += results, σ₄ += issues
}Memory files reference each other:
[↗️σ₁:R₁] - Link to requirement 1
[↗️σ₂:P₃] - Link to pattern 3
[↗️σ₅:I₂] - Link to issue 2
Automatic backups on:
- Mode transitions
- Destructive operations
- Manual trigger
/memory-bank/backups/
└── 2024-01-15/
├── projectbrief.md.bak
├── systemPatterns.md.bak
└── ...
- Update immediately after changes
- Don't wait for mode switches
- Use clear, concise language
- Requirements: R₁, R₂, R₃...
- Features: F₁, F₂, F₃...
- Issues: I₁, I₂, I₃...
- Milestones: M₁, M₂, M₃...
- Link related items
- Maintain traceability
- Enable easy navigation
- Check accuracy weekly
- Prune outdated info
- Update progress metrics
- Add protection during coding
- Document protection reasons
- Review protection coverage
Show current requirements from projectbrief.md
Display active context
What's our current progress?
Add requirement: API must support pagination
Update progress: Authentication 80% complete
Mark issue I₁ as resolved
This implements requirement [↗️σ₁:R₃]
Following pattern [↗️σ₂:P₁]
Addresses issue [↗️σ₅:I₂]
- Cause: Mode permissions
-
Fix: Check mode with
!ckp
- Cause: Not saved before switch
- Fix: Check backups folder
- Cause: Manual edits
- Fix: Reconcile in PLAN mode
- Cause: Forgot to link
- Fix: Add references in current mode
Initialization (Π₂)
- Fill σ₁ (requirements)
- Define σ₃ (tech stack)
- Set σ₅ (milestones)
Development (Π₃)
- Update σ₂ (patterns)
- Track σ₄ (context)
- Monitor σ₅ (progress)
Maintenance (Π₄)
- Maintain σ₆ (protection)
- Archive σ₄ (context)
- Finalize σ₅ (metrics)
Research: Facts → Memory Innovate: Ideas → Patterns Plan: Design → Context Execute: Code → Progress Review: Results → Status
- 🔄 Mode Transitions
- 💾 Memory Management
- 🛡️ Protection Workflow
- 📎 Context Management
- 👥 Team Collaboration
-
Installation Issues
- Node.js Version Compatibility
- Package Installation Failures
- Framework Dependencies Missing
- Database Connection Issues
- Port Conflicts
- Environment Setup Issues
- Build and Development Issues
- Framework CLI Issues
-
Configuration & Runtime Issues
- Framework Configuration Problems
- Runtime Performance Issues
- Module Loading and Plugin Issues
- Database and Storage Issues
- Memory Leaks and High Memory Usage
- High CPU Usage
-
BMAD Module Issues
- BMAD Module Initialization Problems
- Business Model Canvas Issues
- Stakeholder Management Issues
- Analytics and Reporting Issues
- Performance Optimization
-
Database & API Issues
- Database Connection Problems
- Database Migration Issues
- API Performance and Reliability Issues
- Data Consistency Issues
- Transaction Problems
-
Performance & Memory Issues
- Memory Management
- CPU Optimization
- Database Query Performance
- Caching Issues
- Resource Monitoring
-
Security & Authentication Issues
- Authentication Failures
- Authorization Problems
- JWT Token Issues
- Session Management
- CORS and Security Headers
- SSL/TLS Configuration
-
Deployment & Production Issues
- Production Deployment Failures
- Environment Configuration
- Load Balancing Issues
- Monitoring and Logging
- Backup and Recovery
When reporting issues, please include:
- Framework version (
npm list @cursoriper/core) - Node.js version (
node --version) - Operating system and version
- Error messages and stack traces
- Steps to reproduce the issue
- Configuration files (sanitized)
- Recent changes or deployments
- Technical Support: support@cursoriper.com
- Documentation: https://docs.cursoriper.com
- Community Forum: https://community.cursoriper.com