html2site
Use only when the user explicitly invokes $html2site. An ordinary request to
build, host, redesign, or edit a website does not activate this skill.
Convert an existing local HTML application into a Codex Site while preserving
its user-visible design. Add D1-backed, authenticated server endpoints only
when the user requests shared state, a backend API, or local programmatic
access.
Intake
- Resolve the actual source HTML, stylesheet, JavaScript, assets, routes, and
existing API or persistence contracts. Ask only when the intended source or
data authority cannot be determined safely.
- Choose the smallest requested deployment shape:
- Static: HTML, styles, scripts, assets, and private hosting.
- Application: static conversion plus hosted D1, browser routes, and an
authenticated machine API when local writes are requested.
- Keep the canonical Site under the existing project, normally
./site/.
Never create a nested Git repository or publish unrelated parent-repository
source, history, local databases, or credentials.
- Apply
$sites-building before implementation and $sites-hosting after a
successful build. Preserve an existing Site project and access policy.
Workflow
- Read static conversion. Preserve the
original DOM, relative URLs, browser interactions, assets, and responsive
behavior. Explicitly force dynamic rendering when page content can change.
- When the user requests an authenticated API, persistent data, shared state,
or local writes, also read authenticated backend.
Separate browser identity from machine authentication, declare only required
D1/R2 bindings, and keep secrets outside source control.
- Build and exercise the exact requested experience. Use realistic synthetic
records unless the user authorizes creating real data. Do not report a
successful local write until the deployed API and hosted interface both
confirm the same record.
- Read private deployment. Publish the
validated Site privately unless the user explicitly requests local-only work
or approves a different audience.
Non-negotiable boundaries
- Preserve the source HTML design; do not substitute a generic dashboard.
- Keep
.openai/hosting.json limited to project_id and logical d1/r2
bindings. Never store bearer tokens or runtime secret values there.
- A private machine API requires both a Sites bypass credential and an
independently verified application credential. Never expose either to
browser JavaScript.
- Generate or rotate a Sites bypass token only when the user explicitly asks
for one. Rotation immediately invalidates the previous token.
- Never treat a private Site as public merely to make automated calls work.
- Disable unsupported uploads; configure R2 explicitly before accepting files.
- Preserve existing local persistence unless the user deliberately selects or
migrates to a hosted authoritative backend. Never silently fall back or
synchronize data across stores.
- Never run
npm run precommit.
Completion
Return the deployed private URL, canonical Site source location, supported
browser/API behavior, and any remaining unsupported capability. Mention token
or deployment internals only when the user asks or needs to take action.
1---2name: html2site3description: Convert an existing static HTML site into a private Codex Site, optionally adding a persistent authenticated API and local programmatic writes. Use only when deliberately invoked as $html2site.4---56# html2site78Use only when the user explicitly invokes `$html2site`. An ordinary request to9build, host, redesign, or edit a website does not activate this skill.1011Convert an existing local HTML application into a Codex Site while preserving12its user-visible design. Add D1-backed, authenticated server endpoints only13when the user requests shared state, a backend API, or local programmatic14access.1516## Intake17181. Resolve the actual source HTML, stylesheet, JavaScript, assets, routes, and19 existing API or persistence contracts. Ask only when the intended source or20 data authority cannot be determined safely.212. Choose the smallest requested deployment shape:22 - **Static:** HTML, styles, scripts, assets, and private hosting.23 - **Application:** static conversion plus hosted D1, browser routes, and an24 authenticated machine API when local writes are requested.253. Keep the canonical Site under the existing project, normally `./site/`.26 Never create a nested Git repository or publish unrelated parent-repository27 source, history, local databases, or credentials.284. Apply `$sites-building` before implementation and `$sites-hosting` after a29 successful build. Preserve an existing Site project and access policy.3031## Workflow32331. Read [static conversion](./references/static-conversion.md). Preserve the34 original DOM, relative URLs, browser interactions, assets, and responsive35 behavior. Explicitly force dynamic rendering when page content can change.362. When the user requests an authenticated API, persistent data, shared state,37 or local writes, also read [authenticated backend](./references/authenticated-backend.md).38 Separate browser identity from machine authentication, declare only required39 D1/R2 bindings, and keep secrets outside source control.403. Build and exercise the exact requested experience. Use realistic synthetic41 records unless the user authorizes creating real data. Do not report a42 successful local write until the deployed API and hosted interface both43 confirm the same record.444. Read [private deployment](./references/private-deployment.md). Publish the45 validated Site privately unless the user explicitly requests local-only work46 or approves a different audience.4748## Non-negotiable boundaries4950- Preserve the source HTML design; do not substitute a generic dashboard.51- Keep `.openai/hosting.json` limited to `project_id` and logical `d1`/`r2`52 bindings. Never store bearer tokens or runtime secret values there.53- A private machine API requires **both** a Sites bypass credential and an54 independently verified application credential. Never expose either to55 browser JavaScript.56- Generate or rotate a Sites bypass token only when the user explicitly asks57 for one. Rotation immediately invalidates the previous token.58- Never treat a private Site as public merely to make automated calls work.59- Disable unsupported uploads; configure R2 explicitly before accepting files.60- Preserve existing local persistence unless the user deliberately selects or61 migrates to a hosted authoritative backend. Never silently fall back or62 synchronize data across stores.63- Never run `npm run precommit`.6465## Completion6667Return the deployed private URL, canonical Site source location, supported68browser/API behavior, and any remaining unsupported capability. Mention token69or deployment internals only when the user asks or needs to take action.