How to Use Mini-CoderBrain v2.0

Comprehensive guide for setting up and using mini-coder-brain effectively in any project type.


πŸ“‹ Table of Contents

  1. Quick Start
  2. Project Scenarios
  3. Essential Commands
  4. Best Practices
  5. Context Quality
  6. Troubleshooting

πŸš€ Quick Start

Installation + Setup (2 Minutes)

Step 1: Install

git clone https://github.com/kunwar-shah/mini-coder-brain.git
cd mini-coder-brain
./install.sh /path/to/your/project

Step 2: Initialize (MANDATORY)

# In Claude Code, run ONE of these:
/init-memory-bank --docs-path ./docs  # With documentation
/init-memory-bank                     # Auto-detect

Step 3: Verify

/validate-context

Expected: πŸ“Š Context Quality: 85% (Recommended) βœ…


🎯 Project Scenarios

Scenario 1: New Empty Project

Context: Starting from scratch, no code yet

Steps:

  1. Install mini-coder-brain
  2. Run /init-memory-bank
  3. Answer interactive prompts:
    • Project name?
    • What type of app?
    • Tech stack preference?
    • Core features?
  4. Start building with Claude’s help

Result: 60-70% quality (minimum but functional)

Example:

You: /init-memory-bank

Claude: What is your project name?
You: my-saas-app

Claude: What type of application?
You: A SaaS platform for team collaboration

Claude: What technology stack?
You: Next.js 14, TypeScript, Prisma, PostgreSQL

βœ… Context initialized! Quality: 65%

Scenario 2: Existing Project (No Docs)

Context: You have code but no formal documentation

Steps:

  1. Install mini-coder-brain
  2. Run /init-memory-bank (no arguments)
  3. Claude auto-detects:
    • Tech stack from package.json
    • Project structure
    • Git history
    • Coding patterns
  4. Confirm detected information
  5. Provide missing details when prompted

Result: 75-85% quality (recommended)

What gets auto-detected:

  • βœ… Project name (from package.json)
  • βœ… Dependencies β†’ tech stack
  • βœ… File structure β†’ frontend/backend
  • βœ… Recent commits β†’ progress
  • βœ… Test files β†’ testing framework

Scenario 3: Existing Project (With Docs)

Context: You have comprehensive documentation

Steps:

  1. Install mini-coder-brain
  2. Run /init-memory-bank --docs-path ./docs
  3. Claude reads:
    • README.md
    • SRS.md
    • ARCHITECTURE.md
    • API.md
    • Any .md files in docs/
  4. Extracts features, architecture, decisions
  5. Generates rich context automatically

Result: 90-95% quality (optimal)

Documentation files recognized:

  • SRS.md / REQUIREMENTS.md β†’ Features
  • ARCHITECTURE.md / DESIGN.md β†’ System design
  • API.md / API_SPEC.md β†’ API patterns
  • DECISIONS.md / ADR*.md β†’ Technical decisions
  • README.md β†’ Project overview

πŸ› οΈ Essential Commands

/init-memory-bank

Purpose: Initialize project context (MANDATORY after installation)

Usage:

/init-memory-bank                      # Auto-detect
/init-memory-bank --docs-path ./docs   # With documentation
/init-memory-bank --dry-run            # Preview only

When to use: Once after installation, or after major project changes


/validate-context

Purpose: Check context quality with detailed report

Usage:

/validate-context                # Check quality
/validate-context --fix          # Interactive improvements

Output:

πŸ“Š Context Quality: 85% (Recommended) βœ…

βœ… Project name: defined
βœ… Tech stack: 5 technologies
βœ… Core features: 4 features
βœ… Architecture: defined
⚠️  Development goals: missing

Recommendations:
  β€’ Add development goals to productContext.md

When to use:

  • After initialization
  • When Claude seems confused
  • Periodically to ensure quality

/update-memory-bank

Purpose: Update memory after major development work

Usage:

/update-memory-bank                              # Standard update
/update-memory-bank "Completed feature X"        # With note

When to use:

  • After completing major features
  • After making technical decisions
  • End of development session
  • When prompted by footer status

What gets updated:

  • decisionLog.md - Technical decisions
  • progress.md - Completed tasks
  • activeContext.md - Current focus

/import-docs

Purpose: Import documentation after initialization

Usage:

/import-docs ./docs                     # Import folder
/import-docs ./specs/SRS.md             # Import file
/import-docs ./docs --type srs          # With type hint

