Roo Memory Bank prompt

Nubami SQReder - Feb 20 - - Dev Community

Итак, Cline мне не очень понравился своей аскетичностью, поэтому я решил продолжать свои исследования Memory Bank c Roo - всё-таки Roo — это Cline "на стероидах"

Но, прежде чем кидаться в омут с головой, я решил поискать, что в сети пишут про практику использования подхода. Наверняка есть рекомендации, специфические техники промптинга или даже примеры репозиториев, в которых видно, как MB живёт и развивается. Однако всё, что я нашёл, — это сплошной байт - "MB меняет всё полностью", "Супер-промпт", "Как же я в восторге от MB". И небольшие обзоры как скопировать промпт из репозитория и вставить в файл .clinerules. Не густо, и даже разочаровывающе

Штош. Придётся протаптывать дорожку самому

🧠 Memory Bank in the nutshell

Идея строится на том, чтобы проинструктировать LLM сохранять все данные о происходящем в проекте в специальный набор файлов, разделённый по категориям. При старте каждой новой задачи — вычитывать эти файлы, чтобы восстановить контекст происходящего, а по завершению записывать туда обновления, принятые решения и планы на будущее

Важное отличие Roo MB от Cline MB - то, как ведутся файлы с информацией о принятых решениях.

Cline

В Cline MB это довольно безликие techContext.md и systemPatterns.md

techContext.md
# Tech Context

This document outlines the technology choices and considerations for developing the progressive web app.

Current Considerations:
- Chosen framework: React, paired with Tanstack libraries (e.g., React Query, Tanstack Table) for building a responsive and scalable UI.
- No backend implementation exists yet; planning for secure user management and partner connection features.
- Focusing on Progressive Web App best practices including service workers, caching strategies, and offline capabilities.

Technical Debt & Future Considerations:
- Service worker caching strategy and optimization.
- Database backup and error logging frameworks.
- End-to-end encryption for partner data security.

The tech stack has been finalized to use React and associated Tanstack libraries, ensuring robust performance and modern development practices for the app.

## Core Dependencies (package.json requirements)
...
Enter fullscreen mode Exit fullscreen mode

systemPatterns.md
# System Patterns

## Core Architecture
1. **Layered Context Providers**
   - AppSettingsContext: Global preferences
   - AuthContext: User session management
   - TaskContext: Daily tasks state

2. **Offline-First Strategy**
   - IndexedDB for local data persistence
   - Workbox Background Sync for failed requests
   - Optimistic UI updates with rollback capability

3. **Security Patterns**
   - JWT refresh token rotation
   - Encrypted localStorage for sensitive data
   - CSRF protection for API endpoints
...
Enter fullscreen mode Exit fullscreen mode

Roo

Промпт для Roo, в свою очередь, предлагает чёткую структуру для описания принятых решений

## [Date] - [Decision Topic]

**Context:** [What led to this decision]
**Decision:** [What was decided]
**Rationale:** [Why this decision was made]
**Implementation:** [How it will be/was implemented]
Enter fullscreen mode Exit fullscreen mode

Например, вот что у меня получилось на попытке стартовать проект с нуля

decisionLog.md
# Decision Log

## [2025-02-20] - [Development Environment]
**Context:** The user needs to initialize the project and configure the development environment.
**Decision:** Use React, styled-components, TypeScript, Vite, Vitest, and Playwright.
**Rationale:** These technologies are well-suited for building modern progressive web apps.
**Implementation:** The project will be initialized using Vite with the React TypeScript template.

## [2025-02-20] - [Vitest Configuration]
**Context:** The user wants to use globals for Vitest.
**Decision:** Configure Vitest to use globals by adding a `test` property to the `vite.config.ts` file.
**Rationale:** This allows for easier testing without having to import the Vitest functions in every test file.
**Implementation:** Added a `test` property to the `vite.config.ts` file with the `globals` option set to `true`.

## [2025-02-20] - [Styled-components Configuration]
**Context:** The user wants to use styled-components in the project.
**Decision:** Configure styled-components.
**Rationale:** Styled-components allows for writing CSS in JavaScript.
**Implementation:** Attempted to configure styled-components using the `@swc/plugin-styled-components` package, but was unsuccessful. Will proceed without the plugin for now.

...
Enter fullscreen mode Exit fullscreen mode

Тут хорошо видно что делалось, когда и почему

⚡ Небольшой лайфхак

Если просить Roo что-то сделать, в духе "напиши-ка тесты", то он согласно инструкции начнёт читать свой MB по одному файлу. Можно немного сократить этот этап, если сразу передать их содержимое в контекст

follow your custom instructions and do the following:

{detailed task description}

Memory Bank content: @/memory-bank/
Enter fullscreen mode Exit fullscreen mode

Эксперимент продолжается. Memory Bank в Roo, на первый взгляд, кажется куда структурированнее и понятнее, чем в Cline. Но хватит ли этого, чтобы оправдать его использование?

Продолжу копать, а если вам интересно следить за этим процессом — подписывайтесь на мой телеграм-канал: https://t.me/sqr_dev_moments.


🔗 Links

Roo Memory Bank GitHub

. . .