agentleFS
josixjosix/agent-flow/skills/exploration-strategy/SKILL.md

exploration-strategy

Skill8 starsChanged 17 days agoMITView on GitHub

This skill should be used when exploring codebases, finding patterns, searching for code, gathering context, or understanding code structure before planning or implementation.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use fast, parallel exploration to gather context before planning.

    line 9
  2. Distinctive:

    Parallel over sequential: - Run multiple searches simultaneously when possible

    line 17
  3. Distinctive:

    Targeted over exhaustive: - Start with likely locations, expand if needed

    line 18
  4. Distinctive:

    Converge quickly: - Stop when results stabilize or context is sufficient

    line 19
  5. Distinctive:

    Start with high-level structure (directories, entry points)

    line 33
  6. Distinctive:

    Start at known entry point

    line 51
  7. Distinctive:

    Follow imports and references

    line 52
  8. Distinctive:

    Search for specific terms, patterns, or signatures

    line 69
  9. Distinctive:

    Read most promising matches

    line 71
  10. Distinctive:

    Use Glob for file discovery:

    line 107
  11. Distinctive:

    Use Grep for content search:

    line 119
  12. Distinctive:

    Run 3-5 parallel searches maximum

    line 174
  13. Distinctive:

    Before concluding exploration, verify:

    line 186
  14. Distinctive:

    Read entry point files fully

    line 210
  15. Distinctive:

    Test files when adding tests

    line 216

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Exploration Strategy

Use fast, parallel exploration to gather context before planning.

Overview

Effective exploration minimizes wasted effort by quickly identifying relevant code, patterns, and conventions. This skill defines exploration patterns, tool selection, and convergence criteria.

Key Principles

  1. Parallel over sequential - Run multiple searches simultaneously when possible
  2. Targeted over exhaustive - Start with likely locations, expand if needed
  3. Converge quickly - Stop when results stabilize or context is sufficient
  4. Summarize for handoff - Produce actionable summaries for downstream agents

Exploration Patterns

Choose the appropriate pattern based on task characteristics.

Breadth-First Exploration

Use when: Structure is unclear or unfamiliar codebase

Approach:

  1. Start with high-level structure (directories, entry points)
  2. Identify major components and their relationships
  3. Narrow focus based on initial findings
  4. Deep dive into relevant areas

Example:

Initial: Glob for package.json, setup.py, main entry points
Then:    List top-level directories
Then:    Read README and key configs
Finally: Focus on relevant subsystems

Depth-First Exploration

Use when: Target is known but details are needed

Approach:

  1. Start at known entry point
  2. Follow imports and references
  3. Map the call chain
  4. Document dependencies

Example:

Start:   Read specific file mentioned in task
Then:    Follow imports in that file
Then:    Read imported modules
Finally: Document the dependency tree

Targeted Exploration

Use when: Looking for specific patterns or implementations

Approach:

  1. Search for specific terms, patterns, or signatures
  2. Filter results by relevance
  3. Read most promising matches
  4. Expand search if needed

Example:

Search:  Grep for function name or pattern
Filter:  Exclude test files if not relevant
Read:    Top 3-5 most relevant matches
Expand:  Broaden search terms if insufficient

See Search Patterns for detailed pattern guidance.


Search Tool Selection

Match the tool to the search goal.

Tool Selection Matrix

GoalPrimary ToolWhen to Use
Orient in unfamiliar codebasegraph_stats + god_nodesGraph exists; need structural overview
Map imports / callers / dependentsget_neighborsGraph exists; need blast radius
Find path between two conceptsshortest_pathGraph exists; tracing connections
Find files by nameGlobKnow the filename pattern
Find content in filesGrepKnow what text to search for; freshly edited files
Read file contentsReadNeed full file context
External documentationWebSearchNeed API docs or external info
Fetch specific pageWebFetchHave URL, need content

Graph tools first for structural questions; Grep/Read for literal content and freshly edited files. See graphify-usage skill for full decision table.

Glob Patterns

Use Glob for file discovery:

Project structure:     **/*.{ts,tsx}
Config files:          **/config.{json,yaml,yml}
Test files:            **/*.test.ts, **/*.spec.ts
Entry points:          **/index.ts, **/main.ts
Specific component:    **/components/**/Button*.tsx

Grep Patterns

Use Grep for content search:

