agentleFS
Rafaelrr5Rafaelrr5/agent-cortex/skills/github-pages-deploy/SKILL.md

github-pages-deploy

Skill1 starsChanged 37 days agoMITView on GitHub

Publish a static site or client-side game to GitHub Pages.

  • Reads credentials
  • Sends data out
  • Commits and pushes

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the app needs a backend or SSR, stop — this is the wrong tool.

    line 31
  2. Distinctive:

    All 200 and diff clean = the static artifact is fully served.

    line 94
  3. Very specific:

    Ensure index.html + assets are committed and pushed (git status clean, main == origin/main after git fetch).

    line 98
  4. Distinctive:

    Live in-browser render/console check may be unavailable: if the browser tool's Chrome daemon is down on the machine.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Publish a static site / client-side app via GitHub Pages

For putting a static artifact (plain HTML/CSS/JS, a bundled SPA, a client-side game) on a real public URL with ZERO infrastructure: no VPS, no nginx, no SSH. GitHub Pages serves the repo. Use this when the user wants to "see it without being on the local network" and the app has no server side.

Complements static-site-vps-deploy (VPS/nginx path) and nextjs-selfhost-deploy (SSR path) — both assume a VPS; this skill covers the no-infra GitHub path only.

When to Use

  • "publique o jogo de um jeito que eu consiga ver sem estar na rede local"
  • putting a static demo/prototype/game on a URL without provisioning a server
  • a client-side-only app (no backend, no SSR, no secrets needed at runtime)

If the app needs a backend or SSR, stop — this is the wrong tool. Use a VPS deploy skill instead.

Prerequisites

  • Repo pushed to GitHub (any visibility; Pages is PUBLIC once enabled, regardless of repo private).
  • Git credential helper working (git push succeeds without a prompt).
  • The entry point must be index.html at the repo root (or docs/); for JS-framework builds, commit the built dist//out/ output.

Getting a token

Two paths; pick whichever is already true on the machine:

# A) env var already exported
[ -n "$GITHUB_TOKEN" ] && TOKEN=$GITHUB_TOKEN

# B) harvest from git credential helper (matches what `git push` uses —
#    works when no env var is set, via git-credential-manager / OS keychain)
TOKEN=$(printf "protocol=https\nhost=github.com\n" | git credential fill \
        | grep -oP '^password=\K.*')

Enable Pages via API

# Enable Pages serving repo root of `main` — a legacy build. HTTP 201 = on.
curl -s -X POST \
  -H "Authorization: token $TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/$OWNER/$REPO/pages \
  -d '{"source":{"branch":"main","path":"/"}}'

# Poll until status flips "building" -> "built" and grab the public URL
curl -s -H "Authorization: token $TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/pages
#   -> "html_url": "https://<user>.github.io/<repo>/"

Final URL: https://<user>.github.io/<repo>/ (repo name lowercased). First build takes ~30-60s. Do NOT report "live" on a bare HTTP 200 of the URL — that only proves GitHub answered, not that YOUR content built and served.

Verify the deploy served YOUR content (not just 200)

  1. Byte-compare served vs committed HTML — catches stale build, wrong branch, or an empty build:
    curl -s "https://$USER.github.io/$REPO/index.html" -o "$LOCALAPPDATA/Temp/served.html"
    diff index.html "$LOCALAPPDATA/Temp/served.html"   # exit 0 = identical
  2. Resolve every asset ref to 200 — the #1 Windows→Pages trap: NTFS is case-insensitive, Pages serves from case-sensitive Linux, so a file Hero.PNG referenced as hero.png works locally but 404s live:
    grep -oE '(assets/[A-Za-z0-9_./-]+\.(png|jpg|jpeg|svg|mp3|wav))' index.html \
      | sort -u | while read -r a; do
          code=$(curl -s -o /dev/null -w "%{http_code}" "https://$USER.github.io/$REPO/$a")
          [ "$code" != "200" ] && echo "MISSING($code): $a"
        done
    All 200 and diff clean = the static artifact is fully served.

Workflow

  1. Ensure index.html + assets are committed and pushed (git status clean, main == origin/main after git fetch).
  2. Harvest token and enable Pages via API; note the html_url.
  3. Poll Pages status until "built".
  4. Byte-compare the served index.html against the committed one.
  5. Resolve every asset ref against the live URL; assert all 200.
  6. Report the URL with the verification summary (what matched, any gaps).

Pitfalls

  • Native tools get no MSYS path translation on Windows: /tmp/... fails silently for curl/git/diff. Use $LOCALAPPDATA/Temp/... for scratch files a native tool must read or write.
  • GitHub Pages does not host private content privately — enabling Pages makes the site world-readable even if the repo is private.
  • Repository name in the URL is lowercased by GitHub; a mixed-case repo name still resolves at the lowercase path.
  • Live in-browser render/console check may be unavailable if the browser tool's Chrome daemon is down on the machine; in that case do the static byte-compare + asset-resolution checks and say explicitly which check you could NOT run, rather than claiming a full verification.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.