Official agent skill

Testing iOS Code

by bitwarden in bitwarden/ios

Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS.

OfficialGPL-3.0Auto-check passedTesting & QA

Install Testing iOS Code

skills CLI
$ npx skills add bitwarden/ios --skill testing-ios-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bitwarden/ios testing-ios-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bitwarden/ios.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/testing-ios-code .claude/skills/testing-ios-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-ios-code
GitHub stars
694
Token cost
~1.8k tokens
SKILL.md length
585 words
Files
10 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
GPL-3.0

At a glance

Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS.

  • Works in 6 steps: Choose Framework → Determine Test Type → Test Setup Pattern → …
  • Asked to write tests
  • SKILL.md covers Prerequisites, Step 1: Choose Framework, Step 2: Determine Test Type and Step 3: Test Setup Pattern, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Testing iOS Code is an agent skill from bitwarden/ios, published by the product's own GitHub organization. Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS. Use when asked to "write tests", "add test coverage", "test this", "unit test", "add tests for", "missing tests", or when creating test files for new implementations.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `examples/coordinator-test-example.md`, `examples/coordinator-test-swift-testing-example.md` and `examples/processor-test-example.md`).

It sits in Testing & QA, covering Test generation, Unit testing and Test coverage. It works with iOS. The repository describes itself as: Bitwarden mobile apps (Password Manager and Authenticator) for iOS. The licence is GPL-3.0.

When your agent uses it

  • Asked to write tests
  • Add test coverage
  • Creating test files for new implementations

Example prompts

  • “write tests”
  • “add test coverage”
  • “test this”
  • “/testing-ios-code”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Choose Framework
  2. Determine Test Type
  3. Test Setup Pattern
  4. Write Tests
  5. Verify Co-location
  6. Mock Generation

What it can do on your machine

Read from SKILL.md and the folder at commit 59bbfb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are swift).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing iOS Code loads about 1.8k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 585 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bitwarden/ios at commit 59bbfb3, republished under its GPL-3.0 licence (© bitwarden). 585 words, ~1,791 tokens.

Download SKILL.mdSave it as .claude/skills/testing-ios-code/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
testing-ios-code
description
Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS. Use when asked to "write tests", "add test coverage", "test this", "unit test", "add tests for", "missing tests", or when creating test files for new implementations.

Testing iOS Code

Use this skill to write tests following Bitwarden iOS patterns.

Prerequisites

Read Docs/Testing.md — it is the authoritative source for test structure, naming, templates, decision matrix, and simulator configuration.

Step 1: Choose Framework

ScenarioFrameworkWhy
New test fileSwift TestingPreferred for all new tests
Existing XCTest fileXCTestDon't mix frameworks in one file
ViewInspector testsXCTestViewInspector requires XCTest
Snapshot testsXCTestSnapshotTesting requires BitwardenTestCase

Step 2: Determine Test Type

Choose the right test type based on what you're testing:

WhatTest typeXCTest exampleSwift Testing example
Processor actions/effects/stateUnit testexamples/processor-test-example.mdexamples/processor-test-swift-testing-example.md
Coordinator navigation/routesUnit testexamples/coordinator-test-example.mdexamples/coordinator-test-swift-testing-example.md
View interactions (buttons, toggles)ViewInspector testexamples/view-test-example.md— (use XCTest)
View appearanceSnapshot test (disabletest_ prefix)examples/view-test-example.md— (use XCTest)
Service/repository business logicUnit testexamples/service-test-example.mdexamples/service-test-swift-testing-example.md

Step 3: Test Setup Pattern

Swift Testing (new files)

Use a struct with init() — no teardown needed, value types are discarded after each test:

swift
@MainActor
struct FeatureProcessorTests {
    let coordinator: MockCoordinator<FeatureRoute, FeatureEvent>
    let services: MockServiceContainer
    let subject: FeatureProcessor

    init() {
        coordinator = MockCoordinator()
        services = ServiceContainer.withMocks()
        subject = FeatureProcessor(
            coordinator: coordinator.asAnyCoordinator(),
            services: services,
            state: FeatureState(),
        )
    }
}
XCTest (existing files, ViewInspector, snapshots)

Use a class subclassing BitwardenTestCase with setUp()/tearDown():

swift
class FeatureProcessorTests: BitwardenTestCase {
    var coordinator: MockCoordinator<FeatureRoute, FeatureEvent>!
    var services: MockServiceContainer!
    var subject: FeatureProcessor!

    override func setUp() {
        super.setUp()
        coordinator = MockCoordinator()
        services = ServiceContainer.withMocks()
        subject = FeatureProcessor(
            coordinator: coordinator.asAnyCoordinator(),
            services: services,
            state: FeatureState(),
        )
    }

