mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-18 14:53:05 +08:00
docs: add native Japanese translation of ECC documentation (ja-JP)
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>
This commit is contained in:
47
docs/ja-JP/rules/swift/coding-style.md
Normal file
47
docs/ja-JP/rules/swift/coding-style.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.swift"
|
||||
- "**/Package.swift"
|
||||
---
|
||||
# Swift コーディングスタイル
|
||||
|
||||
> このファイルは [common/coding-style.md](../common/coding-style.md) を Swift 固有のコンテンツで拡張します。
|
||||
|
||||
## フォーマット
|
||||
|
||||
- 自動フォーマットには **SwiftFormat**、スタイル強制には **SwiftLint** を使用する
|
||||
- Xcode 16+ には代替として `swift-format` がバンドルされている
|
||||
|
||||
## 不変性
|
||||
|
||||
- `var` よりも `let` を優先する — すべてを `let` で定義し、コンパイラが要求する場合にのみ `var` に変更する
|
||||
- デフォルトで値セマンティクスの `struct` を使用する。同一性や参照セマンティクスが必要な場合にのみ `class` を使用する
|
||||
|
||||
## 命名
|
||||
|
||||
[Apple API デザインガイドライン](https://www.swift.org/documentation/api-design-guidelines/) に従う:
|
||||
|
||||
- 使用箇所での明確さ — 不要な単語を省く
|
||||
- メソッドとプロパティは型ではなく役割にちなんだ名前を付ける
|
||||
- グローバル定数よりも `static let` を定数に使用する
|
||||
|
||||
## エラーハンドリング
|
||||
|
||||
型付き throws(Swift 6+)とパターンマッチングを使用する:
|
||||
|
||||
```swift
|
||||
func load(id: String) throws(LoadError) -> Item {
|
||||
guard let data = try? read(from: path) else {
|
||||
throw .fileNotFound(id)
|
||||
}
|
||||
return try decode(data)
|
||||
}
|
||||
```
|
||||
|
||||
## 並行性
|
||||
|
||||
Swift 6 の厳格な並行性チェックを有効にする。以下を優先する:
|
||||
|
||||
- 隔離境界をまたぐデータには `Sendable` 値型
|
||||
- 共有ミュータブル状態にはアクター
|
||||
- 非構造化 `Task {}` よりも構造化された並行性(`async let`、`TaskGroup`)
|
||||
20
docs/ja-JP/rules/swift/hooks.md
Normal file
20
docs/ja-JP/rules/swift/hooks.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.swift"
|
||||
- "**/Package.swift"
|
||||
---
|
||||
# Swift フック
|
||||
|
||||
> このファイルは [common/hooks.md](../common/hooks.md) を Swift 固有のコンテンツで拡張します。
|
||||
|
||||
## PostToolUse フック
|
||||
|
||||
`~/.claude/settings.json` で設定する:
|
||||
|
||||
- **SwiftFormat**: `.swift` ファイルを編集後に自動フォーマットする
|
||||
- **SwiftLint**: `.swift` ファイルの編集後にリントチェックを実行する
|
||||
- **swift build**: 編集後に変更されたパッケージを型チェックする
|
||||
|
||||
## 警告
|
||||
|
||||
`print()` 文にフラグを立てる — 本番コードでは代わりに `os.Logger` または構造化ロギングを使用する。
|
||||
66
docs/ja-JP/rules/swift/patterns.md
Normal file
66
docs/ja-JP/rules/swift/patterns.md
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.swift"
|
||||
- "**/Package.swift"
|
||||
---
|
||||
# Swift パターン
|
||||
|
||||
> このファイルは [common/patterns.md](../common/patterns.md) を Swift 固有のコンテンツで拡張します。
|
||||
|
||||
## プロトコル指向設計
|
||||
|
||||
小さく焦点を絞ったプロトコルを定義する。共有デフォルトにはプロトコル拡張を使用する:
|
||||
|
||||
```swift
|
||||
protocol Repository: Sendable {
|
||||
associatedtype Item: Identifiable & Sendable
|
||||
func find(by id: Item.ID) async throws -> Item?
|
||||
func save(_ item: Item) async throws
|
||||
}
|
||||
```
|
||||
|
||||
## 値型
|
||||
|
||||
- データ転送オブジェクトとモデルには構造体を使用する
|
||||
- 異なる状態をモデリングするには関連値付きの列挙型を使用する:
|
||||
|
||||
```swift
|
||||
enum LoadState<T: Sendable>: Sendable {
|
||||
case idle
|
||||
case loading
|
||||
case loaded(T)
|
||||
case failed(Error)
|
||||
}
|
||||
```
|
||||
|
||||
## アクターパターン
|
||||
|
||||
ロックやディスパッチキューの代わりに、共有ミュータブル状態にはアクターを使用する:
|
||||
|
||||
```swift
|
||||
actor Cache<Key: Hashable & Sendable, Value: Sendable> {
|
||||
private var storage: [Key: Value] = [:]
|
||||
|
||||
func get(_ key: Key) -> Value? { storage[key] }
|
||||
func set(_ key: Key, value: Value) { storage[key] = value }
|
||||
}
|
||||
```
|
||||
|
||||
## 依存性注入
|
||||
|
||||
デフォルトパラメータ付きでプロトコルを注入する — 本番ではデフォルトを使用し、テストではモックを注入する:
|
||||
|
||||
```swift
|
||||
struct UserService {
|
||||
private let repository: any UserRepository
|
||||
|
||||
init(repository: any UserRepository = DefaultUserRepository()) {
|
||||
self.repository = repository
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
アクターベースの永続化パターンについてはスキル: `swift-actor-persistence` を参照。
|
||||
プロトコルベースの DI とテストについてはスキル: `swift-protocol-di-testing` を参照。
|
||||
33
docs/ja-JP/rules/swift/security.md
Normal file
33
docs/ja-JP/rules/swift/security.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.swift"
|
||||
- "**/Package.swift"
|
||||
---
|
||||
# Swift セキュリティ
|
||||
|
||||
> このファイルは [common/security.md](../common/security.md) を Swift 固有のコンテンツで拡張します。
|
||||
|
||||
## シークレット管理
|
||||
|
||||
- 機密データ(トークン、パスワード、キー)には **Keychain Services** を使用する — `UserDefaults` は使わない
|
||||
- ビルド時のシークレットには環境変数または `.xcconfig` ファイルを使用する
|
||||
- ソースにシークレットをハードコードしない — 逆コンパイルツールで容易に抽出される
|
||||
|
||||
```swift
|
||||
let apiKey = ProcessInfo.processInfo.environment["API_KEY"]
|
||||
guard let apiKey, !apiKey.isEmpty else {
|
||||
fatalError("API_KEY not configured")
|
||||
}
|
||||
```
|
||||
|
||||
## トランスポートセキュリティ
|
||||
|
||||
- App Transport Security(ATS)はデフォルトで強制される — 無効にしない
|
||||
- 重要なエンドポイントには証明書ピンニングを使用する
|
||||
- すべてのサーバー証明書を検証する
|
||||
|
||||
## 入力バリデーション
|
||||
|
||||
- 表示前にすべてのユーザー入力をサニタイズしてインジェクションを防止する
|
||||
- 強制アンラップではなく、バリデーション付きの `URL(string:)` を使用する
|
||||
- 外部ソース(API、ディープリンク、ペーストボード)からのデータは処理前に検証する
|
||||
45
docs/ja-JP/rules/swift/testing.md
Normal file
45
docs/ja-JP/rules/swift/testing.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.swift"
|
||||
- "**/Package.swift"
|
||||
---
|
||||
# Swift テスト
|
||||
|
||||
> このファイルは [common/testing.md](../common/testing.md) を Swift 固有のコンテンツで拡張します。
|
||||
|
||||
## フレームワーク
|
||||
|
||||
新しいテストには **Swift Testing**(`import Testing`)を使用する。`@Test` と `#expect` を使用する:
|
||||
|
||||
```swift
|
||||
@Test("User creation validates email")
|
||||
func userCreationValidatesEmail() throws {
|
||||
#expect(throws: ValidationError.invalidEmail) {
|
||||
try User(email: "not-an-email")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## テストの分離
|
||||
|
||||
各テストは新しいインスタンスを取得する — `init` でセットアップし、`deinit` でティアダウンする。テスト間で共有ミュータブル状態を持たない。
|
||||
|
||||
## パラメータ化テスト
|
||||
|
||||
```swift
|
||||
@Test("Validates formats", arguments: ["json", "xml", "csv"])
|
||||
func validatesFormat(format: String) throws {
|
||||
let parser = try Parser(format: format)
|
||||
#expect(parser.isValid)
|
||||
}
|
||||
```
|
||||
|
||||
## カバレッジ
|
||||
|
||||
```bash
|
||||
swift test --enable-code-coverage
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
プロトコルベースの依存性注入と Swift Testing によるモックパターンについてはスキル: `swift-protocol-di-testing` を参照。
|
||||
Reference in New Issue
Block a user