一键导入
style-guide
Code style and formatting rules. Use when writing code, naming types, or fixing SwiftLint issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Code style and formatting rules. Use when writing code, naming types, or fixing SwiftLint issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | style-guide |
| description | Code style and formatting rules. Use when writing code, naming types, or fixing SwiftLint issues. |
Read the official style guide documentation at docs/StyleGuide.md for complete formatting rules, naming conventions, and SwiftLint configuration.
| Rule | Convention |
|---|---|
| Protocols | Contract suffix, always any when used as type |
| Mocks | Mock suffix (never prefix) |
| Mock variables | Also use Mock suffix |
| Parameters | identifier not id |
| Force unwrap | Never use ! |
| Access modifiers | Never explicit internal |
| Pattern matching | case let .foo(a, b): not case .foo(let a, let b): |
| Line length | Max 140 characters |
Contractany (e.g., any TrackerContract)Mock (suffix only, never prefix)Mock suffix!)case let before the pattern, not let inside each bindingSwift 6 concurrency patterns. Use when working with async/await, actors, MainActor isolation, or Sendable conformance.
Creates Features for dependency injection. Use when creating features, exposing public entry points, or wiring up dependencies.
Creates Repositories that abstract data access. Use when creating repositories, transforming DTOs to domain models, or implementing local-first caching. Supports remote-only, local-only, and cached (remote + local) repositories with CachePolicy.
Creates a new feature module with minimal viable structure. Use when bootstrapping a new feature from scratch, scaffolding the Tuist module, Container, Feature entry point, DeepLinkHandler, and initial screen with placeholder Text view. Includes all unit tests, mocks, stubs, and app integration. For adding domain/data layers afterward, use /datasource, /repository, /usecase. For enhancing views, use /view, /viewmodel, /navigator.
Creates Navigator for navigation. Use when setting up navigation, adding navigation to ViewModels, or testing navigation behavior.
Creates ViewModels with state management. Use when creating ViewModels, implementing ViewState pattern, or adding state management for features. Delegates to /usecase for domain use cases and to /feature for Container/Feature wiring.