feat: enhance file exclusion capabilities with .bmad-flattenignore support (#531)

- Added support for a new optional `.bmad-flattenignore` file to allow users to specify additional files to exclude from the flattened XML output.
- Updated README and documentation to reflect the new feature and provide examples for usage.
- Modified ignore rules to incorporate patterns from the `.bmad-flattenignore` file after applying `.gitignore` rules.

Benefits:
- Greater flexibility in managing file exclusions for AI model consumption.
This commit is contained in:
Daniel Dabrowski
2025-09-06 20:14:24 +02:00
committed by GitHub
parent 155f9591ea
commit 94f67000b2
3 changed files with 22 additions and 2 deletions

View File

@@ -154,9 +154,11 @@ async function parseGitignore(gitignorePath) {
async function loadIgnore(rootDir, extraPatterns = []) {
const ig = ignore();
const gitignorePath = path.join(rootDir, '.gitignore');
const flattenIgnorePath = path.join(rootDir, '.bmad-flattenignore');
const patterns = [
...(await readIgnoreFile(gitignorePath)),
...DEFAULT_PATTERNS,
...(await readIgnoreFile(flattenIgnorePath)),
...extraPatterns,
];
// De-duplicate