ワンクリックで
grpc-migration-contract-distribution
Migrate proto modules to proper contract distribution. Split into proto-only and -generated modules.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Migrate proto modules to proper contract distribution. Split into proto-only and -generated modules.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
RFC-39 compliant API best practices for Java services. Covers request/response patterns, error handling, pagination, versioning, and authentication standards. Use when designing or reviewing REST APIs in Java services.
RFC-29 compliant changelog management with Common Changelog format and Unreleased section extension. Validates changelog on commits, generates from git history, and ensures all merged PRs are documented. Use when setting up changelog workflows or retrofitting existing repositories.
Systematic workflow for CodeRabbit reviews - local CLI, PR threads, and commit attribution
Enforces consistent coding standards across the codebase including naming conventions, code organization, and documentation requirements. Use when writing new code, reviewing pull requests, or refactoring existing code.
Database integration patterns for Java services using jOOQ and Flyway. Covers code generation, read/write splitting, migration guidelines, and version compatibility. Use when setting up or maintaining PostgreSQL integration.
Version catalog strategy, dependency management, BOMs, and version constraints for Java/Gradle projects. Covers version centralization, never-downgrade policy, bundle patterns, resolution strategies, and compatibility matrices.
| name | grpc-migration-contract-distribution |
| description | Migrate proto modules to proper contract distribution. Split into proto-only and -generated modules. |
| compatibility | Java projects with protobuf modules; requires grpc-compliance-validate-repository |
| metadata | {"version":"1.0.0","technology":"java","category":"migration","tags":["java","grpc","protobuf","migration"]} |
Migrate proto modules to proper contract distribution with proto-only and -generated module split.
Migrate proto modules from incorrect distribution (compiled code + dependencies) to proper contract distribution (proto-only artifacts). This ensures:
📚 references/ - Detailed documentation
The grpc-compliance-validate-repository command must be available for the migration checklist validation step.
Cloud agents: Pre-installed (no action needed).
Local setup:
export HOMEBREW_GITHUB_API_TOKEN=your-token
brew tap bitsoex/homebrew-bitso
brew install bitso-grpc-linter
Verify: grpc-compliance-validate-repository --help
See ../grpc-services-rfc-33/references/installation.md for details.
Proto files MUST be in src/main/resources/ following the package structure:
package com.bitso.account.v1; → src/main/resources/com/bitso/account/v1/account.protosrc/main/proto/account.proto or src/main/resources/proto/account.proto⚠️ IMPORTANT: Different rules for existing vs new protos
| Proto Type | Package Rule | Example |
|---|---|---|
| EXISTING (being moved) | Keep original package for backwards compatibility | Keep package protos.model; if that's what it has |
| NEW (V2 services, new messages) | Use project-specific package | package com.bitso.{service}.v2; |
For EXISTING protos being moved:
// Keep the existing package - DO NOT CHANGE
syntax = "proto3";
package protos.model; // Keep this even though it's generic
option java_package = "com.bitso.iba.model";
// Just move to: src/main/resources/protos/model/
For NEW protos (V2 services, new error types):
// Use project-specific package - DO NOT use protos.model
syntax = "proto3";
package com.bitso.iba.rate.v2; // Project-specific
option java_package = "com.bitso.iba.rate.v2";
// Place in: src/main/resources/com/bitso/iba/rate/v2/
Determine project package convention by:
com.bitso.iba.grpc.service)project-root/
├── account-protos/
│ ├── build.gradle # Has protobuf plugin + dependencies
│ └── src/main/proto/ # Wrong location
│ └── account.proto
project-root/
├── account-protos/
│ ├── build.gradle # NO protobuf plugin, NO dependencies
│ └── src/main/resources/ # Correct location
│ └── com/bitso/account/v1/ # Follows package structure
│ └── account.proto
├── account-protos-generated/
│ └── build.gradle # Has protobuf plugin (internal only)
# Example: package com.bitso.account.v1;
mkdir -p proto-module/src/main/resources/com/bitso/account/v1
mv proto-module/src/main/proto/*.proto proto-module/src/main/resources/com/bitso/account/v1/
rm -rf proto-module/src/main/proto
Edit the proto-only module's build.gradle:
com.google.protobuf pluginprotobuf {} configuration blockSee references/BUILD_EXAMPLES.md for configuration templates.
-generated Modulemkdir -p proto-module-generated/src/main/java
# Create build.gradle with protobuf compilation config
See references/BUILD_EXAMPLES.md for the complete generated module configuration.
// Before
dependencies {
implementation project(':proto-module')
}
// After
dependencies {
implementation project(':proto-module-generated')
}
include 'proto-module'
include 'proto-module-generated' // NEW
This step is NON-NEGOTIABLE. Contract distribution migration is a BREAKING CHANGE.
Update the version in the protobuf module's gradle.properties file:
# File: {proto-module}/gradle.properties
# Before: version=1.2.3
# After: version=2.0.0 (BREAKING CHANGE - MAJOR bump required)
# {proto-module}/gradle.properties
version=2.0.0
Why MAJOR version bump is mandatory:
Failure to bump MAJOR version will cause:
src/main/resources/{package/path}/ matching package declarationsrc/main/proto/ directoryprotobuf {} configuration from proto-only module-generated module directory-generated module-generated depend on proto-only via project(':proto-module')settings.gradle to include -generated moduleproject(':proto-module') with project(':proto-module-generated')-generated)gradle.properties (e.g., 1.2.3 → 2.0.0){proto-module}/gradle.properties./gradlew clean buildgrpc-compliance-validate-repository --dir . and verify no ERRORS./gradlew testsrc/main/resources/com/bitso/account/v1/account.protosrc/main/proto/account.proto-generated Modules-generated modules to artifact repositorysrc/main/resources/{package/path}/jar tf account-protos-2.0.0.jar | grep .proto
After migration, external consumers must:
See references/BUILD_EXAMPLES.md for consumer configuration template.
references/BUILD_EXAMPLES.md - Complete Gradle configuration examples