Agent skill
memory-generator
Generate CLAUDE.md project memory files by exploring codebases. Use when user asks to "generate memory", "create CLAUDE.md", "document this project", "understand this codebase", or starts work on a new/unfamiliar repository. Triggers on new project onboarding and documentation requests.
Install this agent skill to your Project
npx add-skill https://github.com/eous/dotclaude/tree/main/skills/memory-generator
SKILL.md
Memory Generator Skill
Generate comprehensive CLAUDE.md project memory files by exploring and analyzing codebases.
When to Use
Invoke this skill when:
- Starting work on a new/unfamiliar project
- A project lacks CLAUDE.md documentation
- User asks to "create memory" or "generate context" for a project
- Beginning exploration of a repository
Exploration Process
Phase 1: Project Structure Analysis
-
Identify project root markers:
.git/directorypackage.json,Cargo.toml,pyproject.toml,go.mod, etc.Makefile,CMakeLists.txt,build.gradle
-
Map directory structure:
bashtree -L 3 -d --dirsfirst # Or for large projects: find . -type d -maxdepth 3 | head -50 -
Identify key directories:
- Source code:
src/,lib/,app/,pkg/ - Tests:
tests/,test/,__tests__/,spec/ - Config:
config/,.github/,.vscode/ - Docs:
docs/,doc/,documentation/
- Source code:
Phase 2: Technology Detection
-
Language detection:
bash# Count files by extension find . -type f -name "*.py" | wc -l find . -type f -name "*.go" | wc -l find . -type f -name "*.rs" | wc -l find . -type f -name "*.ts" -o -name "*.tsx" | wc -l -
Framework detection:
- Python: Django, Flask, FastAPI, pytest
- JavaScript: React, Vue, Next.js, Express
- Go: Gin, Echo, standard library patterns
- Rust: Actix, Axum, Tokio
-
Dependency analysis:
- Read
requirements.txt,pyproject.toml - Read
package.json,package-lock.json - Read
Cargo.toml,go.mod
- Read
Phase 3: Pattern Recognition
-
Architecture patterns:
- Monolith vs microservices
- MVC, clean architecture, hexagonal
- Module organization
-
Code conventions:
- Naming patterns (snake_case, camelCase)
- File naming conventions
- Import organization
-
Testing patterns:
- Test file naming (
test_*.py,*_test.go) - Fixture patterns
- Mock usage
- Test file naming (
Phase 4: Entry Point Discovery
-
Application entry points:
main.py,app.py,index.tscmd/,bin/directoriesMakefiletargets
-
Build/run commands:
- npm scripts
- Makefile targets
- Docker compose services
Phase 5: Documentation Review
- Existing documentation:
- README.md content
- API documentation
- Architecture docs
- Contributing guides
Output: CLAUDE.md Template
# [Project Name]
## Overview
[1-2 sentence project description based on README or package metadata]
## Tech Stack
- **Language**: [Primary language and version]
- **Framework**: [Main framework if applicable]
- **Key Dependencies**: [Important libraries]
- **Testing**: [Test framework]
- **Build Tool**: [npm, cargo, make, etc.]
## Project Structure
[Simplified tree showing key directories]
### Key Directories
- `src/` - [Description]
- `tests/` - [Description]
- [Other important directories]
## Development Commands
```bash
# Install dependencies
[command]
# Run tests
[command]
# Run application
[command]
# Build
[command]
Architecture
Code Organization
[Brief description of how code is organized - modules, packages, layers]
Key Patterns
- [Pattern 1]: [Where/how it's used]
- [Pattern 2]: [Where/how it's used]
Entry Points
- [Main entry point and what it does]
- [Other important entry points]
Conventions
Naming
- Files: [convention]
- Functions/methods: [convention]
- Classes/types: [convention]
Code Style
- [Formatter used]
- [Linter used]
- [Key style rules]
Testing
- Test files: [naming pattern]
- Fixtures: [location/pattern]
- Running: [command]
Important Files
| File | Purpose |
|---|---|
| [file1] | [purpose] |
| [file2] | [purpose] |
Notes for Claude
- [Important context about how to work with this codebase]
- [Any quirks or non-obvious patterns]
- [Preferred approaches for this project]
## Customization
Tailor the generated CLAUDE.md based on:
### For ML/AI Projects
- Add sections on:
- Model architecture locations
- Training scripts
- Dataset handling
- Experiment tracking
### For Web Applications
- Add sections on:
- API endpoints
- Frontend structure
- Database schema location
- Authentication flow
### For Libraries/Packages
- Add sections on:
- Public API surface
- Versioning approach
- Breaking change policy
- Example usage
### For Monorepos
- Add sections on:
- Package/workspace structure
- Shared dependencies
- Inter-package relationships
- Build order
## Usage Example
When user says:
- "Generate memory for this project"
- "Create CLAUDE.md for this repo"
- "Help me understand this codebase"
Execute exploration process and generate CLAUDE.md:
```bash
# Step 1: Basic structure
ls -la
tree -L 2 -d --dirsfirst 2>/dev/null || find . -type d -maxdepth 2
# Step 2: Detect language/framework
cat package.json 2>/dev/null | head -30
cat pyproject.toml 2>/dev/null | head -30
cat Cargo.toml 2>/dev/null | head -30
cat go.mod 2>/dev/null
# Step 3: Read existing docs
cat README.md 2>/dev/null | head -100
# Step 4: Sample source files to understand patterns
# Find representative files and read them
# Step 5: Generate CLAUDE.md
Output Location
- Primary:
./CLAUDE.md(project root, version controlled) - Alternative:
./.claude/CLAUDE.md(claude-specific directory) - Private:
./CLAUDE.local.md(gitignored, personal notes)
Ask user preference if unclear.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
typescript-best-practices
TypeScript development best practices, patterns, and conventions. Use when writing TypeScript code, reviewing .ts/.tsx files, discussing type safety, generics, utility types, or TypeScript project configuration. Triggers on mentions of TypeScript, tsconfig, type inference, generics, discriminated unions, React TypeScript.
api-design
REST and GraphQL API design patterns, best practices, and conventions. Use when designing APIs, discussing HTTP methods, status codes, versioning, or API documentation. Triggers on mentions of REST, API, GraphQL, endpoint, HTTP methods, OpenAPI, swagger, API versioning.
testing-patterns
Software testing patterns, strategies, and best practices. Use when writing tests, discussing test architecture, mocking, fixtures, or test organization. Triggers on mentions of testing, unit tests, integration tests, pytest, jest, mocking, fixtures, TDD, test coverage.
security-checklist
Application security best practices and vulnerability prevention. Use when reviewing code for security issues, implementing authentication, or discussing OWASP vulnerabilities. Triggers on mentions of security, authentication, authorization, XSS, SQL injection, CSRF, OWASP, encryption, secrets.
python-best-practices
Python development best practices, patterns, and conventions. Use when writing Python code, reviewing .py files, discussing pytest, asyncio, type hints, pydantic, dataclasses, or Python project structure. Triggers on mentions of Python, pytest, mypy, ruff, black, FastAPI, Django, Flask.
go-best-practices
Go development best practices, patterns, and conventions. Use when writing Go code, reviewing .go files, discussing goroutines, channels, error handling, or Go project structure. Triggers on mentions of Go, Golang, goroutines, channels, defer, interfaces, go mod.
Didn't find tool you were looking for?