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 fmind/dot --skill ast-grepgit clone --depth 1 https://github.com/fmind/dotWrote 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/fmind/dot/ast-grep)<a href="https://agentmods.dev/skills/fmind/dot/ast-grep"><img src="https://agentmods.dev/badge/skills/fmind/dot/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/fmind/dot/ast-grep"><img src="https://agentmods.dev/badge/skills/fmind/dot/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.00019 | $0.01118 |
| Opus 5.5 | $0.00008 | $0.00447 |
| Sonnet 5.5 | $0.00004 | $0.00224 |
| Haiku 4.5 | $0.00002 | $0.00112 |
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 14d 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 — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ast-grep
Structural code search and rewrite: a pattern is real code with meta-variables, matched against the syntax tree. A call-expression pattern distinguishes a call from similar text inside a string or comment; string and comment nodes can also be matched deliberately. Use it where rg gives false positives; plain text search stays with rg.
Commands
ast-grep outline -l python src/ # symbols, imports, and members per file
ast-grep run -p 'print($$$ARGS)' -l python src/ # scope search to the relevant source
ast-grep run -p 'print($$$ARGS)' -r 'logger.info($$$ARGS)' -l python src/ # dry run: prints the diff, changes nothing
ast-grep run -p 'print($$$ARGS)' -r 'logger.info($$$ARGS)' -l python --update-all src/ # apply after reviewing the dry run (-i to confirm per hunk)
ast-grep run -p 'os.getenv($KEY)' -l python --json=compact src/ # structured output after narrowing paths
ast-grep scan # every rule in sgconfig.yml
ast-grep scan -r rules/no-print.yml --format github # one rule file; GitHub annotations in CI
Workflow
- Write the pattern as code:
$NAMEmatches one node,$$$NAMEa sequence (arguments, statements),$_a node without binding; always pass-l <lang>so the pattern parses in the right grammar, and use--debug-query=astwhen a pattern that should match does not. - Search first: map unfamiliar files with
ast-grep outlinebefore reading full source; pass the relevant path or--globs; use--files-with-matcheswhen only filenames are needed, then read selected matches with-C 2. Use JSON only for structured processing. Widen scope deliberately, and use--no-ignore vcs(orhidden; the flag requires a value) only when skipped files are relevant. - Rewrite in two steps: add
-rto see the diff, then--update-all(or-ifor an interactive session); captured meta-variables are reused in the replacement. - Promote to a rule: for a lint or a repeated refactor,
ast-grep new projectscaffoldssgconfig.ymlandrules/; a rule file hasid,language,rule(pattern,kind,inside,has,not), optionalfix,severity, andmessage;ast-grep testruns itsvalidandinvalidcases. - Wire into the gate: run
ast-grep scaninsidecheck:lint(see mise) so hooks and CI apply the same rules.
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.
- 14d ago Changed c8c9bd70442f
- 15d ago Changed · +1 lines · +1 tokens per session 1d94a9193ee1
- 23d ago Changed 4873b050e5a9
- 26d ago Changed · +1 lines eabfd47020fe
- 1mo ago Changed · +1 lines · -25 tokens per session 62138cb71c09
- 1mo ago Changed · +1 lines 512e97bed462
- 1mo ago Changed · -7 lines 05023224d2bb
- 1mo ago First seen · 57 lines · 43 tokens per session scan A 0762aa76e687
ast-grep is a skill published in the GitHub repository fmind/dot (12 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 1,118 once invoked, about $0.0001 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-09-03.
Other skills, from other repositories
diff-review
Inspect changed code in an exact diff, patch, branch, PR, or candidate for correctness defects. Use for pre-merge or self-review, spec compliance, test gaps, and regression risk — not whole-repo audit, release go/no-go, or plan review.
repository-review
Audit a whole repository across architecture, source, tests, tooling, security, CI/CD, docs, and releases. Use for cross-cutting audits, readiness, or technical-debt reviews with ranked findings — not one diff or release candidate.
systematic-debugging
Diagnose unknown-cause bugs, test/build or auth failures, flakes, and runtime performance regressions. Investigate, reduce, localize, falsify hypotheses, and explain root cause before implementation.
dotfiles-bootstrap
Bootstrap a workstation with the dotfiles framework. Takes a GitHub user / owner+repo / explicit clone URL and runs dot init (which shells out to chezmoi) with the right safety prompts. Honors the active agent profile (ask / plan / apply / audit) so it defaults to dry-run in safer modes and full apply in apply.
vibe
Delegate a coding task to a cheap AI model (Mistral Vibe by default, but any provider Vibe knows about — DeepSeek, Gemini Flash, etc.) and supervise the result via git diff. Claude orchestrates, the cheap model codes. Claude consumes 500-1500 tokens per delegation regardless of how many file reads the delegate does…
poke-holes
Adversarial verification with three competing agents (issue-finder, disprover, judge). Triggers "double check", "are you sure", "poke holes", or a critical fix before production.