Agent skill

Ast Grep

by tctinh in tctinh/agent-hive

Use ast-grep MCP tools for syntax-aware structural search, AST inspection, rule testing, and structural verification.

Custom licenceAuto-check passedDevelopment

Install Ast Grep

skills CLI
$ npx skills add tctinh/agent-hive --skill ast-grep -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tctinh/agent-hive ast-grep --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tctinh/agent-hive.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/opencode-hive/skills/ast-grep .claude/skills/ast-grep && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ast-grep
GitHub stars
158
Token cost
~1.2k tokens
SKILL.md length
583 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
Custom licence

At a glance

Use ast-grep MCP tools for syntax-aware structural search, AST inspection, rule testing, and structural verification.

  • Works in 6 steps: Clarify the target shape → Create a minimal example → Inspect syntax when uncertain → …
  • Tasks that involve MCP servers
  • SKILL.md covers When to use this skill, Tool map, Default workflow and Heuristics, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ast Grep is an agent skill from tctinh/agent-hive. Use ast-grep MCP tools for syntax-aware structural search, AST inspection, rule testing, and structural verification. Triggers: code-shape queries, structural invariants, pattern debugging, AST inspection, and multi-file syntax matching.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering MCP servers.

When your agent uses it

  • Tasks that involve MCP servers

Example prompts

  • “/ast-grep”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Clarify the target shape
  2. Create a minimal example
  3. Inspect syntax when uncertain
  4. Start simple
  5. Test before repo-wide search
  6. Search the repo

What it can do on your machine

Read from SKILL.md and the folder at commit b3f11c0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ast Grep loads about 1.2k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 583 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 583 words (~1,176 tokens).

“Use this skill when the question depends on code structure rather than plain text.”

— opening of SKILL.md by tctinh, Custom licence
name
ast-grep

Read the full SKILL.md on GitHub

Files

Just SKILL.md in packages/opencode-hive/skills/ast-grep of tctinh/agent-hive.

Open the folder on GitHubat commit b3f11c0

Compare with similar skills

Ast Grep next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ast Grep compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ast Grep this skilltctinh/agent-hive158—~1.2kAutomated safety check: PassCustom licence
Analyze Logsactivepieces/activepieces25k1 repos~1.6kAutomated safety check: PassMIT
ReleasePrefectHQ/fastmcp28k—~2.9kAutomated safety check: PassApache-2.0
WebMCP Tool Generatorvercel-labs/agent-browser44k1 repos~752Automated safety check: PassApache-2.0
Review PRPrefectHQ/fastmcp28k—~3.1kAutomated safety check: PassApache-2.0
ObservalObserval/Observal4.3k—~2.2kAutomated safety check: PassApache-2.0

Similar skills

  • Analyze Logs

    activepieces/activepieces

    Analyze application logs from the .evlog/logs/ directory. An agent skill from activepieces/activepieces.

    25k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Release

    PrefectHQ/fastmcp

    Cut a FastMCP release end to end. An agent skill from PrefectHQ/fastmcp.

    28k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • WebMCP Tool Generator

    vercel-labs/agent-browser

    Official

    Builds and validates experimental WebMCP tools that expose a web page's real workflows to agents, with a manifest, init script and evals compared against accessibility-tree automation.

    44k GitHub starsUsed in 1 repo~752 tokens
    DevelopmentAuto-check passed
  • Review PR

    PrefectHQ/fastmcp

    Assess a FastMCP pull request for justified behavior, compatibility, and correctness, then follow CI and review feedback to a revision-specific verdict.

    28k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Observal

    Observal/Observal

    A skill your agent uses when starting any task the organization may already have an approved skill, prompt, MCP server, or Agent for: reviewing code, a commit, a diff, or a pull request; writing…

    4.3k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Ue Code Authoring

    JasonMa0012/MooaToon

    A skill your agent uses when writing or modifying UE C++ (classes, actors, components, subsystems, interfaces, function libraries) with Rider MCP available.

    750 GitHub stars~1.9k tokensUpdated 22 days ago
    DevelopmentAuto-check: notes

More from tctinh/agent-hive

  • Agents Md Mastery

    tctinh/agent-hive

    A skill your agent uses when bootstrapping, updating, or reviewing AGENTS.md — teaches what makes effective agent memory, how to structure sections, signal vs noise filtering, and when to prune…

    158 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Docker Mastery

    tctinh/agent-hive

    A skill your agent uses when working with Docker containers — debugging container failures, writing Dockerfiles, docker-compose for integration tests, image optimization, or deploying containerized…

    158 GitHub stars~2.6k tokensUpdated 6 days ago
    Auto-check: notes
  • Parallel Exploration

    tctinh/agent-hive

    A skill your agent uses when you need parallel, read-only exploration with the agent tool (Scout fan-out)

    158 GitHub stars~1.8k tokensUpdated 6 days ago
    Auto-check passed
  • Verification Reviewer

    tctinh/agent-hive

    A skill your agent uses when independently verifying implementation claims, post-merge review, or when a reviewer needs to falsify success assertions with command-and-output evidence

    158 GitHub stars~1.1k tokensUpdated 6 days ago
    Auto-check passed
  • Code Reviewer

    tctinh/agent-hive

    A skill your agent uses when reviewing implementation changes against an approved plan or task (especially before merging or between Hive tasks) to catch missing requirements, YAGNI, dead code, and…

    158 GitHub stars~1.8k tokensUpdated 6 days ago
    Auto-check passed
  • Parallel Exploration

    tctinh/agent-hive

    A skill your agent uses when you need parallel, read-only exploration with task() (Scout fan-out)

    158 GitHub stars~2k tokensUpdated 6 days ago
    Auto-check passed

Questions about Ast Grep

What does Ast Grep do?

Use ast-grep MCP tools for syntax-aware structural search, AST inspection, rule testing, and structural verification. Ast Grep is an agent skill from tctinh/agent-hive. Use ast-grep MCP tools for syntax-aware structural search, AST inspection, rule testing, and structural verification.

When should I use Ast Grep?

Ast Grep fits situations like: tasks that involve MCP servers.

How do I install Ast Grep in Claude Code?

Run `npx skills add tctinh/agent-hive --skill ast-grep -a claude-code`. Or copy the skill folder (packages/opencode-hive/skills/ast-grep in tctinh/agent-hive) into .claude/skills/ast-grep in your project. Claude Code loads it when a task matches its description.

How do I install Ast Grep in Codex?

Run `npx skills add tctinh/agent-hive --skill ast-grep -a codex`. Or copy the skill folder (packages/opencode-hive/skills/ast-grep in tctinh/agent-hive) into .agents/skills/ast-grep in your project. Codex loads it when a task matches its description.

Can I use Ast Grep in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tctinh/agent-hive --skill ast-grep -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ast-grep, .gemini/skills/ast-grep, .github/skills/ast-grep and .opencode/skills/ast-grep in your project.

What does Ast Grep need to run?

SKILL.md names no scripts, command-line tools or credentials: Ast Grep is instructions for the agent only.

Does Ast Grep access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ast Grep safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ast Grep use?

Ast Grep has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Ast Grep use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ast Grep?

Skills that share tags, products or a category with Ast Grep: Analyze Logs (activepieces/activepieces, 25k stars), Release (PrefectHQ/fastmcp, 28k stars), WebMCP Tool Generator (vercel-labs/agent-browser, 44k stars) and Review PR (PrefectHQ/fastmcp, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ast Grep?

tctinh (a GitHub user) maintains it in tctinh/agent-hive, which has 158 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 4, 2026.

Source: tctinh/agent-hive on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.