memory-bank.mdc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ---
  2. description:
  3. globs:
  4. alwaysApply: true
  5. ---
  6. ## Memory Bank Structure
  7. The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
  8. ```mermaid
  9. flowchart TD
  10.     PB[projectbrief.md] --> PC[productContext.md]
  11.     PB --> SP[systemPatterns.md]
  12.     PB --> TC[techContext.md]
  13.     PC --> AC[activeContext.md]
  14.     SP --> AC
  15.     TC --> AC
  16.     AC --> P[progress.md]
  17. ```
  18. ### Core Files (Required)
  19. 1. `projectbrief.md`
  20.    - Foundation document that shapes all other files
  21.    - Created at project start if it doesn't exist
  22.    - Defines core requirements and goals
  23.    - Source of truth for project scope
  24. 2. `productContext.md`
  25.    - Why this project exists
  26.    - Problems it solves
  27.    - How it should work
  28.    - User experience goals
  29. 3. `activeContext.md`
  30.    - Current work focus
  31.    - Recent changes
  32.    - Next steps
  33.    - Active decisions and considerations
  34. 4. `systemPatterns.md`
  35.    - System architecture
  36.    - Key technical decisions
  37.    - Design patterns in use
  38.    - Component relationships
  39. 5. `techContext.md`
  40.    - Technologies used
  41.    - Development setup
  42.    - Technical constraints
  43.    - Dependencies
  44. 6. `progress.md`
  45.    - What works
  46.    - What's left to build
  47.    - Current status
  48.    - Known issues
  49. ### Additional Context
  50. Create additional files/folders within memory-bank/ when they help organize:
  51. - Complex feature documentation
  52. - Integration specifications
  53. - API documentation
  54. - Testing strategies
  55. - Deployment procedures
  56. ## Core Workflows
  57. ### Plan Mode
  58. ```mermaid
  59. flowchart TD
  60.     Start[Start] --> ReadFiles[Read Memory Bank]
  61.     ReadFiles --> CheckFiles{Files Complete?}
  62.     CheckFiles -->|No| Plan[Create Plan]
  63.     Plan --> Document[Document in Chat]
  64.     CheckFiles -->|Yes| Verify[Verify Context]
  65.     Verify --> Strategy[Develop Strategy]
  66.     Strategy --> Present[Present Approach]
  67. ```
  68. ### Act Mode
  69. ```mermaid
  70. flowchart TD
  71.     Start[Start] --> Context[Check Memory Bank]
  72.     Context --> Update[Update Documentation]
  73.     Update --> Rules[Update .clinerules if needed]
  74.     Rules --> Execute[Execute Task]
  75.     Execute --> Document[Document Changes]
  76. ```
  77. ## Documentation Updates
  78. Memory Bank updates occur when:
  79. 1. Discovering new project patterns
  80. 2. After implementing significant changes
  81. 3. When user requests with **update memory bank** (MUST review ALL files)
  82. 4. When context needs clarification
  83. ```mermaid
  84. flowchart TD
  85.     Start[Update Process]
  86.     subgraph Process
  87.         P1[Review ALL Files]
  88.         P2[Document Current State]
  89.         P3[Clarify Next Steps]
  90.         P4[Update .clinerules]
  91.         P1 --> P2 --> P3 --> P4
  92.     end
  93.     Start --> Process
  94. ```
  95. Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
  96. ## Project Intelligence (.clinerules)
  97. The .clinerules file is my learning journal for each project. It captures important patterns, preferences, and project intelligence that help me work more effectively. As I work with you and the project, I'll discover and document key insights that aren't obvious from the code alone.
  98. ```mermaid
  99. flowchart TD
  100.     Start{Discover New Pattern}
  101.     subgraph Learn [Learning Process]
  102.         D1[Identify Pattern]
  103.         D2[Validate with User]
  104.         D3[Document in .clinerules]
  105.     end
  106.     subgraph Apply [Usage]
  107.         A1[Read .clinerules]
  108.         A2[Apply Learned Patterns]
  109.         A3[Improve Future Work]
  110.     end
  111.     Start --> Learn
  112.     Learn --> Apply
  113. ```
  114. ### What to Capture
  115. - Critical implementation paths
  116. - User preferences and workflow
  117. - Project-specific patterns
  118. - Known challenges
  119. - Evolution of project decisions
  120. - Tool usage patterns
  121. The format is flexible - focus on capturing valuable insights that help me work more effectively with you and the project. Think of .clinerules as a living document that grows smarter as we work together.
  122. REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.