Skip to content

mikeparcewski/wicked-garden / skills/editor-scaffold

wicked-garden-editor-scaffold

Verified

Build an artifact editor plugin or a third-party run plugin ("phase plugin") for wicked-studio: scaffold a wicked-pack.json spec-2 pack with one self-contained HTML entry speaking wicked.editor/2 (/1 to older hosts) or wicked.editor/3 (run plugins: observe topics and run.details panels), ask only for the permissions or observe topics it needs, re-pin its hash, run the conformance cases in headless Chromium against studio's own plugin host, then install it into a wicked-crew daemon's editors. Use when: "build an editor plugin", "make a custom editor", "an editor for this artifact kind", "build a phase plugin", "build a run plugin", "scaffold an editor", "check my editor plugin", "run the editor conformance", "install this editor plugin", studio Settings → Developer → "Create an editor plugin", `/plugin phase`, or a phase of the `editor-plugin` workflow. NOT for granting an editor's permissions (studio Settings does that) or for editing a document (studio's built-in editors do that).

assets/run-plugin/plugins/__PLUGIN_ID__/index.html

View on GitHub
<!doctype html>
<!-- SPDX-License-Identifier: MIT -->
<!--
  __PLUGIN_TITLE__ (__PLUGIN_ID__ __PLUGIN_VERSION__): a third-party run plugin ("phase plugin") speaking
  wicked.editor/3 (DESIGN §2.b; CONTRACT-CS7). ONE self-contained file: every script and style is inline,
  nothing is loaded from outside it (the bundle's policy has connect-src 'none' and pack check refuses
  outside references). It renders ONE section in a job's Details panel from the granted observe topics.
  After every change to this file, re-pin its hash: wicked-garden run scripts/editor/pin.py <pack dir>
-->
<html lang="en"><head><meta charset="utf-8"><title>__PLUGIN_TITLE__</title>
<style>
  :root { --accent: #224a5e; --ink: #0d1117; --ink-muted: #44515d; --surface: #ffffff; }
  * { box-sizing: border-box; }
  body { margin: 0; font: 13px/1.45 system-ui, sans-serif; color: var(--ink); background: var(--surface); }
  main { padding: 8px 12px; }
  .note { color: var(--ink-muted); font-size: 12px; margin: 0 0 6px; }
  [data-event-id] { display: flex; gap: 8px; padding: 2px 4px; border-radius: 4px; font: 12px/1.4 ui-monospace, monospace; }
  .topic { color: var(--accent); font-weight: 600; }
  .detail { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
</style></head>
<body data-protocol="3">
<main>
  <p class="note" id="status">Waiting for run events…</p>
  <div id="events" role="list" aria-label="Observed run events"></div>
</main>
<script>
(() => {
  'use strict';
  const PLUGIN = '__PLUGIN_ID__', VERSION = '__PLUGIN_VERSION__';
  let port = null, observe = [], protocol = 3;
  const seen = new Set();
  const env = (type, payload) => ({ p: 'wicked.editor', v: 1, type, payload });
  const send = (type, payload) => { if (port) port.postMessage(env(type, payload)); };
  const answer = (id, payload) => { if (port) port.postMessage({ p: 'wicked.editor', v: 1, re: id, ok: true, payload }); };

  // YOUR PLUGIN: render rows from events.batch as text only — never innerHTML.
  function renderBatch(p) {
    const rows = Array.isArray(p.rows) ? p.rows : Array.isArray(p.events) ? p.events : [];
    const list = document.getElementById('events');
    for (const r of rows) {
      if (!r || typeof r !== 'object' || typeof r.topic !== 'string') continue;
      const id = typeof r.id === 'string' && r.id ? r.id : String(++count);
      if (seen.has(id)) continue;
      seen.add(id);
      const item = document.createElement('div');
      item.dataset.eventId = id;
      item.dataset.topic = r.topic;
      item.setAttribute('role', 'listitem');
      const t = document.createElement('span');
      t.className = 'topic';
      t.textContent = r.topic;
      const d = document.createElement('span');
      d.className = 'detail';
      d.textContent = typeof r.data?.outcome === 'string' ? r.data.outcome : r.ord != null ? 'Unit ' + r.ord : id;
      item.appendChild(t);
      item.appendChild(d);
      list.appendChild(item);
    }
    const line = seen.size + (seen.size === 1 ? ' event' : ' events');
    document.getElementById('status').textContent = line + (observe.length ? ' · ' + observe.join(', ') : '');
    send('panel.summary', { text: line });
    reportHeight();
  }

  // The section is as tall as the plugin says (card aspect "auto"): report the content's height after every render,
  // or the host keeps the frame at its minimum and the rows are cut off.
  // Also on every layout change (a section first mounted while folded or in a closed drawer measures 0 until shown).
  // Nothing is measured or remembered before host.hello: the ResizeObserver's first callback runs before the port
  // exists, and a height cached then would make the report right after hello look unchanged, so it would be lost.
  let lastHeight = 0;
  function reportHeight() {
    if (!port) return;
    const h = Math.ceil(document.querySelector('main').getBoundingClientRect().height);
    if (h > 0 && h !== lastHeight) { lastHeight = h; send('ui.height', { px: h }); }
  }
  if (typeof ResizeObserver === 'function') new ResizeObserver(() => reportHeight()).observe(document.querySelector('main'));

  function onPort(m) {
    const d = m.data;
    try {
      if (!d || d.p !== 'wicked.editor' || d.v !== 1) return;
      const p = d.payload || {};
      switch (d.type) {
        case 'host.ping': answer(d.id, {}); break;
        case 'host.theme': {
          const t = p.theme || {};
          const map = { '--accent': '--accent', '--ink-high': '--ink', '--ink-muted': '--ink-muted', '--surface-card': '--surface' };
          for (const [k, v] of Object.entries(t)) {
            if (map[k] && typeof v === 'string' && !/url\(|[;{}]/i.test(v)) document.documentElement.style.setProperty(map[k], v);
          }
          break;
        }
        case 'events.batch': renderBatch(p); break;
        case 'host.teardown': break;
        default: break;
      }
    } catch (err) { /* a malformed host message is ignored */ }
  }

  window.addEventListener('message', (e) => {
    if (port || !e.data || e.data.p !== 'wicked.editor' || e.data.type !== 'host.hello' || !e.ports || !e.ports[0]) return;
    port = e.ports[0];
    port.onmessage = onPort;
    const p = e.data.payload || {};
    protocol = typeof p.protocol === 'number' ? p.protocol : 3;
    observe = Array.isArray(p.observe?.topics) ? p.observe.topics.filter((x) => typeof x === 'string') : [];
    document.body.dataset.protocol = String(protocol);
    document.getElementById('status').textContent = observe.length ? 'Observing ' + observe.join(', ') : 'No topics granted';
    reportHeight();
  });
  parent.postMessage(env('plugin.ready', { editor: PLUGIN, version: VERSION, protocol: [3], surfaces: { card: { interactive: false, aspect: 'auto', actions: [] } } }), '*');
})();
</script>
</body></html>
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall