AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Code Symbols

skill-brettatoms-agent-skills-code-symbols · by brettatoms

Find and edit symbols in code using ast-grep (tree-sitter based). Use when finding function definitions, class definitions, symbol usages, renaming symbols, or replacing code in JavaScript, TypeScript, Python, Go, Rust, and other languages. NOT for Clojure - use clj-symbols instead.

No reviews yet
0 installs
36 views
0.0% view→install

Install

$ agentstack add skill-brettatoms-agent-skills-code-symbols

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-brettatoms-agent-skills-code-symbols)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
7mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Code Symbols? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Code Symbols Skill

Use ast-grep (sg) for structural code search based on tree-sitter parsing. Works with 31 languages.

Important: Clojure is NOT supported. Use the clj-symbols skill for Clojure code.

Prerequisites

# npm
npm install --global @ast-grep/cli

# Homebrew
brew install ast-grep

# Cargo
cargo install ast-grep --locked

Verify: ast-grep --version or sg --version

Supported Languages

| Category | Languages | |----------|-----------| | Web | JavaScript, TypeScript, HTML, CSS, JSON | | Systems | C, C++, Go, Rust | | Scripting | Python, Ruby, PHP, Lua, Bash | | JVM | Java, Kotlin, Scala | | Other | Swift, Haskell, Elixir, Nix |

Not supported: Clojure, Erlang, R, MATLAB

Quick Reference

| Task | Command | |------|---------| | Find pattern | ast-grep run --pattern 'PATTERN' --lang LANG path/ | | Find with JSON | ast-grep run --pattern 'PATTERN' --lang LANG path/ --json | | Rename symbol | ast-grep run --pattern 'old' --rewrite 'new' --lang LANG path/ --update-all |

Pattern Syntax

Patterns must be valid code that tree-sitter can parse.

Meta-Variables

| Syntax | Meaning | Example | |--------|---------|---------| | $NAME | Match single node | function $NAME() {} | | $$$ | Match zero or more nodes | function foo($$$) | | $_ | Match but don't capture | $_($$$) |

Basic Examples

# Match any function call
ast-grep run --pattern '$FUNC($$$)' --lang js path/

# Match specific function
ast-grep run --pattern 'myFunction($$$)' --lang js path/

# Match variable assignment
ast-grep run --pattern 'const $NAME = $VALUE' --lang js path/

Common Operations

Find Function Definition

# JavaScript
ast-grep run --pattern 'function $NAME($$$) { $$$ }' --lang js path/

# Python
ast-grep run --pattern 'def $NAME($$$):' --lang py path/

# Go
ast-grep run --pattern 'func $NAME($$$)' --lang go path/

Find Symbol Usages

ast-grep run --pattern 'myFunction($$$)' --lang js path/
ast-grep run --pattern '$OBJ.myMethod($$$)' --lang js path/

Rename Symbol

# Preview
ast-grep run --pattern 'oldName' --rewrite 'newName' --lang js src/

# Apply
ast-grep run --pattern 'oldName' --rewrite 'newName' --lang js src/ --update-all

# Interactive
ast-grep run --pattern 'oldName' --rewrite 'newName' --lang js src/ --interactive

JSON Output

ast-grep run --pattern '$FUNC($$$)' --lang js path/ --json

Parse with jq:

ast-grep run --pattern 'function $NAME($$$) { $$$ }' --lang js path/ --json \
  | jq '.[] | {name: .metaVariables.single.NAME.text, file, line: .range.start.line}'

When to Use ast-grep vs ripgrep

| Scenario | Tool | |----------|------| | Find by name (text pattern) | ripgrep (rg) | | Find by structure (function, class) | ast-grep | | Language-specific patterns | ast-grep | | Maximum speed | ripgrep | | Accurate symbol boundaries | ast-grep |

Additional References

  • Language patterns: See [references/languages.md](references/languages.md) for JS, TS, Python, Go, Rust patterns
  • Editing: See [references/editing.md](references/editing.md) for rewrite, rename, and YAML rules
  • Workflows: See [references/workflows.md](references/workflows.md) for common workflows

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.