| name | adopt-memory-bank |
| description | Add a COMB memory bank to an existing (brownfield) project by analyzing current codebase, dependencies, and architecture. Use when the project already has code but no memory bank. |
| argument-hint | ["project-name"] |
| user-invocable | true |
Adopt Memory Bank โ Brownfield Projects
Add a COMB memory bank to the existing $0 project by analyzing its current state.
Unlike /create-memory-bank (greenfield), this skill reverse-engineers the project's
architecture, dependencies, and patterns from the existing codebase.
Process
Step 1 โ Analyze the codebase
Explore the project without asking the user first:
- Project structure: Read the directory layout, identify layers (backend, frontend, infra, etc.)
- Dependencies: Read package.json, *.csproj, go.mod, Cargo.toml, requirements.txt, etc.
- Configuration: Read config files, environment setup, CI/CD pipelines
- Existing docs: Check for README.md, CONTRIBUTING.md, architecture docs, ADRs
- Git history: Run
git log --oneline -20 to understand recent development focus
- Test setup: Identify test frameworks, coverage configuration
Step 2 โ Summarize findings to user
Present a summary of what was discovered:
Project Analysis: $0
Structure:
- Backend: [detected tech] at [path]
- Frontend: [detected tech] at [path]
- Infrastructure: [detected setup]
Dependencies: [count] packages ([key ones listed])
Test coverage: [if detectable]
Recent focus: [based on git log]
Existing docs: [list found]
Does this look correct? Anything to add or correct?
Step 3 โ Confirm domains with user
Ask the user:
- Are the detected domains correct? Any missing?
- What's the current sprint/phase? (or "no sprints โ maintenance mode")
- Are there active blockers or decisions pending?
- Any patterns or conventions not obvious from code?
Step 4 โ Create directory structure
Same as greenfield but pre-filled:
memory-bank/
โโโ INDEX.md โ Pre-filled from analysis
โโโ core/
โ โโโ projectbrief.md โ Extracted from existing docs + analysis
โ โโโ productContext.md โ From README/docs or user input
โ โโโ active-context.md โ Current state from git log + user input
โ โโโ sprint-tracker.md โ Current sprint if applicable
โโโ tech/
โ โโโ [domain]-stack.md โ Auto-generated from dependency analysis
โโโ arch/
โโโ patterns-overview.md โ Inferred from code structure
โโโ decisions-summary.md โ From existing ADRs or inferred
Step 5 โ Generate pre-filled files
KEY DIFFERENCE from greenfield: Files are pre-filled with real data, not placeholders.
INDEX.md:
- Fill in actual project name, tech stack, file sizes
- Reading strategy customized to detected domains
- Architecture highlights from code analysis
tech/[domain]-stack.md (one per detected domain):
- Actual technology names and versions from dependency files
- Actual project structure (directory layout)
- Patterns inferred from code (e.g., MVC, Repository, CQRS)
arch/patterns-overview.md:
- Architecture style inferred from structure (monolith, microservices, modular, etc.)
- Design patterns detected in code
- Cross-cutting concerns observed (auth, logging, error handling)
core/active-context.md:
- Current phase based on git activity
- Recent completed work from git log
- Next steps inferred from TODO comments, open branches, or user input
core/projectbrief.md:
- Extracted from existing README or docs
- Scope derived from codebase analysis
Step 6 โ Create project root files
memory-bank-protocol.md โ Copy from COMB methodology
project-rules.md โ Pre-fill with detected coding standards, naming conventions
CLAUDE.md โ Create pointer file with actual project decisions
Step 7 โ Report
Memory Bank Adopted for $0
Analysis:
- Scanned [N] directories, [N] config files, [N] recent commits
- Detected [N] domains: [list]
- Identified [N] architectural patterns
Files created:
- memory-bank/INDEX.md (XXX lines) โ pre-filled
- memory-bank/core/projectbrief.md (XXX lines) โ from existing docs
- memory-bank/core/active-context.md (XXX lines) โ from git history
- memory-bank/tech/[domain]-stack.md (XXX lines each) โ from dependencies
- memory-bank/arch/patterns-overview.md (XXX lines) โ from code analysis
- [project root files]
Pre-filled accuracy: Review each file for correctness.
Some inferences may need manual adjustment.
Next: Review the generated files, then start your first task with COMB.
Key Differences from Greenfield
| Aspect | Greenfield (/create-memory-bank) | Brownfield (/adopt-memory-bank) |
|---|
| Input source | User answers questions | Codebase analysis + user confirmation |
| Tech stack | User provides | Auto-detected from dependencies |
| Architecture | User describes | Inferred from code structure |
| Active context | Empty / Sprint 1 | Populated from git history |
| File content | Placeholders filled by user | Pre-filled from analysis |
| Accuracy | High (user provides) | Needs review (inferred) |
Rules
- Always analyze before asking โ show what you found, don't ask blind questions
- Pre-fill files with real data, not placeholders
- Flag inferences with low confidence: "(inferred โ please verify)"
- Keep each file under 400 lines even with pre-filled content
- Respect existing docs โ incorporate, don't replace
- If existing ADRs or architecture docs exist, reference them rather than duplicating