Function definitions:  function\s+handleSubmit
Class definitions:     class\s+UserService
Imports:               import.*from.*@company/
TODO comments:         TODO|FIXME|HACK
Type definitions:      interface\s+User|type\s+User

Combining Tools

Effective exploration often chains tools:

1. Glob: Find all TypeScript files
2. Grep: Search for specific pattern in those files
3. Read: Examine the most relevant matches

Parallel Search Strategies

Maximize exploration efficiency with parallel searches.

When to Parallelize

  • Multiple independent search terms
  • Different file types to examine
  • Separate areas of the codebase
  • Complementary search angles

Parallel Search Examples

Finding a feature implementation:

Parallel:
  - Grep: "featureName" in source files
  - Grep: "featureName" in test files
  - Glob: files with "feature" in name
  - Grep: related config/constants

Understanding a module:

Parallel:
  - Read: module index/main file
  - Grep: imports of this module
  - Glob: test files for this module
  - Read: README in module directory

Parallel Search Limits

  • Run 3-5 parallel searches maximum
  • Too many parallels fragments focus
  • Consolidate results before expanding

Context Gathering Techniques

Gather sufficient context without over-reading.

Essential Context Checklist

Before concluding exploration, verify:

  • Entry points identified
  • Key dependencies mapped
  • Existing patterns documented
  • Test approach understood
  • Config/environment requirements noted

When the question is about runtime behaviour (a setting seems ignored, something is slow or failing), code shows what should happen, not what did. Read perception for the observation surfaces to check (effective config, plans, metrics, logs, history), and report any surface you couldn't reach so the orchestrator can ask the user for access.

Context Priorities

PriorityContext TypeWhen Essential
HighDirect implementation filesAlways
HighRelated test filesWhen modifying behavior
MediumType definitionsWhen working with types
MediumConfiguration filesWhen behavior is configurable
LowDocumentation filesWhen conventions unclear
LowBuild configurationWhen build issues possible

Reading Strategies

Skim for structure:

  • Read entry point files fully
  • Skim supporting files for patterns
  • Focus on public interfaces

Deep read for details:

  • Implementation logic when modifying
  • Test files when adding tests
  • Type definitions when typing

Convergence Criteria

Know when exploration is complete.

Stop Exploring When

  1. Results stabilize - New searches return same files
  2. Context sufficient - Can answer key questions about implementation
  3. Patterns identified - Understand codebase conventions
  4. Scope defined - Know what files need modification

Continue Exploring When

  1. Gaps remain - Cannot answer basic questions about approach
  2. Inconsistencies found - Different patterns in different areas
  3. Dependencies unclear - Cannot determine what else might be affected
  4. Edge cases unknown - Have not identified error handling patterns

Exploration Depth Guidelines

Task ComplexityExploration DepthTime Budget
Simple fix1-3 files2-5 minutes
Feature addition5-10 files5-10 minutes
Refactoring10-20 files10-15 minutes
Architecture change20+ files15-30 minutes

See Exploration Depth for complexity guidelines.


Quick Reference

Exploration Flow

1. Identify likely directories and patterns
2. Run parallel searches for patterns
3. Read most relevant files for conventions
4. Summarize findings for handoff
5. Stop when context sufficient

Tool Decision Tree

Structural / blast-radius / imports? -> Graph tools (get_neighbors, shortest_path)
Orientation in unfamiliar code?      -> graph_stats + god_nodes
Need files?                          -> Glob
Need content (literal/freshly edited)? -> Grep
Need detail?                         -> Read
Need external?                       -> WebSearch/WebFetch

Convergence Check

Can I answer: What files to modify?
Can I answer: What patterns to follow?
Can I answer: What dependencies exist?
If yes to all -> Stop exploring
If no to any -> Continue with targeted search

Resources

  • Search Patterns - Detailed search pattern guidance
  • Exploration Depth - Depth guidelines by task type
  • Deep-Dive Patterns - Parallel exploration for /deep-dive command
  • Deep-Dive Reuse - /orchestrate --use-deep-dive targeted Phase 1 exploration
  • Context Preambles - Graph / personal KB / AgentsView preambles for /orchestrate dispatches
  • Exploration Scenarios - Worked exploration examples

Related Skills

  • task-classification - Classifies tasks before exploration
  • agent-behavior-constraints - Defines Riko's tool permissions
  • prompt-refinement - Refines exploration queries
  • evidence-driven-work - Observation surfaces for runtime questions (read references/perception.md on demand)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.