Add java-interop-reviewer skill for PR code reviews#1417
Merged
Conversation
Create a code reviewer skill modeled after dotnet/android and dotnet/android-tools reviewer skills, adapted for java-interop. Reusable reference files (applicable to any .NET repo): - ai-pitfalls.md: Common AI code generation mistakes - csharp-rules.md: Nullable, async, error handling, performance - security-rules.md: Archive/path safety, command injection - testing-rules.md: NUnit, regression tests, deterministic data - msbuild-rules.md: Task logging, process management, XML conventions - native-rules.md: C++ memory management, best practices Repo-specific rules distilled from top-reviewed PRs (849, 1179, 696, 689, 459, 691, 1153, 1168, 988, 1184): - repo-conventions.md: Mono formatting style, JNI naming conventions, actionable error messages, localization guidance, JNI reference lifecycle, startup performance, trimmer/AOT compatibility, downstream consumer impact - interop-rules.md: JNI reference lifecycle, JniPeerMembers caching, virtual vs non-virtual dispatch, [Register] accuracy, JniTransition, P/Invoke struct layout and marshalling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
CI might be broken, but hopefully fixed by: |
simonrozsival
approved these changes
May 4, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new .github/skills/java-interop-reviewer reviewer skill for dotnet/java-interop, defining a review workflow (SKILL.md) and a set of reusable + repo-specific rule/reference documents intended to guide automated PR reviews.
Changes:
- Introduce
java-interop-reviewerskill definition + end-to-end review workflow guidance. - Add repo-specific “conventions” reference and general C#/MSBuild/native/security/testing guidance rule files.
- Add an “AI pitfalls” checklist to reduce common AI-generated review/code issues.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/skills/java-interop-reviewer/SKILL.md | Main skill definition + review workflow and output format |
| .github/skills/java-interop-reviewer/references/ai-pitfalls.md | Checklist of common AI-generated mistakes to watch for |
| .github/skills/java-interop-reviewer/references/csharp-rules.md | General C# review rules (nullable/async/error/perf/organization) |
| .github/skills/java-interop-reviewer/references/interop-rules.md | Managed/native boundary and JNI/PInvoke review checks |
| .github/skills/java-interop-reviewer/references/msbuild-rules.md | MSBuild targets/tasks review checks |
| .github/skills/java-interop-reviewer/references/native-rules.md | C/C++ and memory-management review checks |
| .github/skills/java-interop-reviewer/references/repo-conventions.md | Repo-specific formatting/style/perf/localization/downstream guidance |
| .github/skills/java-interop-reviewer/references/security-rules.md | Security checklist for archives/paths/process execution |
| .github/skills/java-interop-reviewer/references/testing-rules.md | NUnit/testing expectations and generator-test guidance |
- Use Mono-style space before `(` in Split() example - Use `[]` instead of `Array.Empty<T>()` in early-return example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create a code reviewer skill modeled after dotnet/android and dotnet/android-tools reviewer skills, adapted for dotnet/java-interop.
Structure
SKILL.md— Main workflow: gather diff → independent assessment → load conditional rules → analyze → post reviewreferences/— Rule files loaded conditionally based on changed file typesReusable reference files (globally applicable to any .NET repo)
ai-pitfalls.md!operator, swallowed errors, over-engineering)csharp-rules.mdsecurity-rules.mdtesting-rules.mdmsbuild-rules.mdnative-rules.mdnullptr,const, standard headersRepo-specific reference files (distilled from PR review history)
repo-conventions.mdinterop-rules.mdJniPeerMemberscaching, virtual vs non-virtual dispatch,[Register]accuracy,JniTransition, P/Invoke marshallingPR reviews analyzed
Repo-specific rules were distilled from the PRs with the most code review comments:
Type.GetType()inManagedPeernet7.0Key patterns distilled from these reviews:
FullName,ReferenceType)"Invoker".Lengthnot7)StringComparison.Ordinalfor identifier comparisons (PR [generator] Replace ApiXmlAdjuster with Java.Interop.Tools.JavaTypeSystem #849)nullptrconsistency (PR [java-interop, Java.Interop] Securely load native libs #691)[DynamicallyAccessedMembers],[UnconditionalSuppressMessage]) (PRs [Hello-NativeAOTFromJNI] Add NativeAOT sample #1153, [java.interop] address some "easy" trimmer warnings #1184)Type.GetType()inManagedPeer#1168)net7.0. #988, [Hello-NativeAOTFromJNI] Add NativeAOT sample #1153)HttpClientmust be static,readonlyfor static fields (PR [Java.Interop.Tools.Maven] Initial commit. #1179)Evaluation
Evaluated the skill against 4 PRs not used to build the rules:
<code>parsingWhat the skill catches well (100% coverage):
using/IDisposableWhat the skill can't catch (misses):
.mdbis appended not extension changeReadSymbols=truebehavior with missing symbols.ppdbextension clarificationMAX_PATHlimitationsreturn defaultvsreturn nullclarityVerdict
Net positive, no significant false positive risk. The skill captures universal code quality patterns (65% of findings) that reviewers consistently flag. The 35% it misses is domain-specific expertise that no general ruleset can replace. The skill complements human reviewers — it handles mechanical checks so humans can focus on domain expertise.