modscode / Gallery / tdd-batch
tdd-batch
Pane d'avancement d'un lot /implement-tdd : étapes RED/GREEN/COUT, corrections Cn, vague, durées, pré-audit, verdict, BLOQUÉ, lus depuis la fiche de lot
What it does
- Draws a band above the prompt
- Adds /tdd-batch
- Watches tool calls and can refuse them
- Hooks session.start
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 tdd-batch by pierrebelin (band), as modscode read it from the mod's code:
// https://modscode.com/gallery/pierrebelin-tdd-batch/
// 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 band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const lot = '…'
const duration = '…'
const wave = '…'
const hypotheses = '…'
const name = '…'
const kind = '…'
const description = '…'
const duration2 = '…'
const duration3 = '…'
const kind2 = '…'
const description2 = '…'
const duration4 = '…'
const duration5 = '…'
const kind3 = '…'
const description3 = '…'
const duration6 = '…'
const duration7 = '…'
const passes = '…'
const verdictLabel = '…'
const error = '…'
const number = '…'
const title = '…'
const id = '…'
const phaseLabel = '…'
const finding = '…'
const id2 = '…'
const phaseLabel2 = '…'
const finding2 = '…'
const id3 = '…'
const phaseLabel3 = '…'
const finding3 = '…'
const number2 = '…'
const title2 = '…'
const id4 = '…'
const phaseLabel4 = '…'
const finding4 = '…'
const id5 = '…'
const phaseLabel5 = '…'
const finding5 = '…'
const id6 = '…'
const phaseLabel6 = '…'
const finding6 = '…'
const number3 = '…'
const title3 = '…'
const id7 = '…'
const phaseLabel7 = '…'
const finding7 = '…'
const id8 = '…'
const phaseLabel8 = '…'
const finding8 = '…'
const id9 = '…'
const phaseLabel9 = '…'
const finding9 = '…'
const kind4 = '…'
const description4 = '…'
const kind5 = '…'
const description5 = '…'
const kind6 = '…'
const description6 = '…'
const path = '…'
return (
<Box flexDirection="column" marginTop={1}>
<Box height={1}>
<Box flexGrow={1} flexShrink={1}>
<Text wrap="truncate-end">
<Text bold>
{"Batch "}
{lot}
</Text>
<Text color="green">
{" "}
done
</Text>
<Text dimColor>
{" · "}
{duration}
</Text>
<Text dimColor>
{" · wave "}
{wave}
</Text>
<Text dimColor>
{" · "}
{hypotheses}
{" assumption(s)"}
</Text>
<Text dimColor>
{" — "}
{name}
</Text>
</Text>
</Box>
<Button label="[Collapse]" plain dimColor />
</Box>
<Text wrap="truncate-end" color="yellow">
<Text color="red">
{kind}
</Text>
<Text>
{" "}
{description}
{" — "}
{duration2}
</Text>
<Text>
{" (usual "}
{duration3}
)
</Text>
</Text>
<Text wrap="truncate-end" color="yellow">
<Text color="red">
{kind2}
</Text>
<Text>
{" "}
{description2}
{" — "}
{duration4}
</Text>
<Text>
{" (usual "}
{duration5}
)
</Text>
</Text>
<Text wrap="truncate-end" color="yellow">
<Text color="red">
{kind3}
</Text>
<Text>
{" "}
{description3}
{" — "}
{duration6}
</Text>
<Text>
{" (usual "}
{duration7}
)
</Text>
</Text>
<Text wrap="truncate-end">
<Text dimColor>
{"Audit: "}
</Text>
<Text color="green">
{"pre-audit "}
GREEN
</Text>
<Text dimColor>
{" · "}
</Text>
<Text dimColor>
{"pass "}
{passes}
</Text>
<Text color="green">
{" · "}
{verdictLabel}
</Text>
</Text>
<Text color="red">
{error}
</Text>
<Box flexDirection="column">
<Text wrap="truncate-end" color="green">
{"▸ "}
{number}
{". "}
✅
{" "}
{title}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id}
{" "}
{phaseLabel}
{" "}
{finding}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id2}
{" "}
{phaseLabel2}
{" "}
{finding2}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id3}
{" "}
{phaseLabel3}
{" "}
{finding3}
</Text>
</Box>
<Box flexDirection="column">
<Text wrap="truncate-end" color="green">
{"▸ "}
{number2}
{". "}
✅
{" "}
{title2}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id4}
{" "}
{phaseLabel4}
{" "}
{finding4}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id5}
{" "}
{phaseLabel5}
{" "}
{finding5}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id6}
{" "}
{phaseLabel6}
{" "}
{finding6}
</Text>
</Box>
<Box flexDirection="column">
<Text wrap="truncate-end" color="green">
{"▸ "}
{number3}
{". "}
✅
{" "}
{title3}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id7}
{" "}
{phaseLabel7}
{" "}
{finding7}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id8}
{" "}
{phaseLabel8}
{" "}
{finding8}
</Text>
<Text wrap="truncate-end" color="green">
{" "}
{id9}
{" "}
{phaseLabel9}
{" "}
{finding9}
</Text>
</Box>
<Text color="red" wrap="truncate-end">
BLOCKED (
{kind4}
{") "}
{description4}
</Text>
<Text color="red" wrap="truncate-end">
BLOCKED (
{kind5}
{") "}
{description5}
</Text>
<Text color="red" wrap="truncate-end">
BLOCKED (
{kind6}
{") "}
{description6}
</Text>
<Text dimColor wrap="truncate-end">
{path}
</Text>
{await next(e)}
</Box>
)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
mods/tdd-batch/hooks/register.tsx lines 342–452 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const state = complete(await read($, batch))
const sheet = state.sheet
if (e.props.hasSurvey || state.path === null) return next(e)
const { Box, Button, Text } = $.ui.resolve(e)
if (sheet === null) {
return (
<Box flexDirection="column" width={e.props.bodyColumns} marginTop={1}>
<Text color="red" wrap="truncate-end">{state.error ?? `reading sheet: ${state.path}`}</Text>
</Box>
)
}
const current = sheet.steps.find(step => !isStepDone(step))
const done = sheet.steps.filter(isStepDone).length
const at = await read($, now)
const expanded = await read($, isExpanded)
const { gate, audit } = state
const showsAudit = gate !== null || audit.passes > 0
const shown = expanded ? sheet.steps : sheet.steps.filter(step => step === current)
return (
<Box flexDirection="column" width={e.props.bodyColumns} marginTop={1}>
<Box height={1}>
<Box flexGrow={1} flexShrink={1}>
<Text wrap="truncate-end">
<Text bold>Batch {sheet.lot}</Text>
<Text color={sheet.isDone ? 'green' : undefined} dimColor={!sheet.isDone}>
{' '}
{sheet.isDone ? 'done' : `${done}/${sheet.steps.length} steps`}
</Text>
{state.startedAt !== null && at >= state.startedAt && (
<Text dimColor> · {duration(at - state.startedAt)}</Text>
)}
{state.wave > 0 && <Text dimColor> · wave {state.wave}</Text>}
{sheet.hypotheses > 0 && <Text dimColor> · {sheet.hypotheses} assumption(s)</Text>}
{sheet.name !== '' && <Text dimColor> — {sheet.name}</Text>}
</Text>
</Box>
<Button
key="steps-toggle"
label={expanded ? '[Collapse]' : `[All steps (${sheet.steps.length})]`}
plain
dimColor
onPress={() => update($, isExpanded, value => !value)}
/>
</Box>
{state.running.map(run => {
const elapsed = Math.max(0, at - run.startedAt)
const slow = isSlow(run.kind, elapsed)
return (
<Text key={`run-${run.id}`} wrap="truncate-end" color={slow ? 'yellow' : undefined}>
<Text color={run.kind === 'RED' ? 'red' : run.kind === 'GREEN' ? 'green' : 'cyan'}>{run.kind}</Text>
<Text> {run.description} — {duration(elapsed)}</Text>
{slow && <Text> (usual {duration(TYPICAL_MS[run.kind])})</Text>}
</Text>
)
})}
{showsAudit && (
<Text wrap="truncate-end">
<Text dimColor>Audit: </Text>
{gate !== null && (
<Text color={gate.isGreen ? 'green' : 'red'}>
pre-audit {gate.isGreen ? 'GREEN' : `RED (${gate.failures} failed check(s))`}
</Text>
)}
{audit.passes > 0 && gate !== null && <Text dimColor> · </Text>}
{audit.passes > 0 && <Text dimColor>pass {audit.passes}</Text>}
{audit.verdict !== null && (
<Text color={audit.verdict.isValid ? 'green' : 'red'}> · {verdictLabel(audit.verdict)}</Text>
)}
</Text>
)}
{state.error !== null && <Text color="red">{state.error}</Text>}
{shown.map(step => {
const isDone = isStepDone(step)
const isCurrent = step === current
return (
<Box key={`step-${step.number}`} flexDirection="column">
<Text wrap="truncate-end" color={isDone ? 'green' : isCurrent ? 'yellow' : undefined} bold={isCurrent}>
{isCurrent ? '▸ ' : ' '}
{step.number}. {step.tdd === null ? (isDone ? DONE : '·') : phaseLabel(step.tdd)} {step.title}
</Text>
{step.corrections.map(one => (
<Text
key={`correction-${step.number}-${one.id}`}
wrap="truncate-end"
color={isPhaseDone(one.tdd) ? 'green' : 'yellow'}
>
{' '}
{one.id} {phaseLabel(one.tdd)} {one.finding}
</Text>
))}
</Box>
)
})}
{state.blocked.map((one, index) => (
<Text key={`blocked-${index}`} color="red" wrap="truncate-end">
BLOCKED ({one.kind}) {one.description}
</Text>
))}
{expanded && (
<Text dimColor wrap="truncate-end">
{state.path}
</Text>
)}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Pierre Belin 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
reads filestool 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 10aa587cf913 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.mods/tdd-batch/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.1 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.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 pierrebelin/claude-code-toolkit/plugin install tdd-batch@cctoolkitThis installs the marketplace's latest commit, which may not be the one read here (10aa587cf913). 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 "pierrebelin-tdd-batch" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Blast RadiusBlast Radius: npm testWould Cancel. Proceed Proceed ProceedProceed 1Cancel 2
-
Ask Claude…Replay TheaterReplay Theater 31 31 31src/app.ts (step 01 of 3)● Write● Write● WritePrev pNext nClose q
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
What it does
- Draws a band above the prompt
- Adds /seo-spend, /seo-doctor, /seo-cockpit
- Watches Agent calls and can refuse them
- Hooks agent.spawn, classic.SessionStart, prompt.submit, session.compact and 3 more
-
could not fill the prompt boxcould not fill:Ask Claude…
-
▴Token OptimizerCheckpointCheckpointCheckpointbuildStart freshbuildStart freshbuildStart freshbuildCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointbuildbuildbuildTokens savedSaved Clean up tokens in 30 days (chat 2 this session)Ask Claude…