跳到正文
cccskills
免费在 GitHub 公开

ast-grep

Use this skill when the user wants to search code structurally using AST patterns, perform linting, or rewrite code automatically across multiple files.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli星标 56(GitHub 56 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md1.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

ast-grep Plugin

AST-based code structural search, lint, and rewriting.

Commands

Search

  • ast-grep search run — Search using AST pattern

Rewrite

  • ast-grep rewrite run — Rewrite code using pattern and replacement

Lint

  • ast-grep lint run — Run linting rules
  • ast-grep scan run — Scan directory with rules

Usage Examples

  • "Find all usages of $A && $A() pattern in TypeScript"
  • "Replace null coalescing patterns"
  • "Lint the codebase for specific patterns"
  • "Scan src directory for violations"

Installation

npm install --global @ast-grep/cli
# or
cargo install ast-grep
# or
brew install ast-grep

Examples

# Search for AST pattern
ast-grep --pattern 'const $X = $Y' --lang ts

# Rewrite code
ast-grep --pattern '$A && $A()' --lang ts --rewrite '$A?.()'

# Run lint
ast-grep lint

# Scan directory
ast-grep scan src/

Key Features

  • Pattern looks like real code
  • Supports JS, TS, Python, Rust, Go, Java, etc.
  • Use $VAR as wildcard for AST nodes
  • YAML-based lint rules -批量 code rewriting

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use this skill when the user wants to use 100-exercises-to-learn-rust.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3

免费

Use this skill when the user wants to use 2to3, cli tool: 2to3.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-2.7

免费

Use this skill when the user wants to use 2to3-2.7, cli tool: 2to3-2.7.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

2to3-3.11

免费

Use this skill when the user wants to use 2to3-3.11, cli tool: 2to3-3.11.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

411toppm

免费

Use this skill when the user wants to use 411toppm, cli tool: 411toppm.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

53AIHub

免费

Use this skill when the user wants to use 53AIHub.

中文简介正在准备中。当前显示原文说明。

javimosch/supercli562026年10月30日 更新

查看 javimosch 的全部技能

报告此技能的问题