unified-search-discover

Automate progressive search and safe refactoring of TypeScript/JavaScript codebases.

10|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/CsHeng/dot-claude --skill unified-search-discover
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unified-search-discover
Source: https://github.com/CsHeng/dot-claude/tree/main/skills/unified-search-discover
Command: npx skills add https://github.com/CsHeng/dot-claude --skill unified-search-discover

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides progressive search and discovery workflows with refinement patterns for file finding, content searching, and safe refactoring.

Core Features & Use Cases

  • COUNT → PREVIEW → EXECUTE: Structured search pattern to minimize output and maximize safety.
  • File Discovery: Use fd/find with gitignore awareness and portability considerations.
  • Refactoring Safely: AST-based search and replace with backup guidance.

Quick Start

Start with a COUNT of results for a TypeScript project, preview samples, then execute a full search or refactor if appropriate.

Frequently Asked Questions about unified-search-discover

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

FAQPage Schema
How do I search and refactor code safely across a large codebase?

Progressive search with safe discovery enforces a COUNT → PREVIEW → EXECUTE lifecycle. Start by counting matches with fd, rg, or ast-grep to gauge scope, preview samples to validate correctness, then execute the full refactor or replacement with backup guidance to prevent unintended changes.

What's the best way to find files in a TypeScript project while respecting gitignore?

File discovery with fd or find respects gitignore rules by default, filtering out ignored paths automatically. This portable approach works across Unix and Windows environments, minimizing noise and focusing results on tracked source files.

Can I perform structural search and replace on TypeScript code?

Yes, ast-grep enables AST-based search and replace by matching code structure rather than text patterns. This catches semantically equivalent code that text regex would miss and reduces false positives when refactoring.

How do I use rg for fast text search in codebases?

rg (ripgrep) performs fast text searches across files with built-in gitignore support and parallel processing. Use it in the COUNT phase to quickly filter results before previewing and executing changes.

What precautions should I take when refactoring with search and replace?

The COUNT → PREVIEW → EXECUTE pattern minimizes risk by validating scope and samples before full execution. Always maintain backups and review preview output to ensure the refactor matches your intent before committing changes.

Does this approach work for discovering files across different project structures?

Yes, fd and find with gitignore awareness adapt to varied project layouts while respecting version control rules. The portable design works consistently across TypeScript, JavaScript, and mixed-language projects.