Files
stitch/CLAUDE.md
T

3.3 KiB

Stitch — working rules

Keep the documentation current (standing rule)

Updating the docs is part of finishing a change, not an optional extra. In the same turn as any feature, bug fix, or release:

  1. DEVELOPMENT_HISTORY.md — update whichever of these the change touches:
    • Release history table (version, time, trigger, content)
    • Timeline
    • Problems, blockers and fixes — symptom → root cause → fix → version. Record failed attempts and process mistakes too; the audit trail is the point.
    • Testing & verification audit — what was tested, and what is still untested
    • Project metrics — re-measure (tests, tools, eval), never estimate
    • Known limitations & open risks
  2. README.md — when setup or user-facing behaviour changes.
  3. Mention the doc update in one line at the end of the report to the owner.

Keep the plain-language style: the owner is not an Android developer.

Release checklist

export JAVA_HOME=~/.jdks/jdk-17.0.20.1+1
./gradlew testDebugUnitTest assembleRelease     # tests must pass
cp app/build/outputs/apk/release/app-release.apk dist/Stitch-<version>.apk
~/Android/Sdk/build-tools/35.0.0/aapt dump badging dist/Stitch-<version>.apk | head -1   # verify version
  • Work on develop (or a feature/<name> branch off it). For a release, branch release/<version> from develop, bump the version there, build, test, then merge into main and back into develop.
  • Tag it: v<version>-alpha.N (tests pass), -beta.N (phone checklist passed), plain v<version> (used on the phone without problems). Push branches and tags, then create the Gitea release (pre-release for alpha/beta) and attach the APK. Token: ~/.config/gitea/token, passed per command with -c http.extraHeader, never stored in the repo config; send a normal User-Agent to the Gitea API (it rejects Python's default with a 403). Gitea orders releases by the tag's date: a tag made after the fact must be given the real release date (GIT_COMMITTER_DATE), or it jumps to the top of the Releases tab.
  • Stitch is open source (Apache 2.0). New source files start with the SPDX header (// SPDX-FileCopyrightText: 2026 Mohammed Khalid / // SPDX-License-Identifier: Apache-2.0); code adapted from elsewhere is credited in NOTICE. Never commit personal data: real contact names or numbers, private addresses, keys or tokens. Examples use made-up names.
  • The owner is the only contributor. No Co-Authored-By: lines, "Generated with" footers or other AI attribution in commits, tags, pull requests or release notes. Commit as the repo's configured identity.
  • Bump versionCode and versionName in app/build.gradle.kts first.
  • Never copy the APK before confirming the build succeeded (a stale copy once shipped as a new version).
  • Signing: leave the default (debug key) so builds install over the owner's phone. -PreleaseKey switches to the real key at ~/.stitch-release-key/ and makes the APK refuse to install over the current app — only use it for the deliberate cutover in docs/SIGNING.md.
  • Emulator: ./gradlew assembleDebug -Pemulator (x86_64 Needle stub); grant /dev/kvm with setfacl and remove it afterwards.
  • Needle eval: python3 tools-dev/needle/run_eval.py ~/.cache/stitch-dl/needle/linux-x86_64/needle app/build/needle-tools.json 0.4 — "wrong" must stay 0.