Skip to content

[PM-33572] llm: Add implementing-ios-code skill with Swift templates#2446

Draft
SaintPatrck wants to merge 2 commits intomainfrom
llm/implementing-ios-code
Draft

[PM-33572] llm: Add implementing-ios-code skill with Swift templates#2446
SaintPatrck wants to merge 2 commits intomainfrom
llm/implementing-ios-code

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-33572

📔 Objective

Adds a Claude skill for implementing Bitwarden iOS features following established patterns.

What changed:

  • skills/implementing-ios-code/SKILL.md — Step-by-step implementation workflow: determines scope from a design doc, builds the Core layer first (models, services, repositories), then the full UI file-set (Coordinator, Processor, State, Action, Effect, View), wires DI into ServiceContainer, runs a security checklist (zero-knowledge, Keychain, InputValidator, NonLoggableError, extension memory), and ensures DocC documentation. References Docs/Architecture.md as authoritative and does not duplicate it.

  • skills/implementing-ios-code/templates.md — Minimal copy-paste skeletons derived from actual codebase files: Coordinator, Processor, State/Action/Effect, View (with store.binding and store.perform), Service (protocol + Default* + Has* + // sourcery: AutoMockable), and Repository. Each template notes the source file it was based on.

@github-actions github-actions bot added the t:llm Change Type - LLM related change (e.g. CLAUDE.md files) label Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Logo
Checkmarx One – Scan Summary & Detailsf2ba56e7-bd10-499f-a503-f2f716099a09

Great job! No new security vulnerabilities introduced in this pull request

@SaintPatrck SaintPatrck added the ai-review Request a Claude code review label Mar 13, 2026
@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

Claude finished @SaintPatrck's task in 7m 27s —— View job


I'll analyze this and get back to you.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.08%. Comparing base (8bf3557) to head (8668f72).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2446      +/-   ##
==========================================
- Coverage   87.09%   87.08%   -0.01%     
==========================================
  Files        1859     1859              
  Lines      164348   164348              
==========================================
- Hits       143132   143127       -5     
- Misses      21216    21221       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

Overall Assessment: APPROVE

Reviewed 2 new files adding an LLM skill for implementing Bitwarden iOS features with step-by-step workflow and code templates.

Code Review Details
  • ⚠️ IMPORTANT: Coordinator template declares stackNavigator as non-optional and non-weak, creating retain cycles
    • .claude/skills/implementing-ios-code/templates.md line 46
  • QUESTION: The referenced planning-ios-implementation skill does not exist in the repository
    • .claude/skills/implementing-ios-code/SKILL.md line 12

@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

Inline Findings

Finding 1 - ⚠️ IMPORTANT

File: .claude/skills/implementing-ios-code/templates.md line 46

Coordinator template declares stackNavigator as non-optional and non-weak, which will cause retain cycles

The HasStackNavigator protocol (BitwardenKit/UI/Platform/Application/Utilities/Coordinator.swift lines 95-98) defines stackNavigator as StackNavigator? and its documentation explicitly states: This value should be weak, otherwise a retain cycle might be introduced.

Every coordinator in the codebase uses:

private(set) weak var stackNavigator: StackNavigator?

The template shows var stackNavigator: StackNavigator (non-optional, non-weak). Since weak requires optionality in Swift, code generated from this template cannot be marked weak, creating retain cycles between coordinators and navigators.

This also means line 78 should use optional chaining: stackNavigator?.push(view) instead of stackNavigator.push(view).

Fix: Change line 46 to private(set) weak var stackNavigator: StackNavigator? and line 78 to stackNavigator?.push(view).


Finding 2 - ❓ QUESTION

File: .claude/skills/implementing-ios-code/SKILL.md line 12

The referenced planning-ios-implementation skill does not exist in the repository

This line instructs the LLM to invoke planning-ios-implementation if no plan exists, but that skill is not present in the .claude/skills/ directory. An LLM following this skill would fail at this prerequisite step.

Is this skill planned for a future PR, or should this reference be updated?

- SKILL.md: step-by-step implementation workflow (Core layer first, then UI
  file-set, DI wiring, security checklist, documentation); prerequisites check
  for design doc and Docs/Architecture.md
- templates.md: minimal copy-paste skeletons derived from actual codebase
  files — Coordinator, Processor, State/Action/Effect, View, Service, Repository;
  each template references the source file it was based on
@SaintPatrck SaintPatrck force-pushed the llm/implementing-ios-code branch from 6f815a6 to 8668f72 Compare April 8, 2026 13:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed 2 new files adding an LLM skill for implementing Bitwarden iOS features. The skill provides a step-by-step workflow (SKILL.md) and copy-paste code templates (templates.md) for Coordinator, Processor, State/Action/Effect, View, Service, and Repository patterns. Templates were verified against actual codebase files and correctly reflect current conventions, including the weak optional stackNavigator fix applied in the second commit.

Code Review Details
  • ⚠️ IMPORTANT: Domain list in SKILL.md omits Billing/, which is one of the six fixed subdirectories defined in CLAUDE.md
    • .claude/skills/implementing-ios-code/SKILL.md:20

From the plan, identify:
- Is this a new feature (full file-set) or modification of existing code?
- Which framework: `BitwardenShared`, `AuthenticatorShared`, or `BitwardenKit`?
- Which domain: `Auth/`, `Autofill/`, `Platform/`, `Tools/`, `Vault/`?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ IMPORTANT: Domain list is missing Billing/

Details and fix

CLAUDE.md defines six fixed subdirectories for Core/ and UI/: Auth/, Autofill/, Billing/, Platform/, Tools/, Vault/. This list omits Billing/, which could lead the LLM to place billing-related code in the wrong domain directory.

Suggested change
- Which domain: `Auth/`, `Autofill/`, `Platform/`, `Tools/`, `Vault/`?
- Which domain: `Auth/`, `Autofill/`, `Billing/`, `Platform/`, `Tools/`, `Vault/`?

**Data Models** (if needed)
- Request/Response types in `Core/<Domain>/Models/Request/` and `Response/`
- Enum types in `Core/<Domain>/Models/Enum/`
- CoreData entities only if persistence is needed (add to `Bitwarden.xcdatamodeld`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 We basically never add anything to Core Data. If something's stored on disk, it's either in UserDefaults or the Keychain, depending on how sensitive of data it is.

Maybe this should be

- More-sensitive information persisted to disk is in `KeychainRepository`. Less-sensitive information persisted to disk is in `AppSettingsStore`. Both of these are exposed through `StateService`. Try to use a separate protocol instead of adding to the `StateService, `AppSettingsStore`, and `KeychainRepository` protocols, to ensure interface segregation.


Before finishing:
- [ ] Vault data? → Must use `BitwardenSdk` for all encryption/decryption
- [ ] Storing credentials? → Must use `KeychainRepository`, not `UserDefaults`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [ ] Storing credentials? → Must use `KeychainRepository`, not `UserDefaults`
- [ ] Storing credentials? → Must use `KeychainRepository`, not `AppSettingsStore`


All new public types and methods require DocC (`///`) documentation.
Exceptions: protocol property/function implementations (docs live in the protocol), mock classes.
Use `// MARK: -` sections to organize code within files.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use `// MARK: -` sections to organize code within files.
Use pragma marks to organize code. `// MARK: -` is used to denote different objects in the same file; `// MARK:` is used to denote different sections within an object.

When adding a new screen, create these files (replace `<Feature>` throughout):

```
BitwardenShared/UI/<Domain>/<Feature>/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Sometimes a new screen requires a coordinator, but not always; often one coordinator manages multiple screens (and therefore multiple processors). I'm not sure how best to capture that judgement call here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:llm Change Type - LLM related change (e.g. CLAUDE.md files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants