ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 spiiritual

whiteboard-defense

以 Mitchell Hashimoto 的白板防御练习为核心的 Claude Code 插件:用真正的图表和后果故事问题取代文字计划,再根据代码拷问你自己已发布的系统。

spiiritual@spiiritual

spiiritual/claude-code-stuff/tree/main/plugins/whiteboard-defense

已翻译

关于这个 mod

这个插件通过 /plugin install whiteboard-defense@claude-code-stuff 从 claude-code-stuff 市场安装,并添加两个命令。/whiteboard-defense plan 会取代文字计划:Claude 在逐字稿中绘制真正的系统图,提出关键决策的后果故事(例如“server dies mid-refund: customer charged with no refund, or refund 30s late?”),再让你反过来解释。/whiteboard-defense grill 会在构建后考问你——为什么选 X 而不是 Y、恶意用户能做什么、哪里会失败——答案会根据代码评分,并标出与计划的偏移。计划会以卡片存放在插件的数据文件夹中,绝不会放进你的代码库。图表由 mod 绘制,因此必须在 ~/.claude/settings.json 中通过 CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 启用函数 hooks;显示图片需要 macOS(内置 qlmanage),以及支持图片的终端,例如 Ghostty、kitty、iTerm2 或 WezTerm(不能是 tmux);其他环境会显示文字图表。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add spiiritual/claude-code-stuff
claude plugin install whiteboard-defense
原文 / README

claude-code-stuff

A Claude Code plugin marketplace.

/plugin marketplace add spiiritual/claude-code-stuff
/plugin install better-compaction@claude-code-stuff

better-compaction

A Claude Mod that fixes two things about compaction:

  • Waits for the turn to end. Auto-compaction no longer interrupts the model mid-turn; it runs as soon as the turn finishes. Past 80% of the context window (configurable), or after a prompt-too-long error, it compacts mid-turn as usual.
  • Summarizes at its own effort. The summary runs at a lower effort than the conversation (default medium). The model stays the same, so the prompt cache is kept. Subagents running during a summary keep their own effort.

Mods need function hooks on. Add this to ~/.claude/settings.json:

{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }

Settings, in /config:

| Option | Default | | |---|---|---| | deferCompaction | on | Wait for the turn to end before compacting | | deferUnderPercent | 80 | Stop waiting once the context is this full (% of the window) | | compactionEffort | medium | inherit, low, medium, high, xhigh or max |

Measured on a 214k-token session (3 runs each, recall quiz of 22 facts):

| Effort | Summary time | Quiz | |---|---|---| | low | 31s | 20.2 | | medium | 46s | 20.8 | | high | 59s | 20.7 | | xhigh | 76s | 19.8 | | max | 164s | 20.8 |

Recall was the same within noise at every level, while time grew with effort.

In headless mode (-p, SDK) the deferred compaction runs at the start of the next prompt instead of right after the turn.

whiteboard-defense

/plugin install whiteboard-defense@claude-code-stuff

For Mitchell Hashimoto's whiteboard defense: you should be able to explain any customer-facing system you ship and defend its decisions, even if Claude wrote the code.

  • /whiteboard-defense plan replaces the written plan. Claude draws the system as a real diagram, asks you the decisions that matter as consequence stories ("server dies mid-refund: customer charged with no refund, or refund 30s late?"), then has you explain it back.
  • /whiteboard-defense grill quizzes you after building: why X over Y, what a malicious user can do, where it fails. Answers are graded against the code, and drift from the plan is flagged.

Plans are saved as cards in the plugin's data folder, never in your repo.

The diagrams are pictures drawn in the transcript by a mod, so they need function hooks on (see above), macOS (it renders with the built-in qlmanage), and a terminal that shows images (Ghostty, kitty, iTerm2, WezTerm; not tmux). Anywhere else you get a text diagram.

更多类似作品