|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | + |
| 5 | +- **Reference repo (read-only):** OpenCode lives at `<PATH_TO_OPENCODE_REPO>` (do not modify). This project is building an **iOS app equivalent of OpenCode’s frontend TUI**, so use the TUI sources under `packages/opencode/src/cli/cmd/tui/` as the main UX/feature reference. |
| 6 | + |
| 7 | +- `composeApp/`: Kotlin Multiplatform shared code (networking, domain models, repositories, shared ViewModels). iOS ships this as the static framework `ComposeApp` (SKIE enabled). |
| 8 | + - `composeApp/src/commonMain/...`: cross-platform Kotlin source |
| 9 | + - `composeApp/src/iosMain/...`: iOS bridges (Swift/Kotlin interop, share-extension hooks) |
| 10 | + - `composeApp/src/jvmTest/...`: JVM unit tests for shared logic |
| 11 | +- `iosApp/`: native iOS app and extensions |
| 12 | + - `iosApp/iosApp/`: SwiftUI app + some UIKit chat components |
| 13 | + - `iosApp/OCMobileShareExtension/`: Share Extension |
| 14 | + - `iosApp/iosAppTests/`: XCTest tests (run from Xcode) |
| 15 | +- `companion/`: macOS companion CLI (`oc-pocket`) |
| 16 | + |
| 17 | +Notes: |
| 18 | +- Local planning notes live in gitignored folders (e.g. `docs/ai/`, `.ai/plans/`). |
| 19 | + |
| 20 | +## Build, Test, and Development Commands |
| 21 | + |
| 22 | +- iOS (Xcode): `open iosApp/iosApp.xcodeproj` then build/run the `iosApp` scheme. |
| 23 | +- Kotlin (iOS compile): `./gradlew :composeApp:compileKotlinIosSimulatorArm64` |
| 24 | +- Kotlin framework (simulator): `./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64` |
| 25 | +- Shared Kotlin unit tests (JVM): `./gradlew :composeApp:jvmTest` |
| 26 | + |
| 27 | +## Coding Style & Naming Conventions |
| 28 | + |
| 29 | +- Kotlin: 4-space indentation; `PascalCase` for types, `camelCase` for functions/properties, `UPPER_SNAKE_CASE` for constants. |
| 30 | +- Swift: follow existing SwiftUI/UIKit patterns in `iosApp/iosApp/`; keep diffs small and consistent (no formatter is enforced in-repo). |
| 31 | +- Prefer explicit names over abbreviations; avoid cross-layer leakage (UI ↔ data). |
| 32 | + |
| 33 | +## Testing Guidelines |
| 34 | + |
| 35 | +- Kotlin tests: place in `composeApp/src/jvmTest/kotlin/**`, name files `*Test.kt`. |
| 36 | +- iOS tests: place in `iosApp/iosAppTests`, use XCTest conventions (`*Tests.swift`), run via Xcode test actions. |
| 37 | + |
| 38 | +## Commit & Pull Request Guidelines |
| 39 | + |
| 40 | +- Git history may be empty on some branches; use a consistent convention going forward (recommended: Conventional Commits like `feat: …`, `fix: …`, `chore: …`). |
| 41 | +- PRs: include a short description, testing notes (commands run), and screenshots/screen recordings for UI changes. Link the issue/ticket when applicable. |
| 42 | + |
| 43 | +## Configuration & Security Tips |
| 44 | + |
| 45 | +- API endpoints are currently hard-coded in `composeApp/src/commonMain/kotlin/com/ratulsarna/ocmobile/data/api/ApiConfig.kt`; update for your environment and avoid committing secrets. |
| 46 | +*** End Patch |
0 commit comments