search-code

Search for code patterns in Syncpack. Use when finding symbols, implementations, or understanding how code is used. Covers ast-grep for Rust and grep/rg for other cases.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "search-code" with this command: npx skills add jamiemason/syncpack/jamiemason-syncpack-search-code

Search Code

Guide for searching the Syncpack codebase effectively.

Golden Rule

Use ast-grep for Rust files — it filters out comments, strings, and docs.

Quick Reference

Looking for...Use
Rust symbols, patterns, structsast-grep
Multiple file typesgrep/rg
Content in comments intentionallygrep/rg
Non-Rust files (JSON, MD, TOML)grep/rg

ast-grep Examples

# Find struct definitions
ast-grep -p 'pub struct $NAME' src/

# Find function calls
ast-grep -p 'Specifier::new' src/

# Find enum variants
ast-grep -p 'pub enum $NAME' src/

# Find impl blocks
ast-grep -p 'impl $TYPE' src/

# Find specific method definitions
ast-grep -p 'pub fn run($$$) -> i32' src/

# Find match expressions
ast-grep -p 'match $EXPR { $$$ }' src/

Pattern Syntax

PatternMatches
$NAMESingle identifier
$$$Zero or more items (arguments, fields, etc.)
$_Any single expression

When to Use grep/rg

# Search across file types
rg "TODO" --type rust --type md

# Search in comments (ast-grep ignores these)
rg "FIXME" src/

# Search non-Rust files
rg "version" Cargo.toml

# Case-insensitive search
rg -i "error" src/

Common Searches

Find where a type is used

ast-grep -p 'Context' src/

Find all InstanceState assignments

ast-grep -p 'InstanceState::valid' src/
ast-grep -p 'InstanceState::fixable' src/
ast-grep -p 'InstanceState::unfixable' src/

Find test files

find src -name '*_test.rs'

Find command implementations

ast-grep -p 'pub fn run($$$) -> i32' src/commands/

Tips

  • Start broad, then narrow with more specific patterns
  • Use ast-grep output to find the file, then read_file to understand context
  • Chain searches: find the type, then find where it's constructed

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

write-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

document-code

No summary provided by upstream source.

Repository SourceNeeds Review
General

write-tests

No summary provided by upstream source.

Repository SourceNeeds Review