CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

ast-grep-patterns

This reference explains when to use ast-grep instead of plain-text search and provides commands and recipes for finding or rewriting code by structure. It covers checks for error handling, deprecated APIs, SQL injection risks, secret-like literals, and other code patterns, along with troubleshooting and prompt templates. It recommends testing patterns on a small file first and waiting for approval before applying a rewrite in the large-refactor prompt template.

Quality

87%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

SKILL.md
Quality
Evals
Security

Quality

Content

82%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A dense, highly executable reference skill: real commands, complete rule files, and hard-won gotchas with no filler. The only gaps are minor — a version pin that will age, an implied rather than explicit end-to-end workflow, and all recipes living inline in one file.

DimensionReasoningScore

Conciseness

The body is lean and assumes competence — no explanation of what ASTs are, dense tables for tool choice and troubleshooting, and each recipe carries only a non-obvious gotcha (e.g., "stopBy: end makes has search the whole subtree"). Minor trims possible: the "ast-grep 0.51.3" version pin is time-sensitive information outside a deprecated/old-patterns section, and the agent-skill aside ("install command not verified here") adds little.

4 / 5

Actionability

Everything is copy-paste executable: install commands, one-off pattern and rewrite commands with metavariable semantics documented inline, seven complete YAML rule files with ids, and a symptom-to-fix troubleshooting table. Specific examples cover the common cases (async without try/catch, effect cleanup, empty catch, secrets, SQL interpolation), matching the 5 anchor.

5 / 5

Workflow Clarity

Validation checkpoints for batch/destructive rewrites are explicit — "preview first, then add --update-all to apply", "Test each one on a small file before running it across a repository", and prompt templates gating on "wait for my approval before applying a rewrite" — so the batch-operation cap does not apply. It falls short of the 5 anchor because the overall workflow (choose tool → test pattern → preview → apply) is implied by section order and inline notes rather than presented as an explicit sequenced process with error-recovery loops.

4 / 5

Progressive Disclosure

No bundle files exist; the single ~190-line SKILL.md is well-organized with clear headers (Install, When to use it, Quick commands, Rule recipes, Troubleshooting, Prompt templates, Resources) and clearly signaled one-level-deep external links. Matches the 4 anchor: good structure with most content appropriately placed, though the ~90 lines of rule recipes are inlined in the single file rather than split into a referenced rules file, and the skill exceeds the under-50-lines exception that would let structure alone earn a 5.

4 / 5

Total

17

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description that clearly states concrete capabilities, gives explicit "Use when" triggers with natural phrasing and example shapes, and actively disambiguates against Grep. Trigger coverage and capability enumeration have only minor gaps.

DimensionReasoningScore

Specificity

Names the domain and several concrete actions — "Structural code search and refactoring with ast-grep", "choose it over Grep", "write tested pattern and YAML rule recipes" — with concrete shape examples (async functions without try/catch, empty catch blocks). Falls just short of the 5 anchor's comprehensive coverage since capabilities like scanning with rule files or JSON output are only implied by "YAML rule recipes".

4 / 5

Completeness

Explicitly answers what ("Structural code search and refactoring with ast-grep: choose it over Grep, then write tested pattern and YAML rule recipes") and when ("Use when renaming calls or changing an API signature across a large codebase, migrating a framework, or finding code by shape"), plus an explicit negative boundary ("Not for plain text searches, which Grep handles faster"). Matches the 5 anchor: both what and when with concrete trigger phrases.

5 / 5

Trigger Term Quality

Natural phrases users would say are well covered: "renaming calls", "changing an API signature across a large codebase", "migrating a framework", "empty catch blocks", "long parameter lists". A few common variations are missing (e.g., "codemod", "find all usages", "AST"), which fits the 4 anchor (good coverage, a few natural terms missing) rather than the comprehensive 5 anchor.

4 / 5

Distinctiveness Conflict Risk

Clear niche (structural/syntax-tree search and rewrite) with a distinct tool name and an explicit disambiguation from Grep ("Not for plain text searches, which Grep handles faster"). Minimal conflict risk with other search/refactoring skills, matching the 5 anchor.

5 / 5

Total

18

/

20

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

frontmatter_unknown_keys

Unknown frontmatter key(s) found; consider removing or moving to metadata

Warning

Total

15

/

16

Passed

Repository

FlorianBruniaux/claude-code-ultimate-guide

Path

examples/skills/ast-grep-patterns/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.