From 622c98d1ed8c5dd725bbacfdcf9617559f3188f7 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 13 Mar 2026 16:00:11 -0400 Subject: [PATCH 1/4] [PM-33575] llm: Add delivery skills for preflight, commit, PR, and labeling - perform-ios-preflight-checklist: automated checks (swiftformat, swiftlint, typos) + manual checklist covering architecture, security, testing, documentation/style, and hygiene - committing-ios-changes: [PM-XXXXX] : format with type guide and examples from git log; staged file guidance; what not to commit - creating-ios-pull-request: PR title format, body template from .github/PULL_REQUEST_TEMPLATE.md (Tracking/Objective/Screenshots), always draft, post-creation steps - labeling-ios-changes: change type labels (t:feature-app, t:bug, t:tech-debt, etc.), app context labels (app:password-manager, app:authenticator), special labels (ai-review, hold, needs-qa) --- .../skills/committing-ios-changes/SKILL.md | 67 +++++++++++++++++++ .../skills/creating-ios-pull-request/SKILL.md | 61 +++++++++++++++++ .claude/skills/labeling-ios-changes/SKILL.md | 50 ++++++++++++++ .../perform-ios-preflight-checklist/SKILL.md | 54 +++++++++++++++ 4 files changed, 232 insertions(+) create mode 100644 .claude/skills/committing-ios-changes/SKILL.md create mode 100644 .claude/skills/creating-ios-pull-request/SKILL.md create mode 100644 .claude/skills/labeling-ios-changes/SKILL.md create mode 100644 .claude/skills/perform-ios-preflight-checklist/SKILL.md diff --git a/.claude/skills/committing-ios-changes/SKILL.md b/.claude/skills/committing-ios-changes/SKILL.md new file mode 100644 index 0000000000..20f444f30d --- /dev/null +++ b/.claude/skills/committing-ios-changes/SKILL.md @@ -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] : 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] : Your commit message here +EOF +)" +``` diff --git a/.claude/skills/creating-ios-pull-request/SKILL.md b/.claude/skills/creating-ios-pull-request/SKILL.md new file mode 100644 index 0000000000..8221ec8739 --- /dev/null +++ b/.claude/skills/creating-ios-pull-request/SKILL.md @@ -0,0 +1,61 @@ +--- +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 ` + +## PR Title Format + +Match the commit format: +``` +[PM-XXXXX] : 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] : 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. + +## After Creating + +1. Add labels via `labeling-ios-changes` skill +2. Self-review using `reviewing-changes` skill +3. Mark ready for review when satisfied diff --git a/.claude/skills/labeling-ios-changes/SKILL.md b/.claude/skills/labeling-ios-changes/SKILL.md new file mode 100644 index 0000000000..e6acad6750 --- /dev/null +++ b/.claude/skills/labeling-ios-changes/SKILL.md @@ -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 --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 | diff --git a/.claude/skills/perform-ios-preflight-checklist/SKILL.md b/.claude/skills/perform-ios-preflight-checklist/SKILL.md new file mode 100644 index 0000000000..c03da2c395 --- /dev/null +++ b/.claude/skills/perform-ios-preflight-checklist/SKILL.md @@ -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. From 14f9e554416dbdc06280edbdeb05e3198897c3b6 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 27 Mar 2026 14:31:41 -0400 Subject: [PATCH 2/4] Add AI review label prompt to PR creation skill --- .claude/skills/creating-ios-pull-request/SKILL.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.claude/skills/creating-ios-pull-request/SKILL.md b/.claude/skills/creating-ios-pull-request/SKILL.md index 8221ec8739..791f9754b6 100644 --- a/.claude/skills/creating-ios-pull-request/SKILL.md +++ b/.claude/skills/creating-ios-pull-request/SKILL.md @@ -54,6 +54,19 @@ 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 From 697ed8423688a9014c4124afadfeeb4d6d4fc8b1 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 27 Mar 2026 15:21:10 -0400 Subject: [PATCH 3/4] Add llm commit type and t:llm label to delivery skills --- .claude/skills/committing-ios-changes/SKILL.md | 3 ++- .claude/skills/labeling-ios-changes/SKILL.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.claude/skills/committing-ios-changes/SKILL.md b/.claude/skills/committing-ios-changes/SKILL.md index 20f444f30d..ec0dad0de1 100644 --- a/.claude/skills/committing-ios-changes/SKILL.md +++ b/.claude/skills/committing-ios-changes/SKILL.md @@ -17,7 +17,7 @@ If not done: invoke `perform-ios-preflight-checklist` first. ``` - **Ticket**: `[PM-XXXXX]` or `[BWA-XXX]` — required -- **Type**: one of `feat`, `fix`, `bug`, `chore`, `refactor`, `test`, `docs` +- **Type**: one of `feat`, `fix`, `bug`, `chore`, `refactor`, `test`, `docs`, `llm` - **Description**: imperative mood, lowercase after colon, no period at end - PR number is appended automatically by GitHub on merge: `(#2399)` @@ -32,6 +32,7 @@ If not done: invoke `perform-ios-preflight-checklist` first. | `refactor` | Code restructuring without behavior change | | `test` | Adding or updating tests only | | `docs` | Documentation only | +| `llm` | LLM-related changes (CLAUDE.md, skills, prompts) | ### Examples from git log ``` diff --git a/.claude/skills/labeling-ios-changes/SKILL.md b/.claude/skills/labeling-ios-changes/SKILL.md index e6acad6750..736b1ed792 100644 --- a/.claude/skills/labeling-ios-changes/SKILL.md +++ b/.claude/skills/labeling-ios-changes/SKILL.md @@ -16,9 +16,10 @@ Apply labels to categorize the change type and affected app(s). | `fix` / `bug` | `t:bug` | | `chore` / `refactor` / `test` | `t:tech-debt` | | `docs` | `t:docs` | +| `llm` — LLM config, skills, prompts | `t:llm` | | CI/workflow changes | `t:ci` | | Dependency updates | `t:deps` | -| LLM-generated / misc | `t:misc` | +| Misc | `t:misc` | | Breaking change (add alongside type label) | `t:breaking-change` | ## App Context Label (pick one or both) From ca56d9afc1ad73201689eed3d7622d8c18f46ee1 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen Date: Fri, 27 Mar 2026 15:28:53 -0400 Subject: [PATCH 4/4] Add delivery workflow skill pointers to CLAUDE.md --- .claude/CLAUDE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 983f6547d6..11f7b66984 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -302,6 +302,16 @@ mint run swiftgen config run --config swiftgen-pm.yml # Generate as - **Network debugging**: Networking layer in `Networking/` Swift package — set breakpoints in `APIService` implementations - **State debugging**: Add `print(subject.state)` in processor tests to inspect state changes +## Delivery Workflow + +**You MUST use the following skills for code delivery tasks** — invoke via the Skill tool: + +- **Before committing**: Run `perform-ios-preflight-checklist` to verify architecture, security, testing, and style compliance +- **When committing**: Use `committing-ios-changes` for commit message format, staging guidance, and commit creation +- **When creating a PR**: Use `creating-ios-pull-request` for PR title/body format, draft creation, and AI review label prompt +- **When labeling a PR**: Use `labeling-ios-changes` for change type (`t:*`) and app context (`app:*`) label selection +- **When reviewing code**: Use `reviewing-changes` for architecture, style, compilation, testing, and security review + ## References - `Docs/Architecture.md` — Architecture patterns and principles (authoritative)