
# Getting started

You need Node 22.12 or later and an app running locally. The first review takes a few minutes and needs no configuration and no model key.

## 1. Install

```sh
npm install -g @mattskilly/idiom
npx playwright@1.62.1 install chromium
```

The first line installs the CLI from npm (`bun add -g @mattskilly/idiom` works too). The second line installs the browser Idiom captures with, once per machine.

## 2. Review a page

```sh
idiom quick http://localhost:3000
```

Idiom opens the page at desktop and mobile widths, in light and dark, clicks through its controls with a probe that only lets read-only requests leave the browser, and runs every measured check. It writes `report.html` with each finding, a crop of the problem and how to fix it, plus a list of what a no-setup pass cannot reach (signed-in pages, error states that need fixtures).

## 3. Hand it to your agent

The Claude Code plugin bundles MCP tools, the Idiom skill and reminders after UI edits; in Codex the plugin adds the skill and `codex mcp add` adds the tools. A global CLI install is optional for plugin use. It needs Node 22.12 or later, npm/npx and the matching Chromium from step 1. The first MCP launch downloads the exact GitHub release named by the plugin.

In Claude Code:

```text
/plugin marketplace add mattskilly/idiom
/plugin install idiom@idiom
```

For Codex, in your shell:

```sh
codex plugin marketplace add mattskilly/idiom
codex plugin add idiom@idiom
codex mcp add idiom -- npx -y --package=https://github.com/mattskilly/idiom/releases/download/v0.24.1/mattskilly-idiom-0.24.1.tgz idiom mcp
```

Codex starts a plugin's MCP server inside the plugin's own directory rather than your project, so the Codex plugin supplies the Idiom skill and `codex mcp add` registers the MCP server, which Codex starts in each thread's project directory.

Update Claude Code with `/plugin marketplace update idiom`, then `/plugin update idiom@idiom`. Run `/reload-plugins` or start a new session to apply it. For Codex, run `codex plugin marketplace upgrade idiom`, then `codex plugin add idiom@idiom`, rerun the `codex mcp add` line above with the new release (it replaces the entry), and start a new session.

Remove a duplicate standalone server when switching (`claude mcp remove idiom` for Claude Code). For standalone clients, credentials, long-running tool timeouts and local plugin development, see [MCP](https://idiom.build/docs/mcp.md). [Design QA for Claude Code](https://idiom.build/docs/design-qa-for-claude-code.md) walks through the repair loop.

## 4. Declare a flow

`idiom quick` sees what a visitor sees. To cover the states a visitor rarely reaches, set up the project:

```sh
idiom init
```

`init` scaffolds the project, then offers to hand the rest of setup to Claude Code or Codex if either is installed. The agent gets a setup prompt built from your repo: how to start your app, seed data from your own fixtures (never real credentials), your routes and a first flow of 3–8 states. Using another agent? Print the prompt and paste it in:

```sh
idiom init --print-setup-prompt
```

`init` also looks for the places your project builds UI and wires Idiom into them in one plan you confirm once: a **Design QA (Idiom)** section in `AGENTS.md` (and `CLAUDE.md` or a Cursor rule when you have them) that tells every agent to triage, read context and run `idiom check --changed`, plus `.github/workflows/idiom.yml` when you use GitHub Actions. Git hooks, a nightly run and an Autobuild design-review rule are opt-in. Preview it with `idiom init --dry-run`, rerun only this step with `idiom init --wire`, and leave any surface alone with `--skip-wiring <surface>`. See [init wiring](https://idiom.build/docs/commands.md#wire-agents-ci-hooks-and-autobuild).

Setup writes three things:

- `PRODUCT.md` and `DESIGN.md`: your product's purpose and design law, which your agent reads before it writes UI.
- `.idiom/project.json`: how to start your app, viewports and check settings.
- `.idiom/flows/*.json`: flows, each a list of named states with how to reach them.

Setup is done when this prints `ready`; otherwise it names the first problem and its fix:

```sh
idiom init --validate
```

Then run the loop on a flow:

```sh
idiom check home          # every finding, in fix order
idiom fix home            # hand the top findings to your agent
idiom verify home         # prove they are gone
```

If the app will not start, `idiom doctor home` boots the server once with your settings, times each step and suggests the fix.

See [Configuration](https://idiom.build/docs/configuration.md#flows) for the flow format and [Testing loading, empty and error states](https://idiom.build/docs/testing-loading-empty-error-states.md) for forcing the hard states.

## 5. Gate pull requests

```sh
idiom check home                  # the first run records a baseline; commit .idiom/baselines
idiom check home --fail-on major  # later runs fail only on new problems
```

The first check on a clean commit records a baseline. After that, `check` reports only findings the baseline didn't have, and `idiom baseline accept home` accepts intentional changes. The [GitHub Action](https://idiom.build/docs/configuration.md#github-action) runs this on every pull request and posts one comment; `idiom init` writes that workflow for you when `.github/workflows/` exists, with a full check of every flow on pushes to the default branch.

When `autobuild.toml` exists, interactive `idiom init` (in its wiring plan) and `idiom upgrade` offer the default `idiom-check` gate with an exact diff and confirmation. Without a terminal (a build agent or setup script), run `idiom upgrade --yes` on a clean main: it applies the same diffs and prints them, and records the gate's first baseline (or prints the `idiom baseline record <flow>` command when HEAD is not clean). Commit the wiring and `.idiom/baselines` on main before branching builds. The gate runs `idiom check --gate --fail-on major --deferred warn`, with no path filter or verifier-skill requirement. Busy hosts warn about incomplete coverage; actual findings and run failures still fail. Finding verification is a separate opt-in for Idiom-originated tickets, using a detected project flow and project-derived paths. Once the gate is wired, both also offer the **fix step**, a one-line `skill = "idiom-fix"` swap on the same step (never applied by `--yes`): it fixes up to three new major findings per round inside the build, re-verifies, and fails with a short summary only for what it could not fix. See [fix findings inside the build](https://idiom.build/docs/commands.md#fix-findings-inside-the-build).

To gate every build an agent makes manually, use `idiom check --gate --fail-on major --deferred warn`. It checks only what the change affects within a 3-minute budget, skips docs- and test-only changes in under a second, and ends with a `Timing:` line. Keep the full check on a schedule.

If a step fails, [Troubleshooting](https://idiom.build/docs/troubleshooting.md) lists each symptom with its cause and fix, and `idiom doctor` names the step that failed.
