jovidecroock/pracht/pre-deploy
Claude Code and agent skill by jovidecroock/pracht
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Check a pracht build for production-only failures before deploying: missing env vars, Node-only APIs in edge bundles, missing ISG manifest or platform config, oversized bundles, and static-host gaps. Use for "pre-deploy check", "ready to ship?", "deployment checklist", "is my build production-safe".
Install
npx vskill@latest install jovidecroock/pracht/pre-deploySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as jovidecroock/pracht/pre-deploy.
Pracht Pre-Deploy
Run before every production deploy. Each adapter has a different runtime contract; enforce the one that matches the build. Never deploy on the user's behalf — end at the verdict.
MCP: if pracht dev-mcp is registered, prefer its inspect_*, doctor, and verify tools to the CLI.
Step 1: Build, then detect the adapter
Always build first — never lint a stale dist/.
adapterTarget is authoritative; vite.config.ts (nodeAdapter(), cloudflareAdapter(), vercelAdapter(), staticAdapter()) is the cross-check. Never assume the adapter.
Step 2: Framework-wide checks
These catch app-graph wiring problems independent of the adapter, including defineApp({ constraints }) violations and a stale .pracht/app-graph.json snapshot (fix that with pracht plan --write, then re-review the plan output). Resolve every status: "error" before continuing — if `pracht doctor` reports errors, stop here; the remaining checks will be noisy false positives. Stale generated typed-route files block deployment; if the app does not use them yet, note that typegen --check is optional.
If pracht inspect agents --json reports any WebMCP exposure, run the live browser boundary too. Point it at the already-started preview, or let it own the server lifecycle:
CI must install a pinned Chrome 150+ build and pass its executable with --browser; the verifier never silently downloads one. The verifier drives Chrome through playwright-core, which the app must list as a dev dependency. Treat unsupported API, startup/registration failure, and graph drift as deployment errors. Do not add --scenario unless the repository already supplies an explicitly safe WebMCP eval scenario.
For a PR deploy, pracht report --base origin/main produces a markdown summary (graph diff + verify + budgets) worth attaching.
Step 3: Adapter checklist
Node (@pracht/adapter-node)
dist/server/server.js,dist/server/.vite/client-manifest.json, and — if any
route is render: "isg" — dist/server/isg-manifest.json all exist.
pracht preview --skip-build(ornode dist/server/server.js) boots and
curl localhost:3000 returns 200.
- Every env var the app reads (grep
process.env.*acrosssrc/) is set in
the deployment environment. List them for the user.
- If the app mounts
createImageHandler()from@pracht/image/node,sharp
is installed and localOrigin is the same trusted public origin as nodeAdapter({ canonicalOrigin }). A relative image endpoint without both is an error in every environment; loopback-looking request origins are intentionally not trusted.
- Reverse proxy / TLS termination configured — out of scope here, flag for
confirmation.
- If the proxy strips Vite's deploy base, `nodeAdapter({ basePathStripped:
true }) is set; application code should still observe the public base in request.url, and the proxy must own the bare-base redirect (/app → /app/`).
- If the app registers background work with
args.waitUntil(), the process
manager sends SIGTERM (not SIGKILL) on stop and its grace period exceeds nodeAdapter({ shutdownTimeoutMs }) (default 10s); otherwise that work is cut off on every deploy. A custom server entry must call handler.closeEventStreams() then handler.drain() itself.
- Background work still reaching for
context.executionContext.waitUntilor a
platform context should move to the portable args.waitUntil() — the platform-specific call is undefined on every other adapter.
Cloudflare Workers (@pracht/adapter-cloudflare)
wrangler.toml/wrangler.jsoncpresent at repo root with an assets block
binding ASSETS, and bindings declared for every context.env.* access in loaders, middleware, and API routes (grep, then cross-check). pracht build generates dist/server/wrangler.json from it with main: "worker.js", no_bundle, the ESModule rule, and the assets directory; confirm it exists after the build and that wrangler deploy prints "Using redirected Wrangler configuration".
- If the config defines named environments, the deploy step must either build
with CLOUDFLARE_ENV=<name> or deploy with --env <name> from a config that sets the keys below. Only then does a config need them:
mainpoints atdist/server/worker.js— the deploy entry exporting only
the default handler and Cloudflare entrypoint classes. Pointing it at dist/server/server.js is an error: workerd validates every named export of the deploy entry and rejects the build metadata (buildTarget, manifests, resolvedApp, …) that server.js exports for the prerender pass.
no_bundle: trueplus anESModulerule whose globs include"**/*.js",
so Wrangler uploads pracht's lazy server chunks as separate modules instead of folding them into the entry, and assets.directory: "dist/client".
compatibility_dateis set and is a date the installed workerd supports. It
must not be newer than the runtime, or workerd refuses to start ("This Worker requires compatibility date X, but the newest date supported by this server binary is Y"). Never set it to today's date — that is by construction at or beyond the newest released workerd.
- No Node-only APIs in the server bundle. Check
compatibility_flags
first. Without nodejs_compat, pracht build already fails on any Node builtin left in the bundle (nodejs_als allows node:async_hooks), so grep for globals instead: process.cwd, Buffer, __dirname, __filename. With nodejs_compat (compatibility date 2024-09-23 or later) every node: import builds, but some modules are stubs that throw when called — flag calls into child_process, cluster, worker_threads and writes through fs. Dev already runs inside workerd via @cloudflare/vite-plugin, so this is the backstop for code paths dev never hits.
- An API route importing
@pracht/image/nodeis an error on Workers (its
optimizer needs sharp). Require cloudflareLoader or passthroughLoader.
- ISG uses the per-colo Workers Cache API with no extra config. If
time-revalidated routes should use the edge-tier Workers Caching upgrade, confirm both sides: cloudflareAdapter({ cache: true }) and "cache": { "enabled": true } in wrangler config. With it enabled, flag ISG routes reachable through unbounded query strings — require a bounded allowlist or canonical redirect, or an uncached gateway with a normalized cf.cacheKey — and check that markdown-capable routes normalize Accept at the gateway when variant fan-out matters.
- Bundle size: measure what actually deploys — every
.jsfile under
dist/server/ (worker.js alone is a few lines; no_bundle uploads the pre-built module graph). npx wrangler deploy --dry-run prints the total. The Workers limit is ~1 MB compressed on free, ~10 MB on paid. Warn at 80% of the active limit.
Vercel (@pracht/adapter-vercel)
.vercel/output/config.jsonexists withversion: 3, and
.vercel/output/static/ is populated.
- The render function exists at
.vercel/output/functions/<functionName>.func/server.js. The name defaults to render but is configurable via vercelAdapter({ functionName }) — read it from vite.config.ts rather than hardcoding render.func.
- Env vars are configured in the Vercel project. This cannot be verified from
the CLI alone: run vercel env pull and diff against process.env.* uses.
- Run the Cloudflare Node-only API check unconditionally. The render
function's .vc-config.json is always written with runtime: "edge". Do not skip it based on a runtime probe — ISG routes run the same bundle on Node, but a Node-only API still breaks the edge function.
- Every
<route>.prerender-config.jsonsits next to a Serverless
<route>.func (.vc-config.json with launcherType: "Nodejs"). Vercel rejects a prerender config paired with an edge function: Unexpected function type "EdgeFunction" at path "<route>".
vercelAdapter({ regions: "all" })is valid for the Edge render function,
but generated Node ISG function configs must omit regions so the project default applies; Node configs may only contain arrays of concrete region identifiers.
- An API route importing
@pracht/image/nodeis an error for the Edge
function. Require vercelLoader (with aligned allowed sizes) or passthroughLoader.
Static export (@pracht/adapter-static)
There is no server to get wrong, so this checklist is about what the host must do and what the build cannot enforce.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pre-deploy/SKILL.md
Popularity
- Repository stars
- 115
- Repository forks
- 6
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 May 2026, 6 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jovidecroock/pracht/pre-deploy)