Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
A skill your agent uses when searching or replacing code patterns - use ast-grep instead of text search for semantic accuracy
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install apmantza/pi-lens pi-lens-ast-grep --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pi-lens-ast-grep .claude/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .claude/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grepType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install apmantza/pi-lens pi-lens-ast-grep --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/pi-lens-ast-grep .agents/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .agents/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install apmantza/pi-lens pi-lens-ast-grep --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/pi-lens-ast-grep .cursor/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .cursor/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/apmantza/pi-lens.git --path skills/pi-lens-ast-grep--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install apmantza/pi-lens pi-lens-ast-grep --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/pi-lens-ast-grep .gemini/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .gemini/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install apmantza/pi-lens pi-lens-ast-grepInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/pi-lens-ast-grep .github/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .github/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install apmantza/pi-lens pi-lens-ast-grep --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/apmantza/pi-lens.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/pi-lens-ast-grep .opencode/skills/pi-lens-ast-grep && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pi-lens-ast-grep" agent skill from https://github.com/apmantza/pi-lens/tree/master/skills/pi-lens-ast-grep into .opencode/skills/pi-lens-ast-grep/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pi-lens-ast-grep", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pi-lens-ast-grepA skill your agent uses when searching or replacing code patterns - use ast-grep instead of text search for semantic accuracy
Pi Lens Ast Grep is an agent skill from apmantza/pi-lens. Use when searching or replacing code patterns - use ast-grep instead of text search for semantic accuracy
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The repository describes itself as: Real-time code feedback for pi — LSP, linters, formatters, structural analysis. The licence is MIT.
7 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit db92612. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
ast-grep.github.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Pi Lens Ast Grep loads about 2k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 745 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from apmantza/pi-lens at commit db92612, republished under its MIT licence (© apmantza). 745 words, ~1,987 tokens.
.claude/skills/pi-lens-ast-grep/SKILL.md (or your agent's skills folder).Use ast_grep_search and ast_grep_replace for semantic code search/replace. ast-grep understands code structure, not just text.
These tools (plus ast_grep_outline, lsp_navigation) are registered but inactive by default on hosts that support pi's dynamic tooling. If a call to one of them isn't recognized, activate it first: pi_lens_activate_tools tools=["ast_grep_search", "ast_grep_replace"].
On hosts that aggregate pi-lens behind a single lens tool, the ast_grep_* tools and pi_lens_activate_tools may not be registered at all. There, fall back to the ast-grep CLI (alias sg) — patterns, metavariables, and YAML rules are identical:
# search (≈ ast_grep_search)
ast-grep run -p 'fetchMetrics($$$ARGS)' -l ts src/
# rewrite (≈ ast_grep_replace; -U applies all)
ast-grep run -p 'var $X' -r 'let $X' -l js src/ -U
# full YAML rule (≈ the rule: parameter)
ast-grep scan --rule my-rule.yml src/Structural-intent parameters map to YAML constraints: insideKind → inside: { kind: ..., stopBy: end }, hasKind/hasDescendantKind → has: { kind: ... }, follows → follows: { pattern: ... }, precedes → precedes: { pattern: ... }.
fetchMetrics($ARGS) not fetchMetricspaths to relevant filespaths, then fall back to grepapply: false before apply: truefunction $NAME($$$) { $$$ } not function $NAME(selector unless expert — narrows to AST node kind; does not extract metavariablesfrom "$PATH" matches literal "$PATH", not a wildcard| Syntax | Matches | Named? |
|---|---|---|
$X | single node | yes — captures the node |
$$$ | zero or more nodes | no — unnamed wildcard |
$$$ARGS | zero or more nodes | yes — captures the list |
Use $$$ when you don't need the captured value; $$$NAME when you do.
| Pattern | Matches |
|---|---|
fetchMetrics($ARGS) | call with any single arg |
fetchMetrics($$$ARGS) | call with any number of args |
function $NAME($$$) { $$$ } | function declaration |
import { $NAMES } from $PATH | named import (no quotes on path) |
const $X = $Y | variable declaration |
Use these instead of writing raw YAML:
| Parameter | Tool | What it does |
|---|---|---|
insideKind | both | Only match inside an ancestor of this node kind (searches ALL ancestors, stopBy: end) |
hasKind | both | Only match nodes whose immediate child has this kind (stopBy: neighbor — NOT recursive) |
hasDescendantKind | both | Only match nodes containing this kind anywhere in their descendants (stopBy: end) — use this instead of hasKind when the target isn't a direct child |
follows | both | Only match nodes preceded by a sibling matching this pattern |
precedes | both | Only match nodes followed by a sibling matching this pattern |
hasKind and hasDescendantKind are mutually exclusive on both tools — combining them errors.
⚠ insideKind searches ALL ancestors (stopBy: end) with no boundary of its own — on a deeply nested file it can escalate past the enclosing function you meant and match against an unrelated outer scope; scope with paths or a raw YAML rule: with its own stopBy boundary if that matters.
# console.log only inside functions
ast_grep_search pattern="console.log($MSG)" lang="typescript" insideKind="function_declaration"
# replace var with let, scoped to functions only
ast_grep_replace pattern="var $X" rewrite="let $X" lang="javascript" insideKind="function_declaration"These synthesize a YAML rule automatically. Use rule: for the full DSL when you need all/any/not, nthChild, regex, or other advanced constraints.
rule: parameter)Pass a complete ast-grep YAML rule to unlock the full DSL:
ast_grep_search rule="id: my-rule
language: TypeScript
rule:
pattern: console.log($MSG)
inside:
kind: function_declaration
stopBy: end" lang="typescript"ast_grep_search dump modeWhen a pattern returns zero matches and you don't know the correct node kind or field name, use ast_grep_search with dump=true to inspect a SMALL representative snippet:
ast_grep_search dump=true pattern="function foo() { return 1; }" lang="typescript"Returns the full indented AST with node kinds and positions. Then use the correct kind in your pattern or insideKind.
# console.log inside a class method
pattern: console.log($$$)
inside:
kind: method_definition
stopBy: endUse kind: directly when you want to match a node type without a pattern:
# any arrow function
kind: arrow_function❌ $VAR inside quotes — matches literal "$VAR", not a metavar
from "$PATH" → use grep for wildcard path matching
from "./utils" → ✅ exact string literal works fine
❌ Trailing comma in objects
{ type: $T, } → use { type: $T }
❌ Shorthand property mismatch
{ runnerId: $RID } → won't match { runnerId }
use { runnerId } or { runnerId, $$$REST }
❌ Unnamed $$$ when you need the value
foo($$$) → captures nothing; use foo($$$ARGS) to inspect matches
❌ Multiple top-level statements — triggers "Multiple AST nodes are detected"
Two shapes, two fixes:
1. Sequence inside a block — wrap in braces:
foo(); bar(); → { foo(); bar(); }
2. Cross-context (module-level + block-level together, e.g. an import AND a call) —
wrapping in {} makes the pattern invalid (imports can't live inside a block).
Use two searches: find files containing the import, then scope the call search
to those paths. Or use a YAML `inside:`/`has:` rule (see Composite section above).No matches?
For nodeKind, do not also pass pattern or rule; those forms are mutually exclusive. For rule, provide YAML containing both id and language fields. Use strictness: relaxed when unnamed punctuation is the only mismatch.
strictness: relaxed — ignores unnamed punctuation (trailing commas, semicolons) that smart mode requiresast_grep_search dump=true on a sample snippet to verify the correct node kindgrep or lsp_navigationUse these as starting points, then scope paths tightly.
| Task | Pattern / params |
|---|---|
| Find object-literal function dependency by name | pattern: { resetLSPService: $FN, $$$REST } |
| Find empty catches | pattern: try { $$$BODY } catch ($ERR) { } |
| Find fire-and-forget async calls | pattern: void $CALL |
For lifecycle bugs, search first, then use the returned details.matchLocations[].readSlice handle for bounded context.
Metavar captures appear automatically below each match line:
src/foo.ts:1:1: const x = foo(a, b)
$VAR=x $$$ARGS=a,bNamed captures ($X, $$$NAME) are shown; unnamed wildcards ($$$) are not.
Pagination — use skip: N when results are truncated (next-page hint appears in output).
© apmantza, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/pi-lens-ast-grep of apmantza/pi-lens.
Open the folder on GitHubat commit db92612
Pi Lens Ast Grep next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Pi Lens Ast Grep this skillapmantza/pi-lens | 466 | — | ~2k | Automated safety check: Pass | MIT | |
| Vercel Composition Patternssupabase/supabase | 111k | 58 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 4 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
apmantza/pi-lens
A skill your agent uses when writing a new pi-lens ast-grep rule YAML file — covers schema, drop path, gotchas, and NAPI runner constraints
apmantza/pi-lens
A skill your agent uses when writing a new pi-lens tree-sitter query rule YAML file — covers schema, S-expression syntax, capture names, predicates, and gotchas
apmantza/pi-lens
Navigate code with IDE features and run proactive LSP diagnostics on files/folders/batches.
apmantza/pi-lens
Run the pi-lens release-readiness QA pass — witness the feature × modality matrix against a real pi, count coverage, and issue a ship / ship-with-caveats / don't-ship / blocked line.
apmantza/pi-lens
Run the pi-lens retrospective — turn a session, an incident, or a merged bug fix into environment changes (checks, hooks, contract lines, deletions), classified mechanical-vs-judgement, each with…
Categories
A skill your agent uses when searching or replacing code patterns - use ast-grep instead of text search for semantic accuracy. Pi Lens Ast Grep is an agent skill from apmantza/pi-lens.
Pi Lens Ast Grep fits situations like: replacing code patterns - use ast-grep instead of text search for semantic accuracy.
Run `npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a claude-code`. Or copy the skill folder (skills/pi-lens-ast-grep in apmantza/pi-lens) into .claude/skills/pi-lens-ast-grep in your project. Claude Code loads it when a task matches its description.
Run `npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a codex`. Or copy the skill folder (skills/pi-lens-ast-grep in apmantza/pi-lens) into .agents/skills/pi-lens-ast-grep in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add apmantza/pi-lens --skill pi-lens-ast-grep -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pi-lens-ast-grep, .gemini/skills/pi-lens-ast-grep, .github/skills/pi-lens-ast-grep and .opencode/skills/pi-lens-ast-grep in your project.
SKILL.md names no scripts, command-line tools or credentials: Pi Lens Ast Grep is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: ast-grep.github.io. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Pi Lens Ast Grep is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Pi Lens Ast Grep: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
apmantza (a GitHub user) maintains it in apmantza/pi-lens, which has 466 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 11, 2026.
Source: apmantza/pi-lens on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.