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 wunki/dotfiles --skill ast-grepgit clone --depth 1 https://github.com/wunki/dotfilesWrote 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/wunki/dotfiles/ast-grep)<a href="https://agentmods.dev/skills/wunki/dotfiles/ast-grep"><img src="https://agentmods.dev/badge/skills/wunki/dotfiles/ast-grep/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wunki/dotfiles/ast-grep"><img src="https://agentmods.dev/badge/skills/wunki/dotfiles/ast-grep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00070 | $0.00776 |
| Opus 5.5 | $0.00028 | $0.00310 |
| Sonnet 5.5 | $0.00014 | $0.00155 |
| Haiku 4.5 | $0.00007 | $0.00078 |
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 1mo 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 — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Use ast-grep (sg) when the task depends on code structure: calls, imports, functions, components, conditionals, object literals, nested constructs, or safe repeated rewrites.
Prefer rg for plain text/content search.
Default commands
Check availability:
ast-grep --version || sg --version
Search by AST pattern:
ast-grep run --lang <language> -p '<pattern>' [path]
# short form when sg is installed:
sg run --lang <language> -p '<pattern>' [path]
Use JSON when output may be parsed or large:
ast-grep run --lang ts -p 'console.log($$$ARGS)' --json=stream
Preview rewrites before applying:
ast-grep run --lang js -p 'var $NAME = $VALUE' -r 'let $NAME = $VALUE'
ast-grep run --lang js -p 'var $NAME = $VALUE' -r 'let $NAME = $VALUE' --update-all
Only use --update-all after inspecting the preview.
Pattern reminders
- Patterns should look like real source code in the target language.
$Acaptures one AST node.$$$ARGScaptures zero or more nodes.- Always set
--langexplicitly (js,ts,jsx,tsx,json,yaml,python,go,rust, etc.). - Quote patterns with single quotes to avoid shell expansion.
- If a pattern fails unexpectedly, inspect it with
--debug-query=ast.
Common patterns
# console calls
ast-grep run --lang ts -p 'console.log($$$ARGS)'
# function declarations
ast-grep run --lang ts -p 'function $NAME($$$ARGS) { $$$BODY }'
# React hook usage
ast-grep run --lang tsx -p 'useEffect($$$ARGS)'
# imports from a package
ast-grep run --lang ts -p 'import { $$$IMPORTS } from "$PKG"'
# YAML key/value shape
ast-grep run --lang yaml -p '$KEY: $VALUE'
Rule workflow
For complex searches or reusable rules:
- Start from a small code example that should match.
- Write the simplest working
-ppattern first. - Add YAML rule constraints only after the basic pattern works.
- Use
--json=streamand/or--debug-query=astto inspect matches. - If it fails, remove constraints and debug one condition at a time.
- Preview rewrites; apply only after reviewing matches.
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.
- 1mo ago First seen · 89 lines · 70 tokens per session scan A 9f050a64f883
ast-grep is a skill published in the GitHub repository wunki/dotfiles (47 stars, last pushed 5d ago), licensed MIT. It adds 70 tokens to every session and 776 once invoked, about $0.0003 per session on Opus 5.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-08-30.
Other skills, from other repositories
diagnose-ci
Investigate failing REMOTE CI runs on GitHub Actions: find the failed run, pull the failed-step logs with gh, identify the root cause (compile error, test failure, lint, missing secret, timeout), and recommend a fix. Read-only: it does not commit, push, or edit. Use when CI is red, a GitHub Actions run failed, or the…
triage-dotfiles-env
Playbook of known failure modes in this dotfiles stack: pipx "bad interpreter" after Python rebuilds, gpg commit-signing failures, direnv/nix shellHook running bash instead of zsh, Powerlevel10k instant-prompt warnings, and Neovim plugin errors from removed Lua APIs. Use when a shell startup error, git signing…
fix-and-retry
Diagnose a failing CI run, apply the code fix, commit it, push, and watch the re-run until it passes or fails -- the full fix-and-retry loop in one shot. Use after a pipeline fails and the user says "fix it and retry", "fix the CI and push", or "make CI green". Do NOT use for a read-only investigation that stops at a…
diagnose-runtime
Triage LOCAL runtime failures on your own machine: crashes and errors, hangs and deadlocks, slowness and high CPU/memory, and hardware/serial/USB issues. Method: reproduce, isolate (bisect, log, strace/dtruss, sample), form a hypothesis, verify the fix holds. Read-mostly: it inspects processes and logs, it does not…
save-debug-experience
Record a debugging session's findings into a timestamped markdown file under debugexperience/. Captures problem, root cause, solution, and key learnings in a structured, reusable format. Use when: you've just resolved a non-obvious bug, found an undocumented edge case, encountered an issue that took multiple attempts…
heap-snapshot-inspection
Investigating memory issues and leaks in Chromium-based environments (Chrome, Node.js, Electron) using heap snapshots and the @paulirish/agents CLI.