junrushao commented on code in PR #450: URL: https://github.com/apache/tvm-ffi/pull/450#discussion_r2808232443
########## .claude/skills/tvm-ffi-code-review/SKILL.md: ########## @@ -0,0 +1,239 @@ +<!--- Licensed to the Apache Software Foundation (ASF) under one --> +<!--- or more contributor license agreements. See the NOTICE file --> +<!--- distributed with this work for additional information --> +<!--- regarding copyright ownership. The ASF licenses this file --> +<!--- to you under the Apache License, Version 2.0 (the --> +<!--- "License"); you may not use this file except in compliance --> +<!--- with the License. You may obtain a copy of the License at --> + +<!--- http://www.apache.org/licenses/LICENSE-2.0 --> + +<!--- Unless required by applicable law or agreed to in writing, --> +<!--- software distributed under the License is distributed on an --> +<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --> +<!--- KIND, either express or implied. See the License for the --> +<!--- specific language governing permissions and limitations --> +<!--- under the License. --> + +--- +name: tvm-ffi-code-review +description: Run parallel code reviews using Claude Code and OpenAI Codex reviewers. Produces a unified, prioritized review report with actionable findings from multiple AI models. +disable-model-invocation: true +argument-hint: "[pr | branch:<name> | commit:<sha> | staged | unstaged]" +allowed-tools: Bash(git *), Bash(gh *), Read, Grep, Glob, Task, AskUserQuestion +--- + +# Multi-Model Code Review + +Review code changes using two independent AI reviewers in parallel — **Claude Code** and **OpenAI Codex** — then synthesize their findings into a single prioritized report. + +## Prerequisites + +- **Codex CLI** must be installed and authenticated (`npm install -g @openai/codex` or equivalent). If unavailable, the skill gracefully falls back to Claude-only review. + +## Step 1: Determine review scope + +Parse `$ARGUMENTS` to determine what to review. If the argument is empty or ambiguous, prompt the user with `AskUserQuestion` to choose a scope. + +### Supported scopes + +| Argument | Diff command | Description | +|----------|-------------|-------------| +| `pr` (default) | `git diff $(git merge-base HEAD <main-branch>)...HEAD` | All changes in the current PR/branch since it diverged from the main branch. Auto-detects the main branch (`main` or `master`). | +| `branch:<name>` | `git diff <name>...HEAD` | Changes relative to the named branch. | +| `commit:<sha>` | `git diff <sha>...HEAD` | Changes since the given commit. | +| `staged` | `git diff --cached` | Only staged (indexed) changes. | +| `unstaged` | `git diff` | Only unstaged working-tree changes. | + +### Scope resolution logic + +1. If `$ARGUMENTS` is empty, default to `pr` scope. +2. If `$ARGUMENTS` matches one of the keywords above, use that scope. +3. If `$ARGUMENTS` looks like a branch name or commit SHA (doesn't match a keyword), treat it as `branch:<arg>` for backward compatibility. +4. If the argument is ambiguous or the ref doesn't exist, ask the user: + +``` +AskUserQuestion: + question: "What would you like to review?" + options: + - "Current PR (all commits since diverging from main)" + - "Against a specific branch" + - "Since a specific commit" + - "Staged changes only" +``` + +### Gather the diff + +Once the scope is resolved, run: + +```bash +git diff --stat <resolved-diff-args> +git diff --unified=5 <resolved-diff-args> +``` + +Store the diff output and the list of changed files. If the diff exceeds ~5000 lines, identify the most critical files and note that the review covers a subset. + +## Step 2: Launch both reviewers in parallel + +Use the **Task** tool to launch **both** reviewers simultaneously — two parallel Task calls in a single response. + +### Claude Code Reviewer + +``` +Task(subagent_type: "claude-code-reviewer", model: "opus") +``` + +- **Model**: Claude Opus 4.6 (`claude-opus-4-6`) with high reasoning effort. +- Prompt the subagent with: + - The full unified diff + - The list of changed files + - The shared review instruction below + +### Codex Code Reviewer + +``` +Task(subagent_type: "codex-code-reviewer") +``` + +- **Model**: GPT-5.3 Codex (`gpt-5.3-codex-xhigh`). Pass this as a model hint in the prompt to the subagent: "Use model gpt-5.3-codex-xhigh for this review." Review Comment: again. someone please fix gemini -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
