Explain a GitHub pull request as an English Markdown walkthrough and return a Plannotator share link. Use for PR explanations, walkthroughs, or review preparation.
中文简介正在准备中。当前显示原文说明。
Codify project review rules as deterministic guards — ast-grep structural rules (with TDD-style rule tests) for mechanical checks, REVIEW_GUIDELINES.md for qualitative ones, wired into the project gate / wf verify. Use when the user wants to define review rules, turn a repeated review finding into a lint/guard, or set up ast-grep in a project.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Goal: a review rule stated once should never depend on a reviewer's memory again. Mechanical rules become ast-grep guards (exit code decides); everything else becomes written guidance reviewers receive automatically.
| Rule kind | Destination |
|---|---|
Structural / mechanical ("no console.log outside logger", "every handler calls auth middleware", "no raw SQL in controllers") | ast-grep rule |
| Type-aware or flow-sensitive | existing linter / tsc config — do NOT emulate a type checker with patterns |
| Qualitative (naming taste, architecture judgement) | REVIEW_GUIDELINES.md in repo root — the /review extension and review subagents pick it up |
If a rule can't name a concrete AST shape, it is not an ast-grep rule.
sgconfig.yml # ruleDirs: [.ast-grep/rules], testConfigs: [{testDir: .ast-grep/tests}]
.ast-grep/rules/ # one YAML per rule
.ast-grep/tests/ # one test per rule: valid + invalid snippets
Requires ast-grep on PATH (brew package, already in chezmoi packages).
.ast-grep/tests/<id>-test.yml with valid: (must not
match) and invalid: (must match) snippets — the invalid one is the exact
code from the review finding that motivated the rule..ast-grep/rules/<id>.yml: id, language, severity: error,
message (say WHY, not just what), rule: (pattern/kind/inside…).ast-grep test --skip-snapshot-tests — must print Running N tests with
your test INCLUDED and pass. Pitfall: a test whose rule id does not exist
is silently skipped (0 passed, exit 0) — the count is the proof the test
ran. A wrong rule fails loudly (non-zero exit). Optionally pin snapshots
with ast-grep test -U and drop the flag afterwards.ast-grep scan on the repo: every existing hit is either fixed now or the
rule's scope is narrowed — never ship a guard the codebase already violates.severity: error blocks (scan exits non-zero); warning reports only.
Distilled from the ast-grep catalog, coderabbitai/ast-grep-essentials and semgrep-rules taxonomies. Offer these when the user asks "what guards should this project have?":
await inside Promise.all([...]), JSX cond && <X/> short-circuit with non-boolean, Go defer f() evaluating too early,
empty catch blocks. (Flow/type-sensitive ones — floating promises — belong
to the typed linter, not patterns.)ast-grep scan --rewrite codemod).exec/eval/shell, tool dispatch without
allowlist, unbounded agent loops without budget.coderabbitai/ast-grep-essentials — security rules for 10+ languages, with
tests. Plain ast-grep project: clone and ast-grep scan --config <pack>/sgconfig.yml ., or copy the relevant rules/<lang>/security/*.yml
(MIT) into .ast-grep/rules/.raxITlabs/agent-security-review — 58 rules for AI-agent code (prompt
injection → sinks, MCP tool poisoning, denial-of-wallet).Write a custom rule only when no pack covers it.
Established findings (Tricorder/Google CACM 2018, Facebook CACM 2019, Johnson et al. ICSE 2013): developers abandon noisy tools — keep effective false positives under ~10%; findings must arrive at review time, not in batch reports after merge (fix rates collapse); every finding must be actionable (message says why + what instead, next to the code).
In practice: severity: error only for near-zero-FP rules — everything else
starts as warning and is promoted after it survives real diffs without
noise. One noisy guard erodes trust in all of them: fix or delete it the
week it annoys, never "later".
One source of truth: add ast-grep scan (and ast-grep test if rules exist)
to the project's existing gate script / task runner — CI and wf both call
that. In a wf contract it is just a quick check:
verify:
quick:
- {id: guards, kind: hard, command: "ast-grep scan", timeoutMs: 60000}
Rules created (id → what it guards), triage of rejected rules (where they went
instead), scan status on the current tree, gate wiring. Verification for the
user: ast-grep test && ast-grep scan — exit 0.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Explain a GitHub pull request as an English Markdown walkthrough and return a Plannotator share link. Use for PR explanations, walkthroughs, or review preparation.
中文简介正在准备中。当前显示原文说明。
Review, triage, and resolve PR review comments. Use when user asks to check PR comments, address review feedback, fix issues raised in review, reply to reviewers, or resolve review threads.
中文简介正在准备中。当前显示原文说明。
Entity-aware code change analysis using the pi-sem tools. Use when the user asks what changed, wants blast radius or affected tests, needs focused context for a function/class, wants review help on a commit/branch/PR, or asks to compare semantic diff with raw git diff. Prefer sem_context and sem_impact; use sem_diff selectively for summaries and reviews.
中文简介正在准备中。当前显示原文说明。
Vytvoř workflow kontrakt z dosavadní diskuse — zapíše ~/Workspace/specs/<projekt>/<název>/contract.md (české tělo + strojový frontmatter) a zlintuje ho wf-gate. Použij, když uživatel řekne /wf nebo chce z probraného problému udělat kontrakt. Nikdy neimplementuje.
中文简介正在准备中。当前显示原文说明。
České vysvětlení změny kódu z kontraktu, ref range nebo PR — pozadí, intuice, průchod kódem, důkazy, UAT a kvíz. Volá wf-impl po UAT nebo uživatel ručně.
中文简介正在准备中。当前显示原文说明。
Dirigent jednoho workflow kontraktu ve svém super.engineering worktree — deleguje implementaci na subagenta, mezi fázemi pouští wf-gate, review předá skill wf-review, otevře draft PR (guardovaný), vyřeší komentáře, spustí UAT. Použij, když task session říká, že se má kontrakt provést přes wf-impl.
中文简介正在准备中。当前显示原文说明。