# Succession LP publishing (add this section to your CLAUDE.md)

> Paste this whole section into your existing CLAUDE.md. Do NOT replace your file: keep whatever is already in it and add this alongside.

You publish Figma frames as live landing pages on the `succ-lp` server, then polish them before sharing with the client. The work is TWO PHASES:

- **Phase 1, Figma to page:** one command pulls a Figma frame and builds a live responsive web page.
- **Phase 2, polish:** you pull that live page down, edit the actual HTML (final copy tweaks, spacing, anything the auto-build missed), and push it back live. THIS is where the page gets finished before the client sees it.

Always finish Phase 1 before Phase 2. Re-running Phase 1 rebuilds from Figma and overwrites Phase 2 edits, so do all Figma changes first, then polish last.

## One-time setup: your own Figma token
**When:** right now, before your first publish, to replace the temporary starter token already on the server. After that, only set it again to rotate it, or if a publish ever fails with a token error.

In Figma: avatar, Settings, Security, Personal access tokens. Generate one with scope **File content: Read-only**. Then:
```
ssh succ-lp 'succ-deploy set-token figd_your_token_here'
```
It prints your Figma account on success. Your token stays in your own account on the server; nobody else can read it. It is personal: never paste it into a chat or message.

## Phase 1: publish from Figma
1. In Figma, right-click the FRAME, choose **Copy link to selection** (the link must contain `node-id`).
2. Pick a short client slug (lowercase, hyphens, no spaces). It becomes the subdomain.
3. **New client? The subdomain needs a DNS A record first.** Ask which you prefer, then do one of these:
   - **You add it yourself:** add an A record `<client-slug>.succession.media` pointing to `18.246.162.246` in the DNS panel.
   - **Omar adds it:** run
     ```
     ssh succ-lp 'succ-deploy request-dns <client-slug>'
     ```
     That posts the exact A record task to Omar in the ops Slack channel. He adds it.
   Either way, wait until `dig +short <client-slug>.succession.media` returns `18.246.162.246` before publishing. Re-publishing an existing client needs no DNS step.
4. Publish:
   ```
   ssh succ-lp 'succ-deploy <client-slug> "<figma-frame-url>"'
   ```
   Live at `https://<client-slug>.succession.media`. The first publish also issues HTTPS automatically.

If a page comes out as a flat image (a very design-heavy frame), force the editable build so you can polish it: add `--render=html` to the publish command.

## Phase 2: polish the live page (the last touches)
Once the page is published, finish it by editing the real HTML.

1. Pull the live page into a local folder:
```
rsync -avz succ-lp:/var/www/<client-slug>/ ~/succession-lps/<client-slug>/
```
2. Edit `~/succession-lps/<client-slug>/index.html` directly (fix copy, spacing, headings, links, anything off). Images live in the `assets/` folder beside it.
3. Push it back live (changes are instant, no rebuild):
```
rsync -avz ~/succession-lps/<client-slug>/ succ-lp:/var/www/<client-slug>/
```
4. Open `https://<client-slug>.succession.media`, confirm it looks right, then share with the client.

## Rules
- You run `succ-deploy` (Phase 1) and `rsync` to/from `succ-lp` (Phase 2). Never touch the server config or other clients' folders.
- For a new client subdomain, always settle the DNS A record first: add it yourself, or send it to Omar with `succ-deploy request-dns <client-slug>`.
- No em dashes or en dashes in any copy. Use commas, periods, or colons.
- If anything errors, send the full error text to Omar. Do not try to fix the server.
- Your key and Figma token are yours. Keep them private.
