一键导入
review
Audit grammar / query / binding changes for correctness, performance, and quality. Use when asked to review changes, diffs, or pull requests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit grammar / query / binding changes for correctness, performance, and quality. Use when asked to review changes, diffs, or pull requests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Audit corpus and highlight tests for tests that pass for the wrong reason — designed to pass rather than designed to catch regressions.
Fix multiple GitHub issues on an integration branch. Issues touching different areas (grammar, scanner, queries, bindings, tests) run in parallel worktrees; issues sharing an area or affecting cross-binding code run sequentially. Each goes through fix, simplify, review, and remediation before merging. Use when asked to fix several issues at once.
Complete workflow for fixing GitHub issues — investigation, implementation, review, testing, documentation.
Read a GitHub issue, develop a resolution plan via sequential thinking, rate difficulty/complexity/priority, label low-priority when warranted.
Fetch open GitHub issues and produce a read-only triage report with quick wins and recommended groupings.
Review project activity (issues, commits, changelog) and draft entries for docs/lessons_learned.md.
| name | review |
| description | Audit grammar / query / binding changes for correctness, performance, and quality. Use when asked to review changes, diffs, or pull requests. |
Audit the current change set for correctness, performance, security, and quality problems. Produce concrete, actionable findings.
Determine what to review based on $ARGUMENTS:
| Argument | Scope |
|---|---|
| (empty) | Unstaged + staged changes (git diff HEAD) |
staged | Staged changes only (git diff --cached) |
branch | All commits on current branch vs main (git diff main...HEAD) |
pr <N> | Pull request diff (gh pr diff <N>) |
<commit> | Single commit (git show <commit>) |
<commit>..<commit> | Commit range |
<path or glob> | Full-file review (no diff) |
npx tree-sitter generate) before
reasoning about effects. Stale src/parser.c / src/grammar.json is a
source of spurious findings. The hand-written src/scanner.c is
independent of regeneration.SPECIFICATION.md section. Grammar shape must
match the spec; if it doesn't, the spec may be wrong rather than the
code — flag the divergence either way.docs/lessons_learned.md exists, read it and check whether any lesson
applies.Apply every applicable question. Record each finding:
FINDING: <short title>
FILE: <path>:<line range>
EVIDENCE: <what is wrong and why>
SEVERITY: bug | performance | security | code-smell | test-gap
EFFORT: trivial | small | medium
grammar.js)tree-sitter generate
prints conflicts — verify the diff produces zero conflicts. Conflicts
that are intentional must be listed in the grammar's conflicts array
with a comment pointing to the relevant SPECIFICATION.md section.SPECIFICATION.md §3.1 mirrors the Apache reference grammar's
expression rule; a Groovy operator at the wrong PREC level silently
parses but produces a wrong tree (e.g., putting .. above shifts when
Apache puts them at the same level).token.immediate used where the grammar requires no whitespace
between adjacent tokens (e.g. ?., ??., *., .&, .@, ::, the
as keyword's trailing-context, !instanceof, !in)?repeat that
could match zero or many tokens. The known-tricky Groovy ambiguities
are documented in SPECIFICATION.md §5.3 (label / map / ternary),
§5.4 (slashy vs division), §5.5 (command chain ambiguities).trait_declaration,
enum_declaration): is the rule wired into source_file (or another
producer of _statement / _declaration)? An unwired rule will never
match.field('object', ...), field('property', ...)) match
what queries expect and what SPECIFICATION.md §3.2 promises?SPECIFICATION.md §3.2 that
each Groovy-specific operator emits a distinct named node?
binary_expression with an operator field is correct for symmetric
operators (+, -, ==, etc.) but wrong for Elvis, safe-nav,
spaceship, regex, identity, etc. — those must be their own node kinds.src/scanner.c)tree_sitter_groovy_external_scanner_serialize and deserialised in
…_deserialize? Anything used only within a single scan call may be
a local; anything that must persist across calls (paren depth, GString
nesting stack) must be in the serialised state._slashy_string_start after an
identifier produces wrong parses (a / b becomes a / b /).${ … }? An unbalanced { inside the interpolation must
not close the GString.?,
binary operator, else, etc.).queries/groovy/*.scm)src/node-types.json? Impossible pattern at runtime means the
query references a non-existent node.(method_invocation name: (identifier))
must match the actual field name the grammar uses.#match? regex anchors correct? An unanchored regex over names
will over-match.@function.builtin, @constant, @operator, @keyword)?async, await, defer, var,
record, sealed, non-sealed, permits, yield, val) only
highlighted as @keyword in their keyword positions, not as
identifiers used elsewhere?bindings/)tree_sitter_groovy() (not e.g.
tree_sitter_java())?src/scanner.c named
tree_sitter_groovy_external_scanner_* (matching the grammar's name)?
The scanner is hand-written and not touched by tree-sitter generate,
so any drift must come from a manual edit.binding.gyp, setup.py, Package.swift, Go binding.go,
bindings/rust/build.rs)? Missing scanner.c at link time →
undefined symbol at load time, which node-gyp does NOT catch.package.json, Cargo.toml,
pyproject.toml, tree-sitter.json, go.mod) all use the same name,
version, and license?test/corpus/?test/highlight/
that asserts the capture by name?trait T { … } should not be confused with a juxt-call followed by
a closure; 0..<n should not parse as 0 .. < n.a ? b ?: c : d, 0..n<<1, a ?: b ?: c (see
SPECIFICATION.md §8.1 corpus list)?identifier: /[A-Za-z_$][A-Za-z0-9_$]*/
is fine; a new rule using /.+/ is not.npx tree-sitter test in well under a
second? A new rule that explodes parser table size shows up in
regeneration time and parser.c size..so, or trusts user-supplied paths without canonicalisation?amaanq,
murtaza64) in newly added code?Java vs Groovy, java vs groovy)
introduced by the diff?For each finding: re-read the evidence, confirm file and line range, discard anything speculative. Collapse findings sharing a root cause.
If a finding is pre-existing and the diff does not make it worse, mark "pre-existing" but still report it.
## Review: <scope description>
### Bugs / Grammar
| # | Finding | File | Effort | Evidence |
### Test gaps
| # | Finding | File | Effort | Evidence |
### Code quality
| # | Finding | File | Effort | Evidence |
### Summary
- Files reviewed: N
- Findings: N
- Verdict: APPROVE | APPROVE WITH COMMENTS | REQUEST CHANGES
If zero findings, say so explicitly and state APPROVE.
src/parser.c will mislead you.