Frontend runtime

From agent0ai/space-agent · View interactive version

Frontend runtime is an AI agent skill from the GitHub repository agent0ai/space-agent. Editable frontend runtime rules for framework pages, stores, shared runtime namespaces, and reusable visual patterns.

How to use this skill

Skill file

Use this skill when the task changes browser runtime behavior, framework-backed UI, store orchestration, shared helpers, or general frontend composition under app/.

Editable Scope

Where First-Party Frontend Code Lives

Framework Boot And Runtime

Use <x-browser src="https://example.com"></x-browser> when frontend UI, pages, or widgets need to embed a live browser surface directly in their DOM. Add controls="true" when that surface should render its own address bar and navigation controls; omit it or set controls="false" for a frameless embedded browser. Authored <x-browser> elements register with space.browser automatically, so agents can discover, inspect, navigate, and interact with them the same way they use stand-alone browser windows.

External browser fetches under the framework should try direct fetch(...) first and only fall back to /api/proxy after a failed cross-origin attempt; when that fallback succeeds, the runtime keeps an in-memory origin cache so later requests to the same origin go through the backend immediately for the rest of the page lifetime.

Do not hardcode third-party CORS proxy services such as allorigins, corsproxy, or codetabs in frontend code or widget renderers. For external HTTP reads, use plain fetch(externalUrl) or space.fetchExternal(externalUrl) and let the runtime handle /api/proxy fallback automatically. Use space.proxy.buildUrl(...) only when you need a same-origin proxied URL string for a non-fetch consumer such as an element attribute or link target.

space.utils.markdown.render(...) is the shared browser markdown wrapper. It inserts a .markdown root so the owning feature can style rendered markdown predictably.

space.api includes attachment-style helpers such as space.api.folderDownloadUrl(pathOrOptions) when a feature needs a same-origin download URL instead of a fetched blob.

Store Pattern

Visual And Composition Rules

Promotion Rules

Mandatory Doc Follow-Up

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.