| description | Initialize a .memory-bank folder with structured project documentation templates |
|---|---|
| allowed-tools | Bash, Read, Write, Glob, Grep, AskUserQuestion |
Initialize a Memory Bank for the current project. Memory Bank is a .memory-bank folder in the project root that serves as a persistent knowledge base storing structured documentation about the project: goals, architecture, conventions, tech stack, and current tasks.
Look for an existing .memory-bank folder in the project root. If one exists, inform the user and ask whether to overwrite or skip.
Before creating files, analyze the current project to pre-fill templates with real data:
- Read
package.json,Cargo.toml,pyproject.toml,go.mod, or similar to detect tech stack and project name - Check for
.gitand inspect git conventions (branch names, recent commit message styles) - Look for existing README, docs, CI configs (
.github/workflows,.gitlab-ci.yml,Dockerfile, etc.) - Identify test frameworks and test file patterns
- Detect linters/formatters from config files (
.eslintrc,.prettierrc,ruff.toml, etc.)
Create the following structure:
.memory-bank/
├── index.md
├── product-overview/
│ ├── README.md
│ ├── user-stories.md
│ └── features-epics.md
├── steerings/
│ ├── README.md
│ └── development-conventions.md
├── tech-details/
│ ├── README.md
│ ├── testing-conventions.md
│ ├── infrastructure.md
│ └── tech-stack.md
└── tasks/
├── README.md
├── active.md
└── backlog.md
Use the templates below. Replace placeholder values with real data discovered in step 2. Leave sections as templates (with placeholder text) only when no data can be inferred.
# [Project Name] - Memory Bank
## Quick Links
- [Product Overview](./product-overview/README.md)
- [Steerings](./steerings/README.md)
- [Tech Details](./tech-details/README.md)
- [Tasks](./tasks/README.md)
## Project Summary
One paragraph describing what this project does.
## Current Status
- **Phase**: Development / MVP / Production
- **Version**: x.x.x
- **Last Updated**: YYYY-MM-DD# Product Overview
## What is this?
Describe the product in 2-3 sentences.
## Problem Statement
What problem does this solve?
## Target Audience
Who uses this product?
## Success Metrics
How do we measure success?# User Stories
## Format
Each story follows: **As a [role], I want [feature], so that [benefit].**
## Stories
### [Feature Group Name]
- As a [role], I want [feature], so that [benefit].# Features & Epics
## Epic 1: [Name]
**Goal**: What this epic achieves
### Features
| Feature | Status | Priority |
|---------|--------|----------|
| Feature A | Done | High |
| Feature B | In Progress | High |
| Feature C | Planned | Medium |# Steerings
General project rules and conventions.
- [Development Conventions](./development-conventions.md)# Development Conventions
## Git Flow
- **Main branch**: `main` - production-ready code
- **Development branch**: `develop` - integration branch
- **Feature branches**: `feature/short-description`
- **Bugfix branches**: `bugfix/short-description`
## Commit Messages
Format: `type(scope): description`
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
Example: `feat(auth): add password reset flow`
## Code Style
- Linter: [tool name]
- Formatter: [tool name]
## Pull Request Rules
1. PR title follows commit message format
2. Description includes "What" and "Why"
3. At least 1 approval required
4. All CI checks must pass# Tech Details
- [Tech Stack](./tech-stack.md)
- [Testing Conventions](./testing-conventions.md)
- [Infrastructure](./infrastructure.md)# Tech Stack
## Frontend
| Technology | Version | Purpose |
|------------|---------|---------|
| [framework] | x.x | UI framework |
## Backend
| Technology | Version | Purpose |
|------------|---------|---------|
| [runtime] | x.x | Runtime |
| [database] | x.x | Database |
## Infrastructure
| Technology | Purpose |
|------------|---------|
| Docker | Containerization |
## Why These Choices?
Brief explanation of architectural decisions.# Testing Conventions
## Test Types
- **Unit tests**: Test individual functions/components
- **Integration tests**: Test module interactions
- **E2E tests**: Test full user flows
## Running Tests
```bash
# All tests
[test command here]- Minimum coverage: 80%
- Critical paths: 100%
[Detected or placeholder naming convention]
#### tech-details/infrastructure.md
```markdown
# Infrastructure
## Environments
| Environment | URL | Branch | Purpose |
|-------------|-----|--------|---------|
| Development | localhost | develop | Testing |
| Production | [url] | main | Live |
## CI/CD Pipeline
[Describe detected CI/CD or leave as template]
## Environment Variables
List required env vars (without values):
- `DATABASE_URL` - Database connection string
# Tasks
- [Active Tasks](./active.md)
- [Backlog](./backlog.md)# Active Tasks
## Current Sprint
**Period**: YYYY-MM-DD to YYYY-MM-DD
## In Progress
_No active tasks yet._# Backlog
## Upcoming
_No backlog items yet._After creating all files, print a summary:
- List all created files
- Highlight which sections were pre-filled with detected project data
- Remind the user to review and fill in remaining placeholder sections
- Suggest adding this to their AI assistant prompt:
Read .memory-bank/index.md and linked files to understand this project before answering.