# Windsurf & Claude Code Android Release Playbook: Guardrails for AI-Authored AABs

> Ship Kotlin, Flutter, and Expo Android apps written with Claude Code and Windsurf Cascade — catching hallucinated deprecated SDKs, over-broad manifest permissions, 16 KB alignment gaps, and CI release automation.

- **Canonical URL**: https://gootester.com/frameworks/windsurf-claude-code-android
- **Config File**: CLAUDE.md / .windsurfrules & app/build.gradle.kts
- **Build Command**: `./gradlew clean :app:bundleRelease && bundletool dump manifest --bundle=app/build/outputs/bundle/release/app-release.aab`

```markdown
# Android Google Play Release Invariants (Enforced on Every Build)
- Target SDK: compileSdk = 36, targetSdk = 35+ (edge-to-edge WindowInsets mandatory)
- Native ABI Alignment: NDK r28+ / AGP 8.5.1+ with 16 KB (0x4000) ELF LOAD alignment
- Forbidden Permissions unless explicitly approved:
  READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, MANAGE_EXTERNAL_STORAGE,
  USE_EXACT_ALARM, QUERY_ALL_PACKAGES, FOREGROUND_SERVICE_DATA_SYNC
- Secrets: ZERO API keys in BuildConfig, local.properties bundled into DEX, or assets/
- Verification: Run ./gradlew lintRelease testReleaseUnitTest bundleRelease before commit
```

## Critical Play Console Gotchas
1. **LLM training-cutoff inertia generating `targetSdk = 33` or `34` Gradle files**: Without explicit `CLAUDE.md` or `.windsurfrules` instructions, coding agents frequently scaffold `compileSdk 34` and legacy Accompanist system-UI controllers that Google Play Console immediately blocks on new app uploads.
2. **Silent injection of restricted permissions to 'fix' file picker or notification prompts**: Ask an AI agent to 'let users pick a profile photo and set daily reminders', and it will often add `READ_MEDIA_IMAGES` and `USE_EXACT_ALARM` to `AndroidManifest.xml` — both of which trigger hard Play Console Special Access rejections when Photo Picker and `WorkManager` should be used.
3. **R8 reflection crashes hidden by testing only `assembleDebug` in the terminal**: Agents routinely run `./gradlew assembleDebug` to verify compilation, missing `MissingClasses` or stripped `kotlinx.serialization` / `Retrofit` / `Gson` models that crash instantly when `isMinifyEnabled = true` runs on `bundleRelease`.
4. **Unpinned transitive native AARs failing 16 KB (`0x4000`) ELF alignment**: Agents pulling older ML, PDF, or SQLCipher versions from memorized Maven coordinates introduce 4 KB aligned `.so` binaries that fail Android 15/16 bundle checks.

## Codifying Google Play Policy Inside `CLAUDE.md` and `.windsurfrules`

The secret to shipping production-grade Android apps with **Claude Code** and **Windsurf Cascade** is shifting Google Play compliance *left* into your repository's agent rule files (`CLAUDE.md` and `.windsurfrules`). Coding agents excel when given crisp, verifiable CLI constraints — and stumble when left to guess Play Console's 2026 policy rules from older open-source GitHub examples.
Pin four non-negotiable rules in your workspace prompt: (1) use Android's zero-permission `PickVisualMedia` Photo Picker instead of `READ_MEDIA_IMAGES`, (2) use `WorkManager` instead of `FOREGROUND_SERVICE_DATA_SYNC` or `USE_EXACT_ALARM`, (3) verify every release build with `bundletool build-apks --mode=universal` + `llvm-readelf -l` 16 KB checks, and (4) keep Data Safety documentation updated whenever adding Gradle or npm dependencies.
Before starting your 14-day closed test, run `/tools/play-store-data-safety-sdk-mapper` against your lockfile so every SDK added by your AI pair-programmer is accurately disclosed inside Play Console.

## Agentic CI/CD & MCP Workflows During Your 14-Day Closed Testing Window

Fast agentic iteration becomes a superpower *during* your 14-day Google Play closed testing campaign. When human closed testers report an edge-to-edge keyboard overlap or dark-theme contrast bug on `versionCode 1` (Day 3), Claude Code or Windsurf can reproduce, patch, write a regression test, increment `versionCode 2`, and trigger GitHub Actions in twenty minutes.
Wire your GitHub Actions workflow directly to GOOtester's scoped CI Release Bridge (`POST https://gootester.com/api/v1/ci/release` with `Authorization: Bearer gt_live_example_token_12345`) or inspect `/openapi.json` so every newly rolled-out `.aab` automatically registers inside your GOOtester campaign timeline without sharing any Play Console credentials.

## Pairing Rapid AI Code Velocity with Human Cohort + ARM64 Hardware Truth

AI agents can write 5,000 lines of Kotlin or Dart in an afternoon, yet they cannot legally opt into Google Play as human closed testers or feel touch-latency jitter on a budget MediaTek handset. Google Play requires at least 12 real consented humans opted in continuously for 14 consecutive days — and Google Play alone decides Production Access.
Combine GOOtester's human closed testing cohorts ($6 Basic: 12 testers / 14d; $12 Standard: 15 testers / 16d; $20 Premium: 25 testers / 24d, clock starting strictly after verified `testers@gootester.com` setup) with Standard/Premium's separate physical-device ARM64 ADB QA so every AI-authored release is battle-tested on real silicon.
