This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is an IntelliJ Platform plugin project called "git-commit-stats" built using the IntelliJ Platform Plugin Template. The plugin is currently in its initial template state with sample code that should be removed as actual features are implemented.
Plugin Details:
- Group:
com.github.sukieva.gitcommitstats - Main package:
com.github.sukieva.gitcommitstats - Target platform: IntelliJ IDEA 2025.3
- Minimum build: 253
- Language: Kotlin (JVM toolchain 21)
- Compatible with: IntelliJ IDEA Community Edition and Ultimate Edition
Build the plugin:
./gradlew buildPluginRun tests:
./gradlew checkRun the plugin in a sandboxed IDE instance:
./gradlew runIdeRun UI tests with robot server:
./gradlew runIdeForUiTestsVerify plugin compatibility:
./gradlew verifyPluginRun Qodana code inspections:
./gradlew qodanaGenerate test coverage reports:
./gradlew koverReportGet changelog (for release notes):
./gradlew getChangelog --unreleased --no-headerRun all tests:
./gradlew checkRun a single test class:
./gradlew test --tests "com.github.sukieva.gitcommitstats.MyPluginTest"Test coverage is tracked using Kover and uploaded to CodeCov in CI.
The plugin integrates with IntelliJ's commit workflow using the CheckinHandler extension point:
Checkin Integration (src/main/kotlin/com/github/sukieva/gitcommitstats/checkin/):
CommitStatsHandlerFactory- Factory registered in plugin.xml as checkinHandlerFactoryCommitStatsHandler- Extends CheckinHandler, manages lifecycle and updates UI- Hooks into commit panel via
getBeforeCheckinConfigurationPanel() - Responds to file selection changes via
includedChangesChanged()
Statistics Engine (src/main/kotlin/com/github/sukieva/gitcommitstats/stats/):
CommitStatsCalculator- Core logic for computing diff statistics- Uses IntelliJ's
ComparisonManagerAPI for accurate line counting - Handles binary files, errors, and cancellation
- Async computation with Kotlin coroutines
UI Components (src/main/kotlin/com/github/sukieva/gitcommitstats/ui/):
CommitStatsPanel- Displays file and line statistics- Updates dynamically when commit selection changes
- Shows: modified/added/deleted files, lines added/removed, binary file count
Localization:
MyBundle.kt- Bundle accessor using DynamicBundle- Message keys stored in
src/main/resources/messages/MyBundle.properties
plugin.xml (src/main/resources/META-INF/plugin.xml):
- Declares checkinHandlerFactory extension point
- Depends on com.intellij.modules.vcs for VCS integration
- Plugin description is extracted from README.md during build (between
<!-- Plugin description -->markers)
build.gradle.kts:
- Uses IntelliJ Platform Gradle Plugin 2.x
- Configured for signing, publishing, and verification
- Change notes extracted from CHANGELOG.md
- Publishing to custom channels based on version suffix (e.g., "alpha", "beta")
gradle.properties:
- Central configuration for plugin metadata, version, and platform version
- Modify pluginGroup, pluginName, pluginVersion here
- Includes VCS module dependency:
platformBundledModules = intellij.platform.vcs
- When adding new functionality:
- Register new extension points in plugin.xml
- Follow the existing package structure under
com.github.sukieva.gitcommitstats - Use Kotlin coroutines for background computation
- Update UI on EDT thread via
withContext(Dispatchers.EDT)
- Plugin description in README.md between markers is used as the official description
- CHANGELOG.md entries are used for release notes
- Statistics computation uses IntelliJ's
ComparisonManagerfor diff analysis
The project uses GitHub Actions with three workflows:
build.yml: Runs on push/PR
- Builds plugin
- Runs tests with coverage (uploads to CodeCov)
- Runs Qodana inspections
- Verifies plugin structure
- Creates draft release
release.yml: Triggered on published release
- Builds and publishes to JetBrains Marketplace
run-ui-tests.yml: UI testing workflow
- Gradle configuration cache is enabled
- Kotlin stdlib is not bundled by default (kotlin.stdlib.default.dependency = false)
- Java 21 is required
- Platform Support: IntelliJ IDEA 2025.3+ (both Community and Ultimate editions)
- The plugin depends on
com.intellij.modules.platformandcom.intellij.modules.vcs - Module dependencies work across both Community and Ultimate editions
- Statistics are computed asynchronously with 300ms debouncing
- VCS-agnostic implementation works with Git, SVN, Mercurial, etc.