Website dev

From jsath/claude-skills · View interactive version

Website dev is an AI agent skill from the GitHub repository jsath/claude-skills. Ship changes to an existing Next.js (or static) site that auto-deploys from GitHub to Vercel, and prove they are live: fresh clone, canonical package manager and build, local production check, push or PR, poll Vercel's GitHub commit status for that exact SHA, then smoke-test the live page for expect

How to use this skill

Skill file

Website Dev: build, push, prove it is live

A push is not a deploy and a 200 is not the right page. This skill ends only when the

exact commit is deployed and the live page shows the expected content.

Inputs

Missing the identity string? Pick one from the change itself (new heading, new title) before you start.

Rules

Steps

1. Fresh clone and preflight

gh repo clone <owner/repo> ~/tmp/<repo> && cd ~/tmp/<repo>
git remote show origin | grep 'HEAD branch'          # main vs master
gh auth status                                        # which account will author
git config user.name "<vercel-team member>"; git config user.email "<their GitHub noreply email>"

If you already have a working tree with uncommitted relevant work, continue that instead of overwriting it.

2. Install

pnpm install --frozen-lockfile / npm ci / yarn --frozen-lockfile / bun install to match the lockfile.

On npm peer-dependency conflicts: npm install --legacy-peer-deps. Then git diff package-lock.json: revert lockfile noise you did not intend (a renamed clone dir can rewrite the name field).

3. Change, then build

Make the change. Run the canonical build (pnpm run build etc.). Fix every error, rerun. After any later edit, rerun the build; an earlier green build is stale.

For a new Next.js route, confirm it appears in the build's route table and add it to app/sitemap.ts (or the sitemap source) and any index/nav page that lists siblings.

4. Local production check

lsof -nP -iTCP:3100 -sTCP:LISTEN            # anything here? if it is YOUR old next start, kill that PID (the node child, not just the npm wrapper)
PORT=3100 npm run start &
curl -s localhost:3100/<route> | grep -c "<identity string>"   # must be >= 1

An old next start whose .next folder was replaced returns 200 with blank or stale content. If the page renders client-side only, check the route's JS chunk or use a headless browser; view the page at 390 px and 1440 px wide for clipping and overflow.

5. Push

6. Prove the deploy

scripts/verify-deploy.sh <owner/repo> $SHA https://<domain>/<route> "<identity string>" 600

It polls Vercel's legacy commit status (Vercel reports there even when Checks and Deployments look empty), then fetches the live URL until the identity string appears.

| exit | meaning | do this |

|---|---|---|

| 0 | deployed, content verified | report done |

| 1 | Vercel failure/error | open the printed target_url, quote the exact error, fix, push a new commit |

| 2 | timed out while pending/building | keep polling once more; if still pending, report the target_url |

| 3 | deployed but content missing | catch-all route returning a fallback, wrong URL, CDN cache, or client-only render; verify the JS chunk |

| 4 | no Vercel status at all | Git integration, ignored build step, branch settings, or author gate; see below |

Author gate (status says the author is not a team member, or links to a team invite): push an empty commit authored by a team member on the same branch: git commit --allow-empty -m "chore: trigger vercel deployment" && git push, then rerun step 6 on the new SHA. For a PR preview, do it on the PR branch, not main. A squash merge can keep the PR author as commit author even when a team member merged it: check gh api repos/<o>/<r>/commits/<sha> --jq .author.login. Full diagnosis: references/vercel-author-gate.md.

Specialised paths

Progress reporting (long jobs)

Report against gates, not vibes: 1 code changed, 2 build passed, 3 local check passed, 4 visual QA done, 5 pushed (SHA), 6 Vercel success, 7 live content verified. Anything short of 7 is "not deployed yet", said plainly.

Output format

Shipped: add /pricing FAQ section
Repo: acme/site  branch: main  SHA: 3f9c2e1
Build: pnpm run build, passed (route /pricing in table)
Local: /pricing 200, "Frequently asked" present; 390px + 1440px checked
Vercel: success, https://vercel.com/acme/site/8kq...
Live: https://www.acme.com/pricing 200, "Frequently asked" present
Open: none

Failure handling

Security check before every push

git diff --cached | grep -nE '(sk-|ghp_|xox[bp]-|AKIA|BEGIN .*PRIVATE KEY|SUPABASE_SERVICE_ROLE|=.{32,})' must be empty, .env* must be gitignored, and no secret may carry a NEXT_PUBLIC_ prefix.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.