Files
coder/.agents
Michael Suchacz 431f8c9b2f feat(.agents/skills/deploy-ephemeral): add deploy-ephemeral skill (#30440)
> Xum opened this PR on behalf of @ibetitsmike.

Adds the `deploy-ephemeral` skill. In a checkout whose branch has an
open same-repo PR, it deploys that PR to a dogfood workspace,
`eph-pr-<number>`, built from the new `coder-ephemeral` template
(coder/dogfood#662). The workspace follows the PR branch until the PR
closes, and members of the dogfood `coder` org open it through
organization port shares.

- **Full mode**, when any file outside `site/` changed: the branch's own
Coder runs through `scripts/develop.sh` with the usual `admin@coder.com`
and `member@coder.com` logins. `seed.sh` adds two AI providers routed
through dogfood's AI Gateway, four models, and a title model. The skill
adds the enterprise license from the user's `DOGFOOD_PREMIUM_LICENSE`
secret only when the diff needs it. Ports 3000 and 8080 are shared.
- **Frontend mode**, when only `site/` changed: a production build of
the branch's site runs against dogfood, rebuilt for each commit in about
2 minutes, and each visitor signs in with their own dogfood account.
Port 8080 is shared.
- Docs-only diffs and fork PRs are refused, and a branch without a PR or
with unpushed commits stops for the user. For a merged or closed PR, the
skill deletes the OAuth client, the port shares, and the workspace.

`SKILL.md` is the runbook; `reference.md` covers status states, logs,
sizing, and manual recovery.

`coder start`, `restart`, and `update` with `--parameter` keep the
previous build's value of a mutable parameter (seen with CLI 2.37.3 and
2.38 against dogfood), so the skill changes the mode or branch by
stopping the workspace and posting a start build to
`/api/v2/workspaces/{id}/builds`. This PR does not fix that CLI bug.

## Testing

- UAT on dogfood by an independent critic agent, with fixture PRs in
both modes, over three rounds (record below).
- shellcheck on `seed.sh`, `markdownlint-cli2` and the table formatter
on the docs, and the pre-commit hook on every commit (`ffcb768f3ed` and
the merge of main got their checks by hand). The pre-push hook was
skipped per the maintainer's standing preference.

## Review record

- UAT round 1 (critic task `903fe94e6f`, skill `f0bea80`): FAIL. Skill
fixes: parameter changes through the builds API (the CLI bug above), an
ancestry check instead of "push first" when the checkout is behind the
PR, the mode computed from the PR head, an HTTP status check on the
workspace lookup, and port shares removed before deletion. Its template
findings are fixed in the dogfood PR.
- UAT round 2 (skill `5ac3f3ed718`): PASS, with one minor template
finding fixed in the dogfood PR. `3435ed99f0e` then updated the
`stopped` status row in `reference.md` to match that fix.
- UAT round 3 (skill `3435ed99f0e`, with template version 5): PASS on
the scenarios that fix touches: frontend create and sign-in, the mode
switch, full-mode login and seed, stop and start, a no-op re-run, and
teardown.
- Read-only cleanup audit at `3435ed99f0e` (task `a0afadd148`): no
defects. Its one note, the status fields missing from `reference.md`, is
applied in `6e763cedbbb`.
- After UAT, `ffcb768f3ed` documents frontend mode's production build
(coder/dogfood#662 versions 6 and 7), checked by a live deployment of
#30395 rather than a UAT round.
- Codex review, five rounds from `bdc84de38da`: 12 findings, all threads
resolved. Fixed 7 in `2bfad33348c`, `5948246ce7f`, and `d2b34095ccc`
(frontend override, failed and in-progress builds, a PR head that moves
during the wait, log names read from the untrusted status, teardown);
declined 5 with evidence in the threads. No issues at `d2b34095ccc` and
`e63bc7b820f`. The fixes are runbook text checked against the template
code, not re-run through UAT.
- `e63bc7b820f` merges main for #30452, which fixed main's site build.

Not tested: a non-owner visitor end to end.
2026-10-07 15:58:00 +02:00
..