config/agents/skills/code-search/SKILL.md
Use when searching code, refactoring, running codemods, or choosing between search tools. Provides guidance on ast-grep vs ripgrep selection and usage patterns.
npx skillsauth add edmundmiller/dotfiles code-searchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use ast-grep when structure matters. It parses code and matches AST nodes, so results ignore comments/strings, understand syntax, and can safely rewrite code.
Best for:
scan with rules + test)--json output for toolingUse ripgrep when text is enough. It's the fastest way to grep literals/regex across files.
Best for:
ast-greprgrg to shortlist files, then ast-grep to match/modify with precisionFind structured code (ignores comments/strings):
ast-grep run -l TypeScript -p 'import $X from "$P"'
Codemod (only real var declarations become let):
ast-grep run -l JavaScript -p 'var $A = $B' -r 'let $A = $B' -U
Find function calls with specific patterns:
ast-grep run -l Python -p 'logger.$METHOD($$$ARGS)'
Replace with transformation:
ast-grep run -l TypeScript \
-p 'useQuery($ARGS)' \
-r 'useSuspenseQuery($ARGS)' \
-U
Quick textual hunt:
rg -n 'console\.log\(' -t js
Find in specific file types:
rg 'TODO|FIXME' -t py -t js
Context around matches:
rg -C 3 'error' -t log
List files with matches:
rg -l 'import.*React' -t tsx
Speed + Precision: Use rg to find candidates, then ast-grep for precise operations:
rg -l -t ts 'useQuery\(' | xargs ast-grep run -l TypeScript \
-p 'useQuery($A)' \
-r 'useSuspenseQuery($A)' \
-U
| Aspect | ast-grep | ripgrep | | ------------------- | -------------------------- | ----------------------- | | Unit of match | AST node | Line | | False positives | Low (understands syntax) | Depends on regex | | Rewrites | First-class, safe | Requires sed/awk, risky | | Speed | Slower (parses code) | Fastest (text only) | | Use case | Structural search/refactor | Text search/grep |
Need to modify code?
├─ Yes → ast-grep (safe, structural rewrites)
└─ No
├─ Searching code structure? → ast-grep (accurate)
└─ Just finding text? → ripgrep (fastest)
# ast-grep (language-aware)
ast-grep run -l Python -p 'def $NAME($$$PARAMS): $$$BODY'
# ripgrep (text-based, faster but less precise)
rg '^def \w+\(' -t py
# ast-grep: Safe, precise
ast-grep run -l JavaScript \
-p 'axios.get($URL)' \
-r 'fetch($URL)' \
-U
# ripgrep: Don't use for rewrites (will match in comments/strings)
# ripgrep: Perfect for this
rg 'TODO:|FIXME:' --color=always
# ast-grep: Overkill for text search
development
Read-only Linear issue access via the Linear GraphQL API.
data-ai
## <!-- Purpose: Teach agents fast day-to-day memory browse/search/read/sync workflows in pi-context-repo. --> name: searching-memory description: > Search, browse, and inspect memory quickly in pi-context-repo. Use when asked to find prior notes, inspect memory files, locate preferences, or sync recent memory updates. Trigger phrases: "search memory", "list memory files", "find in memory", "read memory file", "memory status", "sync memory". --- # Searching Memory Use this workflow for fast
development
Comprehensive guide for initializing or reorganizing agent memory into a deeply hierarchical file structure. Use when running /init, when user asks to set up memory, or when memory needs a major reorganization. Trigger phrases: "initialize memory", "set up memory", "populate memory", "build my memory", "memory init".
data-ai
Decomposes and reorganizes agent memory files into focused, single-purpose components. Use when memory has large multi-topic blocks, redundancy, or poor organization. Trigger phrases: "defrag memory", "reorganize memory", "clean up memory files", "split memory blocks".