Source profileQuality 65/100

affaan-m/ECC/docs/ja-JP/skills/java-coding-standards/SKILL.md

java-coding-standards

Use it for engineering tasks; the detail page covers purpose, installation, and practical steps.

Source repository stars
234,327
Declared platforms
0
Static risk flags
0
Last source update
2026-07-27
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Spring Bootサービスにおける読みやすく保守可能なJava(17+)コードの標準。

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/java-coding-standards"
    Safe inspection promptEditorial

    Inspect the Agent Skill "java-coding-standards" from https://github.com/affaan-m/ECC/blob/4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38/docs/ja-JP/skills/java-coding-standards/SKILL.md at commit 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      核となる原則

      巧妙さよりも明確さを優先

      巧妙さよりも明確さを優先デフォルトで不変; 共有可変状態を最小化意味のある例外で早期失敗
    2. 02

      命名

      Review the “命名” section in the pinned source before continuing.

      Review and apply the “命名” source section.
    3. 03

      不変性

      Review the “不変性” section in the pinned source before continuing.

      Review and apply the “不変性” source section.
    4. 04

      Optionalの使用

      Review the “Optionalの使用” section in the pinned source before continuing.

      Review and apply the “Optionalの使用” source section.

    Permission review

    Static risk signals and limitations

    No configured static risk pattern was detected

    This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score65/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars234,327SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    affaan-m/ECC
    Skill path
    docs/ja-JP/skills/java-coding-standards/SKILL.md
    Commit
    4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38
    License
    MIT
    Collected
    2026-07-28
    Default branch
    main
    View the original SKILL.md

    Javaコーディング標準

    Spring Bootサービスにおける読みやすく保守可能なJava(17+)コードの標準。

    核となる原則

    • 巧妙さよりも明確さを優先
    • デフォルトで不変; 共有可変状態を最小化
    • 意味のある例外で早期失敗
    • 一貫した命名とパッケージ構造

    命名

    // PASS: クラス/レコード: PascalCase
    public class MarketService {}
    public record Money(BigDecimal amount, Currency currency) {}
    
    // PASS: メソッド/フィールド: camelCase
    private final MarketRepository marketRepository;
    public Market findBySlug(String slug) {}
    
    // PASS: 定数: UPPER_SNAKE_CASE
    private static final int MAX_PAGE_SIZE = 100;
    

    不変性

    // PASS: recordとfinalフィールドを優先
    public record MarketDto(Long id, String name, MarketStatus status) {}
    
    public class Market {
      private final Long id;
      private final String name;
      // getterのみ、setterなし
    }
    

    Optionalの使用

    // PASS: find*メソッドからOptionalを返す
    Optional<Market> market = marketRepository.findBySlug(slug);
    
    // PASS: get()の代わりにmap/flatMapを使用
    return market
        .map(MarketResponse::from)
        .orElseThrow(() -> new EntityNotFoundException("Market not found"));
    

    ストリームのベストプラクティス

    // PASS: 変換にストリームを使用し、パイプラインを短く保つ
    List<String> names = markets.stream()
        .map(Market::name)
        .filter(Objects::nonNull)
        .toList();
    
    // FAIL: 複雑なネストされたストリームを避ける; 明確性のためにループを優先
    

    例外

    • ドメインエラーには非チェック例外を使用; 技術的例外はコンテキストとともにラップ
    • ドメイン固有の例外を作成(例: MarketNotFoundException)
    • 広範なcatch (Exception ex)を避ける(中央でリスロー/ログ記録する場合を除く)
    throw new MarketNotFoundException(slug);
    

    ジェネリクスと型安全性

    • 生の型を避ける; ジェネリックパラメータを宣言
    • 再利用可能なユーティリティには境界付きジェネリクスを優先
    public <T extends Identifiable> Map<Long, T> indexById(Collection<T> items) { ... }
    

    プロジェクト構造(Maven/Gradle)

    src/main/java/com/example/app/
      config/
      controller/
      service/
      repository/
      domain/
      dto/
      util/
    src/main/resources/
      application.yml
    src/test/java/... (mainをミラー)
    

    フォーマットとスタイル

    • 一貫して2または4スペースを使用(プロジェクト標準)
    • ファイルごとに1つのpublicトップレベル型
    • メソッドを短く集中的に保つ; ヘルパーを抽出
    • メンバーの順序: 定数、フィールド、コンストラクタ、publicメソッド、protected、private

    避けるべきコードの臭い

    • 長いパラメータリスト → DTO/ビルダーを使用
    • 深いネスト → 早期リターン
    • マジックナンバー → 名前付き定数
    • 静的可変状態 → 依存性注入を優先
    • サイレントなcatchブロック → ログを記録して行動、または再スロー

    ログ記録

    private static final Logger log = LoggerFactory.getLogger(MarketService.class);
    log.info("fetch_market slug={}", slug);
    log.error("failed_fetch_market slug={}", slug, ex);
    

    Null処理

    • やむを得ない場合のみ@Nullableを受け入れる; それ以外は@NonNullを使用
    • 入力にBean Validation(@NotNull@NotBlank)を使用

    テストの期待

    • JUnit 5 + AssertJで流暢なアサーション
    • モック用のMockito; 可能な限り部分モックを避ける
    • 決定論的テストを優先; 隠れたsleepなし

    覚えておく: コードを意図的、型付き、観察可能に保つ。必要性が証明されない限り、マイクロ最適化よりも保守性を最適化します。

    Alternatives

    Compare before choosing