dwjohnston / dwjohnston/compose-md

compose init traverses gitignored directories (e.g. .claude/worktrees)

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Bug

`compose init`'s agent-file scan (`findAgentFiles` in [src/commands/init.ts](src/commands/init.ts)) walks the entire directory tree using a hardcoded exclude list:

```ts
const EXCLUDED_DIRS = new Set(['node_modules', '.git']);
```

It never consults `.gitignore`, so it descends into any gitignored directory — for example `.claude/worktrees/*` — and picks up stray `CLAUDE.md` / `AGENTS.md` files living there as if they were real project agent files. This pollutes the generated default approach/YAML with fragments that shouldn't exist (worktree copies, build output, etc).

## Expected

`compose init` should skip gitignored paths (respecting `.gitignore`, and ideally nested `.gitignore` files too), not just `node_modules` and `.git`.

## Suggested fix

Use a gitignore-aware walker (e.g. the `ignore` npm package parsing `.gitignore`) instead of / in addition to the static `EXCLUDED_DIRS` set in `findAgentFiles` ([src/commands/init.ts:148](src/commands/init.ts#L148)).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/commands/init.ts at findAgentFiles and inspect how compose init currently walks directories and applies EXCLUDED_DIRS. Verify the behavior with a project containing .gitignore entries, including a nested .gitignore, and confirm that ignored paths no longer contribute CLAUDE.md or AGENTS.md files while normal agent files still appear in the generated approach/YAML.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.