---
name: promt2page
description: Deploy static HTML/CSS/JS websites to Promt2Page via Remote MCP, optimize images to WebP/JPEG for fast 5–15 MB delivery, enforce plan storage caps (50 MB Preview / 250 MB Starter / 1 GB Pro), register auto-connected domains, and manage Git snapshots.
---

# Promt2Page Agent Deployment Skill

You are connected to **Promt2Page** (`https://dev.promt2.page`), an agent-first static HTML hosting platform with tiered hard-enforced storage caps and automatic Git diff snapshots:
- **Preview (€0, 7-day preview)**: 50 MB storage, `*.promt2.page` subdomain only (no custom domains), latest version snapshot.
- **Starter (€3.25/mo billed €39/yr, or €4.99/mo)**: 250 MB storage, 1 custom domain + Auto SSL, 3 rolling Git snapshots.
- **Creator / Pro (€7.40/mo billed €89/yr, or €9.99/mo)**: 1 GB storage, up to 5 custom domains + Auto SSL, 15 rolling Git snapshots.

## Mandatory Pre-Flight & Optimization Rules

### 1. Check Quota & Plan First
Always call `check_account_and_quota` before preparing or uploading a bundle.
- Verify `storage.remainingBytes` is sufficient for the site you are about to deploy.
- Note `domains.used` vs `domains.limit` — if the user is on the `preview` plan (`domains.limit === 0`), deploy to their 7-day `*.promt2.page` preview URL without attaching a custom domain, and let them know they can upgrade to Starter or Pro in the dashboard to connect a custom domain.

### 2. Optimize & Compress All Images Before Deploying
Before calling `deploy_site`, inspect every image in the project (`.png`, `.jpg`, `.jpeg`, `.webp`, `.gif`, `.svg`) and optimize them so real-world sites stay around **5–15 MB** and load instantaneously:
- **Resize oversized images**: Cap hero/banner images at **1920px** max width and thumbnails/cards at **800px** max width.
- **Convert raster photos to WebP (quality 78–82)** or progressive JPEG when WebP is not desired.
- **Strip EXIF metadata** from all images.
- **Example CLI commands** (run whichever tool is available in the workspace):
  ```bash
  # Using sharp-cli (Node)
  npx --yes sharp-cli -i input.png -o output.webp resize 1920 --withoutEnlargement -- webp --quality 80

  # Using cwebp
  cwebp -q 80 -resize 1920 0 input.jpg -o output.webp

  # Using ffmpeg
  ffmpeg -y -i input.png -vf "scale='min(1920,iw)':-1" -quality 80 output.webp
  ```
- Update HTML/CSS `<img>` and `srcset` references to point to the optimized `.webp`/`.jpg` files and remove the unoptimized originals from the deploy payload.

### 3. Strictly Verify Total Bundle Size Under Plan Cap
Before calling `deploy_site`:
- Exclude `node_modules/`, `.git/`, `.env`, `*.map`, PSD/RAW source files, and build caches.
- Ensure `index.html` exists at the bundle root with relative asset paths.
- Compute total payload size on disk:
  ```bash
  # macOS / Linux
  du -sk ./dist

  # PowerShell
  (Get-ChildItem -Recurse -File ./dist | Measure-Object -Property Length -Sum).Sum / 1MB
  ```
- Confirm `newSiteBytes <= storage.remainingBytes` (taking existing sites into account). The server will atomically reject any upload that exceeds the user's plan cap.

### 4. Deploy & Verify
- Call `deploy_site` with either `files` (array of `{ path, content, encoding }` with `base64` for binary assets) or `archiveBase64` (a `.zip` archive).
- Promt2Page automatically runs `git status --porcelain`: if no files changed, no redundant snapshot is created.
- Return the live URL (7-day `*.promt2.page` preview or custom HTTPS domain) and snapshot commit hash to the user.

### 5. Domains & Rollbacks
- **Search / Buy Auto-Connected Domain**: Call `search_domain` to check availability and EUR pricing via Namecheap (€14.99–€19.99/yr with zero DNS setup). If the user is on Starter/Pro and wants to buy it, call `register_domain` (returns a Stripe payment link in production, or auto-provisions in Sandbox mode) and configures `A @ -> 192.99.160.85` and `CNAME www -> <domain>`.
- **Snapshots & Rollback**: Call `list_snapshots` to inspect commit history and `rollback_snapshot` with `siteId` and `commitHash` to restore any prior version immediately.
