modscode EN

modscode / 図鑑 / skyward

skyward

Skyward for Claude Code: the `/sky` panel over the daemon's computes, plus skills for the Python SDK and the `sky` CLI.

確かめやすいコードターミナル+デスクトップペインBoxButtonInputText

何をするか

  • デスクトップアプリに欄を描く
  • /sky を足す
  • session.start・ui.closeにフックする
  • ネットワークに出る

良いところ

  • プロセスを起こさない
  • TypeScript で書かれている
  • エラーを扱う
  • ファイルを書かない

作り始めるためのコード

2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。

雛形(register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like skyward by Gabriel Francisco (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/gabfssilva-skyward/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Skyward" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const id = '…'
    const get = '…'
    const state = '…'
    const filter = '…'
    const means = '…'
    const text = '…'
    const lastError = '…'
    const clock = '…'
    const count = '…'
    const group = '…'
    const first = '…'
    const length = '…'
    const rank = '…'
    const reason = '…'
    const label = '…'
    const value = '…'
    const value2 = '…'
    const value3 = '…'
    const spark = '…'
    const value4 = '…'
    const value5 = '…'
    const value6 = '…'
    const value7 = '…'
    const value8 = '…'
    const value9 = '…'
    const filter2 = '…'
    const state2 = '…'
    const value10 = '…'
    const value11 = '…'
    const value12 = '…'
    const value13 = '…'
    const value14 = '…'
    const value15 = '…'
    const value16 = '…'
    const value17 = '…'
    const value18 = '…'
    const filter3 = '…'
    const state3 = '…'
    const value19 = '…'
    const value20 = '…'
    const value21 = '…'
    const value22 = '…'
    const value23 = '…'
    const value24 = '…'
    const value25 = '…'
    const value26 = '…'
    const value27 = '…'
    const filter4 = '…'
    const total = '…'
    const summary = '…'
    const order = '…'
    const sha = '…'
    const filter5 = '…'
    const error = '…'
    const sha2 = '…'
    const filter6 = '…'
    const error2 = '…'
    const sha3 = '…'
    const filter7 = '…'
    const error3 = '…'
    const task = '…'
    const notice = '…'
    const text2 = '…'
    const clock2 = '…'
    const text3 = '…'
    const clock3 = '…'
    const text4 = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="column">
          <Box flexDirection="column">
            <Box flexDirection="row" gap={2}>
              <Text bold wrap="truncate">
                {id}
              </Text>
              <Text>
                {`${get} ${state}`}
              </Text>
            </Box>
            <Text dimColor wrap="truncate">
              {filter}
            </Text>
            <Text dimColor wrap="truncate">
              {`avg ${means}`}
            </Text>
            <Text wrap="truncate">
              {text}
            </Text>
            <Text color="red" wrap="truncate">
              {lastError}
            </Text>
          </Box>
          <Text dimColor>
            {`${id} · updated ${clock}`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row" gap={2}>
            <Box flexDirection="row" flexWrap="wrap">
              <Text bold>
                Nodes (
              </Text>
              <Text bold>
                {" · "}
              </Text>
              <Button plain label={`${count} ${group} ✕`} />
              <Text bold>
                {" · "}
              </Text>
              <Button plain label={`${count} ${group} ✕`} />
              <Text bold>
                {" · "}
              </Text>
              <Button plain label={`${count} ${group} ✕`} />
              <Text bold>
                )
              </Text>
            </Box>
            <Box flexDirection="row" gap={1}>
              <Button plain label={`‹ prev`} />
              <Text dimColor>
                {`${first}1–${first}${length} of ${length}`}
              </Text>
              <Button plain label="next ›" />
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Button plain label="▾" />
              <Box flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Text>
                <Text dimColor>
                  {"is "}
                </Text>
                <Text>
                  {state}
                </Text>
                <Text dimColor />
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
              <Box flexShrink={0} paddingLeft={1}>
                <Text dimColor>
                  killing…
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" flexWrap="wrap" columnGap={1} paddingLeft={4}>
              <Text color="red">
                {`kill #${rank}?`}
              </Text>
              <Button label="yes, kill" />
              <Button label="cancel" />
              <Text dimColor>
                it drains first, and a new node takes its rank if the compute still wants it
              </Text>
            </Box>
            <Text color="red">
              {`    kill failed: ${reason}`}
            </Text>
            <Text color="red">
              {`    ${lastError}`}
            </Text>
            <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value2}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value3}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    cpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value4}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value5}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value6}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    gpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value7}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value8}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value9}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box paddingLeft={4}>
              <Text dimColor>
                {filter2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Button plain label="▾" />
              <Box flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Text>
                <Text dimColor>
                  {"is "}
                </Text>
                <Text>
                  {state2}
                </Text>
                <Text dimColor />
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
              <Box flexShrink={0} paddingLeft={1}>
                <Text dimColor>
                  killing…
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" flexWrap="wrap" columnGap={1} paddingLeft={4}>
              <Text color="red">
                {`kill #${rank}?`}
              </Text>
              <Button label="yes, kill" />
              <Button label="cancel" />
              <Text dimColor>
                it drains first, and a new node takes its rank if the compute still wants it
              </Text>
            </Box>
            <Text color="red">
              {`    kill failed: ${reason}`}
            </Text>
            <Text color="red">
              {`    ${lastError}`}
            </Text>
            <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value10}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value11}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value12}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    cpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value13}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value14}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value15}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    gpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value16}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value17}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value18}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box paddingLeft={4}>
              <Text dimColor>
                {filter3}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Button plain label="▾" />
              <Box flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Text>
                <Text dimColor>
                  {"is "}
                </Text>
                <Text>
                  {state3}
                </Text>
                <Text dimColor />
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
              <Box flexShrink={0} paddingLeft={1}>
                <Text dimColor>
                  killing…
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" flexWrap="wrap" columnGap={1} paddingLeft={4}>
              <Text color="red">
                {`kill #${rank}?`}
              </Text>
              <Button label="yes, kill" />
              <Button label="cancel" />
              <Text dimColor>
                it drains first, and a new node takes its rank if the compute still wants it
              </Text>
            </Box>
            <Text color="red">
              {`    kill failed: ${reason}`}
            </Text>
            <Text color="red">
              {`    ${lastError}`}
            </Text>
            <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value19}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value20}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text>
                  <Text dimColor>
                    {`${label} `}
                  </Text>
                  {value21}
                </Text>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    cpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value22}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value23}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"cpu "}
                      </Text>
                      {value24}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box flexDirection="row" gap={2}>
              <Box flexShrink={0}>
                <Text>
                  {`    gpu ${spark}`}
                </Text>
              </Box>
              <Box flexShrink={1}>
                <Box flexDirection="row" flexWrap="wrap" columnGap={2} paddingLeft="0">
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value25}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value26}
                    </Text>
                  </Box>
                  <Box flexShrink={0}>
                    <Text>
                      <Text dimColor>
                        {"gpu "}
                      </Text>
                      {value27}
                    </Text>
                  </Box>
                </Box>
              </Box>
            </Box>
            <Box paddingLeft={4}>
              <Text dimColor>
                {filter4}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
            <Text bold>
              {`Tasks (${total})`}
            </Text>
            <Text dimColor>
              {summary}
            </Text>
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
            <Button plain label={`sort: ${order} ›`} />
            <Input label="function" placeholder="all" submitLabel="filter" />
            <Box flexDirection="row" gap={1}>
              <Button plain label={`‹ prev`} />
              <Text dimColor>
                {`${first}1–${first}${length} of ${total}`}
              </Text>
              <Button plain label="next ›" />
            </Box>
          </Box>
          <Text dimColor>
            no tasks
          </Text>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Box width={1} flexShrink={0}>
                <Text>
                  ·
                </Text>
              </Box>
              <Box width={5} flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text dimColor>
                  {sha}
                </Text>
              </Box>
              <Text dimColor>
                {filter5}
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
            </Box>
            <Box>
              <Text color="red" wrap="wrap">
                {error}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Box width={1} flexShrink={0}>
                <Text>
                  ·
                </Text>
              </Box>
              <Box width={5} flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text dimColor>
                  {sha2}
                </Text>
              </Box>
              <Text dimColor>
                {filter6}
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
            </Box>
            <Box>
              <Text color="red" wrap="wrap">
                {error2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box flexDirection="row" gap={1}>
              <Box width={1} flexShrink={0}>
                <Text>
                  ·
                </Text>
              </Box>
              <Box width={5} flexShrink={0}>
                <Text dimColor>
                  {" #? "}
                </Text>
              </Box>
              <Box flexShrink={0}>
                <Text dimColor>
                  {sha3}
                </Text>
              </Box>
              <Text dimColor>
                {filter7}
              </Text>
              <Box flexShrink={0} paddingLeft={1}>
                <Button plain label="logs" />
              </Box>
            </Box>
            <Box>
              <Text color="red" wrap="wrap">
                {error3}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
            <Text bold>
              Log
            </Text>
            <Input label="node" placeholder="all" submitLabel="go" />
            <Input label="filter" placeholder="term" submitLabel="search" />
            <Button plain label={`task ${task} ✕`} />
            <Text color="red">
              {notice}
            </Text>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Button plain label={`‹ older`} />
            <Text dimColor>
              live
            </Text>
            <Button plain label="newer ›" />
            <Button plain label="latest »" />
          </Box>
          <Text dimColor>
            no events
          </Text>
          <Box flexDirection="row" gap={1}>
            <Box width={8} flexShrink={0}>
              <Text dimColor>
                {clock}
              </Text>
            </Box>
            <Box width={5} flexShrink={0}>
              <Text dimColor>
                {" #? "}
              </Text>
            </Box>
            <Box flexShrink={1}>
              <Text wrap="wrap" color="red">
                {text2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Box width={8} flexShrink={0}>
              <Text dimColor>
                {clock2}
              </Text>
            </Box>
            <Box width={5} flexShrink={0}>
              <Text dimColor>
                {" #? "}
              </Text>
            </Box>
            <Box flexShrink={1}>
              <Text wrap="wrap" color="red">
                {text3}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Box width={8} flexShrink={0}>
              <Text dimColor>
                {clock3}
              </Text>
            </Box>
            <Box width={5} flexShrink={0}>
              <Text dimColor>
                {" #? "}
              </Text>
            </Box>
            <Box flexShrink={1}>
              <Text wrap="wrap" color="red">
                {text4}
              </Text>
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })
}

