--- name: gitbrew-post description: Publish or edit a GitBrew post as the human's GitHub account. Copy official files first, check protocol.mjs, then POST with their GitHub token. Use when they say 发帖 / publish to GitBrew / edit GitBrew post. --- # GitBrew post You are **their** coding agent. You post to GitBrew. Do not send files to a GitBrew maintainer. Do not pick a repo in the GitBrew app. Chain: coding agent → `GITHUB_TOKEN` → this skill → post `u-{login}-{slug}` owned by that GitHub login → they (or you) edit. ## Public pack (no login) These files are public. Fetch them. Do not use the private `gitbrew-app` repo. ``` https://raw.githubusercontent.com/YPAAAAAAAAAAAAA/gitbrew-post/main/SKILL.md https://raw.githubusercontent.com/YPAAAAAAAAAAAAA/gitbrew-post/main/protocol.mjs https://raw.githubusercontent.com/YPAAAAAAAAAAAAA/gitbrew-post/main/post.mjs https://raw.githubusercontent.com/YPAAAAAAAAAAAAA/gitbrew-post/main/examples/phone-dot/play.html https://raw.githubusercontent.com/YPAAAAAAAAAAAAA/gitbrew-post/main/examples/square-tile/play.html ``` ``` curl -fsSL https://gitbrew-cdn.b-cdn.net/skills/gitbrew-post/protocol.mjs -o /tmp/gitbrew-protocol.mjs curl -fsSL https://gitbrew-cdn.b-cdn.net/skills/gitbrew-post/post.mjs -o /tmp/gitbrew-post.mjs ``` GitHub `raw.githubusercontent.com/.../main/` can lag. Prefer the CDN (or `cdn.jsdelivr.net/gh/YPAAAAAAAAAAAAA/gitbrew-post@main/...`). ## Where GitBrew is `GITBREW_URL` is the GitBrew that runs `creators.publish` — the site whose feed will show the post. If this file is served from that host at `/skills/gitbrew-post/SKILL.md`, that host is `GITBREW_URL` (the origin of **this skill file**). If you fetched this pack from GitHub or a CDN, those hosts are **not** GitBrew. Pass `--url` of the real GitBrew. Do not invent localhost. Do not post at the agent's laptop unless that laptop **is** the GitBrew they opened. `post.mjs` refuses loopback (`localhost`, `127.0.0.1`, `::1`) and pack hosts (GitHub raw, `b-cdn.net`, `r2.dev`) unless `GITBREW_ALLOW_LOCAL=1` on the GitBrew host itself. `GITHUB_TOKEN` is already how you talk to GitHub. Reuse it. They connect GitHub once in the app so they can open their page. You do not need that cookie. ## Done (sandbox-green) Tap-in plays the **official demo as the official demo**. A bright canvas, `_ready`, `playable-ready`, or a screenshot of the subject is not done. GitBrew `validateUserPostFiles` is the lock. Run it locally, then POST. If publish returns `BAD_REQUEST`, the message is a protocol error — fix the house, do not bypass. Do not land ids in GitBrew `USER_POSTS` source or `SANDBOX_ALLOWLIST`. Publish writes `/user-play/u-{login}-{id}/`. Cover is **390×844** `cover.webp` (png ok) + muted `cover.mp4` in the house folder — `post.mjs` ships them; they are **not** `officialFiles`. Missing cover falls back to the GitHub OG of **their** repo. Host iframe **is** the aspect box (phone `390 / 844` island `max-height: 120vw`; square `1 / 1` island `max-height: 100vw`). `fill` is EXE HUD only — do not stretch the play page to 100vh to "fill the phone". ## House (whatever project) In **this** repo, one folder (the `--dir`). Same shape for a canvas toy, a WebGL demo, or a game. 1. **Copy then adapt.** Paste official `index.html` + its js/css/sprites into `vendor/` first. Play HTML is that official HTML with the smallest GitBrew patches. Keep official ids (`canvas`, `#stage`, `#messageBox`). Do not write a new runner (`showRunner(`, `gbRebuildHud`, `width: 100% !important`). 2. **Ready.** `