> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modaal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent skills for Duet: teach Claude Code, Codex or Cursor the framework

> Install the Duet agent skill and the two test-double skills in Claude Code, Codex, Cursor or another coding agent, so it builds Duet features with the framework's own loop, commands and checks.

**Duet by Modaal** publishes an agent skill that teaches a coding agent the [Duet framework](https://docs.modaal.dev/articles/duet.md): the three project shapes, the feature loop and its commands, composition, the Kotlin core on the iPhone, the duet-services layer, the `duet` command-line tool, and the action for each diagnostic the tool prints. The skill runs the `duet` tool at the version your tree pins, and names no version itself: it reads your tree's pins.

## What the skills teach

| Skill | Teaches | Repository |
| - | - | - |
| `duet` | the framework, the `duet` CLI and duet-services | [modaal-agent/duet](https://github.com/modaal-agent/duet) |
| `kotlin-ksp-mocks` | generated test doubles for Kotlin interfaces | [modaal-agent/kotlin-ksp-mocks](https://github.com/modaal-agent/kotlin-ksp-mocks) |
| `swift-sourcery-mocks` | generated test doubles for Swift protocols, which `tools/duet mocks` runs | [modaal-agent/swift-sourcery-templates](https://github.com/modaal-agent/swift-sourcery-templates) |

A Duet tree uses all three: the `duet` skill sends the agent to the other two for test doubles.

## In Modaal

Modaal's agent works from Modaal's own Duet instructions and tools in every Modaal project. Install the skill for an agent you run yourself, outside Modaal, on a Duet tree. When an environment provides its own Duet instructions or tools, the skill tells the agent to follow those first.

## Claude Code

Add the marketplace, then install the plugin:

```text theme={null}
/plugin marketplace add modaal-agent/duet
/plugin install duet-ios-android@modaal-duet
```

The same two steps install the test-double skills:

```text theme={null}
/plugin marketplace add modaal-agent/kotlin-ksp-mocks
/plugin install kotlin-ksp-mocks@kotlin-ksp-mocks
/plugin marketplace add modaal-agent/swift-sourcery-templates
/plugin install swift-sourcery-mocks@swift-sourcery-templates
```

From a terminal, `claude plugin marketplace add modaal-agent/duet` and `claude plugin install duet-ios-android@modaal-duet` do the same. The plugin adds about 400 tokens to every session for the skill's description, and about 4,500 when the skill runs.

## A team

Commit the marketplace and the plugin to the repository's `.claude/settings.json`:

```json theme={null}
{
  "extraKnownMarketplaces": {
    "modaal-duet": {
      "source": { "source": "github", "repo": "modaal-agent/duet" }
    }
  },
  "enabledPlugins": {
    "duet-ios-android@modaal-duet": true
  }
}
```

`enabledPlugins` turns the plugin on; it does not download it. Each collaborator runs this once in the repository:

```bash theme={null}
claude plugin install duet-ios-android@modaal-duet --scope project
```

## Other agents

The [`skills`](https://skills.sh) command installs the skill into Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and the other agents it supports:

```bash theme={null}
npx skills add modaal-agent/duet
```

Add `-g` to install it for every project, or `--list` to see what the repository holds without installing. The test-double skills install the same way: `npx skills add modaal-agent/kotlin-ksp-mocks` and `npx skills add modaal-agent/swift-sourcery-templates`.

## By hand

Copy the skill's directory into your agent's skills directory:

```bash theme={null}
git clone --depth 1 https://github.com/modaal-agent/duet
cp -r duet/skills/duet ~/.claude/skills/
```

Copy it into `.claude/skills/` inside a repository instead to install it for that repository only.

## claude.ai and the Claude API

Zip the `skills/duet/` directory and upload it as a custom skill, following Anthropic's [Using Skills in Claude](https://support.claude.com/en/articles/12512180-using-skills-in-claude). For the API, create it with [`POST /v1/skills`](https://platform.claude.com/docs/en/api/skills/create), sending the directory's files under one top folder. The skill's frontmatter carries only the standard keys, so the directory uploads unedited.

## Optional: the CLI as an MCP server

`duet mcp` serves the verification commands (`verify`, `lint`, `record`, `lanes`, `explain`, `materialize`, `protocol-run`, `scope`, `doctor`) as MCP tools over stdio. Launch it with its working directory inside the tree:

```json theme={null}
{ "mcpServers": { "duet": { "command": "duet", "args": ["mcp"] } } }
```

In a tree that has the `tools/duet` wrapper, set `command` to the wrapper's path so the server runs the version the tree pins.

## Check that it loaded

In Claude Code, `/plugin` lists **Duet by Modaal: verifiable iOS and Android twins app architecture**. Ask the agent "what does `duet record --check` do?" in a Duet tree: the answer starts by invoking the `duet` skill.

## Updating

The plugin has its own version, which rises with each change to the skill; a duet release that leaves the skill unchanged leaves it. `claude plugin list` shows the installed version. Fetch the newest with:

```text theme={null}
/plugin marketplace update modaal-duet
/plugin update duet-ios-android@modaal-duet
```

Marketplaces you add yourself do not update automatically unless you turn that on for them. For an `npx skills` install, run `npx skills add modaal-agent/duet` again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.