feat(ast-grep): add ast-grep plugin to marketplace - #86
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello, 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 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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>
| ast-grep run --pattern 'console.log($ARG)' --lang javascript . | ||
|
|
||
| # Search specific files | ||
| ast-grep run --pattern 'class $NAME' --lang python /path/to/project |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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>
| @@ -0,0 +1,2 @@ | |||
| #!/usr/bin/env bash | |||
| cat "${CLAUDE_PLUGIN_ROOT}/CONTEXT.md" No newline at end of file | |||
There was a problem hiding this comment.
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>
Summary
ast-grepplugin sourced from ast-grep/agent-skillast-grepskill viabunx skills addfor AST-based structural code searchPlugin Details
Source:
ast-grep/agent-skill(by Herrington Darkholme)License: MIT
The skill activates automatically when users need to:
Changes
plugins/ast-grep/.claude-plugin/plugin.json— plugin manifestplugins/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 docsplugins/ast-grep/skills-lock.json— version lock.claude-plugin/marketplace.json— new marketplace entryrelease-please-config.json— new package entryREADME.md— new Built-in Plugins entryTest plan
/plugin marketplace add pleaseai/claude-code-plugins/plugin install ast-grep@pleaseaiSummary by cubic
Adds the
ast-grepplugin 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 viaCONTEXT.md, and updates marketplace, docs, and releases so users can installast-grep@pleaseai.ast-grep/agent-skill(MIT): manifest, skill guide, rule reference, and a plugin README with a simple prompting guide.CONTEXT.mdto show ast-grep usage and point to theast-grepskill..claude-plugin/marketplace.json,README.md, andrelease-please-config.json; addedskills-lock.jsonto pin the source.Written for commit 9c621cf. Summary will update on new commits.