java-code-reviewer

Reviews Java OpenInference instrumentation packages against project conventions and semantic conventions.

1.2k|302|Updated Dec 26, 2023
One-click install
npx skills add https://github.com/Arize-ai/openinference --skill java-code-reviewer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-code-reviewer
Source: https://github.com/Arize-ai/openinference/tree/main/.agents/skills/java-code-reviewer
Command: npx skills add https://github.com/Arize-ai/openinference --skill java-code-reviewer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviewing a Java OpenInference instrumentor package by hand is error-prone: reviewers must check Gradle setup, span lifecycle correctness, exhaustive test assertions, and semantic convention compliance, all while verifying behavior against the actual instrumented library source. This Skill automates that audit and reports findings organized by severity.

Core Features & Use Cases

  • Structured four-section review: Checks Gradle setup (compileOnly dependencies, settings.gradle registration, Spotless formatting), testing patterns (exhaustive attribute assertions, error handling, TraceConfig masking), OpenInference semantic conventions, and span lifecycle (span.end(), Scope closing, OITracer usage).
  • Ground-truth verification: Locates the instrumented library version from the Gradle ext block and reads its actual source from the Gradle cache or Maven Central before flagging any finding, calibrating severity by real runtime behavior.
  • Severity-ranked reporting: Presents findings in a Critical/High/Medium/Low table with file paths and line numbers, plus a list of what is working well.
  • Use Case: A contributor opens a PR adding a new instrumentor under java/instrumentation/. Ask the Skill to review the package, and it audits the code against project standards and returns a prioritized findings table.

Quick Start

Review the Java instrumentor package for my library and report any correctness or convention issues with severity levels.

Frequently Asked Questions about java-code-reviewer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a Java OpenInference instrumentor package?

Point the reviewer at the package under java/instrumentation/openinference-instrumentation-<name>/. It reads the source, build.gradle, and tests, then runs four review sections covering Gradle setup, testing patterns, semantic conventions, and span lifecycle, returning a severity-ranked findings table.

What does the Java code review check in instrumentor tests?

It verifies exhaustive attribute assertions using the remove-and-verify pattern ending with an emptiness check, error handling with StatusCode.ERROR and recorded exceptions, context attribute propagation for session_id and metadata, and TraceConfig masking behavior. Missing test files are flagged as Critical.

Does the review verify findings against the actual library source?

Yes. It finds the library version from the root build.gradle ext block, reads sources from the Gradle cache or downloads them from Maven Central, and calibrates severity based on what the library actually does. If sources are unavailable, it discloses that before presenting findings.

What span lifecycle issues does the review detect?

It flags missing span.end() calls as Critical, unclosed Scope from context.makeCurrent() as High, incorrect parent-child nesting in multi-span instrumentors, and use of raw Tracer instead of OITracer, which loses TraceConfig support.

When should I not use this instrumentor review skill?

It is scoped to Java OpenInference instrumentation packages in this repository. It does not review Python or JavaScript instrumentors, general-purpose Java code unrelated to OpenInference tracing, or non-instrumentation modules.