Merge branch 'main' into main
This commit is contained in:
commit
78d83cf1cf
14
README.md
14
README.md
|
|
@ -119,7 +119,7 @@ The BMAD-METHOD™ includes a powerful codebase flattener tool designed to prepa
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- **AI-Optimized Output**: Generates clean XML format specifically designed for AI model consumption
|
- **AI-Optimized Output**: Generates clean XML format specifically designed for AI model consumption
|
||||||
- **Smart Filtering**: Automatically respects `.gitignore` patterns to exclude unnecessary files
|
- **Smart Filtering**: Automatically respects `.gitignore` patterns to exclude unnecessary files, plus optional project-level `.bmad-flattenignore` for additional exclusions
|
||||||
- **Binary File Detection**: Intelligently identifies and excludes binary files, focusing on source code
|
- **Binary File Detection**: Intelligently identifies and excludes binary files, focusing on source code
|
||||||
- **Progress Tracking**: Real-time progress indicators and comprehensive completion statistics
|
- **Progress Tracking**: Real-time progress indicators and comprehensive completion statistics
|
||||||
- **Flexible Output**: Customizable output file location and naming
|
- **Flexible Output**: Customizable output file location and naming
|
||||||
|
|
@ -170,6 +170,18 @@ The generated XML file contains your project's text-based source files in a stru
|
||||||
- File discovery and ignoring
|
- File discovery and ignoring
|
||||||
- Uses `git ls-files` when inside a git repository for speed and correctness; otherwise falls back to a glob-based scan.
|
- Uses `git ls-files` when inside a git repository for speed and correctness; otherwise falls back to a glob-based scan.
|
||||||
- Applies your `.gitignore` plus a curated set of default ignore patterns (e.g., `node_modules`, build outputs, caches, logs, IDE folders, lockfiles, large media/binaries, `.env*`, and previously generated XML outputs).
|
- Applies your `.gitignore` plus a curated set of default ignore patterns (e.g., `node_modules`, build outputs, caches, logs, IDE folders, lockfiles, large media/binaries, `.env*`, and previously generated XML outputs).
|
||||||
|
- Supports an optional `.bmad-flattenignore` file at the project root for additional ignore patterns (gitignore-style). If present, its rules are applied after `.gitignore` and the defaults.
|
||||||
|
|
||||||
|
##### `.bmad-flattenignore` example
|
||||||
|
|
||||||
|
Create a `.bmad-flattenignore` file in the root of your project to exclude files that must remain in git but should not be included in the flattened XML:
|
||||||
|
|
||||||
|
```text
|
||||||
|
seeds/**
|
||||||
|
scripts/private/**
|
||||||
|
**/*.snap
|
||||||
|
```
|
||||||
|
|
||||||
- Binary handling
|
- Binary handling
|
||||||
- Binary files are detected and excluded from the XML content. They are counted in the final summary but not embedded in the output.
|
- Binary files are detected and excluded from the XML content. They are counted in the final summary but not embedded in the output.
|
||||||
- XML format and safety
|
- XML format and safety
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,13 @@
|
||||||
> Gemini Web's 1M+ token context window or Gemini CLI (when it's working) can analyze your ENTIRE codebase, or critical sections of it, all at once (obviously within reason):
|
> Gemini Web's 1M+ token context window or Gemini CLI (when it's working) can analyze your ENTIRE codebase, or critical sections of it, all at once (obviously within reason):
|
||||||
>
|
>
|
||||||
> - Upload via GitHub URL or use gemini cli in the project folder
|
> - Upload via GitHub URL or use gemini cli in the project folder
|
||||||
> - If working in the web: use `npx bmad-method flatten` to flatten your project into a single file, then upload that file to your web agent.
|
> - If working in the web: use `npx bmad-method flatten` to flatten your project into a single file, then upload that file to your web agent. To exclude additional files that must remain in git but shouldn't be sent to the AI, add a `.bmad-flattenignore` file at the project root (gitignore-style), e.g.:
|
||||||
|
>
|
||||||
|
> ```text
|
||||||
|
> seeds/**
|
||||||
|
> scripts/private/**
|
||||||
|
> **/*.snap
|
||||||
|
> ```
|
||||||
|
|
||||||
## What is Brownfield Development?
|
## What is Brownfield Development?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,11 @@ async function parseGitignore(gitignorePath) {
|
||||||
async function loadIgnore(rootDir, extraPatterns = []) {
|
async function loadIgnore(rootDir, extraPatterns = []) {
|
||||||
const ig = ignore();
|
const ig = ignore();
|
||||||
const gitignorePath = path.join(rootDir, '.gitignore');
|
const gitignorePath = path.join(rootDir, '.gitignore');
|
||||||
|
const flattenIgnorePath = path.join(rootDir, '.bmad-flattenignore');
|
||||||
const patterns = [
|
const patterns = [
|
||||||
...(await readIgnoreFile(gitignorePath)),
|
...(await readIgnoreFile(gitignorePath)),
|
||||||
...DEFAULT_PATTERNS,
|
...DEFAULT_PATTERNS,
|
||||||
|
...(await readIgnoreFile(flattenIgnorePath)),
|
||||||
...extraPatterns,
|
...extraPatterns,
|
||||||
];
|
];
|
||||||
// De-duplicate
|
// De-duplicate
|
||||||
|
|
|
||||||
|
|
@ -690,6 +690,7 @@ class IdeSetup extends BaseIdeSetup {
|
||||||
|
|
||||||
async getCoreTaskIds(installDir) {
|
async getCoreTaskIds(installDir) {
|
||||||
const allTaskIds = [];
|
const allTaskIds = [];
|
||||||
|
const glob = require('glob');
|
||||||
|
|
||||||
// Check core tasks in .bmad-core or root only
|
// Check core tasks in .bmad-core or root only
|
||||||
let tasksDir = path.join(installDir, '.bmad-core', 'tasks');
|
let tasksDir = path.join(installDir, '.bmad-core', 'tasks');
|
||||||
|
|
@ -698,7 +699,6 @@ class IdeSetup extends BaseIdeSetup {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await fileManager.pathExists(tasksDir)) {
|
if (await fileManager.pathExists(tasksDir)) {
|
||||||
const glob = require('glob');
|
|
||||||
const taskFiles = glob.sync('*.md', { cwd: tasksDir });
|
const taskFiles = glob.sync('*.md', { cwd: tasksDir });
|
||||||
allTaskIds.push(...taskFiles.map((file) => path.basename(file, '.md')));
|
allTaskIds.push(...taskFiles.map((file) => path.basename(file, '.md')));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue