AI-Generated Code Format Review for Openclaw

A dedicated Java formatting review skill designed to automatically audit and correct naming, comments, structure, and style discrepancies in AI-generated code.

joeyliu1
v1.0.0
Jun 23, 2026
0
340
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install java-code-format-review

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install java-code-format-review using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is AI-Generated Code Format Review?

AI code generators are powerful, but they often produce inconsistencies in formatting, naming patterns, and convention compliance. The AI-Generated Code Format Review skill solves this by providing a programmatic, rule-based formatting audit designed primarily for Java projects. Leveraging conventions from the Alibaba Java Development Manual, it serves as a robust quality gate to enforce readability and consistency prior to committing code.

As part of the Openclaw Skills ecosystem, this tool helps developers quickly identify structural issues, bad naming practices (such as Pinyin or incorrect boolean prefixes), swallowed exceptions, and magic numbers. By integrating these style conventions, the skill bridges the gap between raw AI outputs and enterprise-grade codebase standards.

AI-Generated Code Format Review Use Cases

  • Post-Generation Formatting Audits: Automatically evaluate code generated or refactored by AI agents before pushing to source control.
  • Pre-Commit Linting: Run automated style reviews on staged files to ensure adherence to strict formatting guidelines.
  • Refactoring Preparation: Gauge the structural format and health of legacy codebase blocks before performing large-scale AI-driven rewrites.
  • Team-wide Rule Standardization: Bring consistent formatting rules (P0, P1, P2) into collaborative workflows using Openclaw Skills.

How AI-Generated Code Format Review Works

  1. Git Diff and Source Acquisition: The skill extracts changed code by checking working trees, staged differences (git diff --cached), or specific commit historical diffs.
  2. Configuration Auto-Detection: It inspects the codebase for standard Java build and style configurations, scanning for Checkstyle, Spotbugs, Spotless, Maven, or Gradle project structures.
  3. Automated Auditing: If dedicated linters or format checkers exist, the skill runs them (e.g., Spotless check). Otherwise, it applies its built-in rule framework.
  4. Checklist Validation: The code is evaluated against predefined rule categories: Mandatory (P0), Recommended (P1), and Reference (P2) classifications.
  5. Report Generation: The skill generates an exhaustive review report highlighting rule violations with exact line numbers, severity tags, and remediation steps.
  6. Auto-Fix (Optional): If configuration exists, the skill can programmatically trigger format fixing commands (e.g., mvn spotless:apply).

AI-Generated Code Format Review Setup

Initialize the skill in your project and run a quick environment check. Define your workflow configuration in your project repository.

Step 1: Detect Build Configuration

Verify that the build properties contain valid build tools:

# Check for Maven or Gradle files
ls pom.xml build.gradle build.gradle.kts 2>/dev/null

Step 2: Running Automated Checks

You can execute format checking depending on your build system:

For Maven projects:

mvn spotless:check
mvn checkstyle:check

For Gradle projects:

./gradlew spotlessCheck

Step 3: Automatically Fixing Violations

To resolve detected formatting inconsistencies automatically:

mvn spotless:apply
# Or for Gradle:
./gradlew spotlessApply

Ensure this skill is enabled within your Openclaw Skills directory settings.

AI-Generated Code Format Review Data Schema & Taxonomy

The skill identifies and processes formatting schemas across multiple priority levels. The framework segments findings as follows:

Priority Level Severity Actions Required
P0 [Mandatory] Critical Blocks commit. Violations include swallowed exceptions, naming prefixes with _ or $, raw generic types, and missing @Override annotations.
P1 [Recommended] High Strongly advised to fix. Includes excessive method lengths, nested levels exceeding 3, and string concatenation inside loops.
P2 [Reference] Minor Suggested improvements. Consists of record usages instead of plain data classes, import organization patterns, and non-standard domain suffixes.

Review Report Format Schema

Generated reports output a structured layout summarizing codebase issues:

  • Header: === AI Code Format Review Report ===
  • Target File: File paths identified under review
  • Issues List: Categorized by priority code (P0/P1/P2), line numbers, descriptive analysis, and concrete refactoring solutions
  • Summary Stats: Final score showing total occurrences of each category (e.g., Stats: P0 x4, P1 x2, P2 x1)

AI-Generated Code Format Review Advanced Features

  • Alibaba Java Manual Compliance: Incorporates advanced rule taxonomies aligning directly with enterprise-grade Java development guidelines.
  • Automated Configuration Discovery: Auto-detects custom linter setups (Spotless, Checkstyle, PMD) to prevent linting conflicts and align with existing setups in the Openclaw Skills workflow.
  • Modern Java Feature Audits: Intelligently reviews usages of newer language patterns (Java 10 to 21) such as Record structures, pattern matching, Switch Expressions, and Text Blocks.
  • Anti-Pattern Guardrails: Contains a robust detection index specifically targeted towards common AI generation hallucinations (e.g., excessive field injections, verbose boilerplate generation, and unclosed resources).

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*