api2r/pkgskills/search-code
Claude Code and agent skill by api2r/pkgskills
- community
Checking that the SKILL.md file is still in the repository.
Search and rewrite R source code by syntax using astgrepr. Use when asked to find patterns in code, search for function calls, identify usage of specific arguments, locate structural patterns across R files, or perform find-and-replace on code structure.
Install
npx vskill@latest install api2r/pkgskills/search-codeSKILL.md
The same SKILL.md was published earlier as dslc-io/tidytuesdayr/search-code.
Search and rewrite code with astgrepr
{astgrepr} enables AST-based code search — structural queries that regex can't express cleanly. If not installed: install.packages("astgrepr")
Reference
Metavariables: µVAR captures one node (uppercase only); µµµ captures zero or more (ellipsis). In replacement strings, refer to captures as ~~VAR~~.
ast_rule() — see ?ast_rule. Key args:
pattern— code pattern with metavariableskind— tree-sitter node kind; see the R grammarregex— match node text with a Rust regexid— names the rule; results accessible asmatches$idinside,has,precedes,follows— relational rules, each takes anotherast_rule()all,any,not— boolean combinators, each takes a list ofast_rule()s
For advanced pattern syntax: ast-grep pattern docs.
Searching across files
Patterns
Find and replace
See ?node_replace_all, ?tree_rewrite.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginst/templates/skills/search-code/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/api2r/pkgskills/search-code)