BMAD-METHOD/tools
manjaroblack 125b464b2f This PR introduces a powerful new Codebase Flattener Tool that aggregates entire codebases into AI-optimized XML format, making it easy to share project context with AI assistants for analysis, debugging, and development assistance.
- AI-Optimized XML Output : Generates clean, structured XML specifically designed for AI model consumption
- Smart File Discovery : Recursive file scanning with intelligent filtering using glob patterns
- Binary File Detection : Automatically identifies and excludes binary files, focusing on source code
- Progress Tracking : Real-time progress indicators with comprehensive completion statistics
- Flexible Output : Customizable output file location and naming via CLI arguments
- Gitignore Integration : Automatically respects .gitignore patterns to exclude unnecessary files
- CDATA Handling : Proper XML CDATA sections with escape sequence handling for ]]> patterns
- Content Indentation : Beautiful XML formatting with properly indented file content (4-space indentation)
- Error Handling : Robust error handling with detailed logging for problematic files
- Hierarchical Formatting : Clean XML structure with proper indentation and formatting
- File Content Preservation : Maintains original file formatting within indented CDATA sections
- Exclusion Logic : Prevents self-inclusion of output files ( flattened-codebase.xml , repomix-output.xml )
- tools/flattener/main.js - Complete flattener implementation with CLI interface
- package.json - Added new dependencies (glob, minimatch, fs-extra, commander, ora, chalk)
- package-lock.json - Updated dependency tree
- .gitignore - Added exclusions for flattener outputs
- README.md - Comprehensive documentation with usage examples
- docs/bmad-workflow-guide.md - Integration guidance
- tools/cli.js - CLI integration
- .vscode/settings.json - SonarLint configuration
```
current directory
npm run flatten

npm run flatten -- --output my-project.xml
npm run flatten -- -o /path/to/output/codebase.xml
```
The tool provides comprehensive completion summaries including:

- File count and breakdown (text/binary/errors)
- Source code size and generated XML size
- Total lines of code and estimated token count
- Processing progress and performance metrics
- Bug Fix : Corrected typo in exclusion patterns ( repromix-output.xml → repomix-output.xml )
- Performance : Efficient file processing with streaming and progress indicators
- Reliability : Comprehensive error handling and validation
- Maintainability : Clean, well-documented code with modular functions
- AI Integration : Perfect for sharing codebase context with AI assistants
- Code Reviews : Streamlined code review process with complete project context
- Documentation : Enhanced project documentation and analysis capabilities
- Development Workflow : Improved development assistance and debugging support
This tool significantly enhances the BMad-Method framework's AI integration capabilities, providing developers with a seamless way to share complete project context for enhanced AI-assisted development workflows.
2025-07-19 22:09:39 -05:00
..
builders fix: build web bundles with new file extension includsion 2025-07-06 19:39:34 -05:00
flattener This PR introduces a powerful new Codebase Flattener Tool that aggregates entire codebases into AI-optimized XML format, making it easy to share project context with AI assistants for analysis, debugging, and development assistance. 2025-07-19 22:09:39 -05:00
installer chore(release): 4.31.0 [skip ci] 2025-07-20 02:18:34 +00:00
lib fix: build web bundles with new file extension includsion 2025-07-06 19:39:34 -05:00
md-assets web build optimization 2025-07-06 10:32:39 -05:00
upgraders refactor: nest Claude Code commands under BMad subdirectory (#307) 2025-07-12 10:02:46 -05:00
bmad-npx-wrapper.js doc and text cleanup 2025-07-04 07:47:57 -05:00
bump-all-versions.js version alignment 2025-07-19 00:04:16 -05:00
bump-expansion-version.js chore(tools): clean up and refactor bump scripts for clarity and consistency (#325) 2025-07-17 20:09:09 -05:00
cli.js This PR introduces a powerful new Codebase Flattener Tool that aggregates entire codebases into AI-optimized XML format, making it easy to share project context with AI assistants for analysis, debugging, and development assistance. 2025-07-19 22:09:39 -05:00
semantic-release-sync-installer.js chore(tools): clean up and refactor bump scripts for clarity and consistency (#325) 2025-07-17 20:09:09 -05:00
sync-installer-version.js feat: improve semantic-release automation and disable manual version bumping 2025-06-15 14:16:01 -05:00
update-expansion-version.js fix: standardize on file extension .yaml instead of a mix of yml and yaml 2025-07-02 19:59:49 -05:00
version-bump.js doc and text cleanup 2025-07-04 07:47:57 -05:00
yaml-format.js doc and text cleanup 2025-07-04 07:47:57 -05:00