# Set up Satzstrom in this project

Follow this guide to install the Satzstrom CLI, install its official skill, connect
the local MCP server, and verify the setup with a real document. Work in the user's
current project. No private Satzstrom source code is needed.

## 1. Install the CLI

The current public preview supports Windows x64 and Linux x64 with Node.js 20 or
newer. Check the local platform and Node.js version first. If a prerequisite is
missing, explain what is needed before continuing.

```sh
npm install -g satzstrom
satzstrom --version
```

## 2. Install the official skill

Read the complete [Satzstrom skill](https://satzstrom.com/skills/satzstrom/SKILL.md)
and install it using the coding agent's supported skill installation workflow.
Use the [Quickstart](https://satzstrom.com/quickstart.md) for the current project
and authoring workflow. The [documentation index](https://satzstrom.com/docs/llms.txt)
links directly to the public Markdown references.

## 3. Connect the local MCP server

Register a local stdio MCP server named `satzstrom` with command `satzstrom` and
arguments `["mcp"]`. Reuse an existing matching registration.

For Codex:

```sh
codex mcp add satzstrom -- satzstrom mcp
```

For Claude Code or another client, use that client's supported MCP configuration
workflow with the same command and arguments. See the
[MCP reference](https://satzstrom.com/docs/mcp.md) for the tool contracts.

If loading the skill or MCP tools requires a new task or session, tell the user
exactly how to continue. Verify that the skill and tools are available in that
session before claiming setup is complete.

## 4. Create or use a document

Use an existing Satzstrom document if the project has one. Otherwise initialize
a new document in an unused subdirectory of the current project, for example:

```sh
satzstrom init my-document
```

`init` creates the React project and installs its dependencies. Work in its ordinary
React and CSS files. Use an explicit, preferably absolute `documentPath` with each
MCP document operation. The renderer installs its pinned browser runtime on first
use when required.

## 5. Verify the complete workflow

1. Run MCP `check` with the explicit `documentPath` and fix any reported issues.
2. Run MCP `inspect` with that path, `images: true`, `startPage: 1` and `endPage: 1`.
3. Open the returned page image and inspect the actual layout. Refine the document
   and inspect again if necessary.
4. Run MCP `render` with the document path and an explicit PDF output path, following
   the MCP reference. Confirm that the PDF was created.

If MCP is unavailable, the CLI can diagnose and render the document:

```sh
satzstrom check my-document/document.tsx --strict
satzstrom inspect my-document/document.tsx --images
satzstrom render my-document/document.tsx --strict
```

A successful CLI render verifies document rendering; report an unavailable MCP
connection separately rather than treating it as a completed agent setup.

## Finish

Tell the user where the project and PDF are, and whether the CLI, skill and MCP
connection were verified. If anything failed, state what failed and the next step.
For subsequent authoring, follow the skill: edit, inspect the rendered pages,
refine, then create the final PDF. Rendering runs on the user's computer; the
coding agent provider's own data settings still apply.

Run `satzstrom doctor /absolute/path/document.tsx` to see CLI and primitives versions and the resolved project. MCP exposes the same `doctor` operation with an explicit documentPath and reports the running server version. Version differences alone do not block rendering. Restart the MCP server after updating the CLI. Verify setup with a document check and a first-page image inspection.
