# Contributing to MooshieUI This guide describes how to land changes on `main` via pull request. `main` is branch-protected: do not push directly to it. For architecture and agent-specific conventions, see [AGENTS.md](https://github.com/Mooshieblob1/MooshieUI/blob/main/AGENTS.md). For automated bot review triage during releases, see [docs/BOT_REVIEW_TRIAGE.md](https://github.com/Mooshieblob1/MooshieUI/blob/main/docs/BOT_REVIEW_TRIAGE.md). --- ## 1. Fork, clone, and develop Follow [Build from source](https://github.com/Mooshieblob1/MooshieUI/blob/main/README.md#build-from-source) and the prerequisites in [CONTRIBUTING.md](https://github.com/Mooshieblob1/MooshieUI/blob/main/.github/CONTRIBUTING.md): ```bash git clone https://github.com//MooshieUI.git cd MooshieUI npm install npm run tauri dev ``` Work on a topic branch from up-to-date `main`: ```bash git fetch origin git checkout main git pull origin main git checkout -b chore/ ``` Use a lowercase slug with hyphens (for example `chore/fix-gallery-thumbnail`). --- ## 2. Security pre-commit hook (required) Every PR runs **GlassWorm Infection Audit** CI. Install the same checks locally so commits are not blocked unexpectedly: ```bash bash scripts/setup-hooks.sh ``` This enables `.githooks/pre-commit` (Unicode steganography, tampered git dates, suspicious `eval()` patterns, and related checks). See [Security](https://github.com/Mooshieblob1/MooshieUI/blob/main/README.md#-security) in the README for details. --- ## 3. Validate before you open a PR There is no Vitest/Jest suite; a few pure-logic `node:test` files in `scripts/tests/` run in CI. Rust has unit tests covering pure logic. `npm run check` runs the frontend gates in one go (build, i18n, portals, types). Run the checks that match your changes: | If you changed… | Run | |-----------------|-----| | Svelte, stores, TypeScript, `package.json` | `npm run build` (expect `✓ built in` at the end) | | Rust (`src-tauri/`) | `cargo check --manifest-path src-tauri/Cargo.toml` | | Rust shared with the headless server | Also `cargo check --manifest-path src-tauri/Cargo.toml --no-default-features --features server` | | Rust logic with test coverage | `cargo test --manifest-path src-tauri/Cargo.toml` (see note below) | | Rust formatting | `cd src-tauri && cargo fmt --check` | | Locale files (`src/lib/locales/*.ts`) | Ensure every locale has the same keys and `{placeholders}` as `en.ts` | | Documentation only | Check behavior against current code and release notes; verify local links and wiki page/section targets | The Rust suite is green on `main`. If `cargo test` fails, treat it as a regression from your change, not a known issue. ### Conventions (high-signal) - **Dual-mode IPC:** All backend calls use `ipcInvoke()` / `ipcListen()` in `src/lib/utils/ipc.ts` — never raw Tauri `invoke()` / `listen()` (browser mode breaks silently). - **Gallery images:** May be PNG, JXL or WebP; use `loadGalleryImageDisplay()` / `loadGalleryImagePng()` for the requested representation — do not read gallery files directly in the UI. Videos use their own output/export path. - **Svelte 5:** No `