modscode / Gallery / doc-review
doc-review
Review design specs and implementation plans in a pane: move by block, pin comments, ask side questions, submit one review.
What it does
- Draws a pane, the status line, toasts
- Watches tool calls and can refuse them
- Hooks session.start, turn.complete, ui.close, ui.focus and 1 more
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- Handles errors
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)
import type { Register } from 'claude-code'
// Drawn like doc-review by revelationnow (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/revelationnow-doc-review/
// 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: "Review: ‹basename›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const title = '…'
const path = '…'
const cursor = '…'
const n = '…'
const length = '…'
const revision = '…'
const query = '…'
const notice = '…'
const length2 = '…'
const lo = '…'
const n2 = '…'
const quote = '…'
const text = '…'
const quote2 = '…'
const text2 = '…'
const quote3 = '…'
const text3 = '…'
const status = '…'
const submitLabel = '…'
return (
<Box flexDirection="column">
<Box height={3} />
<Box flexDirection="column" columnGap={1}>
<Text bold>
{title}
</Text>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-middle">
{path}
</Text>
</Box>
</Box>
<Text dimColor>
{"block "}
{cursor}
/
{n}
{" · "}
{length}
{" "}
comment
{` (${length} orphaned)`}
{` · ${length} question`}
{` · revision ${revision}`}
{` · ${length} changed since reviewed`}
{" · awaiting revision"}
{` · find "${query}" no matches`}
</Text>
<Text color="green">
{notice}
</Text>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginBottom={1}>
<Button plain hotkey="j" label="next" />
<Button plain hotkey="k" label="prev" />
<Button plain hotkey="g" label="top" />
<Button plain hotkey="e" label="end" />
<Button plain hotkey="f" label="find" />
<Button plain hotkey="n" label="next match" />
<Button plain hotkey="p" label="prev match" />
<Button plain hotkey="m" label="next comment" />
<Button plain hotkey="c" label="comment" />
<Button plain hotkey="a" label="ask" />
<Button plain hotkey="i" label="explain" />
<Button plain hotkey="s" label={`submit review (${length})`} />
<Button plain hotkey="y" label="approve" />
<Button plain hotkey="h" label="pan left" />
<Button plain hotkey="l" label="pan right" />
<Button plain hotkey="r" label="next revised" />
<Button plain hotkey="d" label="diff" />
<Button plain hotkey="v" label="mark viewed" />
<Button plain hotkey="q" label="close" />
</Box>
<Text dimColor>
This surface has no text field for find.
</Text>
<Box flexDirection="row" gap={1} marginBottom={1}>
<Text dimColor>
find "
{query}
{"\": "}
{length2}
{" "}
block
</Text>
<Button plain dimColor label="clear" />
</Box>
<Text dimColor>
{"… "}
{lo}
{" more above (k to move up)"}
</Text>
<Text dimColor>
{"… "}
{n2}
{" more below (j to move down)"}
</Text>
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
Comments whose passage no longer appears (still sent with the review):
</Text>
<Box flexDirection="row">
<Text dimColor wrap="wrap">
{"✎ "}
{quote}
{"… : "}
{text}
</Text>
<Button plain dimColor label="✕" />
</Box>
<Box flexDirection="row">
<Text dimColor wrap="wrap">
{"✎ "}
{quote2}
{"… : "}
{text2}
</Text>
<Button plain dimColor label="✕" />
</Box>
<Box flexDirection="row">
<Text dimColor wrap="wrap">
{"✎ "}
{quote3}
{"… : "}
{text3}
</Text>
<Button plain dimColor label="✕" />
</Box>
</Box>
<Box position="absolute" left={0} height={3} flexDirection="column">
<Box position="absolute" top={0} left={0} flexDirection="column">
<Text>
{" "}
</Text>
</Box>
<Text dimColor wrap="truncate-end">
{status}
</Text>
<Box flexDirection="row" columnGap={2} overflow="hidden" height={1}>
<Button plain label="next" />
<Button plain label="prev" />
<Button plain label="find" />
<Button plain label="next match" />
<Button plain label="prev match" />
<Button plain label="comment" />
<Button plain label="ask" />
<Button plain label="explain" />
<Button plain label={`${submitLabel}`} />
<Button plain label="top" />
</Box>
<Text dimColor wrap="truncate-end">
────────
</Text>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const q = '…'
await $.ui.status(`spec ready: /doc-review`)
await $.ui.toast(`doc-review: nothing differs from the version you reviewed.`)
await $.ui.toast(`doc-review: no block contains "${q}".`)
return next(e)
})
}
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.
doc-review/hooks/register.tsx lines 1522–1542 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const [doc, comments, threads, composer, notice, picked] = await Promise.all([
read($, docA),
read($, commentsA),
read($, threadsA),
read($, composerA),
read($, noticeA),
read($, askViaA),
])
const columns = e.props.bodyColumns ?? e.viewport?.columns ?? 80
lastColumns = columns
const offset = e.props.scroll?.offset ?? 0
const common = { doc, comments, threads, composer, notice, columns, approvePhrase, explainModel, askModel, askVia: picked ?? askModel, offset }
if (e.surface === 'mobile') {
const t = $.ui.resolve(e)
return drawPane($, { ...common, t, Input: null })
}
const t = $.ui.resolve(e)
return drawPane($, { ...common, t, Input: t.Input })
})doc-review/hooks/register.tsx lines 989–1148 · Pane
function drawPane(
$: EngineInterface,
args: {
t: Table
Input: ElementConstructor<InputProps> | null
doc: DocReviewDoc | null
comments: readonly DocReviewComment[]
threads: readonly DocReviewThread[]
composer: DocReviewComposer
notice: string | null
/** Cells across the pane's body. */
columns: number
approvePhrase: string
explainModel: string
/** The configured default for side questions. */
askModel: string
/** Where the next side question goes: this session's pick, else askModel. */
askVia: string
/** The first row of the tree the pane's window shows. */
offset: number
},
): RenderElement {
const { t, Input, doc, comments, threads, composer, notice } = args
const { Box, Text, Button, Markdown } = t
if (!doc) {
return (
<Box flexDirection="column">
<Text dimColor>No document open. Type /{COMMAND} <path> to review a markdown file.</Text>
<Button key="close" plain hotkey="q" label="close" onPress={() => void $.ui.close({ id: PANE })} />
</Box>
)
}
if (doc.view === 'diff') return drawDiff($, t, doc, notice)
// With a text field the composer draws under the block; without one the
// engine's dialog takes the text.
const compose = (mode: 'comment' | 'ask', at?: number) => (Input ? openComposer($, mode, at) : composeViaDialog($, mode, args.askVia, at))
const n = doc.blocks.length
const { lo, hi } = windowOf(n, doc.cursor)
const live = comments.filter(c => !c.isOrphan)
const orphans = comments.filter(c => c.isOrphan)
const changed = new Set(doc.changed)
const matched = new Set(doc.search?.matches ?? [])
const isFinding = composer?.mode === 'find'
const isNarrow = args.columns < NARROW
const gutter = isNarrow ? 2 : 3
const roomFor = (block: DocReviewBlock) => Math.max(10, args.columns - gutter - (block.depth ?? 0) * 2)
/**
* A block's actions: always shown on the current block, shown on any other
* while the pointer is on it. They sit in the blank row under the block, so
* nothing moves. An item of a tight list has no blank row under it (the
* next item starts there and would paint over them), so its actions sit at
* the right end of its own last line instead, drawn over it.
*/
const actionRow = (i: number, isCurrent: boolean, isTight: boolean) => {
const at = doc.blocks[i]
const place = isTight ? { bottom: 0, right: 0 } : { bottom: -1, left: gutter + (at?.depth ?? 0) * 2 }
return (
// Unkeyed: a key would make it a hover scope of its own, and a hidden
// Box is never under the pointer.
<Box
position="absolute"
{...place}
flexDirection="row"
{...(isCurrent ? {} : { display: 'none' as const, hover: { display: 'flex' as const } })}
>
{isTight && <Text>{' '}</Text>}
<Button key={`act-c:${i}`} plain dimColor label="comment" onPress={() => void compose('comment', i)} />
<Text dimColor> · </Text>
<Button key={`act-a:${i}`} plain dimColor label="ask" onPress={() => void compose('ask', i)} />
<Text dimColor> · </Text>
<Button key={`act-h:${i}`} plain dimColor label="explain" onPress={() => void explain($, args.explainModel, i)} />
</Box>
)
}
const rows: RenderElement[] = []
for (let i = lo; i < hi; i += 1) {
const block = doc.blocks[i]
if (!block) continue
const isCurrent = i === doc.cursor
const isChanged = changed.has(i)
const own = live.filter(c => c.anchor.blockIndex === i)
const ownThreads = threads.filter(th => th.anchor.blockIndex === i)
const indent = (block.depth ?? 0) * 2
// Items of one list sit tight, as the list would.
// The current one keeps its gap: its actions sit there.
const isTight = block.kind === 'item' && doc.blocks[i + 1]?.kind === 'item' && !isCurrent
const under = gutter + indent
rows.push(
<Box key={`blk:${i}`} flexDirection="column" marginBottom={isTight ? 0 : 1}>
<Box key={`pre:${i}`} position="absolute" top={-BAR_ROWS} left={0} width={1} height={1} />
<Box flexDirection="row">
<Box width={gutter}>
<Button
key={`b:${i}`}
plain
dimColor={!isCurrent && !isChanged}
label={isCurrent ? '▶' : isChanged ? '+' : '·'}
hover={{ dimColor: false, bold: true }}
// A click selects the block; on the current one (Enter after Tab, a second click) it comments.
onPress={() => void (isCurrent ? compose('comment', i) : setCursor($, i))}
/>
</Box>
<Box flexDirection="column" flexGrow={1} flexShrink={1} marginLeft={indent}>
{drawBody($, t, block, {
room: roomFor(block),
pan: isCurrent ? (doc.pan ?? 0) : 0,
dim: !isCurrent && composer !== null && composer.mode !== 'find',
isCurrent,
...(doc.search && matched.has(i) ? { query: doc.search.query } : {}),
})}
</Box>
</Box>
{own.map(c => (
<Box key={`cm:${c.id}`} flexDirection="row" marginLeft={under}>
<Text color="yellow">✎ </Text>
<Box flexGrow={1}>
<Text color="yellow" wrap="wrap">
{c.text}
</Text>
</Box>
<Button key={`rm:${c.id}`} plain dimColor label="✕" onPress={() => void removeComment($, c.id)} />
</Box>
))}
{ownThreads.map(th => (
<Box key={`th:${th.id}`} flexDirection="column" marginLeft={under}>
<Text color="cyan" wrap="wrap">
{th.kind === 'explain' ? 'ⓘ' : '?'} {th.question}
{th.kind === 'explain' && th.model ? ` (${th.model})` : ''}
{th.kind === 'ask' && th.model
? th.alone === 'chosen'
? ` (answered by ${th.model} from the document alone)`
: ` (answered by ${th.model} from the document alone: the conversation had no reply yet)`
: ''}
</Text>
{th.status === 'pending' && <Text dimColor>{th.kind === 'explain' ? 'explaining…' : 'asking…'}</Text>}
{th.status === 'failed' && <Text color="red">could not ask: {th.failure ?? 'unknown'}</Text>}
{th.status === 'answered' && <Markdown text={capMarkdown(th.answer ?? '')} dimColor />}
{th.status !== 'pending' && (
<Box flexDirection="row" gap={1}>
{th.kind === 'ask' && <Button key={`keep:${th.id}`} plain label="keep as comment" onPress={() => void keepAsComment($, th)} />}
{th.kind === 'ask' && <Button key={`send:${th.id}`} plain label="send to conversation" onPress={() => void escalate($, th)} />}
<Button key={`drop:${th.id}`} plain dimColor label="dismiss" onPress={() => void dismissThread($, th.id)} />
{th.status === 'answered' && th.outputTokens !== undefined && (
<Text dimColor>
{th.outputTokens} out · {th.cachedTokens ?? 0} cached
</Text>
)}
</Box>
)}
</Box>
))}
{composer && composer.mode !== 'find' && composer.blockIndex === i && Input && (
<Box flexDirection="row" marginLeft={under} gap={1}>
<Inputdoc-review/hooks/register.tsx lines 950–987 · Pane
function drawDiff($: EngineInterface, t: Table, doc: DocReviewDoc, notice: string | null): RenderElement {
const { Box, Text, Button, Code } = t
const d = diffText(doc.baselineText, doc.text)
return (
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Text bold>{doc.title}</Text>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-middle">
{doc.path}
</Text>
</Box>
</Box>
<Text dimColor>
diff against the version you reviewed
{d ? ` · +${d.added} −${d.removed} lines · ${doc.changed.length} ${doc.changed.length === 1 ? 'block' : 'blocks'} changed` : ''}
{doc.revision > 0 ? ` · revision ${doc.revision}` : ''}
</Text>
{notice && <Text color="green">{notice}</Text>}
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginBottom={1}>
<Button key="diff" plain hotkey="d" label="document" onPress={() => void toggleView($)} />
<Button key="next-change" plain hotkey="r" label="next revised" onPress={() => void nextChange($)} />
<Button key="reviewed" plain hotkey="v" label="mark viewed" onPress={() => void markReviewed($)} />
<Button key="close" plain hotkey="q" label="close" onPress={() => void $.ui.close({ id: PANE })} />
</Box>
{!d && <Text dimColor>The two versions are too long to diff here.</Text>}
{d && d.hunks.length === 0 && <Text dimColor>No changes since the version you reviewed.</Text>}
{d &&
d.hunks.slice(0, MAX_HUNKS).map((hunk, i) => (
<Box key={`hunk:${i}`} flexDirection="column" marginBottom={1}>
<Code source={capHunk(hunk)} format="diff" wrap="wrap" />
</Box>
))}
{d && d.hunks.length > MAX_HUNKS && <Text dimColor>… {d.hunks.length - MAX_HUNKS} more hunks not shown</Text>}
</Box>
)
}doc-review/hooks/register.tsx lines 1324–1375 · Pane
function drawStickyBar(
$: EngineInterface,
t: Table,
a: {
offset: number
columns: number
status: string
hasMatches: boolean
/** The status row while finding: the match Enter goes to. */
preview: RenderElement | null
/** The find field, drawn in the bar while finding. */
finder: RenderElement | null
compose: (mode: 'comment' | 'ask') => unknown
explain: () => void
submitLabel: string
},
): RenderElement {
const { Box, Text, Button } = t
const blank = ' '.repeat(a.columns)
return (
<Box key="sticky-bar" position="absolute" top={a.offset} left={0} width={a.columns} height={BAR_ROWS} flexDirection="column">
{/* Spaces first, so nothing of the document shows between the buttons. */}
<Box position="absolute" top={0} left={0} flexDirection="column">
{Array.from({ length: BAR_ROWS }, (_, k) => (
<Text key={`bar-blank:${k}`}>{blank}</Text>
))}
</Box>
{a.preview ?? (
<Text dimColor wrap="truncate-end">
{a.status}
</Text>
)}
{a.finder ?? (
<Box flexDirection="row" columnGap={2} overflow="hidden" height={1}>
<Button key="bar:next" plain label="next" onPress={() => void moveCursor($, 1)} />
<Button key="bar:prev" plain label="prev" onPress={() => void moveCursor($, -1)} />
<Button key="bar:find" plain label="find" onPress={() => void openFind($)} />
{a.hasMatches && <Button key="bar:find-next" plain label="next match" onPress={() => void findNext($)} />}
{a.hasMatches && <Button key="bar:find-prev" plain label="prev match" onPress={() => void findPrev($)} />}
<Button key="bar:comment" plain label="comment" onPress={() => void a.compose('comment')} />
<Button key="bar:ask" plain label="ask" onPress={() => void a.compose('ask')} />
<Button key="bar:explain" plain label="explain" onPress={a.explain} />
<Button key="bar:submit" plain label={a.submitLabel} onPress={() => void submitReview($)} />
<Button key="bar:top" plain label="top" onPress={() => void moveCursor($, () => 0)} />
</Box>
)}
<Text dimColor wrap="truncate-end">
{'─'.repeat(a.columns)}
</Text>
</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
reads 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 c54494cade14 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 read | Every module hooks/hooks.json names was read.doc-review/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.5 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No 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 open | Network 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 draws | The 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 line | Whether 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 Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether 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 sends | Whether it both reads files or environment variables and reaches the network.reaches no network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An 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 revelationnow/claude-doc-review/plugin install doc-review@claude-doc-reviewThis installs the marketplace's latest commit, which may not be the one read here (c54494cade14). 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 "revelationnow-doc-review" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…AttemptsPlain3 attempts from src/ · nothing is applied until you press AdoptDiff of StealthHide+ src/app.ts
Footer label+ src/app.tsFooter label+ src/app.tsClassic more files not shown: open the worktree to see them.Footer labelClose x -
Ask Claude…CIcross Bash · Classicmain · a1b2c3d · failed at 14:32Open the run on GitHubFix it fClose x
(no log available)
-
Ask Claude…Gitbranch main · Pinned notice · 0, 0 untracked, 0 staged× git failed► Hint lineRefresh rStage all aCommit Ghost cClose xWorking tree clean.Fix loginMonoGenerate gCommitTop rowHint linesrc/app.tsbinDiffStageUnstageRevertTop rowHint linesrc/app.tsbinDiffStageUnstageRevertTop rowHint line… 3 moresrc/app.tsbinDiffStageUnstageRevertsrc/app.tsClosebuild (cut to fit)
Plainbuild (cut to fit)Plainbuild (cut to fit)MinimalMinimalMinimalPlain -
Ask Claude…Night shiftNight shiftEach task ran in its own worktree and branch; nothing is in your checkout until you press Adopt.Diff of Fix loginHide diff+ src/app.ts
Edit+ src/app.tsEdit+ src/app.tsAgent more files not shown: open the worktree to see them.EditClose x -
Ask Claude…airlock: transaction a1b2c3d is open in another session — mutations blocked hereAirlock reviewTransaction (unknown) · REVIEWRepository: Worktree: src/Changes: 3 file(s), +0/-0Files: 3 and 3 moreUntracked files included in baseline: 3Skipped files: TransactionSide-effect events: 3 (3 denied). Effects already performed outside the workspace cannot be rolled back by reject.Checks: Airlock does not run your project test suite. Accept checks concurrent edits and patch fit before applying. Rej…APPLY_FAILED: this transaction may be partially applied. Preserve the workspace and backup for manual recovery; Accept …Pane preview is capped at 10,000 characters; the diff may be incomplete.
ReviewReview vAccept aReject r -
Ask Claude…Backgrounda1b2c3dok · 2h 10m · exit Follow latest
$ npm testNo output yet.Follow latest