Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
67 changes: 67 additions & 0 deletions .claude/skills/committing-ios-changes/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: committing-ios-changes
description: Commit changes, stage files, or create a commit for Bitwarden iOS. Use when asked to "commit", "stage changes", "create commit", "git commit", or when ready to record changes to git history.
---

# Committing iOS Changes

## Pre-commit Check

Before committing, verify the preflight checklist is complete.
If not done: invoke `perform-ios-preflight-checklist` first.

## Commit Message Format

```
[PM-XXXXX] <type>: Brief description of what changed
```

- **Ticket**: `[PM-XXXXX]` or `[BWA-XXX]` β€” required
- **Type**: one of `feat`, `fix`, `bug`, `chore`, `refactor`, `test`, `docs`
- **Description**: imperative mood, lowercase after colon, no period at end
- PR number is appended automatically by GitHub on merge: `(#2399)`

### Type Guide

| Type | Use when |
|------|----------|
| `feat` | New user-visible feature |
| `fix` | Bug fix |
| `bug` | Bug fix (alternate convention used in this repo) |
| `chore` | Maintenance, dependency update, build change |
| `refactor` | Code restructuring without behavior change |
| `test` | Adding or updating tests only |
| `docs` | Documentation only |

### Examples from git log
```
[PM-32221] chore: Add appcontext to crashlytics
[PM-31470] bug: Show migrate personal vault on unlock
[PM-33136] fix: Centralize TOTP key error handling to reduce Crashlytics noise
[PM-31836] bug: Create Passkeys into MyItems
```

## What to Stage

Stage specific files β€” avoid `git add -A` or `git add .`:

```bash
git add BitwardenShared/UI/Auth/Login/LoginProcessor.swift
git add BitwardenShared/UI/Auth/Login/LoginProcessorTests.swift
```

## What NOT to Commit

- Files containing credentials, API keys, or secrets
- Build artifacts (`.build/`, `DerivedData/`, `.xcodeproj/` β€” already gitignored)
- Unintended changes to `project-*.yml` (verify these are intentional)
- Snapshot test images unless your PR intentionally changes UI

## Create the Commit

```bash
git commit -m "$(cat <<'EOF'
[PM-XXXXX] <type>: Your commit message here
EOF
)"
```
74 changes: 74 additions & 0 deletions .claude/skills/creating-ios-pull-request/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: creating-ios-pull-request
description: Create a pull request, open a PR, or submit a PR for Bitwarden iOS changes. Use when asked to "create PR", "open pull request", "submit PR", "push and open PR", or when work is ready for review.
---

# Creating an iOS Pull Request

## Prerequisites

- All commits are in place
- Preflight checklist complete (`perform-ios-preflight-checklist`)
- Branch is pushed to remote: `git push -u origin <branch-name>`

## PR Title Format

Match the commit format:
```
[PM-XXXXX] <type>: Brief description
```

Keep under 70 characters. GitHub appends the PR number on merge.

## PR Body

Use the repo's `.github/PULL_REQUEST_TEMPLATE.md` structure:

```markdown
## 🎟️ Tracking
[PM-XXXXX](https://bitwarden.atlassian.net/browse/PM-XXXXX)

## πŸ“” Objective
[1-3 sentences: what this PR does and why]

## πŸ“Έ Screenshots
[Required for UI changes. Use fixed-width images. Delete section if not applicable.]
```

## Create as Draft

```bash
gh pr create \
--draft \
--base main \
--title "[PM-XXXXX] <type>: Brief description" \
--body "$(cat <<'EOF'
## 🎟️ Tracking
[PM-XXXXX](https://bitwarden.atlassian.net/browse/PM-XXXXX)

## πŸ“” Objective
[Description]
EOF
)"
```

Always create as `--draft`. Mark ready for review only after self-review.

## AI Review Label

Before running `gh pr create`, **always** use the `AskUserQuestion` tool to ask whether to add an AI review label:

- **Question**: "Would you like to add an AI review label to this PR?"
- **Options**: `ai-review-vnext`, `ai-review`, `No label`

If the user selects a label, include it via the `--label` flag:

