# Repository Guidelines ## Project Structure & Module Organization - `app/` holds Expo Router screens; tab flows live in `app/(tabs)/`, while modal or detail pages sit alongside feature folders. - Shared UI and domain logic belong in `components/`, `services/`, and `utils/`; Redux state is organized per feature under `store/`. - Native iOS code (HealthKit bridge, widgets, quick actions) resides in `ios/`; design and process docs are tracked in `docs/`. - Assets, fonts, and icons live in `assets/`; keep new media optimized and referenced via `@/assets` aliases. ## Build, Test, and Development Commands - `npm run ios` / `npm run ios-device` – builds and runs the prebuilt iOS app in Simulator or on a connected device. - `npm run reset-project` – clears caches and regenerates native artifacts; use after dependency or native module changes. ## Coding Style & Naming Conventions - TypeScript with React hooks is standard; use functional components and keep state in Redux slices if shared. - Follow ESLint (`eslint-config-expo`) and default Prettier formatting (2 spaces, trailing commas, single quotes). - Name components in `PascalCase`, hooks/utilities in `camelCase`, and screen files with kebab-case (e.g., `ai-posture-assessment.tsx`). - Co-locate feature assets, styles, and tests to simplify maintenance. ## Testing Guidelines - Automated tests are minimal; add Jest + React Native Testing Library specs under `__tests__/` or alongside modules when adding complex logic. - For health and native bridges, include reproduction steps and Simulator logs in PR descriptions. - Always run linting and verify critical flows on an iOS simulator (HealthKit requires a real device for full validation). ## Commit & Pull Request Guidelines - Prefer Conventional Commit prefixes (`feat`, `fix`, `chore`, etc.) with optional scope: `feat(water): 支持自定义提醒`. Keep summaries under 80 characters. - Group related changes; avoid bundling unrelated features and formatting in one commit. - PRs should describe the problem, solution, test evidence (commands run, screenshots, or screen recordings), and note any iOS-specific setup. - Link to Linear/Jira issues where relevant and request review from feature owners or the iOS platform team. ## iOS Integration Notes - HealthKit, widgets, and quick actions depend on native modules: update `ios/` and re-run `npm run ios` after modifying Swift or entitlement files. - Keep App Group IDs, bundle identifiers, and signing assets consistent with `app.json` and `ios/digitalpilates.xcodeproj`; coordinate credential changes with release engineering.