# chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes architecture

> Architecture diagram of the GitHub repository chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes
- Repository: https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes

## Overview

##### Main Components
- Memory System – Representing the module that logs every interaction (from memories.md) with timestamps, tags, and version-controlled entries.
- Lessons Learned – A dedicated component (from lessons-learned.md) that captures issues, solutions, and impacts with links to specific examples.
- Scratchpad – This part (from scratchpad.md) is used for managing the current phase, tasks, statuses, and dependencies.
- Mode Handling – Differentiate between “Plan Mode” (gathering information, generating questions, and planning tasks) and “Agent Mode” (which executes actions once confidence and readiness criteria are met).
- Rules & Specifications – File directories like .cursor/rules and .cursorrules, along with RULESFORAI.md, embody the guidelines and operational triggers that structure how the overall system behaves.
- Project Requirements – The file project-requirements.md that specifies system needs and could affect how the other modules interact.

##### Interactions and Relationships
- Data Flow & Updates:
- The Memory System continuously logs interactions and decisions.
- The Lessons Learned module collects post-action feedback and tracks best practices.
- The Scratchpad ties in real-time task tracking and updates, feeding directly into the mode system.
- Mode System Transitions:
- Cross-referencing:
- How different modules reference each other (for example, @memories.md ↔️ @lessons-learned.md ↔️ @scratchpad.md).

##### Architectural Patterns and Design Principles
- Modular Organization – Separate files and directories indicate a modular design where each file/component has a dedicated responsibility.
- Documentation and Version Control – Emphasize that every module logs and updates its data consistently (noting the [v1.0.0] style).

##### Incorporate Relevant Technologies, Frameworks, or Libraries
- Markdown-based formats for documentation indicate a file-driven approach.
- Although not described as using web or UI frameworks, the structure could be extended by integrating APIs or storage systems if necessary. For now, focus on the protocol and file I/O mechanisms as the “technology” behind the scenes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Input and Mode System
    U["User Input"]:::input
    subgraph "Mode System"
        PM["Plan Mode<br/>(Gathers inputs & generates questions)"]:::mode
        AM["Agent Mode<br/>(Executes tasks and updates system)"]:::mode
        PM -->|"transitions"| AM
    end
    U -->|"initiates"| PM

    %% Documentation Modules
    subgraph "Documentation Modules"
        M["Memory System<br/>(Tracks interactions)"]:::documentation
        L["Lessons Learned<br/>(Captures resolutions)"]:::documentation
        S["Scratchpad<br/>(Live tracking dashboard)"]:::documentation
    end

    %% Additional Components
    PR["Project Requirements<br/>(System needs definition)"]:::requirements

    subgraph "Rules & Guidelines"
        R1["Rules Directory"]:::rules
        R2["RULES Documentation"]:::rules
    end

    %% Data flow connections
    AM -->|"logsExecution"| M
    AM -->|"updatesLessons"| L
    AM -->|"updatesScratchpad"| S

    PM ---|"feedsData"| S
    S ---|"updatesMemory"| M
    M ---|"crossRefers"| L
    L ---|"crossRefers"| M

    %% Influence of Rules on Modes
    R1 -->|"enforcesRules"| PM
    R2 -->|"enforcesRules"| AM

    %% Project Requirements informing Mode System
    PR -->|"informs"| PM
    PR -->|"informs"| AM

    %% Class definitions for color coding
    classDef documentation fill:#f9f,stroke:#333,stroke-width:2px;
    classDef mode fill:#ccf,stroke:#333,stroke-width:2px;
    classDef input fill:#cfc,stroke:#333,stroke-width:2px;
    classDef requirements fill:#fc9,stroke:#333,stroke-width:2px;
    classDef rules fill:#ff9,stroke:#333,stroke-width:2px;

    %% Click Events
    click M "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/blob/main/.cursor/memories.md"
    click L "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/blob/main/.cursor/lessons-learned.md"
    click S "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/blob/main/.cursor/scratchpad.md"
    click PR "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/blob/main/.cursor/project-requirements.md"
    click R1 "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/tree/main/.cursor/rules"
    click R2 "https://github.com/chipphillips/new-project-rules-ultra-context-for-ai-memories-lessons-scratchpad-with-plan-and-act-modes/blob/main/RULESFORAI.md"
```