When to use:

  • Found documentation after initial setup
  • Documentation was updated
  • Want to add more context

/map-codebase

Purpose: Enable instant file access

Usage:

/map-codebase --rebuild       # First time (30 seconds)
/map-codebase                 # Load existing (instant)

When to use: Once per project, rebuild when structure changes


/memory-cleanup

Purpose: Archive old data to prevent β€œPrompt too long”

Usage:

/memory-cleanup                # Standard cleanup
/memory-cleanup --dry-run      # Preview only
/memory-cleanup --full         # Aggressive cleanup

When to use: When notified by status footer, or quarterly


πŸŽ“ Best Practices

1. Always Provide Documentation Paths

# βœ… GOOD: With documentation
/init-memory-bank --docs-path ./docs

# ❌ BAD: Without docs (when you have them)
/init-memory-bank

2. Validate Quality After Setup

/init-memory-bank --docs-path ./docs
/validate-context  # Always check!

Target: Aim for 80%+ quality

3. Update Memory After Major Work

# After completing features
/update-memory-bank "Completed authentication with JWT"

# After technical decisions
/update-memory-bank "Chose Redis for sessions"

4. Keep productContext.md Current

Manually update when:

  • Adding major features
  • Changing tech stack
  • Updating project goals

5. Run Cleanup When Notified

When you see:

πŸ’‘ Memory cleanup recommended: 12 session updates
   Run /memory-cleanup

Run: /memory-cleanup immediately


πŸ“Š Context Quality Guide

Quality Levels

Score Level Meaning Action
<40% πŸ”΄ Below Minimum Won’t work well CRITICAL: Run /init-memory-bank
40-60% 🟑 Minimum Works but limited Run /validate-context --fix
60-80% 🟒 Recommended Good effectiveness Optional improvements
80-100% 🌟 Optimal Excellent Perfect!

Minimum Requirements

Must Have:

  • βœ… Project name (not placeholder)
  • βœ… Technology stack (3+ items)
  • βœ… Core features (2+ items)

Should Have (for 80%+):

  • βœ… Architecture description
  • βœ… Development goals
  • βœ… Project documentation

Improving Quality

From 60% β†’ 80%:

  1. Add architecture description
  2. Define development goals
  3. Document key patterns
  4. Run /import-docs if you have documentation

From 80% β†’ 95%:

  1. Import comprehensive documentation
  2. Add decision history
  3. Document API patterns
  4. Include success metrics

🚨 Troubleshooting

Problem: β€œClaude asks what framework I’m using”

Cause: Context not loaded or quality too low

Solution:

  1. Run /validate-context
  2. If quality <60%, run /validate-context --fix
  3. Verify productContext.md has tech stack
  4. Re-run /init-memory-bank if needed

Problem: β€œContext quality is 45%”

Cause: Insufficient information in memory bank

Solution:

  1. Run /validate-context --fix
  2. Follow interactive prompts
  3. Or manually edit .claude/memory/productContext.md
  4. Add: tech stack, features, architecture
  5. Re-validate: /validate-context

Problem: β€œ/init-memory-bank doesn’t populate files”

Cause: Templates exist but not initialized

Solution:

  1. Check if files exist: ls .claude/memory/*.md
  2. If they exist, back them up
  3. Re-run installer
  4. Run /init-memory-bank in Claude Code (not bash!)

Problem: β€œPrompt is too long” error

Cause: Memory bank bloat from many sessions

Solution:

  1. Run /memory-cleanup immediately
  2. Verify: check .claude/archive/ for backed up data
  3. Quality should be maintained
  4. Run cleanup quarterly

πŸ“š Additional Resources

  • SETUP.md: https://github.com/kunwar-shah/mini-coder-brain/blob/main/SETUP.md
  • Examples: https://github.com/kunwar-shah/mini-coder-brain/tree/main/examples
  • Commands: Full Command Reference
  • Issues: https://github.com/kunwar-shah/mini-coder-brain/issues

βœ… Quick Reference Card

# Installation
./install.sh /path/to/project

# Setup (MANDATORY)
/init-memory-bank --docs-path ./docs

# Validation
/validate-context

# Daily Use
/update-memory-bank "note"
/map-codebase

# Maintenance
/memory-cleanup  (when notified)

Ready to master Mini-CoderBrain? Follow these guides and reach 95% context quality!