    override func tearDown() {
        super.tearDown()
        coordinator = nil
        services = nil
        subject = nil
    }
}

See examples/ for complete patterns per test type.

Step 4: Write Tests

Naming
FrameworkPatternExample
Swift Testing@Test func <functionName>_<behavior>()@Test func perform_appeared_loadsData() async
XCTestfunc test_<functionName>_<behavior>()func test_perform_appeared_loadsData() async
Assertions
XCTestSwift Testing
XCTAssertEqual(a, b)#expect(a == b)
XCTAssertTrue(x)#expect(x == true) or #expect(x)
XCTAssertNil(x)#expect(x == nil)
XCTAssertNotNil(x)#expect(x != nil)
XCTUnwrap(x)try #require(x)
XCTAssertThrowsError#expect(throws:) { ... }
Test focus areas

Processor tests — test both paths:

  • receive(_:) actions: assert subject.state mutations
  • perform(_:) effects: await subject.perform(.effect), then assert state or coordinator calls
  • Always test error paths, not just happy path

Service tests — test:

  • Successful operations
  • Error handling and propagation
  • Interactions with mocked dependencies

View tests — test (XCTest only):

  • Button taps → processor.dispatchedActions.last (sync)
  • Async button taps → processor.effects.last
  • State-driven UI (disabled buttons, text content)

Step 5: Verify Co-location

Test files must live alongside implementation files:

BitwardenShared/UI/Auth/Login/LoginProcessor.swift
BitwardenShared/UI/Auth/Login/LoginProcessorTests.swift  ← same directory

Step 6: Mock Generation

New protocols need mocks:

  1. Add // sourcery: AutoMockable as a trailing comment on the protocol declaration line
  2. Run ./Scripts/generate-mocks.sh <Framework> where <Framework> matches the target (e.g. BitwardenShared, AuthenticatorShared, BitwardenKit, AuthenticatorBridgeKit) — requires BUILD_DIR, see script header
  3. Or just build — Sourcery runs automatically in pre-build phase

See references/mock-generation.md for full details.

Show full SKILL.md (235 more words)Show less

Conventions

  • Fixtures live in the shared fixtures file for their area — reusable SDK-model and CipherView fixtures belong in the shared BitwardenSdk+<Area>Fixtures.swift file for the domain the model belongs to (e.g. CipherView.cardFixture()), not co-located inside an individual test file. Pick the file by area and framework: Vault models go in …/UI/Vault/PreviewContent/BitwardenSdk+VaultFixtures.swift, Auth models in …/Core/Auth/Services/TestHelpers/BitwardenSdk+AuthFixtures.swift, Tools models in …/Core/Tools/Extensions/TestHelpers/BitwardenSdk+ToolsFixtures.swift, and so on — under BitwardenShared for Password Manager or the AuthenticatorShared counterpart for Authenticator. Add new reusable fixtures to the matching file (create the area's fixtures file if one doesn't exist yet).
  • Split large test files per feature — when a test file grows unwieldy, break it into <Type>Tests+<Feature>.swift extensions (e.g. AddEditItemProcessorTests+DriversLicense.swift), and author the new file in Swift Testing.
  • Snapshot tests — pick the approach with the user — there are two valid patterns, and which fits is a human-discretion call. (1) Instantiate the view directly: build it with a MockProcessor/Store in setUp, then assertSnapshot(of: subject.navStackWrapped, as:) per state (all prefixed disabletest_); see AddEditSendItemView+SnapshotTests.swift. This is required for new views, which use #Preview macros that the snapshot harness cannot enumerate. (2) Iterate PreviewProvider._allPreviews, which is sometimes the better path for views that still expose a PreviewProvider. When a view could go either way, use the AskUserQuestion tool to let the user choose rather than deciding unilaterally — offer (a) instantiate the view directly and (b) iterate PreviewProvider._allPreviews, noting that direct instantiation is required if the view only exposes #Preview macros.

© bitwarden, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in .claude/skills/testing-ios-code of bitwarden/ios.

  • SKILL.md
  • examples/coordinator-test-example.md
  • examples/coordinator-test-swift-testing-example.md
  • examples/processor-test-example.md
  • examples/processor-test-swift-testing-example.md
  • examples/service-test-example.md
  • examples/service-test-swift-testing-example.md
  • examples/view-test-example.md
  • references/mock-generation.md
  • references/testing-gotchas.md

Open the folder on GitHubat commit 59bbfb3

Compare with similar skills

