file-search

Search codebases for text patterns and syntax-aware AST matches.

41|4|Updated May 6, 2026
One-click install
npx skills add https://github.com/markerikson/opencode-config-example --skill file-search-markerikson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: file-search
Source: https://github.com/markerikson/opencode-config-example/tree/main/config/skill/file-search
Command: npx skills add https://github.com/markerikson/opencode-config-example --skill file-search-markerikson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Quickly locating relevant occurrences and structural code constructs across a codebase without getting overwhelmed by noisy results.

Core Features & Use Cases

  • Fast text search with ripgrep: Find strings, comments, identifiers, and regex-based matches across selected file types and directories.
  • Syntax-aware structural search with ast-grep: Locate code patterns using AST matching for more reliable refactors and impact analysis.
  • Precision-first search strategy: Narrow by language, directory, and specificity, then cap results to keep the analysis manageable.

Quick Start

Use the file-search skill to search for a structural pattern in the target folder by running: execute_command("sg --pattern 'class $NAME { $$$ }' --lang python src/").

Frequently Asked Questions about file-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search for structural code patterns across a codebase?

Text search with ripgrep finds strings, comments, and identifiers using regex across selected file types and directories. A precision-first strategy narrows the scope by language and directory, then caps results to keep the output manageable.

Can I use ast-grep and ripgrep for security scanning?

By using ast-grep for syntax-aware matching and ripgrep for text search, you can locate specific code constructs and usages. This precision-first approach narrows by language and directory, capping outputs to prevent excessive noise during refactoring preparation.

What is the best way to find code usages without getting overwhelmed by noisy results?

The best way to find code usages is applying a precision-first search strategy. Narrow the search scope by language, directory, and specificity, then cap the outputs to keep the analysis manageable and avoid excessive result volume.

How do I inspect dependencies in a specific folder using ast-grep?

Run ast-grep with a structural pattern and target the source folder, such as execute_command("sg --pattern 'class $NAME { $$$ }' --lang python src/"). This discovers usages and inspects dependencies within the specified directory.