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 aivrar/portable-hermes-agent --skill ast-grepgit clone --depth 1 https://github.com/aivrar/portable-hermes-agentWrote 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/aivrar/portable-hermes-agent/ast-grep)<a href="https://agentmods.dev/skills/aivrar/portable-hermes-agent/ast-grep"><img src="https://agentmods.dev/badge/skills/aivrar/portable-hermes-agent/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/aivrar/portable-hermes-agent/ast-grep"><img src="https://agentmods.dev/badge/skills/aivrar/portable-hermes-agent/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.00016 | $0.03452 |
| Opus 5 | $0.00008 | $0.01726 |
| Sonnet 5 | $0.00003 | $0.00690 |
| Haiku 4.5 | $0.00002 | $0.00345 |
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 7d 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.
This is a copy
100% identical to ast-grep — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ast-grep
ast-grep (binary also named sg) is an AST-aware search and rewrite tool across 25 languages. It treats your pattern as code, parses it the same way it parses your project, and matches structurally. It is the right tool whenever your question depends on code shape rather than text bytes.
This skill ships a Python wrapper at scripts/ast_grep_helper.py and platform install scripts at install.sh (POSIX) and install.ps1 (Windows). The helper adds offline pattern validation, the two-pass write trick, and binary auto-resolution. Use it as your default entry point.
Upstream source: vendored from code-yeongyu/ast-grep-skill (MIT), as shipped in oh-my-openagent's shared-skills bundle.
When to use this skill
Use it whenever the question is about code structure, not bytes:
- "Find every function that takes a
Requestparameter." - "Rewrite every
console.log(x)tologger.info(x)." - "Strip every
as anycast." - "Replace
require(...)withimportacross the repo." - "Find empty catch blocks."
- "Migrate
Optional[X]toX | None." - "Apply this codemod across these 200 files."
- "Run our YAML lint rules and surface violations."
Switch to search_files (or plain rg) when the question is text-shaped (string literal contents, comments, license headers, file names, cross-language regex). When in doubt, ask: "does the answer depend on the language's syntax tree, or just on the file's bytes?" If the former, ast-grep. If the latter, search_files.
Hermes integration notes:
- Run the helper and
sgthrough theterminaltool. Single-quote every pattern so the shell never expands$VAR. - For find→read chains around matches, use
--json-outand process withexecute_coderather than piping through interpreters. - This complements (does not replace) Hermes's
patchtool:patchis for targeted edits you author; ast-grep is for pattern-driven bulk rewrites across many sites.
What ships with it
13 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.
- install.ps1 7.0 KB runs code
- install.sh 7.4 KB runs code
- LICENSE 1.0 KB
- references/cli.md 7.1 KB
- references/install.md 5.5 KB
- references/patterns.md 5.4 KB
- references/pitfalls.md 8.7 KB
- references/recipes.md 7.7 KB
- references/sgconfig.md 6.3 KB
- references/yaml-rules.md 11 KB
- scripts/ast_grep_helper.py 27 KB runs code
- tests/smoke.ps1 5.6 KB runs code
- tests/smoke.sh 7.6 KB runs code
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.
- 7d ago First seen · 289 lines · 16 tokens per session scan A e5404b443ee1
ast-grep is a skill published in the GitHub repository aivrar/portable-hermes-agent (217 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 3,452 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to ast-grep, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
ha-self-diagnosis
Self-understanding and issue reporting for Hope Agent itself. Use when the user asks how Hope Agent works internally, asks about its own source code/docs/runtime behavior, reports a bug/failure/slowness/crash, asks to diagnose logs, or asks to create/submit a GitHub issue for a bug, feature request, or improvement…
rag-index-decisions
After making a non-obvious architectural decision, solving a novel bug, agreeing on a coding standard, or reaching a conclusion worth remembering, index it back into the knowledge base so the next occurrence is one search away. Uses adddocument or addfromurl. Closes the feedback loop that makes a RAG-backed team…
olares-doctor
Runtime diagnosis for Olares apps and the system via olares-cli — find the root cause when an app won't install or start, crashes, cannot pull an image, is running but unreachable, or is slow; includes doctor images and thirdleveldomain. Use for diagnosing catalog and dev app failures, not for authoring or editing…
log-analyzer
Parse agent log files to identify error patterns, rate limit hits, timeout clusters, tool failures, and component-level error counts. Produces a structured anomaly report. Cron-compatible — silent if no issues, alert digest if anomalies found. Also computes per-tool failure rates from a Hermes profile state.db…
feishu-troubleshoot
A Feishu troubleshooting tool with FAQs and diagnostic commands. Feishu is a collaboration platform with online documents and workplace services.
worth-fix
A verification and decision-making guide for checking whether bug reports, claims, proposals, or refactoring ideas are true and worth acting on.