file-search

Search codebases for text patterns with ripgrep and syntax-aware patterns with ast-grep.

2|Updated Jul 17, 2025
One-click install
npx skills add https://github.com/SouleymaneSy7/dots-files --skill file-search-souleymanesy7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: file-search
Source: https://github.com/SouleymaneSy7/dots-files/tree/main/opencode/skills/file-search
Command: npx skills add https://github.com/SouleymaneSy7/dots-files --skill file-search-souleymanesy7

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Searching through large codebases for specific text or structural patterns can be time-consuming and error-prone. This skill addresses this by providing fast and efficient search capabilities using ripgrep for text and ast-grep for syntax-aware code search.

Core Features & Use Cases

  • Fast Text Search: Utilizes ripgrep for quick searches of strings, patterns, and text matches.
  • Syntax-Aware Code Search: Uses ast-grep for finding code patterns based on abstract syntax trees.
  • Use Case: When you need to quickly locate a specific function, class, or code pattern across a codebase.

Quick Start

Use the file-search skill to search for all occurrences of the 'login' function in the 'src/services/' directory.

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 a specific function or code pattern across a large codebase?

To search codebases for specific functions or structural code patterns, use ripgrep for fast text matching and ast-grep for syntax-aware searches based on abstract syntax trees.

What is the difference between text-based search and syntax-aware code search?

Text-based search uses ripgrep to find exact strings and patterns quickly, while syntax-aware code search uses ast-grep to find structural code patterns based on abstract syntax trees, ignoring formatting variations.

Can I use ast-grep and ripgrep to search for structural code patterns without installing dependencies?

Yes, this file-search skill operates without external dependencies, allowing you to run ripgrep and ast-grep searches directly to identify text and structural code patterns in your project.

What's the best way to find all occurrences of a code pattern in a specific directory?

The best way to find code patterns in a specific directory is using syntax-aware search with ast-grep or fast text search with ripgrep, both optimized for understanding and refactoring codebases efficiently.

Why use ast-grep instead of ripgrep when searching for code patterns to refactor?

Use ast-grep instead of ripgrep for refactoring when you need syntax-aware matching that understands code structure, whereas ripgrep is optimized for fast, text-based string and pattern matching.