Review pr

From spiriMirror/libuipc · View interactive version

Review pr is an AI agent skill from the GitHub repository spiriMirror/libuipc. Review a libuipc pull request end-to-end: checkout the PR, summarize changes, list files for the human reviewer, and perform a domain-aware AI review covering physics correctness, backend architecture, C++ style, GPU code, and Python bindings. Optionally post review comments via `gh`. Use when the u

How to use this skill

Skill file

libuipc PR Review

Follow the owner working agreements. Inspect PRs without changing the working

branch unless the user requests checkout; a review does not authorize publication.

Architecture primer (read before reviewing)

libuipc is a GPU-accelerated Incremental Potential Contact (IPC) simulation

library (C++20 + optional Python/pybind11).

Layer split:

| Layer | Path | Role |

|-------|------|------|

| Core | src/core/, include/uipc/ | Engine lifecycle, Scene/World, geometry attribute ECS |

| Geometry | src/geometry/ | Mesh algorithms; libigl, TBB, Octree, embedded C++ METIS |

| Constitution | src/constitution/ | Material / constraint implementations |

| I/O | src/io/ | Scene + mesh serialisation |

| Sanity check | src/sanity_check/ | Pre-sim scene validation |

| Backends | src/backends/<name>/ | Physics engines as runtime-loaded SHARED libraries in test and packaged builds |

| Pybind | src/pybind/ | Thin pybind11 wrapper; mirrors C++ submodules |

Backend plugin ABI (src/backends/common/module.h):

Systems separately derive from ISimSystem / SimSystem and register with their engine.

CUDA backend subsystems (most review-sensitive):

affine_body/, finite_element/, contact_system/, collision_detection/,

distance_system/, active_set_system/, inter_primitive_effect_system/,

engine/ (Newton + augmented-Lagrangian step in advance_al.cu)

Workflow

1. Checkout and fetch metadata

# Only when checkout is requested:
gh pr checkout <PR_NUMBER> --repo spiriMirror/libuipc
gh pr view <PR_NUMBER> --repo spiriMirror/libuipc --json title,body,author,baseRefName,headRefName,headRefOid,headRepository,url,additions,deletions,changedFiles
gh pr diff <PR_NUMBER> --name-only --repo spiriMirror/libuipc

2. Present summary to the human reviewer

## PR #<N>: <title>
Author: <author>   Branch: `<head>` → `<base>`
URL: <url>
Stats: +<add> / -<del> across <N> files

### Description
<body>

### Files to review  (grouped by subsystem)
#### Backend — CUDA physics
  src/backends/cuda/affine_body/...
  src/backends/cuda/finite_element/...
  ...
#### Core / Public API
  include/uipc/...
  src/core/...
#### Geometry / Constitution
  src/geometry/...   src/constitution/...
#### Python bindings
  src/pybind/...   python/src/uipc/...
#### Build / CMake
  CMakeLists.txt   src/backends/.../CMakeLists.txt
#### Tests
  apps/tests/...   python/tests/...

3. AI review — libuipc-specific checklist

Run gh pr diff <PR_NUMBER> --repo spiriMirror/libuipc and check every

area below that is touched. Metadata fields must match the

GitHub CLI JSON contract.


Fast fail
C++20 style
CUDA / GPU code
Constitution / material
Public C++ API (`include/uipc/`)

snake_case functions, m_ prefix for members

C++ style (`.clang-format` enforced)
CMake / XMake
Python bindings (`src/pybind/` + `python/`)
Tests

apps/tests/<subsystem>/CMakeLists.txt


4. Output format

Each finding must have a sequential number (1, 2, 3 … across all severity tiers) and a

clickable local file link constructed from the absolute repo path + relative file path.

Use this markdown link format for every citation:

[filename.ext:LINE](ABSOLUTE_REPO_PATH/relative/path/to/file.ext)

For example, if the repo is at /home/user/libuipc and the file is

src/backends/cuda/affine_body/foo.cu at line 42:

[foo.cu:42](/home/user/libuipc/src/backends/cuda/affine_body/foo.cu)

Full output template:

## AI Review — PR #<N>

### Summary of changes
<one paragraph>

### Findings

🔴 Critical (must fix)
**#1** — [filename.ext:LINE](ABSOLUTE_PATH/relative/path/filename.ext)
Description of the issue and why it matters.

**#2** — [filename.ext:LINE](ABSOLUTE_PATH/relative/path/filename.ext)
Description.

🟡 Suggestion
**#3** — [filename.ext:LINE](ABSOLUTE_PATH/relative/path/filename.ext)
Description.

🟢 Nice-to-have
**#4** — [filename.ext:LINE](ABSOLUTE_PATH/relative/path/filename.ext)
Description.

### Checklist coverage
(tick the items above that were verified or N/A)

5. Post comments via `gh` (when asked)

General review comment / request changes / approve:

gh pr review <PR_NUMBER> --repo spiriMirror/libuipc --comment --body "..."
gh pr review <PR_NUMBER> --repo spiriMirror/libuipc --request-changes --body "..."
gh pr review <PR_NUMBER> --repo spiriMirror/libuipc --approve --body "LGTM"

Inline comment on a specific line:

gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
  --method POST \
  -f path="<FILE_PATH>" \
  -f body="Your comment" \
  -F line=<LINE_NUMBER> \
  -f side="RIGHT" \
  -f commit_id="<HEAD_REF_OID>"

Run gh auth status first if commands fail.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.