github-pages-gitops

Read and modify GitHub repository config.json via the Contents API with SHA handling.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/Junghyun99/MagicSplit --skill github-pages-gitops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-pages-gitops
Source: https://github.com/Junghyun99/MagicSplit/tree/main/.claude/skills/github-pages-gitops
Command: npx skills add https://github.com/Junghyun99/MagicSplit --skill github-pages-gitops

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GitHub Pages + GitHub API 커밋 기반 설정 변경 패턴을 구현한다. MagicSplit의 docs/ 웹 UI에 새 필드를 추가하거나, config-editor 페이지를 처음 구성하거나, config.json의 새 파라미터와 HTML 폼을 연동하거나, GitHub API 409 Conflict / SHA 불일치 오류를 디버깅할 때 반드시 이 스킬을 사용한다. docs/ 폴더의 JavaScript가 config.json을 읽고 쓰는 모든 작업의 기준이다.

Core Features & Use Cases

  • GitHub Contents API를 통한 GET/PUT 흐름으로 config.json을 안전하게 편집하고 커밋합니다.
  • SHA 검증(SHA-locked) 전략으로 409 Conflict를 피하고 연속 저장 시 안정적으로 업데이트를 유지합니다.
  • Base64 인코딩/디코딩과 UTF-8 한글 처리와 관련된 브라우저 호환성 가이드를 제공합니다.
  • docs UI와 config-editor 페이지 간의 연동, 새로운 파라미터 추가 및 폼 필드 매핑에 대한 실무 패턴을 제공합니다.
  • PAT 보안 운영, 로컬 저장소 활용, 에러 핸들링 및 워크플로우 정합성 확보를 위한 구현 가이드를 포함합니다.

Quick Start

Use this skill to wire the docs UI to config.json via the GitHub Contents API and ensure commits include the current SHA.

Frequently Asked Questions about github-pages-gitops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update config.json on GitHub Pages using the Contents API without getting a 409 Conflict?

To update config.json via the GitHub Contents API without a 409 Conflict, you must fetch the current file SHA and include it in your PUT request payload. This SHA-locked strategy ensures safe, commit-based updates by validating that the file has not changed since you last read it.

Why does my GitHub Contents API save fail with a SHA mismatch error?

A SHA mismatch error occurs during a GitHub Contents API save when the SHA in your request does not match the latest commit SHA on the server. You must re-fetch the config.json file to obtain the updated SHA before retrying your commit-based update.

How do I handle Base64 encoding and decoding for UTF-8 Korean text in a browser config editor?

Handling Base64 encoding and decoding for UTF-8 Korean text in a browser config editor requires safely converting strings to byte arrays before encoding. This ensures GitHub Contents API receives valid Base64 content while preserving Korean characters during config.json read and write operations.

Do I need a Personal Access Token to write to config.json through a GitHub Pages UI?

Yes, you need a GitHub Personal Access Token with contents: write permission to modify config.json through a GitHub Pages UI. The PAT must be stored securely in the browser's localStorage to authenticate your API-driven commit requests safely.

What is the best way to wire an HTML form to a config.json file on GitHub Pages?

The best way to wire an HTML form to config.json on GitHub Pages is using the GitHub Contents API for GET and PUT operations. This pattern maps form fields to JSON parameters and performs SHA-validated commits to ensure safe configuration updates.

Can I use the GitHub Contents API for continuous config.json edits in a docs UI workflow?

Yes, you can use the GitHub Contents API for continuous config.json edits in a docs UI workflow by implementing SHA verification on every save. Re-fetching the SHA after each successful commit prevents conflicts and maintains workflow alignment during sequential updates.