```bash
gh pr create --draft --label "ai-review-vnext" --title "..." --body "..."
```

## After Creating

1. Add labels via `labeling-ios-changes` skill
2. Self-review using `reviewing-changes` skill
3. Mark ready for review when satisfied
50 changes: 50 additions & 0 deletions .claude/skills/labeling-ios-changes/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: labeling-ios-changes
description: Label a pull request, categorize changes, or add labels to a PR for Bitwarden iOS. Use when asked to "label PR", "add labels", "categorize changes", "what labels should I add", or after creating a PR.
---

# Labeling iOS Changes

Apply labels to categorize the change type and affected app(s).

## Change Type Label (pick one)

| Commit type | Label |
|-------------|-------|
| `feat` β€” user-facing feature | `t:feature-app` |
| `feat` β€” internal tool/automation | `t:feature-tool` |
| `fix` / `bug` | `t:bug` |
| `chore` / `refactor` / `test` | `t:tech-debt` |
| `docs` | `t:docs` |
| CI/workflow changes | `t:ci` |
| Dependency updates | `t:deps` |
| LLM-generated / misc | `t:misc` |
| Breaking change (add alongside type label) | `t:breaking-change` |

## App Context Label (pick one or both)

| App affected | Label |
|--------------|-------|
| Password Manager (`BitwardenShared/`, `Bitwarden/`) | `app:password-manager` |
| Authenticator (`AuthenticatorShared/`, `Authenticator/`) | `app:authenticator` |
| Both | `app:password-manager` + `app:authenticator` |

## Apply Labels

```bash
gh pr edit <PR_NUMBER> --add-label "t:feature-app,app:password-manager"
```

On the current branch (no PR number needed):
```bash
gh pr edit --add-label "t:bug,app:password-manager"
```

## Special Labels

| Label | When to use |
|-------|-------------|
| `ai-review` | Request a Claude code review via CI |
| `automated-pr` | PR created by automation or workflow |
| `hold` | Prevent merge β€” add when PR should not be merged yet |
| `needs-qa` | QA review required before merge |
54 changes: 54 additions & 0 deletions .claude/skills/perform-ios-preflight-checklist/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: perform-ios-preflight-checklist
description: Perform preflight checks, pre-commit check, self review, or verify changes are ready to commit for Bitwarden iOS. Use when asked to "preflight", "pre-commit check", "self review", "ready to commit", "check my changes", or before creating a PR.
---

# iOS Pre-flight Checklist

Run this before every commit or PR.

## Automated Checks (Run These First)

```bash
mint run swiftformat --lint --lenient . # Formatting
mint run swiftlint # Lint
typos # Spell check
```

Fix any failures before continuing.

## Manual Checklist

### Architecture
- [ ] UDF respected: views send actions/effects, never mutate state directly
- [ ] Business logic in Processor; navigation logic in Coordinator
- [ ] No new top-level subdirectories in `Core/` or `UI/`
- [ ] `Services` typealias uses only the `Has*` protocols this processor needs

### Security
- [ ] Zero-knowledge: no unencrypted vault data logged, stored, or transmitted
- [ ] Secrets use `KeychainRepository`, not `UserDefaults`/`CoreData`
- [ ] User input validated via `InputValidator`
- [ ] Sensitive errors implement `NonLoggableError`
- [ ] Extension memory impact checked if KDF is involved

### Testing
- [ ] New processor actions/effects have tests
- [ ] Error paths tested (not just happy path)
- [ ] New protocols have `// sourcery: AutoMockable`
- [ ] Test files co-located with implementation files

### Documentation & Style
- [ ] All new public types/methods have DocC (`///`) documentation
- [ ] `TODO` comments include JIRA ticket: `// TODO: PM-12345 - description`
- [ ] Imports grouped: system β†’ third-party β†’ project modules
- [ ] `Has*` / `Default*` / `Mock*` naming conventions followed

### Hygiene
- [ ] No hardcoded secrets, credentials, or API keys
- [ ] No `try!` or force-unwraps (`!`) in production code paths
- [ ] No unintended changes to `project-*.yml` specs

## All Green?

Proceed to commit using the `committing-ios-changes` skill.
Loading