feat: add .understandignore support for user-configurable file exclusion#81
feat: add .understandignore support for user-configurable file exclusion#81
Conversation
…se plugin New skill that takes markdown knowledge bases (Obsidian, Logseq, Dendron, Foam, Karpathy-style, Zettelkasten, plain) and produces interactive knowledge graphs with typed nodes/edges, auto-format detection, and dashboard visualization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detailed step-by-step plan covering core type extensions, schema validation, dashboard changes (CSS, store, sidebar, reading panel, edge styling, layout), agent definitions, format guides, and skill definition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move all design docs to docs/superpowers/specs/ and all implementation plans to docs/superpowers/plans/ for consistent organization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User-configurable file exclusion using .gitignore syntax, with hardcoded defaults, auto-generated starter file, and pre-analysis review pause. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TDD-driven plan covering IgnoreFilter module, IgnoreGenerator, core exports, project-scanner agent update, and skill Phase 0.5 integration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…eation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…project-scanner Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59a6f56bfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ".cache/", | ||
| ".turbo/", | ||
| "target/", | ||
| "bin/", |
There was a problem hiding this comment.
Stop excluding all
bin/ directories by default
The new default pattern bin/ removes every file under any bin directory, which is broader than “.NET build output” and now hides legitimate source entrypoints in common layouts (for example Node/Ruby CLI launchers committed under bin/). This directly reduces scan accuracy for those projects even when users never configured .understandignore; the exclusion should be narrowed to .NET artifact paths or applied conditionally after detecting a .NET project.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed. Removed bin/ from defaults (Node/Ruby use it for CLI launchers). Fixed negation override by re-filtering from original file list when .understandignore exists.
| 4. Filter the remaining file list through these patterns. Files matching any pattern are excluded. | ||
| 5. `!` negation patterns override the hardcoded exclusions from Step 2 (e.g., `!dist/` force-includes files from dist/). |
There was a problem hiding this comment.
Apply ignore negations before default-filter drops files
Step 2.5 currently says to filter the remaining list and also claims ! patterns can override Step 2 exclusions, but those two rules conflict: once Step 2 removes dist/* (or other defaults), a later pass over the remaining files cannot re-include them. In practice, users who add !dist/ will still not get dist files back, so the advertised override behavior is broken unless defaults and user patterns are evaluated in one matcher over the pre-filter candidate set.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed. Updated Step 2.5 — when .understandignore exists, createIgnoreFilter re-filters the original Step 1 file list (not the post-Step-2 remainder), merging defaults and user patterns in a single ignore instance so ! negation works correctly.
…erride flow - Remove bin/ from DEFAULT_IGNORE_PATTERNS (Node/Ruby CLI launchers use bin/) - .NET users can add bin/ to .understandignore manually - Fix project-scanner Step 2.5 to re-filter from original file list when .understandignore exists, ensuring ! negation correctly overrides defaults Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3de6dc1fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 1. Check if `$PROJECT_ROOT/.understand-anything/.understandignore` exists. If so, read it. | ||
| 2. Check if `$PROJECT_ROOT/.understandignore` exists. If so, read it. | ||
| 3. If neither file exists, skip this step entirely — Step 2's hardcoded filtering is sufficient. | ||
| 4. If at least one file exists, re-filter the **original file list from Step 1** (not the Step 2 output) using the `createIgnoreFilter` function from `@understand-anything/core`, which merges hardcoded defaults and user patterns into a single `.gitignore`-compatible matcher. This ensures `!` negation in user files can override hardcoded defaults (e.g., `!dist/` force-includes dist/ files). |
There was a problem hiding this comment.
Avoid requiring @understand-anything/core in scan scripts
This step makes the generated scanner script depend on @understand-anything/core from the scanned project context, but the script is executed under $PROJECT_ROOT and most target repositories will not have that package installed. In that environment, enabling .understandignore support causes a runtime module-resolution failure (MODULE_NOT_FOUND) and prevents scanning from completing; this is especially likely because Phase 0.5 now creates .understandignore on first run. Please keep Step 2.5 self-contained (or reference a guaranteed-resolvable path) so scans do not fail on ordinary projects.
Useful? React with 👍 / 👎.
| # Use ! prefix to force-include something excluded by defaults. | ||
| # | ||
| # Built-in defaults (always excluded unless negated): | ||
| # node_modules/, .git/, dist/, build/, bin/, obj/, *.lock, *.min.js, etc. |
There was a problem hiding this comment.
Fix starter header to match actual default exclusions
The generated .understandignore header says bin/ is a built-in default exclusion, but DEFAULT_IGNORE_PATTERNS does not exclude bin/. This mismatch can mislead users into thinking bin/ is already filtered, so they may not add an explicit rule and end up scanning large build-output trees (notably in .NET repos), increasing scan time and noise. The header should reflect real defaults (or defaults should be aligned to the header).
Useful? React with 👍 / 👎.
Summary
.understandignorefile with.gitignoresyntax for excluding files/directories from analysis!negation to force-include/understandskill that generates the starter file and pauses for user review before scanningDetails
Core (packages/core)
ignore-filter.ts: Parses.understandignoreusing theignorenpm package, merges 3 layers (hardcoded defaults →.understand-anything/.understandignore→ root.understandignore)ignore-generator.ts: Scans for common directories (tests, docs, fixtures, etc.) and generates a starter file with all suggestions commented outAgent (project-scanner.md)
bin/andobj/to hardcoded Build output exclusions.understandignorefiltering after hardcoded filtersfilteredByIgnorecount in scan output schemaSkill (understand/SKILL.md)
.understandignoreon first run via deterministic Node.js scriptTest plan
/understandon a project — verify Phase 0.5 generates starter file and pauses.understandignorepatterns actually exclude files from scan results!dist/negation force-includes dist/ filesfilteredByIgnorecount appears in scan output🤖 Generated with Claude Code