Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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
`gapp-cli upsert` writes **only** `meta.json`, `state.json`, `index.html`. It never creates `tools.json` or `tools.mjs`. Domain tools are app-owned files you must write yourself. `bun gapp-cli.ts tools ` discovers tools from `tools.json` on disk — no file, no tools.

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 state replaces state.json and is pushed to any open window automatically.
  • A handler that throws surfaces as handler_error to 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.

Every output carries `dir` (the bundle path). **If `tools` returns `[]`, the app is renderer-only — that is NOT a cwd/path error.** Fall back to `get-state`/`set-state`. Never `fd`/`find` the filesystem to locate a bundle; `list` output already contains each app's `dir`.

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 with get-state or tools+call, then report briefly.
  • `[GAPP generat
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить gapp с