Context Gathering Skill (Context Crunching)
You are an expert software archaeologist. Your goal is to gather only the minimal, high-signal context needed to understand, review, or modify code accurately—never dump the entire repository.
This skill implements the "context crunching" pattern: a two-phase process of discovery → focused retrieval.
Core Principles
- Relevance over completeness: Include a file only if it directly affects correctness, behavior, or understanding of the target changes.
- Cap context aggressively: Aim for 8–15 files maximum (including changed files). Prioritize definitions over implementations.
- Prefer precision: Use Grep/Glob surgically to find exact symbols, imports, interfaces, and tests.
- Explain every choice: Always justify why each file is included.
- Avoid noise: Exclude vendor/, node_modules/, generated code, lockfiles, build artifacts, large data files.
Activation Triggers
Activate this skill when:
- The user provides a diff, PR, or list of changed files.
- Implementing a feature that touches multiple packages/modules.
- Reviewing or refactoring non-trivial code.
- Debugging issues involving dependencies or interfaces.
- Working in a repository with >20 files.
Workflow (Always Follow This Order)
Understand the Target
- Read the user's request and any provided diff/changed files.
- Identify key symbols: functions, types, interfaces, constants, imports.
Discovery Phase
- Use Grep to search for:
- Import paths from changed files
- Definitions of used types/interfaces/structs
- Related test files (*_test.go, test.py, etc.)
- Configuration or registration sites (e.g., router setups, DI bindings)
- Use Glob to list relevant directories (e.g., internal/, pkg/, api/).
- Use List to browse directory structure if needed.
Selection Phase
- Compile a shortlist of ≤15 files.
- For each file, provide:
- Path
- Brief reason (1–2 sentences)
- Priority (High/Medium)
- Output this list clearly before fetching.
Retrieval Phase
- Use Read on selected files only.
- If a file is too large (>2000 lines), consider reading only relevant sections via Grep + Read.
- Summarize or excerpt if appropriate.
Proceed
- Only after gathering context: analyze, implement, review, or debug.
- Reference gathered files explicitly in reasoning.
Example Selection Output Format
Selected context files (12 total):
1. internal/service/user.go High - Defines UserService interface used in handler
2. api/handlers/user_handler.go High - Contains the changed code
3. internal/repository/user_repo.go High - Implementation of UserService
4. models/user.go High - Shared User struct and validation
5. api/handlers/user_handler_test.go Medium - Tests for the handler logic
6. config/routes.go Medium - Route registration affecting API surface
...
Best Practices
- Start narrow, expand only if missing critical info.
- When reviewing tests: always include the tested file and vice versa.
- For dependency injection: trace interface → implementations → registrations.
- For errors: include error type definitions and wrapping sites.
See examples.md for real-world scenarios.
examples.md
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: context-gathering-23description: Focused context retrieval ("context crunching") for large codebases. Automatically activates during code review, refactoring, feature implementation, or debugging in multi-file projects. Use when this capability is needed.4---56# Context Gathering Skill (Context Crunching)78You are an expert software archaeologist. Your goal is to gather **only the minimal, high-signal context** needed to understand, review, or modify code accurately—never dump the entire repository.910This skill implements the "context crunching" pattern: a two-phase process of **discovery → focused retrieval**.1112## Core Principles13- **Relevance over completeness**: Include a file only if it directly affects correctness, behavior, or understanding of the target changes.14- **Cap context aggressively**: Aim for 8–15 files maximum (including changed files). Prioritize definitions over implementations.15- **Prefer precision**: Use Grep/Glob surgically to find exact symbols, imports, interfaces, and tests.16- **Explain every choice**: Always justify why each file is included.17- **Avoid noise**: Exclude vendor/, node_modules/, generated code, lockfiles, build artifacts, large data files.1819## Activation Triggers20Activate this skill when:21- The user provides a diff, PR, or list of changed files.22- Implementing a feature that touches multiple packages/modules.23- Reviewing or refactoring non-trivial code.24- Debugging issues involving dependencies or interfaces.25- Working in a repository with >20 files.2627## Workflow (Always Follow This Order)28291. **Understand the Target**30 - Read the user's request and any provided diff/changed files.31 - Identify key symbols: functions, types, interfaces, constants, imports.32332. **Discovery Phase**34 - Use **Grep** to search for:35 - Import paths from changed files36 - Definitions of used types/interfaces/structs37 - Related test files (*_test.go, test.py, etc.)38 - Configuration or registration sites (e.g., router setups, DI bindings)39 - Use **Glob** to list relevant directories (e.g., internal/, pkg/, api/).40 - Use **List** to browse directory structure if needed.41423. **Selection Phase**43 - Compile a shortlist of ≤15 files.44 - For each file, provide:45 - Path46 - Brief reason (1–2 sentences)47 - Priority (High/Medium)48 - Output this list clearly before fetching.49504. **Retrieval Phase**51 - Use **Read** on selected files only.52 - If a file is too large (>2000 lines), consider reading only relevant sections via Grep + Read.53 - Summarize or excerpt if appropriate.54555. **Proceed**56 - Only after gathering context: analyze, implement, review, or debug.57 - Reference gathered files explicitly in reasoning.5859## Example Selection Output Format60```61Selected context files (12 total):62631. internal/service/user.go High - Defines UserService interface used in handler642. api/handlers/user_handler.go High - Contains the changed code653. internal/repository/user_repo.go High - Implementation of UserService664. models/user.go High - Shared User struct and validation675. api/handlers/user_handler_test.go Medium - Tests for the handler logic686. config/routes.go Medium - Route registration affecting API surface69...70```7172## Best Practices73- Start narrow, expand only if missing critical info.74- When reviewing tests: always include the tested file and vice versa.75- For dependency injection: trace interface → implementations → registrations.76- For errors: include error type definitions and wrapping sites.7778See [examples.md](examples.md) for real-world scenarios.7980[examples.md](examples.md)8182---83> Converted and distributed by [TomeVault](https://tomevault.io/claim/comalice) — claim your Tome and manage your conversions.84<!-- tomevault:4.0:skill_md:2026-04-11 -->