Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add pproenca/dot-skills --skill ast-grepgit clone --depth 1 https://github.com/pproenca/dot-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/pproenca/dot-skills/ast-grep)<a href="https://agentmods.dev/skills/pproenca/dot-skills/ast-grep"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/ast-grep.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00060 | $0.02157 |
| Opus 5 | $0.00030 | $0.01078 |
| Sonnet 5 | $0.00012 | $0.00431 |
| Haiku 4.5 | $0.00006 | $0.00216 |
Grade A, and why
ast-grep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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
patternfor simple structures - Use
kindwithhas/insidefor complex structures - Combine with
all,any, ornotfor compound queries - Always use
stopBy: endfor 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
- Always use
stopBy: end- Ensures complete subtree traversal for relational rules - Start simple, add complexity - Begin with patterns, progress to kinds, then relational rules
- Debug with AST inspection - Use
--debug-query=astto verify structure matching - Escape in inline rules - Use
\$VARor single quotes for shell commands - Test in playground first - Use https://ast-grep.github.io/playground.html for rapid iteration
What ships with it
51 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- AGENTS.md 67 KB
- assets/templates/_template.md 876 B
- metadata.json 969 B
- README.md 4.0 KB
- references/_sections.md 1.8 KB
- references/compose-all-for-and-logic.md 1.3 KB
- references/compose-any-for-or-logic.md 1.4 KB
- references/compose-field-targeting.md 2.9 KB
- references/compose-has-for-children.md 1.4 KB
- references/compose-inside-for-context.md 1.3 KB
- references/compose-matches-for-reuse.md 1.4 KB
- references/compose-not-for-exclusion.md 1.4 KB
- references/compose-precedes-follows.md 2.4 KB
- references/const-kind-filter.md 1.3 KB
- references/const-not-inside-not.md 1.3 KB
- references/const-pattern-constraint.md 1.2 KB
- references/const-post-match-timing.md 1.4 KB
- references/const-regex-filter.md 1.2 KB
- references/meta-multi-match-lazy.md 1.1 KB
- references/meta-named-vs-unnamed.md 1.2 KB
- references/meta-naming-convention.md 1.1 KB
- references/meta-reuse-binding.md 1.2 KB
- references/meta-single-node.md 1.1 KB
- references/meta-underscore-noncapture.md 1.3 KB
- references/org-file-filtering.md 1.3 KB
- references/org-message-clarity.md 1.4 KB
- references/org-project-structure.md 1.4 KB
- references/org-severity-levels.md 1.5 KB
- references/org-unique-rule-ids.md 1.2 KB
- references/pattern-avoid-comments-strings.md 1.1 KB
- references/pattern-context-selector.md 1.0 KB
- references/pattern-debug-ast.md 1.2 KB
- references/pattern-kind-vs-pattern.md 1.2 KB
- references/pattern-language-aware.md 1.0 KB
- references/pattern-nthchild-matching.md 1.7 KB
- references/pattern-range-matching.md 1.9 KB
- references/pattern-strictness-levels.md 1.4 KB
- references/pattern-valid-syntax.md 870 B
- references/perf-avoid-regex-heavy.md 1.5 KB
- references/perf-specific-patterns.md 1.5 KB
- references/perf-stopby-boundaries.md 1.5 KB
- references/perf-thread-parallelism.md 1.4 KB
- references/rewrite-meta-variable-reference.md 1.3 KB
- references/rewrite-preserve-semantics.md 1.3 KB
- references/rewrite-syntax-validity.md 1.4 KB
- references/rewrite-test-before-deploy.md 1.4 KB
- references/rewrite-transform-operations.md 1.4 KB
- references/test-edge-cases.md 1.5 KB
- references/test-playground-first.md 1.4 KB
- references/test-snapshot-updates.md 1.4 KB
- references/test-valid-invalid-cases.md 1.4 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 181 lines · 60 tokens per session scan A 207f3a9604fb
ast-grep is a skill published in the GitHub repository pproenca/dot-skills (203 stars, last pushed 23d ago), licensed MIT. It adds 60 tokens to every session and 2,157 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
adversarial-reviewer
Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.
gsd-ns-review
Route to the appropriate quality / review skill based on the user's intent. gsd-code-review-fix was absorbed by gsd-code-review --fix in #2790.
issue
Use when starting a chain from a GitHub issue — turning an issue URL or number into a triaged, planned, dispatched, and reviewed pull request. Classifies the thread (bug → root-cause discipline, feature → plan chain, question → drafted reply), synthesizes a spec from the issue's own acceptance criteria, then runs the…
gitnexus
A code-graph analysis add-on for examining an existing codebase, including symbols, call paths, execution flows, and effects across repositories. It can query GitNexus through its command-line or MCP interfaces.
cleanup-code-inspections
Reduce technical debt and improve code quality by systematically resolving static analysis warnings.
superlint
This skill describes the mandatory standard operating procedure for using our internal SuperLint tool. Use this when tasks require fixing code quality issues according to corporate standards.