Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计通过

ast-grep搜索结果 grep

Agent Skill

ast-grep 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,609

周安装

146

GitHub Stars

131

下载量

1,133
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ast-grep(搜索结果 grep)
来源仓库:https://github.com/pproenca/dot-skills
仓库路径:skills/ast-grep
安装命令:
npx skills add https://github.com/pproenca/dot-skills --skill ast-grep
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/pproenca/dot-skills --skill ast-grep

简介

用于记录任务执行中的错误、用户纠正和经验缺口,适合让 Agent 持续沉淀问题和修正最佳实践时使用。

  • 适用于 ast-grep 搜索结果相关的信息整理,可结合来源仓库进一步核验用法。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。
  • 安装前建议检查是否会触发联网、命令执行或文件读写,确保操作边界清晰。
  • ast-grep 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ast-grep Community Best Practices

Comprehensive best practices guide for ast-grep rule writing and usage, maintained by the ast-grep community. Contains 46 rules across 8 categories, prioritized by impact to guide automated rule generation and code transformation.

When to Apply

Reference these guidelines when:

  • Writing new ast-grep rules for linting or search
  • Debugging patterns that don't match expected code
  • Optimizing rule performance for large codebases
  • Setting up ast-grep projects with proper organization
  • Reviewing ast-grep rules for correctness and maintainability

General Workflow

Follow this workflow when creating ast-grep rules for code search:

Step 1: Understand the Query

Clarify what you want to find:

  • Target programming language
  • Edge cases to handle
  • What to include vs exclude

Step 2: Create Example Code

Write a sample code snippet representing the desired match pattern.

Step 3: Write the ast-grep Rule

Choose the right approach:

  • Use pattern for simple structures
  • Use kind with has/inside for complex structures
  • Combine with all, any, or not for compound queries
  • Always use stopBy: end for relational rules (inside, has) to ensure complete search

Step 4: Test the Rule

# Inspect AST structure
ast-grep run --pattern '[code]' --lang [language] --debug-query=ast

# Test inline rule
echo "[code]" | ast-grep scan --inline-rules "[rule]" --stdin

# Test from file
ast-grep scan --rule [file.yml] [path]

Step 5: Search the Codebase

Deploy the validated rule:

# Search with pattern (simple matches)
ast-grep run --pattern '[pattern]' --lang [language] [path]

# Search with rule file (complex queries)
ast-grep scan --rule [file.yml] [path]

# Apply fixes interactively
ast-grep scan --rule [file.yml] --interactive [path]

Quick Tips

  1. Always use stopBy: end - Ensures complete subtree traversal for relational rules
  2. Start simple, add complexity - Begin with patterns, progress to kinds, then relational rules
  3. Debug with AST inspection - Use --debug-query=ast to verify structure matching
  4. Escape in inline rules - Use \$VAR or single quotes for shell commands
  5. Test in playground first - Use https://ast-grep.github.io/playground.html for rapid iteration

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Pattern CorrectnessCRITICALpattern-
2Meta Variable UsageCRITICALmeta-
3Rule CompositionHIGHcompose-
4Constraint DesignHIGHconst-
5Rewrite CorrectnessMEDIUM-HIGHrewrite-
6Project OrganizationMEDIUMorg-
7Performance OptimizationMEDIUMperf-
8Testing & DebuggingLOW-MEDIUMtest-

Quick Reference

1. Pattern Correctness (CRITICAL)

2. Meta Variable Usage (CRITICAL)

3. Rule Composition (HIGH)

4. Constraint Design (HIGH)

5. Rewrite Correctness (MEDIUM-HIGH)

6. Project Organization (MEDIUM)

7. Performance Optimization (MEDIUM)

8. Testing & Debugging (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

  • AGENTS.md - Complete compiled guide with all rules

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.73%
按下载量换算337

Codex

21.86%
按下载量换算248

OpenCode

17.43%
按下载量换算197

Gemini CLI

11.96%
按下载量换算136

Antigravity

6.59%
按下载量换算75

windsurf

3.63%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pproenca/dot-skills --skill ast-grep;npx skills add pproenca/dot-skills --skill "ast-grep" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills