gapp
БесплатноБез исполняемых скриптовНе проверенCreate, modify, and operate Glimpse-APPs via the gapp-cli bun script — bundle layout, tools.json/tools.mjs authoring contract, progressive domain-tool calls…
от Dwsy★ 26 звёзд на GitHubОб этом скилле
GAPP agent skill
Two jobs: authoring (create/modify a GAPP) and operating (call a GAPP's domain tools). All operations run through bun gapp-cli.ts (see §5); the system prompt carries only the app id list.
1. Bundle layout — who writes what
A GAPP lives at <cwd>/.pi/gapp/<id>/ (project) or ~/.pi/gapp/<id>/ (global):
| File | Written by | Purpose |
|---|---|---|
meta.json |
gapp-cli upsert |
id/name/scope/enabled/instances |
state.json |
gapp-cli upsert + every tool call |
SSOT — the only thing the UI renders |
index.html |
gapp-cli upsert |
render layer; reads state, never fetches disk |
tools.json |
you, by hand | tool catalog { "tools": [...] } |
tools.mjs |
you, by hand | gappToolHandlers — runs in Host Node |
tui.mjs |
optional | terminal renderer |
Authoring order: write tools.json + tools.mjs → gapp-cli upsert (html) → gapp-cli tools <id> → gapp-cli call.
2. tools.mjs contract
Export gappToolHandlers; each handler takes { state, arguments, context } and must return { state, result? }:
export const gappToolHandlers = {
refresh({ state, arguments: args }) {
return { state: buildState(), result: { ok: true } };
},
};
- It runs in the Host Node process, so it may read the filesystem/git — that is how a GAPP shows live data instead of hardcoded values.
- Returned
statereplacesstate.jsonand is pushed to any open window automatically. - A handler that throws surfaces as
handler_errorto the caller.
3. tools.json contract
{ "tools": [ { "name": "refresh", "description": "Re-read from disk.", "inputSchema": { "type": "object", "properties": {} } } ] }
name (valid identifier), non-empty description, and an object inputSchema are required — an invalid entry is silently dropped from the catalog.
4. Sharing one implementation with the UI
The window gets window.__GAPP_TOOLS_MODULE_URL__. Import it so WebView, TUI, Host, and gapp_call run the same code:
const mod = await import(window.__GAPP_TOOLS_MODULE_URL__);
const out = mod.gappToolHandlers.refresh({ state: GappStore.get(), arguments: {} });
GappStore.replace(out.state);
Render from state only. If state is empty on first paint, call the tool once, then GappStore.subscribe(render).
5. Operating an existing GAPP — the CLI
All operations go through one bun script (no gapp_* tools are registered):
GAPP=~/.pi/agent/extensions/generative-ui/gapp/gapp-cli.ts
bun $GAPP list [--online|--all] # app list (index refs valid elsewhere)
bun $GAPP tools [id] # domain tool catalog ← REQUIRED before call
bun $GAPP call <id> <tool> --args '{…}' # run a domain tool (preferred write path)
bun $GAPP get-state <id> # read state.json (SSOT)
bun $GAPP set-state <id> --state '{…}' [--merge] # fallback when no tool fits (--merge = top-level key merge, NOT numeric increment)
bun $GAPP open <id> # open window (daemon-owned)
bun $GAPP reload <id> [--window] # hot reload after editing tools.mjs/html
bun $GAPP upsert --name <n> --html-file <f> … # create/update bundle
bun $GAPP set-status <id> --disable|--archive # lifecycle
Add --cwd <path> when operating outside the app's project; add --local to skip the daemon (disk only). Output is one JSON document on stdout.
Empty tools has three distinct readings — check hasToolsJson + note:
| Output | Meaning | Action |
|---|---|---|
hasToolsJson: false + note |
renderer-only app (no tools.json) | get-state/set-state fallback |
hasToolsJson: true, tools: [] |
tools.json entries invalid (missing name/description/inputSchema) | fix tools.json |
GAPP not found error |
wrong id | bun $GAPP list for valid ids |
Id resolution scans all registered projects (the gapp registry), not just the session cwd — an app from another project resolves fine without --cwd.
Progressive flow: never invent domain tool names. See app → bun $GAPP tools <id> → call → get-state/set-state fallback → upsert/open.
Prefer call over set-state: a tool recomputes state from truth, a hand-written state blob goes stale.
Inbound
[GAPP event]→ re-read withget-stateortools+call, then report briefly.- `[GAPP generat
Установить gapp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл gapp?
Create, modify, and operate Glimpse-APPs via the gapp-cli bun script — bundle layout, tools.json/tools.mjs authoring contract, progressive domain-tool calls, and native-feel WebView UI.
Как установить скилл gapp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gapp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic