一键导入
review
Code review of current PR/commit changes against project coding standards. Use when the user asks for a code review or mentions reviewing changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Code review of current PR/commit changes against project coding standards. Use when the user asks for a code review or mentions reviewing changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference for the Tangle component YAML specification format
Guidelines for building well-structured, maintainable ML pipelines in Tangle
Analyzes merged PRs from the past week, identifies user-facing changes, and opens a draft PR to the TangleML/website docs repo with updated documentation. Use when running the weekly documentation sync, or when the user invokes /docs-update.
React and React Compiler patterns for this project. Use when writing React components, hooks, providers, or working with React Compiler compatibility.
Run validation and testing commands for the project. Use when the user asks to validate, lint, typecheck, or run tests.
Vitest unit and component testing patterns. Use when writing unit tests, component tests, or hook tests.
| name | review |
| description | Code review of current PR/commit changes against project coding standards. Use when the user asks for a code review or mentions reviewing changes. |
| disable-model-invocation | true |
| allowed-tools | Bash(git *), Bash(gt *), Bash(gh *), Read, Grep, Glob, Agent |
| argument-hint | ["PR number"] |
Review code changes against project coding standards. This team uses Graphite for stacked PRs — each commit is a PR in a stack.
Check if the user provided a PR number as an argument.
If a PR number was provided (e.g., /review 1234):
gh pr view <number> --json number,title,url,headRefOid,baseRefName --jq '{number, title, url, head_sha: .headRefOid, base: .baseRefName}'
gh pr diff <number>
If no argument was provided, try the current branch:
gh pr view --json number,title,url,headRefOid,baseRefName --jq '{number, title, url, head_sha: .headRefOid, base: .baseRefName}'
gh pr diff
Note the base branch. In a Graphite stack the base is usually the parent PR's branch (not main), and gh pr diff is already scoped to that base — so the diff it returns contains only this PR's own changes. Trust that scope (see "Stack Awareness" below); don't widen it with git diff main...HEAD.
If no PR exists for the current branch, fall back to local commit review:
git show HEAD as the diff source (existing behavior)Store the PR number and head commit SHA for comment posting later.
gh pr diff <number> for the diffgit show HEAD --stat then git show HEAD for the diff. Do NOT use git diff main...HEAD as this shows all commits in the stack.PRs in this repo are stacked — each PR builds on the one below it, and they're reviewed (and merged) bottom-to-top. A finding only belongs on the PR that introduced it.
gh pr diff <number> already returns only the changes this PR adds on top of its base (the parent PR's branch). Review exactly that set — do not pull in code from parent PRs or unrelated files.+ lines in the diff) from lines that merely surround them. Only the former are in scope. When in doubt, confirm a line is part of this PR's diff before commenting on it.Changed code should follow this project's documented standards and React best practices. These skills are the source of truth — consult them rather than guessing, and frame findings in their terms (link the relevant one in the comment):
ui-primitives — BlockStack/InlineStack/Text/Heading/Paragraph/Button/Icon, the tone prop, when raw HTML is acceptablereact-patterns — Rules of Hooks, React Compiler compatibility, provider/custom-hook structuretypescript-standards — no unsafe as, type guards, interface vs type, namingproject-conventions — file structure, import order, comments policy, error handling, no inline styles for static valuestanstack-query / tanstack-router — server-state and routing patternsaccessibility — interactive components, forms, dialogs, ARIAReview changed code for violations, prioritizing:
as) — suggest type guards instead (typescript-standards)async (react-patterns)react-patterns)react-compiler.config.js is updated. A new file under an already-enabled directory is covered automatically; a new top-level file is NOT, and a rename leaves a dead entry pointing at a deleted file while the new file loses coverage<a><button> from <Link><Button>; use <Button asChild>), missing labels (accessibility)BlockStack does NOT mean it uses primitives everywhere it should. Scan every changed JSX block for the raw-HTML equivalents (ui-primitives):
<div className="flex flex-col …"> → BlockStack; <div className="flex …"> (row) → InlineStacktext-muted-foreground, text-rose-600, …) → the tone prop (subdued, critical, …)<h1>–<h6> / Text as="h*" → Heading; raw <p> → Paragraph; styled <span> → Text (e.g. font="mono", not className="font-mono")@/ → relative; project-conventions)project-conventions → Comments & Documentation). Comments should explain why, not narrate what. Flag:
// loop over items above a .map)style={} for static values → use Tailwind classes (inline style is only for dynamic/computed values; project-conventions)typescript-standards)Present findings in this format:
## Issues Found
### 1. **[Issue Title]** - [File:Line]
[Code snippet showing the problem]
**Why**: [Brief explanation]
**Fix**: [Suggested solution]
---
## What's Good
- [Positive observations about the code]
- Note if file was added to `react-compiler.config.js` (React Compiler enabled)
---
## Summary Table
| Issue | Severity | Location |
| ----- | --------------- | --------- |
| ... | High/Medium/Low | file:line |
Skip this step entirely if in fallback mode (no PR).
After presenting the review, use AskUserQuestion with multi-select to let the user pick which findings to post as inline PR comments.
Each option should show:
Example options:
[High] src/utils/api.ts:42 — "Unsafe type cast" → suggest type guard instead of as[Medium] src/components/List.tsx:15 — "Missing UI primitive" → use BlockStack instead of divThe user picks which comments to post. Only proceed with the selected ones.
If the user selects none or there are no findings, skip to the end.
Skip this step entirely if in fallback mode (no PR).
Determine the repo owner/name:
gh repo view --json nameWithOwner --jq '.nameWithOwner'
For each selected finding, post an inline review comment. Every comment must be prefixed with the AI disclaimer:
> 🤖 This is an AI-generated code review comment.
<rest of the comment body>
Post using:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-f body="<comment>" \
-f path="<file>" \
-F line=<line> \
-f commit_id="<head_sha>"
After posting, show a summary:
| # | File | Issue | Posted |
|---|---|---|---|
| 1 | src/utils/api.ts:42 | Unsafe type cast | Yes |
| 2 | src/components/List.tsx:15 | Missing UI primitive | Yes |
tone usage and well-judged comments