modscode JA

modscode / Gallery / code-modernization

code-modernization

Guided modernization for any legacy codebase: start with /modernize, get an assessment, an interactive map, the business rules mined from the code, and a plan you approve, then an upgrade, a rewrite or a rebuild with independent proof that…

Code you can checkTerminal + desktopPaneBandStatus lineToastBoxButtonInputText

What it does

  • Draws a pane
  • Adds /modernize-panel, /modernize-review-pane, /modernize-sign
  • Watches tool calls and can refuse them
  • Hooks prompt.submit, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

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 code-modernization by Anthropic (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/anthropics-code-modernization/
// 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: "code-modernization" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const left = '…'
    const TRACK_LABELS = '…'
    const at = '…'
    const length = '…'
    const label = '…'
    const summary = '…'
    const full = '…'
    const rest = '…'
    const right = '…'
    const stateWord = '…'
    const count = '…'
    const PROOF_MARKS = '…'
    const PROOF_MARKS2 = '…'
    const PROOF_MARKS3 = '…'
    const doneCount = '…'
    const label2 = '…'
    const label3 = '…'
    const many = '…'
    const done = '…'
    const modules = '…'
    const text = '…'
    const name = '…'
    const word = '…'
    const name2 = '…'
    const name3 = '…'
    const reason = '…'
    const line = '…'
    const status = '…'
    return (
      <Box flexDirection="column" paddingRight={1}>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Text bold wrap="truncate-end">
              {`${left} · ${TRACK_LABELS}`}
            </Text>
            <Box columnGap={1}>
              <Button dimColor>
                {`system ${at}1/${length}`}
              </Button>
              <Button dimColor>
                hide
              </Button>
            </Box>
          </Box>
          <Box flexWrap="wrap">
            <Text color="success">
              {`✓ ${label} `}
            </Text>
            <Text color="success">
              {`✓ ${label} `}
            </Text>
            <Text color="success">
              {`✓ ${label} `}
            </Text>
          </Box>
          <Text dimColor wrap="truncate-end">
            {summary}
          </Text>
          <Box>
            <Text color="success">
              {full}
            </Text>
            <Text dimColor>
              {rest}
            </Text>
            <Text>
              {` ${right}`}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box flexWrap="wrap">
            <Text>
              <Text>
                ■
              </Text>
              <Text dimColor>
                {` ${stateWord} ${count}  `}
              </Text>
            </Text>
            <Text>
              <Text>
                ■
              </Text>
              <Text dimColor>
                {` ${stateWord} ${count}  `}
              </Text>
            </Text>
            <Text>
              <Text>
                ■
              </Text>
              <Text dimColor>
                {` ${stateWord} ${count}  `}
              </Text>
            </Text>
            <Text>
              <Text color="success" bold>
                {PROOF_MARKS}
              </Text>
              <Text dimColor>
                {` proven ${count}  `}
              </Text>
            </Text>
            <Text>
              <Text color="success" bold>
                {PROOF_MARKS2}
              </Text>
              <Text dimColor>
                {` proven ${count}  `}
              </Text>
            </Text>
            <Text>
              <Text color="success" bold>
                {PROOF_MARKS3}
              </Text>
              <Text dimColor>
                {` proven ${count}  `}
              </Text>
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text bold color="suggestion">
              Phases
            </Text>
            <Text dimColor>
              {" ──────── "}
            </Text>
            <Text>
              {`${doneCount}/${length}`}
            </Text>
          </Box>
          <Box>
            <Text color="success">
              {label}
            </Text>
            <Text dimColor>
              {` ${right}`}
            </Text>
          </Box>
          <Box>
            <Text color="success">
              {label2}
            </Text>
            <Text dimColor>
              {` ${right}`}
            </Text>
          </Box>
          <Box>
            <Text color="success">
              {label3}
            </Text>
            <Text dimColor>
              {` ${right}`}
            </Text>
          </Box>
          <Text dimColor>
            {`  … ${length} more phases`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text bold color="suggestion">
              {many}
            </Text>
            <Text dimColor>
              {" ──────── "}
            </Text>
            <Text>
              {`${done}/${modules}`}
            </Text>
          </Box>
          <Text wrap="truncate-end">
            <Text dimColor>
              {"■ "}
            </Text>
            <Text bold>
              {"the whole upgrade "}
            </Text>
            <Text>
              {text}
            </Text>
          </Text>
          <Text wrap="truncate-end">
            <Text>
              {"■ "}
            </Text>
            <Text bold>
              {name}
            </Text>
            <Text dimColor>
              {`  ${word}`}
            </Text>
            <Text color="error" />
            <Text>
              {`  ${text}`}
            </Text>
          </Text>
          <Text wrap="truncate-end">
            <Text>
              {"■ "}
            </Text>
            <Text bold>
              {name2}
            </Text>
            <Text dimColor>
              {`  ${word}`}
            </Text>
            <Text color="error" />
            <Text>
              {`  ${text}`}
            </Text>
          </Text>
          <Text wrap="truncate-end">
            <Text>
              {"■ "}
            </Text>
            <Text bold>
              {name3}
            </Text>
            <Text dimColor>
              {`  ${word}`}
            </Text>
            <Text color="error" />
            <Text>
              {`  ${text}`}
            </Text>
          </Text>
          <Text dimColor>
            {`  … ${length} more`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text bold color="suggestion">
              Next
            </Text>
            <Text dimColor>
              {" ──────── "}
            </Text>
            <Text>
              {right}
            </Text>
          </Box>
          <Box flexDirection="column" paddingLeft={2}>
            <Text color="claude" wrap="wrap">
              {`${text}  (by hand)`}
            </Text>
            <Text dimColor wrap="truncate-end">
              {reason}
            </Text>
          </Box>
          <Box marginTop={1} flexWrap="wrap" columnGap={1}>
            <Button>
              put in prompt
            </Button>
            <Button>
              sign the brief
            </Button>
            <Button>
              review rules
            </Button>
            <Button>
              stop the run
            </Button>
          </Box>
          <Text dimColor wrap="truncate-end">
            click a button, or ctrl+x tab then Tab, Enter
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text bold color="suggestion">
              Attention
            </Text>
            <Text dimColor>
              {" ──────── "}
            </Text>
            <Text>
              {length}
            </Text>
          </Box>
          <Text color="warning" wrap="truncate-end">
            {`  ! ${line}`}
          </Text>
          <Text color="warning" wrap="truncate-end">
            {`  ! ${line}`}
          </Text>
          <Text color="warning" wrap="truncate-end">
            {`  ! ${line}`}
          </Text>
          <Text dimColor>
            {`  … ${length} more`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text bold color="suggestion">
              Session
            </Text>
            <Text dimColor>
              {" ──────── "}
            </Text>
            <Text>
              {status}
            </Text>
          </Box>
          <Text dimColor wrap="truncate-end">
            {`  ${summary}`}
          </Text>
        </Box>
      </Box>
    )
  })
}

The mod's own code

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

plugins/code-modernization/hooks/register.ts lines 837–923 · Pane
  on('ui.render', { component: 'Pane' }, async ($, e, next) => {
    const host = state.host

    if (host === null || (e.requestId !== PANE_ID && e.requestId !== SIGN_ID)) {
      return next(e)
    }

    const table = $.ui.resolve(e)
    const kit: Kit = {
      Box: table.Box,
      Text: table.Text,
      Button: table.Button,
      ...('Raster' in table && { Raster: table.Raster }),
      ...('Code' in table && { Code: table.Code }),
      ...('Input' in table && { Input: table.Input }),
      ...('Select' in table && { Select: table.Select }),
    }

    const columns = Math.max(24, wholeOf(e.props.bodyColumns) - 1)

    if (e.requestId === SIGN_ID) {
      return signView(
        kit,
        state.sign,
        state.snapshot?.system ?? '',
        state.snapshot?.brief?.openQuestions ?? 0,
        columns,
        signActionsOf(host),
      )
    }

    // A squeezed pane (a dialog or another panel has its rows) can report a body of no rows at all.
    const rows = wholeOf(e.props.scroll.bodyRows)

    state.pane.isOpen = true
    state.pane.isWaiting = false
    state.pane.bodyColumns = columns
    state.pane.bodyRows = rows
    state.pane.placement = e.props.placement

    const snapshot = state.snapshot

    const plan = planOf(rows, e.props.placement, {
      phases: snapshot?.brief?.phases.length ?? 0,
      modules: snapshot?.modules.length ?? 0,
      attention:
        (snapshot?.attention.length ?? 0) +
        [...state.fleet.signatures.values()].filter(signature => signature.agents.size >= 3).length,
      hasMap: snapshot !== null && snapshot.estate !== null && kit.Raster !== undefined,
      headerRows: headerRowsOf(snapshot, columns),
      nextRows: nextRowsOf(snapshot, state, columns),
      legendRows: legendRowsOf(snapshot, columns),
    })

    let estate: { cells: string; columns: number; rows: number; tiles: State['estate'] extends infer T ? (T extends { tiles: infer U } ? U : never) : never } | null = null

    // The plan sheds the map first when the body is too short; a Raster of no rows is refused.
    if (snapshot !== null && snapshot.estate !== null && kit.Raster !== undefined && plan.estate >= 1 && columns >= 1) {
      const mapRows = Math.min(256, plan.estate)
      const held = state.estate

      const tiles =
        held !== null && held.columns === columns && held.rows === mapRows && held.tiles.length > 0
          ? held.tiles
          : tilesOf(snapshot, columns, mapRows)

      state.estate = { tiles, columns, rows: mapRows, isMounted: true }

      const painted = paint(tiles, columns, mapRows, state.touches, nowMs())

      estate = { cells: painted.cells, columns, rows: mapRows, tiles }

      if (painted.isAnimating) {
        animate(host)
      }
    } else {
      // No map drawn: nothing for the frame timer to repaint.
      state.estate = null
    }

    return paneView(
      kit,
      state,
      { columns, rows, placement: e.props.placement, nowMs: nowMs(), estate, plan },
      paneActionsOf(host),
    )
  })
plugins/code-modernization/hooks/views/deck.tsx lines 266–324 · Pane
export function signView(
  kit: Kit,
  sign: SignState,
  system: string,
  openQuestions: number,
  columns: number,
  actions: SignActions,
): RenderElement {
  const { Box, Text, Button, Input } = kit
  const width = Math.max(30, columns)

  return (
    <Box flexDirection="column" width={width}>
      <Text bold color={HEAD}>Sign the brief</Text>
      <Text dimColor wrap="wrap">
        {`Records who approved the plan in analysis/${system}/MODERNIZATION_BRIEF.md, and how much of it. Nothing is built until it is signed.`}
      </Text>
      {openQuestions > 0 ? (
        <Text color={WARN} wrap="wrap">{`${openQuestions} open question${openQuestions === 1 ? '' : 's'} in the brief ${openQuestions === 1 ? 'is' : 'are'} still unticked.`}</Text>
      ) : null}
      <Box marginTop={1} flexDirection="column">
        {Input !== undefined ? (
          <Input
            key="signer"
            label="Approved by"
            placeholder="name, role"
            value={sign.name}
            submitLabel="sign"
            autoFocus
            onInput={actions.name}
            onSubmit={value => {
              actions.name(value)
              actions.sign()
            }}
          />
        ) : (
          <Text>{`Approved by: ${sign.name}`}</Text>
        )}
      </Box>
      <Box marginTop={1} columnGap={2}>
        <Text dimColor>Covers:</Text>
        <Button key="phase1" plain onPress={() => actions.covers('phase-1')}>
          {`${sign.covers === 'phase-1' ? '◉' : '○'} Phase 1 only`}
        </Button>
        <Button key="full" plain onPress={() => actions.covers('full')}>
          {`${sign.covers === 'full' ? '◉' : '○'} Full plan`}
        </Button>
      </Box>
      {sign.error !== null ? <Text color={BAD} wrap="wrap">{sign.error}</Text> : null}
      <Box marginTop={1} columnGap={2}>
        <Button key="do-sign" onPress={actions.sign}>sign</Button>
        <Button key="cancel" dimColor onPress={actions.cancel}>cancel</Button>
      </Box>
      <Box>
        <Text dimColor>enter signs · tab moves · esc cancels</Text>
      </Box>
    </Box>
  )
}
plugins/code-modernization/hooks/views/pane.tsx lines 619–662 · Pane
export function paneView(
  kit: Kit,
  state: State,
  frame: PaneFrame,
  actions: PaneActions,
): RenderElement {
  const { Box, Text } = kit
  const width = Math.max(20, frame.columns)
  const snapshot = state.snapshot

  if (snapshot === null) {
    return (
      <Box flexDirection="column" paddingRight={1} rowGap={1}>
        <Text bold>Modernization</Text>
        {state.readError !== null ? (
          <Text dimColor wrap="wrap">{`could not read the workspace: ${state.readError}`}</Text>
        ) : (
          <Box flexDirection="column">
            <Text wrap="wrap">Nothing to show yet: no legacy code under legacy/ and no analysis under analysis/.</Text>
            <Text wrap="wrap">
              <Text>To begin, type </Text>
              <Text bold color={ACCENT}>{frontDoorOf(state.options.commandPrefix)}</Text>
              <Text>. It asks what you want done with your code, finds it, and gives you the first step.</Text>
            </Text>
          </Box>
        )}
      </Box>
    )
  }

  const plan = frame.plan

  return (
    <Box flexDirection="column" paddingRight={1} rowGap={plan.gap}>
      {header(kit, snapshot, width, actions)}
      {estate(kit, snapshot, frame, width)}
      {plan.phases > 0 ? phases(kit, snapshot, width, plan.phases) : null}
      {plan.modules > 0 ? modules(kit, snapshot, width, plan.modules) : null}
      {nextBlock(kit, snapshot, actions, state, width, plan.hasHint)}
      {plan.attention > 0 ? attention(kit, state, snapshot, width, plan.attention) : null}
      {session(kit, state, frame, width, plan.session)}
    </Box>
  )
}
plugins/code-modernization/hooks/views/pane.tsx lines 98–135 · Pane
function header(kit: Kit, snapshot: Snapshot, width: number, actions: PaneActions): RenderChildren {
  const { Box, Text, Button } = kit
  const target = snapshot.brief?.target
  const percent = snapshot.percent
  const right = percent === null ? '' : `${(percent * 100).toFixed(percent < 0.1 ? 1 : 0)}% done`
  const left = `${snapshot.system}${target !== undefined ? ` → ${target}` : ''}`
  const bar = barOf(percent ?? 0, Math.max(4, width - right.length - 1))
  const summary = estateLine(snapshot)
  const at = snapshot.systems.indexOf(snapshot.system)
  const many = snapshot.systems.length > 1

  return (
    <Box flexDirection="column">
      <Box justifyContent="space-between">
        <Text bold wrap="truncate-end">{clip(`${left} · ${TRACK_LABELS[snapshot.track]}`, Math.max(8, width - (many ? 22 : 9)))}</Text>
        <Box columnGap={1}>
          {many ? <Button key="system" dimColor onPress={actions.system}>{`system ${at + 1}/${snapshot.systems.length}`}</Button> : null}
          <Button key="hide" dimColor onPress={actions.close}>hide</Button>
        </Box>
      </Box>
      <Box flexWrap="wrap">
        {snapshot.stages.map(stage => (
          <Text color={stage.isDone ? GOOD : undefined} dimColor={!stage.isDone}>
            {`${stage.isDone ? '✓' : '·'} ${stage.label} `}
          </Text>
        ))}
      </Box>
      {summary !== '' ? <Text dimColor wrap="truncate-end">{clip(summary, width)}</Text> : null}
      {percent !== null ? (
        <Box>
          <Text color={GOOD}>{bar.full}</Text>
          <Text dimColor>{bar.rest}</Text>
          <Text>{` ${right}`}</Text>
        </Box>
      ) : null}
    </Box>
  )
}
plugins/code-modernization/hooks/views/pane.tsx lines 137–170 · Pane
function estate(kit: Kit, snapshot: Snapshot, frame: PaneFrame, width: number): RenderChildren {
  const { Box, Text, Raster } = kit

  if (frame.estate === null || Raster === undefined) {
    return null
  }

  const counts = countsOf(frame.estate.tiles)

  return (
    <Box flexDirection="column">
      <Raster
        key={RASTER_KEY}
        columns={frame.estate.columns}
        rows={frame.estate.rows}
        cells={frame.estate.cells}
      />
      <Box flexWrap="wrap" width={width}>
        {counts.map(entry => (
          <Text>
            <Text color={hexOf(STATE_COLORS[entry.state])}>■</Text>
            <Text dimColor>{` ${stateWord(snapshot.track, entry.state)} ${entry.count}  `}</Text>
          </Text>
        ))}
        {proofCountsOf(frame.estate.tiles).map(entry => (
          <Text>
            <Text color={entry.kind === 'proven' ? GOOD : entry.kind === 'partly' ? WARN : BAD} bold>{PROOF_MARKS[entry.kind]}</Text>
            <Text dimColor>{` ${entry.kind === 'proven' ? 'proven' : entry.kind === 'partly' ? 'partly proven' : 'not proven'} ${entry.count}  `}</Text>
          </Text>
        ))}
      </Box>
    </Box>
  )
}
plugins/code-modernization/hooks/views/pane.tsx lines 172–222 · Pane
function phases(kit: Kit, snapshot: Snapshot, width: number, max: number): RenderChildren {
  const { Box, Text } = kit
  const brief = snapshot.brief

  if (brief === null || brief.phases.length === 0) {
    return null
  }

  const isDone = (ids: readonly string[]) =>
    ids.length > 0 &&
    ids.every(id => {
      const module = snapshot.byNode.get(id)

      return module !== undefined && isUnitDone(snapshot, module)
    })

  const ordered = [...brief.phases].sort((a, b) => a.number - b.number)
  const currentIndex = Math.max(0, ordered.findIndex(phase => !isDone(phase.modules)))
  const start = Math.max(0, Math.min(currentIndex - 1, ordered.length - max))
  const shown = ordered.slice(start, start + max)
  const doneCount = ordered.filter(phase => isDone(phase.modules)).length

  return (
    <Box flexDirection="column">
      {rule(kit, 'Phases', width, `${doneCount}/${ordered.length}`)}
      {shown.map(phase => {
        const done = isDone(phase.modules)
        const isCurrent = ordered[currentIndex] === phase && !done
        const ticked = phase.criteria.filter(criterion => criterion.isTicked).length
        const right = phase.criteria.length > 0 ? `${ticked}/${phase.criteria.length} checks` : ''
        const label = `${done ? '✓' : isCurrent ? '▸' : '·'} P${phase.number} ${phase.title}`

        return (
          <Box>
            <Text
              color={done ? GOOD : isCurrent ? HEAD : undefined}
              bold={isCurrent}
              dimColor={!done && !isCurrent}
            >
              {pad(clip(label, width - right.length - 1), width - right.length - 1)}
            </Text>
            <Text dimColor>{` ${right}`}</Text>
          </Box>
        )
      })}
      {ordered.length > shown.length ? (
        <Text dimColor>{`  … ${ordered.length - shown.length} more phases`}</Text>
      ) : null}
    </Box>
  )
}
Licence text (Apache-2.0)
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

What its code calls

writes filesdrives Claudetool callsremembers

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 d4226d062928 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/code-modernization/hooks/register.ts
ParsesEvery file parses as TypeScript or JavaScript.28 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).runs no program a Windows PC lacks
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.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no 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.Apache-2.0

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 anthropics/claude-plugins-official
/plugin install code-modernization@claude-plugins-official

This installs the marketplace's latest commit, which may not be the one read here (d4226d062928). 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 "anthropics-code-modernization" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs