mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-18 14:53:05 +08:00
Translate everything-claude-code repository to Japanese including: - 17 root documentation files - 60 agent documentation files - 80 command documentation files - 99 rule files across 18 language directories (common, angular, arkts, cpp, csharp, dart, fsharp, golang, java, kotlin, perl, php, python, ruby, rust, swift, typescript, web) - 199 skill documentation files Total: 455 files translated to Japanese with: - Consistent terminology glossary applied throughout - YAML field names preserved in English (name, description, etc.) - Code blocks and examples untouched (comments translated) - Markdown structure and relative links preserved - Professional translation maintaining technical accuracy This translation expands ECC accessibility to Japanese-speaking developers and teams. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
3.2 KiB
3.2 KiB
paths
| paths | ||
|---|---|---|
|
Kotlin コーディングスタイル
このファイルは common/coding-style.md を Kotlin 固有のコンテンツで拡張します。
フォーマット
- ktlint または Detekt でスタイルを強制
- 公式 Kotlin コードスタイル(
gradle.propertiesにkotlin.code.style=official)
不変性
varよりもvalを優先 — デフォルトはval、ミューテーションが必要な場合のみvarを使用- 値型には
data classを使用する; public API では不変コレクション(List、Map、Set)を使用 - 状態更新にはコピーオンライト:
state.copy(field = newValue)
命名
Kotlin の慣例に従う:
camelCase— 関数とプロパティPascalCase— クラス、インターフェース、オブジェクト、型エイリアスSCREAMING_SNAKE_CASE— 定数(const valまたは@JvmStatic)- インターフェースの接頭辞は振る舞いで付ける、
Iではない:ClickableであってIClickableではない
Null 安全性
!!は使用しない —?.、?:、requireNotNull()、またはcheckNotNull()を優先- スコープ付き null 安全操作には
?.let {}を使用 - 正当に結果がない可能性がある関数からは nullable 型を返す
// BAD
val name = user!!.name
// GOOD
val name = user?.name ?: "Unknown"
val name = requireNotNull(user) { "User must be set before accessing name" }.name
シールド型
閉じた状態階層のモデリングにはシールドクラス/インターフェースを使用する:
sealed interface UiState<out T> {
data object Loading : UiState<Nothing>
data class Success<T>(val data: T) : UiState<T>
data class Error(val message: String) : UiState<Nothing>
}
シールド型に対しては常に網羅的な when を使用する — else ブランチは使わない。
拡張関数
ユーティリティ操作には拡張関数を使用するが、発見しやすくする:
- レシーバー型にちなんだファイル名にする(
StringExt.kt、FlowExt.kt) - スコープを限定する —
Anyや過度に汎用的な型に拡張を追加しない
スコープ関数
適切なスコープ関数を使用する:
let— null チェック + 変換:user?.let { greet(it) }run— レシーバーを使って結果を計算:service.run { fetch(config) }apply— オブジェクトの設定:builder.apply { timeout = 30 }also— 副作用:result.also { log(it) }- スコープ関数の深いネストは避ける(最大2レベル)
エラーハンドリング
Result<T>またはカスタムシールド型を使用- throwable コードのラッピングには
runCatching {}を使用 CancellationExceptionは絶対にキャッチしない — 常に再スローする- 制御フローに
try-catchを使用しない
// BAD — 制御フローに例外を使用
val user = try { repository.getUser(id) } catch (e: NotFoundException) { null }
// GOOD — nullable 戻り値
val user: User? = repository.findUser(id)