modscode JA

modscode / Gallery / dca-factory-cockpit

dca-factory-cockpit

Claude Code only, optional: the dca-factory cycle as a cockpit in a pane — the foundation (describe, set up) beside the cycle discover, backlog, run, decide, delivered — live, with a background worker. Draws what factory.sh prints; the fac…

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText

What it does

  • Draws a pane, the status line, toasts
  • Adds /factory-cockpit
  • Watches tool calls and can refuse them
  • Hooks session.start, turn.complete
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors
  • Writes no files

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

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

// Drawn like dca-factory-cockpit by Christoph Bloemer (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/domain-centric-development-dca-factory-cockpit/
// 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: "Factory cockpit" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const project = '…'
    const delivered = '…'
    const total = '…'
    const tokens = '…'
    const text = '…'
    const MARK_GLYPH = '…'
    const id = '…'
    const label = '…'
    const text2 = '…'
    const label2 = '…'
    const text3 = '…'
    const label3 = '…'
    const text4 = '…'
    const label4 = '…'
    const text5 = '…'
    const label5 = '…'
    const text6 = '…'
    const label6 = '…'
    const text7 = '…'
    const label7 = '…'
    const text8 = '…'
    const label8 = '…'
    const text9 = '…'
    const label9 = '…'
    const text10 = '…'
    return (
      <Box flexDirection="column" paddingX={1} paddingY={1} width="100%">
        <Box flexDirection="column">
          <Box borderStyle="round" paddingX={1}>
            <Box flexDirection="column" flexGrow={1}>
              <Box justifyContent="space-between">
                <Box gap={2}>
                  <Box>
                    <Text bold>
                      domaincentric
                    </Text>
                    <Text bold>
                      .dev
                    </Text>
                  </Box>
                  <Text>
                    │
                  </Text>
                  <Text bold>
                    FACTORY COCKPIT
                  </Text>
                </Box>
              </Box>
              <Box gap={2} marginTop={1}>
                <Text bold>
                  PROJECT
                </Text>
                <Text bold>
                  {project}
                </Text>
                <Text>
                  {delivered}
                  {" of "}
                  {total}
                  {" stories delivered"}
                  {` · ${tokens} tokens`}
                  {" · worker ▶"}
                </Text>
              </Box>
            </Box>
          </Box>
          <Box marginTop={1} />
          <Box gap={1} marginTop={1}>
            <Text bold>
              Next ›
            </Text>
            <Text>
              {text}
            </Text>
          </Box>
          <Box gap={1}>
            <Text>
              This project's pipeline is older than the cockpit reads — the description and discovery views stay empty.
            </Text>
            <Box gap={0}>
              <Button label="✦ update" plain />
              <Text>
                {" ›"}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box gap={1}>
            <Text bold>
              {MARK_GLYPH}
            </Text>
            <Text bold>
              {id}
              {" — "}
            </Text>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Box gap={3}>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text2}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label2}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text3}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label3}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text4}
                </Text>
              </Box>
            </Box>
            <Box gap={3}>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label4}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text5}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label5}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text6}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label6}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text7}
                </Text>
              </Box>
            </Box>
            <Box gap={3}>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label7}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text8}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label8}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text9}
                </Text>
              </Box>
              <Box gap={1} width={44} flexShrink={0}>
                <Box width={10} flexShrink={0}>
                  <Text bold>
                    {label9}
                  </Text>
                </Box>
                <Text wrap="truncate">
                  {text10}
                </Text>
              </Box>
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const story = '…'
    const what = '…'
    const stage = '…'
    await $.ui.status(`factory: waits for you — ${story} ${what}`)
    await $.ui.toast(`factory: ${story} — ${stage} started`)
    await $.ui.toast(`factory: ${story} — ${stage} gate refused`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

plugins/dca-factory-cockpit/hooks/register.tsx lines 441–446 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const now = await read($, cockpit)
    const { Text } = $.ui.resolve(e)
    if (!now) return <Text color={C.muted}>No factory in this project.</Text>
    return draw($, e, now)
  })
plugins/dca-factory-cockpit/hooks/register.tsx lines 452–611 · Pane
async function draw($: EngineInterface, e: RenderInput<'Pane'>, now: Cockpit) {
  const { Box, Text, Button, ...rest } = $.ui.resolve(e)
  // the site's paper for a light theme, its deep plates for a dark one — before anything is drawn
  const theme = (await $.config.list().catch(() => [])).find(row => row.key === 'theme')
  applyPalette(/light/i.test(String(theme?.value ?? '')))
  const ui = components({
    Box,
    Text,
    Button,
    Input: 'Input' in rest ? rest.Input : null,
    width: e.props.bodyColumns ?? e.viewport?.columns ?? 100,
  })
  const at = await $.clock.now()
  const current = await read($, tab)
  const open = await read($, detail)
  const job = await read($, worker)
  const rows = e.viewport?.rows ?? 40
  const status = now.status
  const isFocused = Boolean(e.props.isFocused)

  // The links every view shares — one way to open a story, a record, a file.
  const storyCell = (row: Row): Cell => ({ node: ui.marked(row.mark, `story-${row.story}`, row.story, () => void openStory($, row.story)) })
  const recordCell = (record: DecisionRecord, back: Detail | null): Cell => ({
    node: ui.link(`record-${record.id}`, record.id, () => void openFile($, `${now.root}/${record.path}`, record.id, back)),
  })
  // An unguarded epic's own act, beside its hint — the epic's name opens the epic, this writes its journey.
  const guardCell = (hint: FactoryStatus['journeys'][number]): Cell => ({
    node: ui.button(`guard-${hint.epic}`, 'add guard', () => send($, hint.action.skill || `/factory-backlog journey ${hint.epic}`), { byClaude: true }),
  })
  const ask = (key: string, label: string, placeholder: string, command: string) =>
    ui.ask(key, label, placeholder, value => send($, `${command} ${value}`.trim()), () => void $.prompt.fill({ text: `${command} ` }))
  const idWidth = Math.max(8, ...status.rows.map(row => row.story.length)) + 4
  const recordTable = (list: DecisionRecord[], back: Detail | null) =>
    ui.table(
      [COL.mark, { name: 'state', width: 9 }, COL.record, COL.asked, COL.what],
      list.map(record => [
        ui.mark(record.kind === 'acceptance' ? 'acceptance' : 'question'),
        { text: record.state, color: record.state === 'open' ? C.wait : C.muted },
        recordCell(record, back),
        { text: fmt.when(record.asked), color: C.muted },
        { text: record.text, color: C.muted },
      ]),
      'No record.',
    )

  const head = (
    <Box flexDirection="column">
      <Box borderStyle="round" borderColor={C.accent} paddingX={1}>
        <Box flexDirection="column" flexGrow={1}>
          <Box justifyContent="space-between">
            <Box gap={2}>
              {/* side by side, not nested: a Text inside a Text takes the outer colour */}
              <Box>
                <Text bold color={C.bright}>
                  domaincentric
                </Text>
                <Text bold color={C.accent}>
                  .dev
                </Text>
              </Box>
              <Text color={C.line}>│</Text>
              <Text bold color={C.accent}>
                FACTORY COCKPIT
              </Text>
            </Box>
            {ui.button('close', '✕ close', () => void $.ui.close({ id: PANE }), { hotkey: 'q' })}
          </Box>
          <Box gap={2} marginTop={1}>
            <Text bold color={C.accent}>
              PROJECT
            </Text>
            <Text bold color={C.bright}>
              {now.project}
            </Text>
            <Text color={C.muted}>
              {status.delivered} of {status.total} stories delivered
              {status.tokens > 0 ? ` · ${fmt.tokens(status.tokens)} tokens` : ''}
              {job.state === 'running' ? ' · worker ▶' : ''}
            </Text>
          </Box>
        </Box>
      </Box>
      <Box marginTop={1}>
        {ui.phases(
          [
            { key: 'tab-describe', label: 'Describe', hotkey: '0', isOpen: current === 'describe' && !open, onPress: () => void showTab($, 'describe') },
            { key: 'setup', label: '✦ setup', isOpen: false, onPress: () => send($, '/factory-setup') },
            { key: 'update', label: '✦ update', isOpen: false, onPress: () => send($, '/factory-update') },
          ],
          TABS.map(one => ({
            key: `tab-${one.id}`,
            label: one.label,
            hotkey: one.key,
            isOpen: one.id === current && !open,
            mark:
              one.id === 'decide' && status.waiting.length > 0
                ? { text: String(status.waiting.length), color: C.wait }
                : one.id === 'run' && (isRunning() || status.running.length > 0)
                  ? { text: '▶', color: C.accent }
                  : one.id === 'delivered' && status.delivered > 0
                    ? { text: String(status.delivered), color: C.done }
                    : undefined,
            onPress: () => void showTab($, one.id),
          })),
        )}
      </Box>
      {status.waiting.length > 0 && ui.banner(C.wait, status.waiting.map(wait => `${MARK_GLYPH[wait.mark] ?? '?'} ${wait.story} — ${wait.what}`))}
      <Box gap={1} marginTop={1}>
        <Text bold color={C.accent}>
          Next ›
        </Text>
        <Text color={C.text}>{status.next.text}</Text>
      </Box>
      {now.isBehind && (
        <Box gap={1}>
          <Text color={C.wait}>This project's pipeline is older than the cockpit reads — the description and discovery views stay empty.</Text>
          {ui.link('behind-update', '✦ update', () => send($, '/factory-update'))}
        </Box>
      )}
    </Box>
  )

  const page = (body: RenderElement | RenderElement[], hint: string) => (
    // the painted surface fills the pane: at least the rows the surface gave its body, the whole width
    <Box flexDirection="column" paddingX={1} paddingY={1} backgroundColor={C.bg} minHeight={e.props.scroll?.bodyRows ?? rows} width={e.props.bodyColumns ?? '100%'}>
      {head}
      <Box flexDirection="column" marginTop={1}>
        {body}
      </Box>
      {ui.keys(isFocused, hint)}
    </Box>
  )

  // ---- one process's output: what it read, edited and ran, a shared one's stages as headings
  if (open?.kind === 'output') {
    const lines = await read($, outputLines)
    return page(
      [
        <Box gap={1}>
          <Text bold color={C.bright}>
            {open.story} / {open.process}
          </Text>
        </Box>,
        ui.actions([
          ui.button('back', '← back', () => void (open.back?.kind === 'story' ? openStory($, open.back.id) : update($, detail, () => open.back)), { hotkey: 'b' }),
        ]),
        ui.framed(ui.log(lines.slice(-Math.max(10, rows - 12)), 'This process wrote nothing.')),
      ],
      'b back',
    )
  }

  // ---- a file: a description, a discovery report, a hand-over, a decision record
  if (open?.kind === 'file') {
    return page(
      [
        <Box gap={1}>
          <Text bold color={C.bright}>
            {open.title}
          </Text>
plugins/dca-factory-cockpit/hooks/components.tsx lines 259–264 · Pane
  const link = (key: string, label: string, onPress: () => void) => (
    <Box key={`link-${key}`} gap={0} hover={{ backgroundColor: C.line }}>
      <Button key={key} label={label} plain onPress={onPress} />
      <Text color={C.accent}> ›</Text>
    </Box>
  )
plugins/dca-factory-cockpit/hooks/components.tsx lines 230–255 · Pane
  const fields = (items: (Field | false | null | undefined | '' | 0)[], wanted = 1) => {
    const present = items.filter((item): item is Field => typeof item === 'object' && item !== null && Boolean(item.text))
    const perRow = Math.max(1, Math.min(wanted, pairsPerRow(width)))
    const rowsOf: Field[][] = []
    for (let index = 0; index < present.length; index += perRow) rowsOf.push(present.slice(index, index + perRow))
    return (
      <Box flexDirection="column" marginTop={1}>
        {rowsOf.map(pairs => (
          <Box gap={3}>
            {pairs.map(item => (
              <Box gap={1} width={perRow > 1 ? PAIR : undefined} flexShrink={perRow > 1 ? 0 : 1}>
                <Box width={10} flexShrink={0}>
                  <Text bold color={C.accent}>
                    {item.label.toUpperCase()}
                  </Text>
                </Box>
                <Text color={item.color ?? C.text} bold={item.bold} wrap="truncate">
                  {item.text}
                </Text>
              </Box>
            ))}
          </Box>
        ))}
      </Box>
    )
  }
Licence text (MIT)
MIT License

Copyright (c) 2026 Christoph Bloemer and contributors

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.

What its code calls

runs programsreads filesdrives Claudetool calls

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit aa96a6933a11 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.plugins/dca-factory-cockpit/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.3 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).plugins/dca-factory-cockpit/hooks/register.tsx:329 open (not on Windows); plugins/dca-factory-cockpit/hooks/register.tsx:334 xdg-open (not on Windows)
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.plugins/dca-factory-cockpit/hooks/register.tsx:40 bash (a shell or interpreter); plugins/dca-factory-cockpit/hooks/register.tsx:189 bash (a shell or interpreter)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add domain-centric-development/dca-marketplace
/plugin install dca-factory-cockpit@dca-marketplace

This installs the marketplace's latest commit, which may not be the one read here (aa96a6933a11). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "domain-centric-development-dca-factory-cockpit" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs