# Codebase Flattener Tool BMad-Core includes a powerful codebase flattener for preparing existing projects to the web for AI Analysis ```bash # Basic usage - creates flattened-codebase.xml npx bmad-method flatten # Custom input/output npx bmad-method flatten --input /path/to/source --output project.xml ``` Features: - AI-optimized XML output format - Smart filtering with .gitignore respect - Binary file detection and exclusion - Real-time progress tracking - Comprehensive completion statistics