affaan-m/ECC

java-coding-standards

Spring Bootサービス向けのJavaコーディング標準:命名、不変性、Optional使用、ストリーム、例外、ジェネリクス、プロジェクトレイアウト。

65Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/java-coding-standards"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn java-coding-standards's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: Spring Bootサービスにおける読みやすく保守可能なJava(17+)コードの標準。

npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/java-coding-standards"
Check the pinned source

Best fit

  • Spring Bootサービス向けのJavaコーディング標準:命名、不変性、Optional使用、ストリーム、例外、ジェネリクス、プロジェクトレイアウト。

Bring this context

  • A concrete task that matches the documented purpose of java-coding-standards.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned java-coding-standards instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read java-coding-standards through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

核となる原則

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

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

命名

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

SKILL.md · 命名
Review and apply the “命名” source section.
03

不変性

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

SKILL.md · 不変性
Review and apply the “不変性” source section.
04

Optionalの使用

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

SKILL.md · Optionalの使用
Review and apply the “Optionalの使用” source section.
05

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

Review the “ストリームのベストプラクティス” section in the pinned source before continuing.

SKILL.md · ストリームのベストプラクティス
Review and apply the “ストリームのベストプラクティス” source section.

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use java-coding-standards to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned java-coding-standards source to [task]. Pay particular attention to these source sections: “核となる原則”, “命名”, “不変性”, “Optionalの使用”, “ストリームのベストプラクティス”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current java-coding-standards result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “核となる原則” has been checked.

The source section “命名” has been checked.

The source section “不変性” has been checked.

The source section “Optionalの使用” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does java-coding-standards do?

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

How do I start using java-coding-standards?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/java-coding-standards". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
65/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

65/100
Documentation24/30
Specificity11/25
Maintenance18/20
Trust signals12/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

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なし

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

Source repo
affaan-m/ECC
Skill path
docs/ja-JP/skills/java-coding-standards/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected