Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

feat(skill): add Phase 0.5 for .understandignore setup and review pause

Lum110459a6f56bfea0
diff --git a/understand-anything-plugin/skills/understand/SKILL.md b/understand-anything-plugin/skills/understand/SKILL.md
index be26f59b..3ad7fcf4 100644
--- a/understand-anything-plugin/skills/understand/SKILL.md
+++ b/understand-anything-plugin/skills/understand/SKILL.md
@@ -77,6 +77,37 @@ Determine whether to run a full analysis or incremental update.
---
+## Phase 0.5 — Ignore Configuration
+
+Set up and verify the `.understandignore` file before scanning.
+
+1. Check if `$PROJECT_ROOT/.understand-anything/.understandignore` exists.
+2. **If it does NOT exist**, generate a starter file:
+ - Run the following Node.js one-liner in `$PROJECT_ROOT`:
+ ```bash
+ node -e "
+ const fs = require('fs');
+ const path = require('path');
+ const root = process.cwd();
+ const dirs = ['__tests__','test','tests','fixtures','testdata','docs','examples','scripts','migrations','.storybook'];
+ const header = '# .understandignore — patterns for files/dirs to exclude from analysis\n# Syntax: same as .gitignore (globs, # comments, ! negation, trailing / for dirs)\n# Lines below are suggestions — uncomment to activate.\n# Use ! prefix to force-include something excluded by defaults.\n#\n# Built-in defaults (always excluded unless negated):\n# node_modules/, .git/, dist/, build/, bin/, obj/, *.lock, *.min.js, etc.\n#\n';
+ let body = '';
+ const found = dirs.filter(d => fs.existsSync(path.join(root, d)));
+ if (found.length) { body += '# --- Detected directories (uncomment to exclude) ---\n\n' + found.map(d => '# ' + d + '/').join('\n') + '\n\n'; }
+ body += '# --- Test file patterns (uncomment to exclude) ---\n\n# *.test.*\n# *.spec.*\n# *.snap\n';
+ fs.writeFileSync(path.join(root, '.understand-anything', '.understandignore'), header + body);
+ "
+ ```
+ - Report to the user:
+ > Generated `.understand-anything/.understandignore` with suggested exclusions based on your project structure. Please review it and uncomment any patterns you'd like to exclude from analysis. When ready, confirm to continue.
+ - **Wait for user confirmation before proceeding.**
+3. **If it already exists**, report:
+ > Found `.understand-anything/.understandignore`. Review it if needed, then confirm to continue.
+ - **Wait for user confirmation before proceeding.**
+4. After confirmation, proceed to Phase 1.
+
+---
+
## Phase 1 — SCAN (Full analysis only)
Dispatch a subagent using the `project-scanner` agent definition (at `agents/project-scanner.md`). Append the following additional context:
@@ -113,6 +144,9 @@ Store the file list as `$FILE_LIST` with `fileCategory` metadata for use in Phas
**Gate check:** If >100 files, inform the user and suggest scoping with a subdirectory argument. Proceed only if user confirms or add guidance that this may take a while.
+If the scan result includes `filteredByIgnore > 0`, report:
+> Excluded {filteredByIgnore} files via `.understandignore`.
+
---
## Phase 2 — ANALYZE