ast-grep-typescript-react

ast-grep-typescript-react is a skill for Claude Code, Codex from pproenca/dot-skills. It costs 129 tokens per session (1,266 once invoked), scanned A, original, MIT.

A guide for writing and debugging ast-grep patterns and code transformations for TypeScript and React. ast-grep is a tool that searches source code by its structure and can rewrite matching code.

In plain words
What is it for?
Use it to find or rewrite React elements, props, hooks, imports, and TypeScript types, or to diagnose patterns that match nothing.
Why use it?
It helps avoid silent failures caused by using the wrong parser or syntax rules, especially when searching JSX or TypeScript constructs. It also explains how to build reliable rules and codemods.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it to find or rewrite React elements, props, hooks, imports, and TypeScript types, or to diagnose patterns that match nothing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pproenca/dot-skills/ast-grep-typescript-react
Install

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.

Any agent
npx skills add pproenca/dot-skills --skill ast-grep-typescript-react
Clone the repo
git clone --depth 1 https://github.com/pproenca/dot-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for ast-grep-typescript-react

README.md
[![agentmods](https://agentmods.dev/badge/skills/pproenca/dot-skills/ast-grep-typescript-react/github.svg)](https://agentmods.dev/skills/pproenca/dot-skills/ast-grep-typescript-react)
Your own site
<a href="https://agentmods.dev/skills/pproenca/dot-skills/ast-grep-typescript-react"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/ast-grep-typescript-react/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.

agentmods 80×15 button for ast-grep-typescript-react

Your own site · 80×15
<a href="https://agentmods.dev/skills/pproenca/dot-skills/ast-grep-typescript-react"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/ast-grep-typescript-react.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,266 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00129 $0.01266
Opus 5.5 $0.00052 $0.00506
Sonnet 5.5 $0.00026 $0.00253
Haiku 4.5 $0.00013 $0.00127

Measured 2mo ago against content hash 98e79e0b4f12, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ast-grep-typescript-react 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 2mo 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.

skills/.experimental/ast-grep-typescript-react/SKILL.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ast-grep for TypeScript & React

The wrong defaults a capable model hits when pointing ast-grep at .ts/.tsx code — mostly cases where a rule silently matches nothing because the language or a node kind was guessed wrong. This skill assumes you already know ast-grep's rule mechanics (patterns, meta-variables, all/any/has/inside, constraints); it corrects only what TypeScript and React add on top.

For general ast-grep rule-writing mechanics, use the companion ast-grep skill.

When to Apply

  • Writing an ast-grep pattern or YAML rule whose target is .ts or .tsx code
  • Searching for JSX elements, props, React hooks, imports, or TS type constructs
  • Building a codemod that rewrites JSX or TypeScript (rename a component, strip React.FC, migrate imports)
  • A rule "matches nothing" on TSX and you don't know why (usually the language or a node kind)
  • Driving ast-grep programmatically from a JS/TS script via @ast-grep/napi

First moves when a TS/React rule misbehaves

  1. Check the language. JSX-bearing files must run under tsx, never typescript. This is the single most common cause of silent no-match. See lang-tsx-for-jsx.
  2. Debug the pattern's AST. ast-grep run --pattern '<your pattern>' --lang tsx --debug-query=ast on a real snippet shows the node kinds and reveals ERROR nodes. Trust this over guessed kind names.
  3. Wrap fragments. If the pattern is an attribute, prop, or type annotation, it needs context + selector. See ctx-fragment-context-selector.

Rule Categories

# Category Prefix Covers
1 Language Selection lang tsx-vs-typescript split, scanning .ts + .tsx, languageGlobs
2 Fragment Matching ctx context/selector for JSX attrs, props, type annotations
3 JSX Node Kinds jsx self-closing vs paired elements, attribute-value metavariables
4 TypeScript Constructs ts type-only imports, as casts, React.FC generics
5 Rewrites & Codemods fix re-emitting JSX metavars so children/props aren't dropped
6 Programmatic Use napi @ast-grep/napi Lang.Tsx, NapiConfig shape

Read the full file on GitHub · 68 lines

Changes

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.

  1. 2mo ago First seen · 68 lines · 129 tokens per session scan A 98e79e0b4f12

Subscribe to this mod's changes

ast-grep-typescript-react is a skill published in the GitHub repository pproenca/dot-skills (231 stars, last pushed 3mo ago), licensed MIT. It adds 129 tokens to every session and 1,266 once invoked, about $0.0005 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.

Related

ast-grep-typescript-react compared with skills from other repositories

ast-grep-typescript-react next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ast-grep-typescript-reactpproenca/dot-skillsSkill2313mo agoMITA129Claude Code, Codex
custom-featuresTanStack/tableSkill29k7d agoMITA35Claude Code, Codex
fast-typescript-checkinternet-development/www-sacredSkill1.6k14d agoMITA84Claude Code, Codex
port-sacred-terminal-ui-to-typescript-cliinternet-development/www-sacredSkill1.6k14d agoMITA0Claude Code, Codex
adding-personhog-rpcPostHog/posthogSkill41ktodaynoneA88Claude Code, Codex
splitting-oversized-modulesPostHog/posthogSkill41ktodaynoneA197Claude Code, Codex
developing-the-cliPostHog/posthogSkill41ktodaynoneA186Claude Code, Codex