agentleFS
hoyoboy0726123hoyoboy0726123/claude-skill-github-pages-deployer/SKILL.md

github-pages-deployer

Skill2 starsChanged 9 months agoMITView on GitHub

Automates end-to-end deployment to GitHub Pages using GitHub Actions. Handles Git initialization, GitHub repo creation, Vite base-path configuration, verified workflow setup, and proactive deployment monitoring — all without asking the user to run any commands manually.

  • Installs packages
  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Affitor/affiliate-skills★ 757same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If package-lock.json or yarn.lock is missing, do NOT ask the user to run npm install locally.

    line 31
  2. Very specific:

    Create .github/workflows/deploy.yml using this exact template (do not modify the structure):

    line 60
  3. Distinctive:

    If the run fails:

    line 135

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

GitHub Pages Deployer

You are a GitHub Pages deployment expert. When a user asks to deploy a frontend project to GitHub Pages, you handle the entire pipeline autonomously — from git init to live URL — using a battle-tested GitHub Actions workflow.

Capabilities

  • github-pages
  • github-actions
  • vite
  • react
  • static-site-deployment
  • ci-cd
  • git-automation
  • npm

Prerequisites

Before starting, verify:

  1. git is installed and configured.
  2. gh (GitHub CLI) is installed and authenticated (gh auth status).
  3. The project has a package.json with a build script.

Lock File Policy:

  • If package-lock.json or yarn.lock is missing, do NOT ask the user to run npm install locally.
  • The CI workflow handles this with npm install --legacy-peer-deps.

Workflow

1. Project Configuration

Vite Projects — read vite.config.js or vite.config.ts and inject the base path:

base: '/<REPO_NAME>/',

This ensures assets load correctly from the GitHub Pages subdirectory URL.

2. Git Initialization (Windows-Safe)

⚠️ On Windows, do NOT chain commands with &&. Execute each command on its own line.

git init
git checkout -b main
git add .
git commit -m "Initial commit"
gh repo create <owner>/<repo-name> --public
git remote add origin https://github.com/<owner>/<repo-name>.git
git push -u origin main

3. Verified Deployment Workflow

Create .github/workflows/deploy.yml using this exact template (do not modify the structure):

name: Deploy static content to Pages

on:
  push:
    branches: ["master", "main"]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Node
        uses: actions/setup-node@v4
        with:
          node-version: 20
      - name: Install dependencies
        run: npm install --legacy-peer-deps
      - name: Build
        run: npm run build
      - name: Setup Pages
        uses: actions/configure-pages@v4
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: './dist'
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

4. Push and Enable Pages

Push the feature branch and create a PR, or push directly to main:

git push -u origin main

Enable GitHub Pages via API (no leading slash — Windows shell path rewrite issue):

gh api -X POST repos/<owner>/<repo>/pages -F build_type=workflow
  • 409 Conflict → Pages already enabled, continue.
  • 403 Forbidden → Verify gh auth status matches the repo owner.

5. Proactive Monitoring (MANDATORY)

Do NOT ask the user to check the Actions tab.

Immediately after pushing, retrieve the run ID and watch it to completion:

gh run list --repo <owner>/<repo> --limit 1
gh run watch <RUN_ID> --repo <owner>/<repo>

If the run fails:

  1. Fetch logs: gh run view <RUN_ID> --log-failed --repo <owner>/<repo>
  2. Diagnose the error automatically.
  3. Apply a fix and re-push without asking the user.

Post-Mortem & Lessons Learned

IssueRoot CauseFix
Missing lock filenpm ci fails when package-lock.json is absentUse npm install --legacy-peer-deps instead of npm ci
White-screen 404 on PagesVite assets use absolute paths by defaultAdd base: '/<REPO_NAME>/' to vite.config.js
Pages API path rewrite on WindowsGit Bash converts /repos/... to a filesystem pathOmit the leading / — use repos/<owner>/<repo>/pages
User left to monitorPassive agent behaviorMandate gh run watch after every push
Auth mismatchgh logged-in user ≠ repo ownerAlways run gh auth status before API calls

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.