Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .claude/commands/work-on-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ Work through each phase sequentially. **Confirm with the user before advancing t

### Phase 1: Implement

Invoke the `implementing-android-code` skill and use it to guide your implementation of the task. Understand what needs to be done, explore the relevant code, and write the implementation.
Invoke `Skill(implementing-android-code)` to guide your implementation of the task. Understand what needs to be done, explore the relevant code, and write the implementation.

**Before advancing**: Summarize what was implemented and confirm the user is ready to move to testing.

### Phase 2: Test

Invoke the `testing-android-code` skill and use it to write tests for the changes made in Phase 1. Follow the project's test patterns and conventions.
Invoke `Skill(testing-android-code)` to write tests for the changes made in Phase 1. Follow the project's test patterns and conventions.

**Before advancing**: Summarize what tests were written and confirm readiness for build verification.

### Phase 3: Build & Verify

Invoke the `build-test-verify` skill to run tests, lint, and detekt. Ensure everything passes.
Invoke `Skill(build-test-verify)` to run tests, lint, and detekt. Ensure everything passes.

**If failures occur**: Fix the issues and re-run verification. Do not advance until all checks pass.

**Before advancing**: Report build/test/lint results and confirm readiness for self-review.

### Phase 4: Self-Review

Invoke the `perform-android-preflight-checklist` skill to perform a quality gate check on all changes. Address any issues found.
Invoke `Skill(perform-android-preflight-checklist)` to perform a quality gate check on all changes. Address any issues found.

**Before advancing**: Share the self-review results and confirm readiness to commit.

### Phase 5: Commit

Invoke the `committing-android-changes` skill to stage and commit the changes with a properly formatted commit message.
Invoke `Skill(committing-android-changes)` to stage and commit the changes with a properly formatted commit message.

**Before advancing**: Confirm the commit was successful and ask if the user wants to proceed to review and PR creation, or stop here.

Expand All @@ -56,7 +56,7 @@ Launch a subagent with the `/bitwarden-code-review:code-review-local` command to

### Phase 7: Pull Request

Prompt the user to invoke the `creating-android-pull-request` skill to create the pull request with proper description and formatting. **Create as a draft PR by default** unless the user has explicitly requested a ready-for-review PR.
Prompt the user to invoke `Skill(creating-android-pull-request)` to create the pull request with proper description and formatting. **Create as a draft PR by default** unless the user has explicitly requested a ready-for-review PR.

## Guidelines

Expand Down
15 changes: 13 additions & 2 deletions .claude/skills/build-test-verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,16 @@ ui/src/testFixtures/ # UI test utilities (BaseViewModelTest, BaseCom

## Lint & Static Analysis

**IMPORTANT**: Prefer running detekt on modified files only β€” a full project scan is slow and unnecessary during development. The project supports a `-Pprecommit=true` flag that limits detekt to staged files.

**IMPORTANT**: Always pipe detekt output through a filter to capture errors on the first run. Detekt prints violation details to stderr/stdout but Gradle can obscure them. Use the grep pattern below to see violations immediately.

```bash
# Detekt (static analysis)
./gradlew detekt
# Detekt on staged files only (preferred during development)
git add -u && ./gradlew -Pprecommit=true detekt 2>&1 | grep -E "FAILED|BUILD|Line |Rule |Signature|detekt" | head -40

# Detekt on all files (full scan, use sparingly)
./gradlew detekt 2>&1 | grep -E "FAILED|BUILD|Line |Rule |Signature|detekt" | head -40

# Android Lint
./gradlew lint
Expand All @@ -105,6 +112,10 @@ ui/src/testFixtures/ # UI test utilities (BaseViewModelTest, BaseCom
./fastlane check
```

### How `-Pprecommit=true` Works

The root `build.gradle.kts` configures detekt tasks to use `git diff --name-only --cached` when this property is set, limiting analysis to staged files only. This is the same mechanism used by the project's pre-commit hook. Stage your changes with `git add` before running.

---

## Codebase Discovery
Expand Down
3 changes: 2 additions & 1 deletion .claude/skills/testing-android-code/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ fun `test exception`() {

Common testing mistakes in Bitwarden. **For complete details and examples:** See `references/critical-gotchas.md`

> **β›” STOP β€” `@Suppress("MaxLineLength")`**: Do NOT add this annotation unless the `fun` declaration line **actually exceeds 100 characters**. Count the characters first. Do not copy it from nearby tests. Detekt will tell you if it's needed β€” when in doubt, leave it off.

**Core Patterns:**
- **assertCoroutineThrows + runTest** - Never wrap in `runTest`; call directly
- **Static mock cleanup** - Always `unmockkStatic()` in `@After`
Expand All @@ -263,7 +265,6 @@ Common testing mistakes in Bitwarden. **For complete details and examples:** See
- **Null stream testing** - Test null returns from ContentResolver operations
- **bufferedMutableSharedFlow** - Use with `.onSubscription { emit(state) }` in Fakes
- **Test factory methods** - Accept domain state types, not SavedStateHandle
- **@Suppress("MaxLineLength")** - Only add when the `fun` declaration line **actually exceeds 100 chars** β€” do not copy the pattern blindly

---

Expand Down
Loading