sztwiorok

static-site

Deploy static websites to Buddy Packages. Use when user asks to "deploy static site", "host static files", "publish website", "upload build artifacts", or mentions deploying pre-built HTML/CSS/JS files, SPA builds, or static exports.

sztwiorok 0 Updated 4mo ago

Resources

1
GitHub

Install

npx skillscat add sztwiorok/buddy-plugin/static-site

Install via the SkillsCat registry.

SKILL.md

Buddy Static Site Deployment

Host static websites with versioning via Buddy Packages. Each version gets a unique URL.

Prerequisites

Verify authentication with bdy whoami. If it fails, user must run bdy login in a separate terminal.

CRITICAL: AI Agent Requirements

STOP: Read before publishing any package.

Ask about authentication (MANDATORY for new packages)

Before creating a NEW package, you MUST use AskUserQuestion tool.

Question: "Do you want to protect this static site with authentication?"

Options:

  1. "HTTP Basic Auth (username:password)" → create with -a user:pass flag
  2. "Buddy Authentication" → create with --buddy flag
  3. "No authentication (public)" → proceed without auth flags

Note: Auth is set on package creation, not per-version. For existing packages, skip this question.

Workflow

0. Ensure index.html exists (CRITICAL)

The main HTML file MUST be named index.html for the URL to serve the page directly. Without it, visitors will see a directory listing instead of the website.

  • If deploying a single HTML file (e.g., mypage.html), rename it to index.html before publishing
  • If deploying a directory, ensure it contains an index.html at the root
  • Framework builds (Vite, Next.js static export) automatically create index.html
# Example: rename single HTML file
mv mypage.html index.html

1. Build Static Assets (if needed)

Most frameworks need a build step:

npm run build      # Output: ./dist or ./build

2. Determine Package Name and Version

  • Package name: project name or user-specified
  • Version: semantic versioning (1.0.0, 1.0.1, etc.)

3. Create Package (first time only)

Without auth (public):

bdy package create -i my-site

With auth:

bdy package create -i my-site --buddy
bdy package create -i my-site -a admin:secret123

4. Publish Version

bdy package publish my-site@1.0.0 ./dist

Overwrite existing version:

bdy package publish my-site@1.0.0 ./dist --force

5. Show Results

bdy package version get my-site 1.0.0

Output includes:

  • Url - the live site URL
  • App url - Buddy dashboard link
  • Size - package size
  • Created - timestamp

URL format:

https://<version>-<package>-<workspace>.files-pkg-2.registry.sh

Example: version 1.0.0 of package my-site in workspace myplayground:

https://1-0-0-my-site-myplayground.files-pkg-2.registry.sh

Versioning

Each version has its own URL. Old versions remain accessible.

# List all versions
bdy package version list my-site

# Delete old version
bdy package version delete my-site 0.9.0

Examples

References