This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Always respond to the user in Korean.
- Code comments, commit messages, etc. follow existing conventions.
- All content in this file MUST be written in English, regardless of the user's language.
- When adding new rules or sections, follow the existing formatting and language conventions.
When asked to commit, follow this procedure:
- Check recent commit history to match the existing message format (e.g.,
[#issue-number] description) - Present the commit message(s) and included files to the user for review
- MUST wait for explicit user approval before creating each commit — never batch-execute multiple commits without approval per commit
- Only create the commit after user approval
Commit message format:
- Write header only, or header + body. Nothing else.
- NEVER append
Co-Authored-By, signatures, or any extra metadata
Build system: Tuist v4.65.4
# Generate Xcode project from Tuist configuration
tuist generate
# Build the app (development)
xcodebuild -workspace Codive.xcworkspace -scheme Codive -configuration Debug
# Run tests
xcodebuild -workspace Codive.xcworkspace -scheme CodiveTests -configuration Debug test
# Lint code (runs automatically on build)
swiftlint
# Development environment setup (Fastlane)
fastlane setup_development
# App Store environment setup
fastlane setup_appstoreThis project follows MVVM (Model-View-ViewModel) pattern with Clean Architecture principles. The codebase is organized into feature-based modules with clear separation of concerns across three layers.
Domain Layer (Pure business logic, no external dependencies)
- Entities: Core data models
- UseCases: Business logic operations
- Repository Interfaces: Protocols that Data layer implements
Data Layer (Data access and networking)
- Repositories (Implementation): Implement Domain layer repository protocols
- DataSources: Remote (API via CodiveAPI) and Local (UserDefaults, CoreData) data sources
- DTOs: API response models that map to Domain entities
Presentation Layer (UI and state management)
- Views (SwiftUI): UI components and screens
- ViewModels: State management using
@Publishedproperties, orchestrate UseCases
Codive/
├── Application/ # App entry point and global configuration
├── Core/ # Shared utilities and resources
├── Features/ # Feature modules (Auth, Home, Feed, Profile, etc.)
│ └── [Feature]/
│ ├── Domain/ # Business logic
│ ├── Data/ # Data access
│ └── Presentation/ # UI
├── Shared/ # Common components (DesignSystem, Extensions, Data utilities)
├── DIContainer/ # Dependency injection containers
└── Router/ # Navigation and routing
The project uses a DIContainer pattern with centralized dependency management:
- AppDIContainer (
Codive/DIContainer/AppDIContainer.swift): Root container that creates and manages all feature containers - FeatureDIContainers (e.g.,
AuthDIContainer.swift): Individual containers for each feature that assemble their UseCases, Repositories, and ViewModels
Key pattern: Feature containers are initialized lazily by AppDIContainer and passed to Features. When implementing new features, create a corresponding [Feature]DIContainer.swift file following existing examples.
- Primary: Swift Concurrency (async/await) for networking and asynchronous operations
- Secondary: Combine framework for View bindings and state management
- ViewModels use
@Publishedproperties for SwiftUI state binding - API calls use async/await (see HomeDatasource.swift for examples)
- CodiveAPI: Swift OpenAPI generated client for backend communication
- Moya: Networking layer foundation (used by CodiveAPI)
- Kingfisher: Image caching and loading
- KakaoSDK: Kakao authentication integration
SwiftLint configuration (/.swiftlint.yml):
- Lint is run as a pre-build script automatically
- Key rules:
- No force casting (
as!) or force try (try!) - Use
.isEmptyinstead of.count == 0 - Trailing closures required for SwiftUI style
- Type body length: warning at 300 lines, error at 400 lines
- File length: warning at 400 lines, error at 600 lines
- Cyclomatic complexity: warning at 15, error at 25
- Type nesting max 2 levels, function nesting max 3 levels
- No force casting (
Run swiftlint manually to check code before committing.
- Framework: XCTest
- Location:
CodiveTests/Features/ - Run tests:
xcodebuild -workspace Codive.xcworkspace -scheme CodiveTests test - Tests should follow the same feature structure as main app (Domain, Data, Presentation)
- Deployment Target: iOS 16.0+
- Swift Version: 6.0+
- Configurations: Debug (with Dev app variant) and Release
- Development Team: BBVZV8T99P
- Code Signing: Manual (uses match)
Debug build:
- App name: "Codive (Dev)"
- Bundle ID:
com.codive.app - Provisioning:
match Development com.codive.app
Release build:
- App name: "Codive"
- Provisioning:
match AppStore com.codive.app
- Base URL: Set via
BASE_URLin xcconfig files (Codive/Resources/Secrets/Debug.xcconfigandRelease.xcconfig) - Kakao SDK:
KAKAO_APP_KEYandKAKAO_AUTH_URLconfigured in Info.plist - Custom URL schemes:
kakao[APP_KEY]andcodive://
API communication uses CodiveAPI package (Swift OpenAPI generated):
- Remote data sources (e.g.,
HomeDatasource.swift) call API services - Responses are converted from DTOs to Domain entities
- Use async/await for API calls
- Error handling should follow repository pattern (catch in repositories, surface as Result or throw)
- Router Pattern:
AppRouterand feature-specificNavigationRouters manage navigation stack - ViewFactory: Creates Views with injected dependencies
- Views request navigation through Router without creating child ViewModels directly
- Routes are typically handled in ViewModel, which calls Router methods
Current branch: feat/#57
Main branch for PRs: develop
Follow feature branch naming: feat/#[issue-number]
Adding a new feature:
- Create feature directory in
Codive/Features/[FeatureName]/with Domain/Data/Presentation subdirectories - Implement Domain layer (Entities, UseCases, Repository Interfaces)
- Implement Data layer (Repositories, DataSources, DTOs)
- Implement Presentation layer (ViewModels, Views)
- Create
[FeatureName]DIContainer.swiftinCodive/DIContainer/ - Register the container in
AppDIContainer - Add routing in
AppRouterif needed
Modifying API interaction:
- Update DTOs in appropriate Data layer (in feature)
- Ensure domain entity mapping in repository implementation
- Add corresponding API call method in repository if needed
Adding shared UI components:
- Place in
Codive/Shared/DesignSystem/following existing structure (Buttons, Sheets, Navigation, Alerts, UIHelpers, etc.) - Use custom style modifiers (e.g.,
.customCornerRadius(),.customShadow()) - Design system colors are in
Codive/Resources/Colors.xcassets
Updating build configuration:
- Modify
Project.swiftfor Tuist configuration - Rebuild with
tuist generateafter changes - Info.plist entries defined in Project.swift
infoPlistsection