Testing iOS Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing iOS Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing iOS Code this skillbitwarden/ios694—~1.8kAutomated safety check: PassGPL-3.0
Test Generatorgustavscirulis/snapgrid1171 repos~2.7kAutomated safety check: NotesCustom licence
OpenROAD Module Test AdderThe-OpenROAD-Project/OpenROAD3.2k—~1.8kAutomated safety check: PassBSD-3-Clause
Caliber Testingcaliber-ai-org/ai-setup1.3k—~3.2kAutomated safety check: PassMIT
Test Coverage Reviewareed1192/finance-news-aggregator149—~2.6kAutomated safety check: PassMIT
Write Testsgrafana/synthetic-monitoring-app171—~1.2kAutomated safety check: PassAGPL-3.0

Similar skills

  • Test Generator

    gustavscirulis/snapgrid

    Generate test templates for unit tests, integration tests, and UI tests using Swift Testing and XCTest.

    117 GitHub starsUsed in 1 repo~2.7k tokens
    Testing & QAAuto-check: notes
  • OpenROAD Module Test Adder

    The-OpenROAD-Project/OpenROAD

    Adds integration or unit tests to an OpenROAD module: writes the Tcl test, generates golden files and registers it in both CMake and Bazel.

    3.2k GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Caliber Testing

    caliber-ai-org/ai-setup

    Writes Vitest tests following project patterns: tests/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment…

    1.3k GitHub stars~3.2k tokensUpdated 13 days ago
    Testing & QAAuto-check passed
  • Test Coverage Review

    areed1192/finance-news-aggregator

    Audit, plan, write, and verify unit tests for Python projects using pytest.

    149 GitHub stars~2.6k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Write Tests

    grafana/synthetic-monitoring-app

    Official

    Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.

    171 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Write Tests

    openplayerjs/openplayerjs

    Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…

    649 GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from bitwarden/ios

All 11 skills in this repo
  • Official

    Build the Bitwarden iOS app, capture all compiler and lint warnings, categorize them into Swift 6 concurrency vs actionable, and interactively fix the actionable ones.

    694 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Build Test Verify

    bitwarden/ios

    Official

    Build the project, run tests, lint, format, spell check, generate mocks, or verify the build passes for Bitwarden iOS.

    694 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Official

    Convert a hand-written bespoke mock to a Sourcery AutoMockable-generated mock.

    694 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Official

    Evaluates a bitwarden/ios "Update SDK to" PR against the sdk-swift commit range for compile-time, runtime and serialization breaking changes, maps affected symbols to iOS call sites, and applies…

    694 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Fixing Flaky Tests

    bitwarden/ios

    Official

    Diagnose and fix flaky (intermittently failing) tests in Bitwarden iOS.

    694 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Official

    Implement, write code, add a new screen, create a feature, new view, new processor, or wire up a new service in Bitwarden iOS.

    694 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Testing iOS Code

What does Testing iOS Code do?

Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS. Testing iOS Code is an agent skill from bitwarden/ios, published by the product's own GitHub organization. Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS.

When should I use Testing iOS Code?

Testing iOS Code fits situations like: asked to write tests; add test coverage; creating test files for new implementations.

How do I install Testing iOS Code in Claude Code?

Run `npx skills add bitwarden/ios --skill testing-ios-code -a claude-code`. Or copy the skill folder (.claude/skills/testing-ios-code in bitwarden/ios) into .claude/skills/testing-ios-code in your project. Claude Code loads it when a task matches its description.

How do I install Testing iOS Code in Codex?

Run `npx skills add bitwarden/ios --skill testing-ios-code -a codex`. Or copy the skill folder (.claude/skills/testing-ios-code in bitwarden/ios) into .agents/skills/testing-ios-code in your project. Codex loads it when a task matches its description.

Can I use Testing iOS Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bitwarden/ios --skill testing-ios-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-ios-code, .gemini/skills/testing-ios-code, .github/skills/testing-ios-code and .opencode/skills/testing-ios-code in your project.

What does Testing iOS Code need to run?

SKILL.md names no scripts, command-line tools or credentials: Testing iOS Code is instructions for the agent only.

Does Testing iOS Code access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing iOS Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing iOS Code use?

Testing iOS Code is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing iOS Code use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Testing iOS Code?

Skills that share tags, products or a category with Testing iOS Code: Test Generator (gustavscirulis/snapgrid, 117 stars), OpenROAD Module Test Adder (The-OpenROAD-Project/OpenROAD, 3.2k stars), Caliber Testing (caliber-ai-org/ai-setup, 1.3k stars) and Test Coverage Review (areed1192/finance-news-aggregator, 149 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing iOS Code?

bitwarden (a GitHub organization, an official publisher) maintains it in bitwarden/ios, which has 694 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 6, 2026.

Source: bitwarden/ios on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.