Skip to content
Back to skills

Make Panel

ASecurity

Build a custom layer8 panel from a plain-language request ("a panel listing my open PRs across projects") - interview the user (what it shows, does and must not do, badges, third-party connection, dock area, refresh, actions), then write it as a JS plugin in ~/.layer8/plugins and open it in the window.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
developmentjavascriptjavareactnodegitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add crashPopeye/layer8 --skill make-panel --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Make Panel?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Make Panel
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/crashpopeye-make-panel/badge)](https://www.skillsdirectory.com/skills/crashpopeye-make-panel)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: make-panel
description: Build a custom layer8 panel from a plain-language request ("a panel listing my open PRs across projects") - interview the user (what it shows, does and must not do, badges, third-party connection, dock area, refresh, actions), then write it as a JS plugin in ~/.layer8/plugins and open it in the window.
argument-hint: "<what the panel should show>"
---

# Make a panel

A layer8 plugin is one JavaScript file in `~/.layer8/plugins/` (or `$LAYER8_HOME/plugins/`). The app hot-reloads it, and its panels join the dock like built-in ones.

## 1. Learn the SDK

Read `layer8://ui/plugins` (MCP server `layer8`). Its `sdk` text is the plugin SDK; follow it over anything below, and only offer options in the interview that it documents. Reading an existing plugin there is the fastest way to match the API. Complete plugins live in the `crashPopeye/layer8-plugins` source.

## 2. Interview the user

Ask before building, with the `AskUserQuestion` tool (up to four questions per call, each with 2-4 options; the user can always answer "Other" in their own words). Skip a question the request already answers, and put your recommended option first, marked "(Recommended)". Without `AskUserQuestion` (Codex, or a non-interactive session), ask the same questions in one plain message; when nobody can answer, take the recommended options and say so in the summary.

**Round 1 — purpose**

| Question | Options (real SDK capabilities) |
|---|---|
| What does it show? | layer8 data only (projects, tasks, sessions, PRs, artifacts — live from the node tree) · a third-party service · both |
| What can it do? (multi-select) | read only · run layer8 actions with `sdk.do` (the actions listed on the nodes, such as a task's `set-link` or `set-stage`) · open links in the browser · write to the third-party service |
| What must it never do? (multi-select) | change anything (no `sdk.do`, no writes) · show toasts · call any network outside layer8 · touch tasks outside the current project |
| What else should it add? (multi-select) | a badge on every task row in the sidebar · a badge on every session row · a status bar segment · ⌘K commands |

**Round 2 — third-party service** (only when it shows or writes a service)

| Question | Options |
|---|---|
| Which service? | offer the 2-3 most likely from the request (GitHub, Linear, Sentry, Datadog…) |
| How does it sign in? | OAuth through a layer8 connection (Recommended for private data: layer8 holds the token, the plugin calls `sdk.connection().fetch`; needs the plugin published in a plugin source and an OAuth app with PKCE) · public API, no sign-in (plain `fetch`; the API must allow CORS) |
| How often does it refresh? | when opened, plus a refresh button (Recommended) · every minute · every 5 minutes · live (layer8 data only: `useNode` re-renders on change) |

API keys and personal tokens are not an option: a plugin has nowhere safe to keep a secret. If the user insists, offer OAuth or a public endpoint instead.

**Round 3 — placement**

| Question | Options |
|---|---|
| Where does it open? | right column (Recommended) · bottom of the right column (`right-bottom`) · centre workspace |
| Where may it be moved? | anywhere (Recommended) · right column only (`areas: ["right"]`) · centre only (`areas: ["center"]`) |
| Which actions does it expose as buttons? (multi-select) | offer the node actions the data in step 3 lists, plus "open in browser" and "focus the task" |

## 3. Find the data

Panels read the same tree you do. Read the nodes the panel needs (`layer8://app` for projects and workflows, `layer8://project/<name>` for tasks, `layer8://task/<path>` for branches, PRs, sessions) and note the fields to show and the actions to offer. Read these before round 3 so the actions question lists real ones.

## 4. Write the plugin

File `~/.layer8/plugins/<panel-id>.js`, where `<panel-id>` is kebab case. Sketch:

```js
export default function setup(sdk) {
  const { React, ui } = sdk;
  const h = React.createElement;

  function OpenPRs() {
    const app = sdk.useNode("app", 2);
    const tasks = (app?.children ?? []).flatMap((p) => p.children ?? []).filter((t) => t.kind === "task");
    return h(ui.ScrollArea, { className: "h-full p-2" },
      tasks.map((t) => h(ui.Button, { key: t.addr, variant: "ghost", onClick: () => sdk.focus(t.addr) }, t.title)));
  }

  sdk.registerPanel({ id: "open-prs", title: "Open PRs", icon: "GitPullRequest", component: OpenPRs, defaultPosition: "right" });
}
```

Map each answer to code:

| Answer | Code |
|---|---|
| area / moves | `registerPanel({ defaultPosition, areas })` |
| task or session badge | `registerBadge({ id, title, on: "task" \| "session", component })`; `component` gets `{addr}`, returns `null` when there is nothing to show, and calls `e.stopPropagation()` in click handlers |
| status bar segment | `registerSegment({ id, title, component })`; tell the user to show it in Settings › Status bar |
| ⌘K commands | `registerCommand({ id, title, run })`, at least one that opens the panel |
| refresh cadence | `React.useEffect` with `setInterval`, cleared on unmount; a refresh `ui.Button` for "when opened" |
| actions | `sdk.do([{ target, action, args }])`, `sdk.openUrl`, `sdk.focus`; report failures with `sdk.notify(message, "error")` unless toasts are ruled out |
| OAuth connection | `const svc = sdk.connection()` in `setup`; render a Connect button until `svc.use().state === "connected"`, then `svc.fetch(path)` |
| must-not rules | leave the matching calls out entirely; don't just hide them |

Rules: no build step and no imports (everything comes from `sdk`); use the shadcn components in `sdk.ui` and theme classes, never hard-coded colours; keep it under ~150 lines.

**OAuth connection.** A hand-made plugin gets no connection: it must be installed from a source. Write the plugin and a `layer8-plugins.json` listing (a fresh UUID `id` and the `connection` block from the SDK) in a folder the user chooses, then tell them the steps: create the OAuth app with redirect URI `http://127.0.0.1:<port>/oauth/callback/<id>`, push the folder to GitHub, `layer8 do ui:marketplace add-source source=<owner/repo>`, and install from Settings › Plugins. Fill in what you can't know (client id, URLs) as clearly marked values in the listing.

## 5. Open it

```json
{"ops":[{"target":"ui:layout","action":"open-panel","args":{"panel":"open-prs"}}]}
```

If the result is an error, read `layer8://ui/layout` and `layer8://ui/plugins` for the plugin's load error, fix the file, and retry. If `ui:layout` doesn't exist yet in this version of layer8, tell the user the file path and that the panel appears once plugins are supported.

## 6. Finish

Set the stage to `Done` (skip it when `set-stage` is not listed on `here` or does not offer that stage):

```json
{"ops":[{"target":"here","action":"set-stage","args":{"stage":"Done"}}]}
```

Summarise the choices as a table (question → answer, noting any default you took), then the file path and how to change the panel later (edit the file, or ask again). Then, if `advance` is listed on `here`:

```json
{"ops":[{"target":"here","action":"advance"}]}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.