Skip to content

feat(ast-grep): add ast-grep plugin to marketplace - #86

Merged
amondnet merged 5 commits into
mainfrom
feat/add-ast-grep-plugin
Mar 12, 2026
Merged

feat(ast-grep): add ast-grep plugin to marketplace#86
amondnet merged 5 commits into
mainfrom
feat/add-ast-grep-plugin

Conversation

@amondnet

@amondnet amondnet commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ast-grep plugin sourced from ast-grep/agent-skill
  • Installs the ast-grep skill via bunx skills add for AST-based structural code search
  • Updates marketplace config, release-please config, and README

Plugin Details

Source: ast-grep/agent-skill (by Herrington Darkholme)
License: MIT

The skill activates automatically when users need to:

  • Search codebases using AST patterns rather than text search
  • Find specific language constructs (async functions, class methods, etc.)
  • Perform complex code queries with structural matching

Changes

  • plugins/ast-grep/.claude-plugin/plugin.json — plugin manifest
  • plugins/ast-grep/.agents/skills/ast-grep/SKILL.md — skill (managed by skills.sh)
  • plugins/ast-grep/.agents/skills/ast-grep/references/rule_reference.md — rule docs
  • plugins/ast-grep/skills-lock.json — version lock
  • .claude-plugin/marketplace.json — new marketplace entry
  • release-please-config.json — new package entry
  • README.md — new Built-in Plugins entry

Test plan

  • /plugin marketplace add pleaseai/claude-code-plugins
  • /plugin install ast-grep@pleaseai
  • Verify skill loads when asking about AST-based code search

Summary by cubic

Adds the ast-grep plugin to the marketplace for structural code search using AST patterns, with a skill to help write and test rules. Preloads quick-start usage and a link to the skill at session start via CONTEXT.md, and updates marketplace, docs, and releases so users can install ast-grep@pleaseai.

  • New Features
    • Added plugin from ast-grep/agent-skill (MIT): manifest, skill guide, rule reference, and a plugin README with a simple prompting guide.
    • Added a session-start hook that reads CONTEXT.md to show ast-grep usage and point to the ast-grep skill.
    • Updated .claude-plugin/marketplace.json, README.md, and release-please-config.json; added skills-lock.json to pin the source.

Written for commit 9c621cf. Summary will update on new commits.

Adds the ast-grep plugin sourced from ast-grep/agent-skill, providing
structural code search and analysis using Abstract Syntax Tree (AST)
patterns. The plugin includes the ast-grep skill with comprehensive
rule-writing documentation and reference guides.
@vercel

vercel Bot commented Mar 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
claude-code-plugins Ready Ready Preview, Comment Mar 12, 2026 2:52am

Request Review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the ast-grep plugin, significantly enhancing the platform's code analysis capabilities by allowing users to perform structural code searches based on Abstract Syntax Tree (AST) patterns. This enables more precise and complex code queries than traditional text-based searches, facilitating tasks like finding specific language constructs or refactoring code.

Highlights

  • New Plugin: ast-grep: The ast-grep plugin has been added to the marketplace, enabling structural code search and analysis using Abstract Syntax Tree (AST) patterns.
  • Skill Installation: The ast-grep skill is now installable via bunx skills add, providing capabilities for AST-based code search.
  • Configuration Updates: The marketplace configuration, release-please configuration, and the main README have been updated to include the new ast-grep plugin.
Changelog
  • .claude-plugin/marketplace.json
    • Added a new entry for the ast-grep plugin.
  • README.md
    • Updated the Built-in Plugins section to include ast-grep.
  • plugins/ast-grep/.agents/skills/ast-grep/SKILL.md
    • Added the ast-grep skill definition and a comprehensive guide for its usage.
  • plugins/ast-grep/.agents/skills/ast-grep/references/rule_reference.md
    • Added detailed documentation for ast-grep rule syntax, covering atomic, relational, and composite rules.
  • plugins/ast-grep/.claude-plugin/plugin.json
    • Added the plugin manifest file for ast-grep.
  • plugins/ast-grep/skills-lock.json
    • Added the skill version lock file for ast-grep.
  • release-please-config.json
    • Added a new package configuration for the ast-grep plugin.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the ast-grep plugin, which provides skills for structural code search. The changes correctly add the plugin manifest, skill files, marketplace entry, and release configuration. The implementation is solid, with just one minor suggestion to align the plugin's author metadata with repository conventions for external plugins.

Comment thread plugins/ast-grep/.claude-plugin/plugin.json
@amondnet amondnet self-assigned this Mar 12, 2026
@amondnet
amondnet merged commit 9b85ab8 into main Mar 12, 2026
7 checks passed
@amondnet
amondnet deleted the feat/add-ast-grep-plugin branch March 12, 2026 02:53

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/ast-grep/.agents/skills/ast-grep/references/rule_reference.md">

<violation number="1" location="plugins/ast-grep/.agents/skills/ast-grep/references/rule_reference.md:147">
P2: Don't recommend `stopBy: end` as the default. It changes relational rules from direct-neighbor matching to whole-tree traversal, so readers will overmatch unless they intentionally need a deep search.</violation>
</file>

<file name="plugins/ast-grep/.agents/skills/ast-grep/SKILL.md">

<violation number="1" location="plugins/ast-grep/.agents/skills/ast-grep/SKILL.md:179">
P2: This Python example uses an invalid ast-grep pattern, so copying it will not produce a working search.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.


**field**: Specifies a sub-node within the target node that should match the relational rule. Only for `inside` and `has`.

**Best Practice**: When unsure, always use `stopBy: end` to ensure the search goes to the end of the direction.

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Don't recommend stopBy: end as the default. It changes relational rules from direct-neighbor matching to whole-tree traversal, so readers will overmatch unless they intentionally need a deep search.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/ast-grep/.agents/skills/ast-grep/references/rule_reference.md, line 147:

<comment>Don't recommend `stopBy: end` as the default. It changes relational rules from direct-neighbor matching to whole-tree traversal, so readers will overmatch unless they intentionally need a deep search.</comment>

<file context>
@@ -0,0 +1,297 @@
+
+**field**: Specifies a sub-node within the target node that should match the relational rule. Only for `inside` and `has`.
+
+**Best Practice**: When unsure, always use `stopBy: end` to ensure the search goes to the end of the direction.
+
+## Composite Rules
</file context>
Fix with Cubic

ast-grep run --pattern 'console.log($ARG)' --lang javascript .

# Search specific files
ast-grep run --pattern 'class $NAME' --lang python /path/to/project

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This Python example uses an invalid ast-grep pattern, so copying it will not produce a working search.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/ast-grep/.agents/skills/ast-grep/SKILL.md, line 179:

<comment>This Python example uses an invalid ast-grep pattern, so copying it will not produce a working search.</comment>

<file context>
@@ -0,0 +1,323 @@
+ast-grep run --pattern 'console.log($ARG)' --lang javascript .
+
+# Search specific files
+ast-grep run --pattern 'class $NAME' --lang python /path/to/project
+
+# JSON output for programmatic use
</file context>
Fix with Cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/ast-grep/README.md">

<violation number="1" location="plugins/ast-grep/README.md:17">
P1: Document the required `ast-grep` CLI prerequisite here. The plugin only installs a skill, so these steps alone leave users without the `ast-grep` binary that the skill tells Claude to run.</violation>
</file>

<file name="plugins/ast-grep/hooks/context.sh">

<violation number="1" location="plugins/ast-grep/hooks/context.sh:2">
P2: This hook duplicates the ast-grep skill and forces its instructions into every startup session. Prefer the existing skill only; otherwise you'll pay the token cost on unrelated sessions and have two prompt sources to keep in sync.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.


This approach is best suited for general code queries and explorations within your projects.

## Installation

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Document the required ast-grep CLI prerequisite here. The plugin only installs a skill, so these steps alone leave users without the ast-grep binary that the skill tells Claude to run.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/ast-grep/README.md, line 17:

<comment>Document the required `ast-grep` CLI prerequisite here. The plugin only installs a skill, so these steps alone leave users without the `ast-grep` binary that the skill tells Claude to run.</comment>

<file context>
@@ -0,0 +1,26 @@
+
+This approach is best suited for general code queries and explorations within your projects.
+
+## Installation
+
+```sh
</file context>
Fix with Cubic

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cat "${CLAUDE_PLUGIN_ROOT}/CONTEXT.md" No newline at end of file

@cubic-dev-ai cubic-dev-ai Bot Mar 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This hook duplicates the ast-grep skill and forces its instructions into every startup session. Prefer the existing skill only; otherwise you'll pay the token cost on unrelated sessions and have two prompt sources to keep in sync.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/ast-grep/hooks/context.sh, line 2:

<comment>This hook duplicates the ast-grep skill and forces its instructions into every startup session. Prefer the existing skill only; otherwise you'll pay the token cost on unrelated sessions and have two prompt sources to keep in sync.</comment>

<file context>
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+cat "${CLAUDE_PLUGIN_ROOT}/CONTEXT.md"
\ No newline at end of file
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant