# Installing Reggie

Reggie is a Claude Code skill that captures before/after UI screenshots, builds a
comparison card, and keeps one visual report comment on a pull request.

You are reading this because someone asked you to install Reggie for them. Work
through the steps below, check your own work, and report honestly if a step fails.

## Requirements

- Node.js 20 or newer
- An authenticated GitHub CLI (`gh auth status`)
- A Filestack API key (free tier is fine) — https://www.filestack.com
- A web app the user can run locally, for capturing screenshots

## 1. Download and unpack the skill

The skill installs into the user's personal skills folder so it is available in
every project:

```bash
curl -fsSL -o /tmp/reggie.zip https://reggie.wynter.ai/downloads/reggie.zip
unzip -o /tmp/reggie.zip -d ~/.claude/skills
```

The archive already contains a top-level `reggie/` folder, so this creates
`~/.claude/skills/reggie/` with `SKILL.md` at its root. Do not create an extra
nesting level — `~/.claude/skills/reggie/reggie/SKILL.md` will not be detected.

Verify:

```bash
head -3 ~/.claude/skills/reggie/SKILL.md
```

You should see `---` followed by `name: reggie`.

## 2. Install dependencies

```bash
cd ~/.claude/skills/reggie
npm install
npx playwright install chromium
```

**If `npm install` fails while building `sharp` from source**, the machine has a
system libvips (common with Homebrew) that sharp prefers over its prebuilt
binary. Force the prebuilt one:

```bash
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install
```

Verify both dependencies load:

```bash
cd ~/.claude/skills/reggie && node -e "require('sharp'); require('playwright'); console.log('ok')"
```

## 3. Set the Filestack API key

Reggie uploads comparison cards to Filestack so GitHub can display them. Ask the
user for their key — do not invent one, and do not commit it to the repository.

```bash
export FILESTACK_API_KEY="their-key"
```

Tell the user to add that line to their shell profile (`~/.zshrc` or `~/.bashrc`)
so it persists, or to the project's `.env` if they prefer. If the user does not
have a key yet, everything except `add` and `publish` still works — say so
clearly rather than pretending the install is complete.

Optional variables:

| Variable | Purpose |
| --- | --- |
| `FILESTACK_POLICY` / `FILESTACK_SIGNATURE` | Only when Filestack security is enabled |
| `REGGIE_FILESTACK_PATH` | Storage path prefix, e.g. `reggie/` |
| `REGGIE_ICON_URL` | Public mascot URL; otherwise Reggie uploads the bundled icon once |

## 4. Check the GitHub CLI

```bash
gh auth status
```

Reggie uses `gh` to find the pull request and to create or update its comment. If
this is not authenticated, tell the user to run `gh auth login` themselves — it is
interactive and you cannot complete it for them.

## 5. Initialize the current project

From the root of the repository the user is working in:

```bash
node ~/.claude/skills/reggie/scripts/reggie.mjs init
```

This writes `.reggie.json` (base URL, viewport, masks) and creates a local
`.reggie/` workspace. Add `.reggie/` to the project's `.gitignore` unless the
user wants captures committed.

Then open `.reggie.json` and set `baseUrl` to wherever the user's app actually
runs — the default is `http://localhost:3000`.

Also add a `baseline` block. It is what lets Reggie be used *after* a change is
already made, which is the common case on an open pull request — it boots the base
commit in a throwaway worktree to rebuild the missing `before`:

```json
"baseline": { "command": "npm run dev", "port": 3101 }
```

Ask the user how their app starts, and pick a port the project never uses.

## 6. Confirm it works

Ask the user to start their app, then run a real capture against a route that
exists:

```bash
node ~/.claude/skills/reggie/scripts/reggie.mjs capture \
  --name install-check --slot before --url http://localhost:3000/
```

Look at `.reggie/screenshots/install-check-before.png` yourself. If it is blank,
a login page, or an error page, the install is not finished — fix the URL or the
app state before telling the user it works.

Clean up when you are done:

```bash
node ~/.claude/skills/reggie/scripts/reggie.mjs reset
```

## Command reference

```bash
node ~/.claude/skills/reggie/scripts/reggie.mjs help
node ~/.claude/skills/reggie/scripts/reggie.mjs init
node ~/.claude/skills/reggie/scripts/reggie.mjs capture --name <id> --slot before|after --url <url>
node ~/.claude/skills/reggie/scripts/reggie.mjs add --name <id> --title <title> --summary <sentence>
node ~/.claude/skills/reggie/scripts/reggie.mjs publish [--pr <number>]
node ~/.claude/skills/reggie/scripts/reggie.mjs report
node ~/.claude/skills/reggie/scripts/reggie.mjs reset
```

## Report back

When you are finished, tell the user:

1. Whether the skill is installed and detected
2. Whether Playwright, sharp, `gh`, and the Filestack key are each ready
3. Anything still needed from them, and the exact command to fix it

Then remind them how Reggie is used. He is user-invoked — nothing happens until
they run `/reggie` or ask for him by name. There are two paths:

- **Change not made yet:** `capture --slot before`, make the change,
  `capture --slot after`, then `add` and `publish`.
- **Change already made or already on a PR:** `baseline --name <id> --route <path>`
  captures both slots by rebuilding the `before` from the base commit, then `add`
  and `publish`.
