/duet-ios-android:duetfrom Duet by Modaal: verifiable iOS and Android twins app architecture
Build and change native iOS and Android apps on the Duet framework: feature logic as pure reducers over typed State, Action and Effect, SwiftUI and Jetpack Compose shells, and recorded fixtures both apps replay byte-identically in CI. Use when a tree has parity/manifest.yaml, parity/fixtures, tools/duet or parity/duet-tools.ref, or depends on dev.modaal.duet, dev.modaal.duet.services or the Swift packages Duet, DuetShells and DuetTesting; when asked to add or change a feature, write a scenario or a chain, record or verify fixtures, run duet verify, duet record --check, duet lint, duet doctor or duet mcp, mount a store in a shell, compose features with a Dependency and a Component, add a worker, adopt DuetTelemetry or DuetTheming, generate design tokens, or move the family pins; and when a fixture drifts in CI, verify stops at its meta-checks, a Kotlin exception terminates the iOS app, or SwiftPM cannot resolve two duet versions. Covers the Kotlin Multiplatform flavor, the Swift flavor and twins.
Trending skills
7-day visitors to each skill page
Ships in Duet by Modaal: verifiable iOS and Android twins app architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A Duet app keeps each feature's logic in a pure reducer, renders it with the platform's own UI, and records the feature's behavior as fixtures: a scenario goes in, a canonical state and effect trace comes out. CI replays every fixture on every platform and fails on any byte that differs.
If the environment gives you its own Duet instructions or tools (a parity/authoring.md in the
tree, a host application's tools for running or scaffolding Duet apps), follow those; use this
skill for what they do not cover.
| What the tree holds | Shape | Where feature logic goes |
|---|---|---|
src-kmp/, and manifest rows with kotlin: only | Kotlin Multiplatform flavor: one Kotlin core both apps consume | src-kmp/subtrees/<feature>/logic/src/commonMain/ |
manifest rows with swift: only, packages depending on Duet | Swift flavor: a pure Swift core, Apple platforms only | src-ios/Subtrees/<Name>/<Name>Feature/Sources/ |
rows with both swift: and kotlin:, kotlinCore: jvm, src-android/ | twins: a Swift core for iPhone, a Kotlin core for Android | both; the row's scenario: names the side that records |
a checkout of github.com/modaal-agent/duet itself | the framework | read its CONTRIBUTING.md; this skill is for apps |
| no Duet yet | — | open tutorial1-start (Kotlin) or tutorial1-swift-start (Swift) from duet-tutorials, or follow the series by hand (worked-examples.md). Modaal (modaal.dev), the authoring service around the framework, scaffolds Duet projects |
| a CombineRIBs app | migration | duet-migration carries the coexistence shim and its port-or-delete recipe |
Then run tools/duet lanes for the tree's lanes and what verify does not cover, and
tools/duet lint for the manifest's state. model.md states the three shapes
in full.
Effect value, and
the feature's effect handler (its Runtime) performs it through the feature's environment. Saving a
value, a network call and a timer are effects; a worker is for lifecycle-bound work no single
effect requests.tools/duet record. Never edit one by hand. A behavior change
re-records in the same change, and the fixture diff is the review artifact.tools/duet mocks),
design tokens (tools/duet design-tokens), sum coders (tools/duet canonical-sum).TestClock, the deterministic-async helpers), never the
wall clock. A test that flakes under virtual time is a bug in the code or the test.@unchecked Sendable; tools/duet doctor reports it.@MainActor and build under strict concurrency.parity/manifest.yaml and its spec to parity/feature-specs/<f>.md;
the spec names every fixture in backticks.tools/duet record --feature <f> (--chain <c> for a chain). The side the manifest's
scenario: names writes the fixtures.StoreHost, the view rendering its state
(composition-and-shells.md).tools/duet verify: the meta-checks, then every lane, then the coverage gate.tools/duet record --feature <f> --check: regenerates in memory and fails if a byte changed.scenarios-and-fixtures.md has the scenario DSL on both flavors, chains, the manifest grammar and the replay runner.
Run tools/duet <verb> when the tree has the wrapper: it resolves the CLI at the tree's pin,
parity/duet-tools.ref. Without one, install the release binary of that pin, checked against its
.sha256 (cli.md), and run it by its path. The
CLI is a macOS Apple-silicon binary; inside an agent sandbox its download needs network access to
github.com and release-assets.githubusercontent.com. tools/duet help lists the verbs the
tree's pin has. The ones a feature loop uses:
| Verb | What it does |
|---|---|
verify [--feature <f>] | meta-checks, then every platform lane, then the coverage gate |
lint | the manifest meta-checks alone, in seconds |
record --feature <f> / --chain <c> | regenerate fixtures from the scenario; --check fails on a changed byte |
lanes | the lane inventory, and what verify does not cover |
explain | re-print the last run's failures from parity/.runs |
materialize <fixture>#<step> --platform <p> | write one failing step as a standalone test |
scope <path> | which gates govern a file |
doctor | the declaration cross-check and the worker-isolation lint |
mocks [--check], design-tokens [--check] | the code generators the manifest and the token file drive |
protocol-run [--platform swift|kotlin|both] | the corpus through a replay runner; verify does not run it |
mcp | the verification verbs as a stdio MCP server |
Each verb above except mcp takes --json. cli.md has every verb, the MCP entry and the CI
template.
tools/duet pins # the tree's pins, exit 1 on a disagreement
tools/duet pins --latest # plus the duet tag duet-services pins, and each repository's newest release
When tools/duet help lists no pins, the tree's pin predates the verb: run it at the newest
duet-tools tag for one run, DUET_TOOLS_REF=<tag> tools/duet pins --latest.
exact:, so SwiftPM fails to resolve a tree that moves one and not the
other. Move the Swift exact: pins and the Gradle catalog's duet and duetServices together.parity/duet-tools.ref deliberately, and read the "Adopting"
section of each duet-tools CHANGELOG entry you cross. Moving the CLI pin can also move the
floor of the manifest's mocks.bundle; tools/duet lint names it.| Product | What it gives an app |
|---|---|
DuetDiagnostics | a diagnostics port and an os.Logger worker |
DuetAppServices | inbound (URLs, push, lifecycle) and outbound (URL open, pasteboard, haptics, prompts) workers behind narrow ports |
DuetTelemetry, dev.modaal.duet.services:telemetry | the tracked-event grammar and a worker that fans events out to sinks |
DuetTheming, dev.modaal.duet.services:theming | themes, appearance and the provider the views read |
Adopt them at the composition root; services.md has the adoption steps, design tokens, localization and analytics.
In the Kotlin Multiplatform flavor the iPhone app links the core as one XCFramework. Check these five first when the iPhone side fails:
export.@Throws terminates the app.cancel() (BridgedStore in the tutorials' bridge library).swift test links the last assembled framework; assemble first (scripts/assemble_kit.sh).ARCHS=arm64.kotlin-on-apple.md has each, and the boundary file.
Generated doubles follow the family's mock dialect (<fn>CallCount, <fn>Args, <fn>Handler, …).
Kotlin interfaces get them from the kotlin-ksp-mocks skill's processor, Swift protocols from
tools/duet mocks, which runs the Sourcery templates the manifest's mocks: section names. Install
those skills for their detail: npx skills add modaal-agent/kotlin-ksp-mocks and
npx skills add modaal-agent/swift-sourcery-templates.
| Output | Action |
|---|---|
fixture listed but missing on disk: … run: tools/duet record --feature <f> | record the feature; a fixture comes from its scenario |
fixture on disk but not in manifest: <name> | add it to the row's fixtures: or delete the stray file |
duet verify: FAIL (meta-checks) — not running platform lanes | run tools/duet lint and fix its finding first |
✗ fixture '<name>' step <n> '<label>' — <kind> diverged | the reducer and the fixture disagree on that step's state or effects; tools/duet materialize <name>#<n> --platform <platform> reproduces the step as a test (the next: line names the same step) |
duet record --check: FAIL — behavioral drift in <n> fixture(s): | re-record with tools/duet record --feature <f>, read the diff, commit it |
[mocks] bundle: <v> is below the <v> floor | raise the manifest's mocks.bundle in the change that moves the CLI pin |
[declarations] <file>: … | .modaal/project.json disagrees with the disk; troubleshooting.md has each row |
[workers] … '@unchecked Sendable' | isolate the worker (@MainActor) or prove it Sendable |
duet: not inside a parity repo | run from inside the tree; its root holds parity/fixtures |
| the iOS app terminates on a Kotlin call | add @Throws to the boundary function and call it with try |
| SwiftPM cannot resolve two duet versions | move duet and duet-services together; tools/duet pins --latest |
troubleshooting.md has every diagnostic with its cause.
Store, TestStore,
canonical JSON, the fixture dialects, the three shapes.@Throws,
BridgedStore, assembling before Swift builds.duet mcp, CI.references/cli.md (opens in a new tab)references/composition-and-shells.md (opens in a new tab)references/kotlin-on-apple.md (opens in a new tab)references/model.md (opens in a new tab)references/scenarios-and-fixtures.md (opens in a new tab)references/services.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/worked-examples.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub modaal-agent/duet --plugin duet-ios-android