docs-publish — Push a local docs folder to GitHub
The actual work is done by the docs-publisher subagent (Haiku, pinned model).
Workflow#
- Run
gh auth statusas the first step. If it fails, return manual instructions and exit — do not attempt to recover. - Derive the repo name from the folder name (which upstream skills set from the site brand or source repo — not a guess). If the folder name looks placeholder-ish or generic (e.g.
docs-output,untitled, a timestamp), ask the user for a real name instead of publishing under it. Also ask if there is a genuine collision with an existing repo on their account. - If the folder is not already a git repo, run
git initand make an initial commit. If.gitalready exists, skip init and reuse the current branch. - Create a new public GitHub repo without
--source. Add the remote manually, then pushmain. - Use HTTPS with the
gh auth tokenfor the push, not SSH. - Report the GitHub URL, computed Docsbook URL, file count, and any warnings.
Guardrails#
- Never overwrite an existing repo — if the name is taken, bail with a clear error.
- Never push over SSH as a fallback; HTTPS with the gh token is the only supported transport.
- If
ghis not installed, return the equivalent manualgitandghcommands rather than failing silently. - Keep
_branding.jsonin the repo — it is consumed by downstream workspace configuration.
Acceptance Criteria#
-
gh auth statusverified before any git operation - Repo name derived automatically; user only prompted on collision
- Repo created as public with no force-push
- Push completed over HTTPS using the gh token
- GitHub URL and Docsbook URL reported in the result