$npx -y skills add Rune-kit/rune --skill scoutFast codebase scanner. Use when any skill needs codebase context. Finds files, patterns, dependencies, project structure. Pure read-only — never modifies files.
| 1 | # scout |
| 2 | |
| 3 | Fast, lightweight codebase scanning. Scout is the eyes of the Rune ecosystem. |
| 4 | |
| 5 | ## Instructions |
| 6 | |
| 7 | When invoked, perform these steps: |
| 8 | |
| 9 | ### Phase 1: Structure Scan |
| 10 | |
| 11 | Map the project layout: |
| 12 | |
| 13 | 1. Use `Glob` with `**/*` to understand directory structure |
| 14 | 2. Use `Bash` to run `ls` on key directories (root, src, lib, app) |
| 15 | 3. Identify framework by detecting these files: |
| 16 | - `package.json` → Node.js/TypeScript |
| 17 | - `Cargo.toml` → Rust |
| 18 | - `pyproject.toml` / `setup.py` → Python |
| 19 | - `go.mod` → Go |
| 20 | - `pom.xml` / `build.gradle` → Java |
| 21 | |
| 22 | ``` |
| 23 | TodoWrite: [ |
| 24 | { content: "Scan project structure", status: "in_progress" }, |
| 25 | { content: "Run targeted file search", status: "pending" }, |
| 26 | { content: "Map dependencies", status: "pending" }, |
| 27 | { content: "Detect conventions", status: "pending" }, |
| 28 | { content: "Generate codebase map (if full scan)", status: "pending" }, |
| 29 | { content: "Generate scout report", status: "pending" } |
| 30 | ] |
| 31 | ``` |
| 32 | |
| 33 | ### Phase 2: Targeted Search (Search-First) |
| 34 | |
| 35 | **Search-first principle**: Before building anything new, scout checks if a solution already exists — in the codebase, in package registries, or in available MCP servers. |
| 36 | |
| 37 | **Adopt / Extend / Compose / Build decision matrix**: |
| 38 | |
| 39 | When scout finds the caller's target domain, classify the situation: |
| 40 | |
| 41 | ``` |
| 42 | ADOPT — Exact match exists (in codebase, npm, PyPI, MCP). Use as-is. |
| 43 | EXTEND — Partial match exists. Extend/configure existing solution. |
| 44 | COMPOSE — Multiple pieces exist. Wire them together. |
| 45 | BUILD — Nothing suitable exists. Build from scratch. |
| 46 | ``` |
| 47 | |
| 48 | Report the classification to the calling skill. This informs Phase 2 (PLAN) in cook — ADOPT and EXTEND are vastly cheaper than BUILD. |
| 49 | |
| 50 | **Quick checks before deep search**: |
| 51 | 1. `Grep` the codebase for existing implementations of the target functionality |
| 52 | 2. Check `package.json` / `pyproject.toml` / `Cargo.toml` for relevant installed packages |
| 53 | 3. If the task involves external data/APIs: note available MCP servers that might help |
| 54 | |
| 55 | Based on the scan request, run focused searches: |
| 56 | |
| 57 | 1. Use `Glob` to find files matching the target domain: |
| 58 | - Auth domain: `**/*auth*`, `**/*login*`, `**/*session*` |
| 59 | - API domain: `**/*.controller.*`, `**/*.route.*`, `**/*.handler.*` |
| 60 | - Data domain: `**/*.model.*`, `**/*.schema.*`, `**/*.entity.*` |
| 61 | 2. Use `Grep` to search for specific patterns: |
| 62 | - Function names: `pattern: "function <name>"` or `"def <name>"` |
| 63 | - Class definitions: `pattern: "class <Name>"` |
| 64 | - Import statements: `pattern: "import.*<module>"` or `"from <module>"` |
| 65 | 3. Use `Read` to examine the most relevant files (max 10 files, prioritize by relevance) |
| 66 | |
| 67 | **Verification gate**: At least 1 relevant file found, OR confirm the target does not exist. |
| 68 | |
| 69 | #### Info Saturation Detection (Know When to Stop) |
| 70 | |
| 71 | Scout's default is "max 10 file reads" — but the real question is whether additional reads are productive. Track saturation across Phase 2 searches: |
| 72 | |
| 73 | **Entity tracking**: As you scan files, extract key entities (function names, class names, imports, API endpoints, config keys). Maintain a running set of discovered entities. |
| 74 | |
| 75 | | Signal | Threshold | Meaning | Action | |
| 76 | |--------|-----------|---------|--------| |
| 77 | | **New entity ratio** | Last 2 file reads added <2 new entities | Search is exhausted for this domain | STOP scanning, move to Phase 3 | |
| 78 | | **Content similarity** | Last 2 files share >70% of the same imports/patterns | Files are in the same module, redundant reads | Skip remaining files in this directory | |
| 79 | | **Query variation** | 3+ Glob/Grep queries with different patterns all return the same files | All search angles converge | Domain is fully mapped, proceed | |
| 80 | |
| 81 | **When saturation detected**: Emit in Scout Report: |
| 82 | ``` |
| 83 | ### Saturation |
| 84 | - Reached after [N] file reads — last 2 reads added [M] new entities |
| 85 | - Recommendation: synthesize_and_report (further scanning unlikely to yield new insights) |
| 86 | ``` |
| 87 | |
| 88 | **Why**: Without saturation detection, scout reads its full budget of 10 files even when 3 files already contain everything needed. This wastes context tokens and delays the calling skill. Early saturation detection returns control faster. |
| 89 | |
| 90 | ### Phase 3: Dependency Mapping |
| 91 | |
| 92 | 1. Use `Grep` to find import/require/use statements in identified files |
| 93 | 2. Map which modules depend on which (A → imports → B) |
| 94 | 3. Identify the blast radius of potential changes: which files import the target file |
| 95 | |
| 96 | ### Phase 4: Convention Detection |
| 97 | |
| 98 | 1. Check for config files using `Glob`: |
| 99 | - `.eslintrc*`, `eslint.config.*` → ESLint rules |
| 100 | - `tsconfig.json` → TypeScript config |
| 101 | - `.prettierrc*` → Prettier config |
| 102 | - `ruff.toml`, `.ruff.toml` → Python linter |
| 103 | 2. Check naming conventions by r |