description | globs | alwaysApply | |
---|---|---|---|
Memory Bank for Software Implementation |
|
true |
I'm an AI agent with session-based memory. Between sessions, I rely on Memory Bank files in .agents/rules/memory-bank/
to maintain project continuity.
ALWAYS check the actual file system first - never assume files are missing:
- FIRST: Check if
.agents/rules/memory-bank/
directory exists - THEN: List actual files present in that directory
- NEVER report "missing" without actually checking
[Memory Bank: Active - Loaded: {list actual files found}]
- Brief project summary from files
- Proceed with loaded context
[Memory Bank: Directory found, files empty - Initializing]
- Immediately offer: "I found the memory bank directory but it's empty. I'll analyze the project and create the core files now."
- Auto-proceed with initialization unless user objects
[Memory Bank: Creating structure]
- Create
.agents/rules/memory-bank/
directory - Immediately initialize with project analysis
- Report completion
[Memory Bank: Partial - Found: {list actual files}]
- Load available files
- Note which core files are missing:
Missing: {list}
- Offer: "Should I create the missing files to complete the memory bank?"
- Check directory existence:
.agents/rules/memory-bank/
- List directory contents: Show what's actually there
- Attempt to read each file: Handle read errors gracefully
- Report actual status: Based on what was found, not assumptions
- Directory missing → Create and initialize
- Files missing → Create missing files
- Files unreadable → Report specific file issues
- Permissions issues → Provide specific guidance
brief.md
- Project requirements and scope (user-maintained)architecture.md
- System design and implementation detailscontext.md
- Current state and active workproduct.md
- Purpose and user experience goalstech.md
- Technology stack and dependencies
- Always create directory first if missing
- Populate immediately with project analysis
- Verify creation and report success
- Request user review for accuracy
Triggers:
- Directory missing
- Directory empty
- Core files missing
Process:
- Create
.agents/rules/memory-bank/
if needed - Analyze current project structure
- Identify project type, main files, and patterns
- Create all core files with discovered information
- Report:
[Memory Bank: Initialized - Created: {list files}]
- Ask: "Please review the generated memory bank files for accuracy"
When some files exist:
- Load and analyze existing files
- Identify missing core files
- Generate missing files based on:
- Existing file content
- Current project analysis
- Consistency with loaded context
- Maintain coherence across all files
Smart update triggers:
- After implementing new features
- When project structure changes
- When dependencies are modified
- When user requests updates
Update process:
- Verify all files accessible
- Load current state from all files
- Compare with project reality
- Update incrementally (don't rewrite everything)
- Prioritize
context.md
for recent changes - Preserve user-maintained content in
brief.md
- Never assume - always check actual file system
- Create missing structure proactively
- Handle partial states gracefully
- Provide specific error messages with solutions
"Memory bank missing" reports:
- Root cause: Not checking file system
- Solution: Always verify directory and file existence first
- Response: Create missing components immediately
Permission/access issues:
- Check: File permissions and directory access
- Report: Specific files and permission issues
- Suggest: Concrete steps to resolve
Inconsistent file states:
- Detect: Files that don't match current project
- Update: Outdated information automatically
- Preserve: User-provided requirements and constraints
- Load
context.md
first - most relevant for current work - Load
architecture.md
second - high-impact technical context - Load remaining files based on immediate needs
- Cache insights to avoid re-reading during session
- Incremental updates rather than full rewrites
- Focus on changed areas of the project
- Preserve stable information across updates
- Version awareness - note when major changes occur
- Specific file states: "Found 3 of 5 core files"
- Immediate actions: "Creating missing architecture.md"
- Next steps: "Ready to proceed with loaded context"
- Detect issues early in session start
- Offer solutions immediately - don't wait for user requests
- Auto-recover when possible - minimize user intervention
- Explain what happened - build user confidence
- Auto-create missing structure instead of reporting errors
- Initialize with intelligent defaults based on project analysis
- Update incrementally rather than requiring full rebuilds
- Maintain continuity even when files are temporarily inaccessible
- File System First: Always check actual files before reporting status
- Proactive Creation: Create missing components immediately
- Intelligent Defaults: Populate files with project analysis, not empty templates
- Graceful Degradation: Work effectively even with partial or missing files
- User-Centric: Minimize troubleshooting, maximize productivity
Remember: The memory bank should be invisible infrastructure that "just works." When there are issues, solve them immediately rather than requiring user intervention.