pi-lens-write-ast-grep-rule
Installation
SKILL.md
Writing a pi-lens ast-grep Rule
Drop path: rules/ast-grep-rules/rules/<id>.yml
Same id as a built-in overrides it. Multiple rules per file: separate with ---.
Minimal template
id: no-foo-bar
language: TypeScript # PascalCase — see languages below
severity: warning # error | warning | hint | info — pick by evidence, see below
message: "Avoid foo.bar() — use baz() instead"
note: |
Longer explanation / fix guidance here.
rule:
pattern: foo.bar($ARG)
Pick the severity by the evidence behind the rule, not by feel: