Back to list
anntnzrb

ast-grep

by anntnzrb

Configurations for LLM Harnesses

0🍴 0📅 Jan 23, 2026

SKILL.md


name: ast-grep description: "Read-only structural code search with ast-grep/sg. Grep/rg/sed alternative for AST-aware CLI exploration, pattern search, and fast code discovery. Activates on ast-grep/sg, structural search, AST search, find usages, tree-sitter."

ast-grep

Overview

Read-only CLI search with sg or ast-grep. AST-aware grep for code exploration and SWE tasks.

Quick start

  • Prefer sg. Fallback ast-grep. Last resort: nix run nixpkgs#ast-grep --.
  • Basic pattern search:
    • sg -p 'console.log($MSG)' -l ts src
  • Files with matches only:
    • sg -p 'console.log($$$)' -l ts --files-with-matches src
  • Show JSON (stream):
    • sg -p 'console.log($$$)' -l ts --json=stream src

Workflow

  • Locate: start with narrow paths + --globs include/exclude.
  • Verify language: set -l/--lang for stdin or ambiguous files.
  • Inspect: use --debug-query or --inspect summary when matches surprise.
  • Report: --files-with-matches or --json=stream for pipelines.
  • Prefer read-only search; skip rewrite flags.

Tasks

  • Pattern search: run (default) with -p/--pattern.
  • Context: -A/-B/-C for line context.
  • Performance: narrow paths, --globs, --files-with-matches, --json=stream.

Guardrails

  • Read-only: never use --rewrite, -r, --update-all, or --interactive.
  • Stdin requires --lang.

Resources

  • reference.md: patterns, strictness, selectors, output formats.
  • cookbook/: practical recipes.

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon