# Contributing to Stitch Thanks for wanting to help. Stitch is maintained by one person, so this guide keeps things simple and predictable for everyone. ## The short version 1. **Fork** the repository and clone your fork. 2. Create a branch **from `develop`**: `git checkout -b feature/short-name develop` (use `fix/short-name` for bug fixes). 3. Make your change, **with tests**, and run the checks below. 4. Open a **pull request into `develop`** (never into `main`). 5. The maintainer reviews it. Only the maintainer merges; `main` and `develop` are protected. Please open an issue first for anything larger than a small fix, so no one spends a weekend on something that won't be merged. ## How the branches work | Branch | What it holds | Who writes to it | |---|---|---| | `main` | Released versions only | Maintainer, by merging a release | | `develop` | The next version, as it comes together | Maintainer, by merging pull requests | | `feature/*`, `fix/*` | One change each | You, in your fork | | `release/` | One per version | Maintainer | Releases are tagged `v-alpha.N` (tests pass), `v-beta.N` (tested on a real phone) and `v` (final). See the README for the full model. ## Before you open a pull request ```sh export JAVA_HOME=/path/to/jdk-17 ./gradlew testDebugUnitTest # every test must pass ./gradlew assembleDebug # it must build ``` If you touched how requests reach the on-device model (tool descriptions, `agent/Agent.kt`, `QuickCommands`), also run the Needle eval; its "wrong" count must stay **0**: ```sh python3 tools-dev/needle/run_eval.py path/to/needle app/build/needle-tools.json 0.4 ``` No paid AI key is needed to test: `python3 tools-dev/fake-ai/fake_ai.py` runs a stand-in AI server. ## What a good change looks like - **Safety comes first.** Stitch can call, text and tap on someone's phone. Anything that sends, deletes, pays or posts must go through the existing confirmation path (`Tool.risk`, `needsConfirmation`). Values that must be exact — phone numbers, names, times — come from the phone's data or the user's own words, never from a model's memory. - **Match the surrounding code**: Kotlin, Jetpack Compose, one module, comments that explain *why*. - **Plain language** in anything a user reads: Stitch is used by people who are not developers. - **Tests** for behaviour, especially bug fixes: a test that fails before the fix and passes after. - **New source files** start with the license header: ```kotlin // SPDX-FileCopyrightText: 2026 Your Name // SPDX-License-Identifier: Apache-2.0 ``` ## Commit messages A short summary line (under ~70 characters), a blank line, then *why* the change was needed. Reference the issue if there is one (`Fixes #12`). ## Licensing of contributions Stitch is licensed under the **Apache License 2.0**. By submitting a pull request you agree that your contribution is licensed under the same terms (section 5 of the license), and that you have the right to submit it. No separate agreement is needed. ## Reporting bugs and asking for features Use the issue templates. For a bug, the Stitch version (Settings shows it), your phone model and Android version, what you said to Stitch, and what happened are the four things that matter most. Security problems: please **don't** open a public issue — see [SECURITY.md](SECURITY.md). Everyone taking part is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md).