Mod 自身のコード

Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。

plugins/skyward/hooks/register.tsx 653〜812 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE_ID }, ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const now = Date.now()

    const show = (next: View, focus: string) => {
      view = next
      snapshot = { kind: 'loading' }
      focusKey = focus
      notice = undefined
      action = undefined
      refresh?.()
      $.ui.invalidate('ui.render')
    }

    // Keeps the current snapshot on screen until the page arrives, and both buttons drawn so the focus ring stays put.
    const turnPage = (page: number, pageCount: number) => {
      if (view.kind !== 'detail' || page < 0 || page >= pageCount) return
      view = { ...view, page }
      refresh?.()
    }

    const filterLog = (log: LogFilter, at?: { page: number; group: NodeGroup | null }) => {
      if (view.kind !== 'detail') return
      if (at !== undefined && (at.page !== view.page || at.group !== view.group)) focusKey = 'log-node'
      view = { ...view, log, ...at }
      notice = undefined
      refresh?.()
      $.ui.invalidate('ui.render')
    }

    // Like a page turn, the list changes when the next read arrives, and the buttons pressed stay drawn meanwhile.
    const filterNodes = (group: NodeGroup) => {
      if (view.kind !== 'detail') return
      view = { ...view, group: view.group === group ? null : group, page: 0 }
      refresh?.()
      $.ui.invalidate('ui.render')
    }

    const updateTasks = (tasks: TaskQuery) => {
      if (view.kind !== 'detail') return
      view = { ...view, tasks }
      refresh?.()
      $.ui.invalidate('ui.render')
    }

    const toggleLogTask = (taskId: string) => {
      if (view.kind !== 'detail') return
      filterLog({ ...view.log, task: view.log.task === taskId ? null : taskId, cursors: [] })
    }

    const toggleLogNode = (nodeId: string) => {
      if (view.kind !== 'detail') return
      filterLog({ ...view.log, node: view.log.node === nodeId ? null : nodeId, cursors: [] })
    }

    const toggleNode = (nodeId: string) => {
      if (view.kind !== 'detail') return
      const expanded = new Set(view.expanded)
      if (!expanded.delete(nodeId)) expanded.add(nodeId)
      view = { ...view, expanded }
      refresh?.()
      $.ui.invalidate('ui.render')
    }

    const setAction = (next: Action | undefined, focus?: string) => {
      action = next
      if (focus !== undefined) focusKey = focus
      $.ui.invalidate('ui.render')
    }

    // A deleted compute and a drained node lose their controls once the next read shows it, so those stay in
    // `sending` until then; a scaled compute keeps its controls and is let go at once.
    const perform = (sending: Action, focus: string, write: (daemon: Writes) => Promise<void>) => {
      const daemon = writes
      if (daemon === undefined) return
      setAction(sending, focus)
      write(daemon).then(
        () => {
          if (action === sending && sending.kind === 'scale') action = undefined
          refresh?.()
        },
        (error: unknown) => {
          if (action !== sending) return
          action = { ...sending, step: 'failed', reason: error instanceof Error ? error.message : String(error) }
          $.ui.invalidate('ui.render')
        },
      )
    }

    // The first press only asks, with the ring on cancel, so a second Enter does not delete.
    const removeControls = (c: Compute): RenderElement | null => {
      if (!deletable(c)) return null
      const pending = action?.kind === 'delete' && action.id === c.id ? action : undefined
      if (pending?.step === 'asking') {
        return (
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text color="red">delete this compute?</Text>
            <Button key="delete-confirm" label="yes, delete" onPress={() => perform({ kind: 'delete', id: c.id, step: 'sending' }, 'back', (daemon) => daemon.remove(c.id))} />
            <Button key="delete-cancel" label="cancel" onPress={() => setAction(undefined, 'delete')} />
          </Box>
        )
      }
      if (pending?.step === 'sending') return <Text dimColor>deleting…</Text>
      return <Button key="delete" label="delete" onPress={() => setAction({ kind: 'delete', id: c.id, step: 'asking' }, 'delete-cancel')} />
    }

    // Reads the drafts from `action` as it is now, not as it was drawn: two fields typed into between draws would
    // otherwise each write back the other's stale text.
    const draftScale = (typed: { min?: string; max?: string }) => {
      if (action?.kind !== 'scale' || action.step !== 'asking') return
      action = { ...action, ...typed }
    }

    const applyScale = (c: Compute, typed: { min?: string; max?: string }) => {
      if (action?.kind !== 'scale' || action.id !== c.id || action.step !== 'asking') return
      const asked = { ...action, ...typed }
      const min = count(asked.min, c.bounds.min)
      const max = count(asked.max, c.bounds.max)
      if (min === null || max === null || min > max) return setAction({ ...asked, invalid: true })
      if (min === c.bounds.min && max === c.bounds.max) return setAction(undefined, 'scale')
      perform({ ...asked, step: 'sending' }, 'back', (daemon) => daemon.scale(c, min, max))
    }

    // Mobile has no Input, so a compute is scaled there from the CLI or the web console. A field empties on Enter, so
    // one holding text that was refused shows it back as its placeholder.
    const scaleControls = (c: Compute): RenderElement | null => {
      if (!deletable(c) || e.surface === 'mobile') return null
      const pending = action?.kind === 'scale' && action.id === c.id ? action : undefined
      if (pending?.step === 'sending') return <Text dimColor>scaling…</Text>
      if (pending?.step !== 'asking') {
        return <Button key="scale" label="scale" onPress={() => setAction({ kind: 'scale', id: c.id, min: '', max: '', invalid: false, step: 'asking' }, 'scale-min')} />
      }
      const { Input } = $.ui.resolve(e)
      return (
        <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
          <Input key="scale-min" label="min" placeholder={pending.min === '' ? String(c.bounds.min) : pending.min} submitLabel="scale" onInput={(text) => draftScale({ min: text })} onSubmit={(text) => applyScale(c, { min: text })} />
          <Input key="scale-max" label="max" placeholder={pending.max === '' ? String(c.bounds.max) : pending.max} submitLabel="scale" onInput={(text) => draftScale({ max: text })} onSubmit={(text) => applyScale(c, { max: text })} />
          <Button key="scale-apply" label="apply" onPress={() => applyScale(c, {})} />
          <Button key="scale-cancel" label="cancel" onPress={() => setAction(undefined, 'scale')} />
          {pending.invalid ? <Text color="red">whole numbers, min ≤ max</Text> : null}
        </Box>
      )
    }

    scrolling = false
    const columns = fitColumns(e.props.bodyColumns)
    const tableWidth = columns.reduce((width, column) => width + TABLE_GAP + column.width, NAME_WIDTH)

    const cell = (column: Column, text: string, props: { color?: string; dim?: boolean; bold?: boolean }): RenderElement => (
      <Box width={column.width} flexShrink={0}>
        <Text wrap="truncate" color={props.color} dimColor={props.dim} bold={props.bold}>
          {column.right ? text.padStart(column.width) : text}
        </Text>
      </Box>
    )

    const tableRow = (name: RenderElement, cells: RenderElement[]): RenderElement => (
      <Box flexDirection="row" gap={TABLE_GAP}>
        <Box width={NAME_WIDTH} flexShrink={0}>{name}</Box>
        {cells}
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 Gabriel Francisco

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

コードが呼ぶもの

通信

コードから読み取ったデザイン

読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。

コードから読めること

2026-10-06 に読んだコミット 9575eef3bc60 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。plugins/skyward/hooks/register.tsx
解析できるすべてのファイルが TypeScript か JavaScript として解析できる。1 ファイルを解析
コードが Mod の中で完結import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中
読める圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし
呼び出しが見える通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で
入れる前に自分で判断する材料
描く場所コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに同じように描く
入れる手順リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる
Windows のプログラム$.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない
通信fetch の送り先(https のホスト)がコードに書いてあるか。plugins/skyward/hooks/register.tsx:436 fetch(`${DAEMON}${path}`); plugins/skyward/hooks/register.tsx:564 fetch(`${DAEMON}/v1/computes/${id}`); plugins/skyward/hooks/register.tsx:582 fetch(`${DAEMON}/v1/computes/${compute}/nodes/${node}`)
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない
読んで送るファイルや環境変数を読み、かつ通信するか。通信するが、ファイルも環境変数も読まない
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件

入れる

入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。

リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。

/plugin marketplace add gabfssilva/skyward
/plugin install skyward@skyward

入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(9575eef3bc60)と違うことがあります。入れる前に見比べてください。

Claude に聞く

modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:

modscode のデザイン「gabfssilva-skyward」をコードごと読んで、同じようなペインを作って

Claude から探す: MCP コネクタ

似たデザイン