Skip to content

deploy-prebuilt-app-to-netlify

An agent skill for deploying a verified local build artifact to Netlify without asking Netlify to rebuild the source project.

Role
Agent workflow design and automation engineering
Scope
Deployment, deterministic validation, and portable distribution
Status
Published npm package v0.1.0
Only the built dist folder passing a preflight check before deployment

Problem

Teams that already have a built application often deploy it through a hosting flow designed for source code. That path can trigger unnecessary rebuilds, publish the wrong directory, or upload unsafe local artifacts such as secrets and caches.

Constraints

  1. C1

    The requested artifact must be validated before any remote mutation.

  2. C2

    Secrets, source trees, caches, and unrelated files must never enter the deploy payload.

  3. C3

    Site selection, production promotion, and deployment each require separate authorization.

Architecture

A local preflight checks the artifact and its publish directory before anything remote happens. The skill then selects the Netlify CLI flow behind explicit mutation gates and finishes by verifying the deployed URL and its content.

01

Preflight

Preflight validates the artifact tree, entry points, size, and excluded content.

02

Deployment

This layer chooses the correct draft or production Netlify CLI path, and only after authorization.

03

Verification

Verification reads back deployment state and confirms the delivered application at its public URL.

Decisions

D1

Deploy the artifact, not the repository

Prebuilt delivery stays separate from source builds and their dependency graph, so the build that was validated locally is the one that gets published.

D2

Block unsafe trees before login

Local safety checks run before credentials are requested or remote state changes, so an unsafe payload is rejected before it can affect the site.

D3

Verify the public result

A successful CLI exit is treated as incomplete until the deployment state and served content have been checked.

Contribution

  • Defined acceptance rules for safe artifact trees.
  • Implemented a deterministic preflight utility.
  • Separated authorization for draft deploys, production deploys, and site selection.
  • Added regression tests for the package and the deployment flow.

Outcomes

  • Agents can deploy a verified local build without asking Netlify to rebuild the source.
  • Unsafe payloads fail before any remote change.
  • Authorization stays scoped to the requested deployment stage.
  • The final report distinguishes local validation, remote mutation, and public verification.

Verified stack

  • Agent Skills
  • JavaScript
  • Node.js
  • npm
  • Netlify CLI
  • GitHub Actions
  • CI/CD

Working through something similar?

Share your challenge, scope, and timeline to start a focused conversation.