litmus
MCP server that monitors source changes, recommends test types, and provides language-agnostic test writing guides and a /tdd skill for Claude Code.
README
litmus
Never let a test plan slip. litmus is a Claude Code plugin that watches your edits, works out which test types the change likely needs, and — depending on the cadence you pick — either quietly reminds you or holds the turn until you've triaged a plan. It ships language-agnostic guides for nine test types and a /tdd skill.
litmus is not a linter and it does not grade the tests you write. It sits one step earlier: making sure test planning doesn't get forgotten, and injecting the right writing rules as context when you do write tests. For grading written tests, reach for /code-review instead.
It belongs to no vendor, phones home to nothing, and collects no telemetry.
How it works — three axes
| Axis | Question | What it is |
|---|---|---|
| Hooks | When do I get reminded? | Detect source changes, accumulate them per session, and nudge for a test plan at the end of a turn. |
| MCP server | What do I test, by which rules? | Serves the test-type map and per-type guides as tools (list_test_types, get_guide, recommend_guide) and resources, read from disk at call time. |
| Skill | How do I drive it? | /tdd — a red-green-refactor loop that loads the right guide before writing tests. |
The guides themselves are nine language-agnostic docs in guides/ — per-type must-cover cases and writing principles. The MCP server is one way to read them; you can also open the files directly.
What you'll see
When you change source and end a turn, litmus reminds you. In advisory mode it's a non-blocking note:
🧪 litmus — 2 source file(s) changed (140 lines) this session without a test plan.
Test types this change likely touches:
- Integration Test (high) — API endpoint change; persistence / DB change
Load a type's rules with the litmus get_guide tool (e.g. get_guide "regression"),
or read guides/ directly. Run /tdd to drive it test-first.
In block mode it holds the turn and walks you through a two-step triage instead:
STOP — litmus (block mode) requires a test plan before this turn ends.
Scope: 3 source file(s), 123 lines. Triage mode: FULL.
STEP 1 — TRIAGE (one markdown table, nothing else) ... then ask which types to detail.
STEP 2 — DESIGN (only the confirmed types) ... load each guide, extend existing tests.
The suggested types are regex-based guesses (from file paths and diff signals), tagged
high/medium confidence — hints to confirm against the code, not verdicts. Editing a
test file, or only docs/config, triggers nothing.
Test type map
Four levels, nine types:
| Level | Test type | Owner | Guide |
|---|---|---|---|
| Code | Unit Test | Engineer | 01 |
| Code | Integration Test | Engineer | 02 |
| System | Sanity Test | Engineer | 03 |
| System | Functional Test | Engineer | 04 |
| System | Scenario Test | Engineer | 05 |
| System | Performance Test | Engineer | 06 |
| Regression | Regression Test | Engineer + PM | 07 |
| Product | Policy Test / UAT | PM | 08 |
| Product | Design / UX Test | PD | 09 |
Entry points by role
| Role | Start here |
|---|---|
| Engineer, changing logic | Unit (01), then Integration (02) if a boundary is crossed |
| Engineer, changing an API/endpoint | Integration (02) |
| Engineer, changing persistence/DB | Integration (02), Regression (07) if shared |
| Engineer, changing the UI | Functional (04), Design/UX (09) |
| Engineer, before a release | Sanity (03), Regression (07) |
| PM / Product Owner | Policy Test / UAT (08) |
| Designer (PD) | Design / UX Test (09) |
Install
Requires Node.js 18+ on your PATH — Claude Code runs the hooks and the MCP server with node.
/plugin marketplace add retemper/litmus
/plugin install litmus@retemper
Local development (point the marketplace at a local checkout instead):
/plugin marketplace add /path/to/litmus
/plugin install litmus@retemper
Run /reload-plugins (or restart Claude Code) to apply. On first use, litmus asks you two questions (cadence + forcefulness) and saves your answers. Until then it runs in its quietest useful mode.
Updating
Self-hosted marketplaces don't auto-update by default, so new versions won't arrive on their own. Either update on demand:
/plugin update litmus@retemper
…or enable auto-update once by adding the marketplace to your Claude Code settings.json:
{ "extraKnownMarketplaces": { "retemper": { "autoUpdate": true } } }
With that set, litmus updates itself whenever Claude Code starts. (Your personal config in ~/.claude/litmus lives outside the plugin cache, so updates never touch your settings.)
Configuration
Two knobs plus two thresholds.
cadence — when to nudge:
| Value | Behaviour |
|---|---|
per-task |
every turn that changed source |
by-scale |
only when the change is large (see thresholds) |
per-branch |
once per git branch |
daily |
once a day |
off |
disabled |
forcefulness — how to nudge:
| Value | Behaviour |
|---|---|
advisory |
a non-blocking system message |
block |
holds the turn and walks you through a 2-step triage |
Thresholds (only used by by-scale): minFiles (default 3) and minLines (default 80). A change at or under both is "light" and skipped by by-scale.
Where config comes from (highest precedence first)
- Environment:
LITMUS_CADENCE,LITMUS_FORCEFULNESS,LITMUS_MIN_FILES,LITMUS_MIN_LINES - Project:
.litmus.json(searched from the cwd up to 8 levels) - Personal:
~/.claude/litmus/config.json - Unset
Safe defaults — litmus never goes silently dead:
- Fully unset →
by-scale+advisory(the quietest mode that still speaks up). - If you set
cadencebut notforcefulness, forcefulness defaults toblock. - To turn it off completely, set
cadence: "off".
Example .litmus.json:
{ "cadence": "by-scale", "forcefulness": "advisory", "minFiles": 3, "minLines": 80 }
The block-mode workflow
In block mode the reminder isn't a warning — it's a 2-step triage that keeps a turn from dumping a wall of test cases:
- Triage — one markdown table: each test type, needed? (✅/❌/🔶), a one-line reason, and any existing test path (you search first). Then it stops and asks which types to detail.
- Design — only for the types you confirm, it reads that type's guide and writes cases — extending existing tests rather than duplicating them.
MCP tools
The plugin starts a small stdio MCP server (litmus) exposing:
| Tool | Input | Returns |
|---|---|---|
list_test_types |
— | the four-level, nine-type map as a table |
get_guide |
test_type (name / file / number / alias) |
the full guide for that type |
recommend_guide |
role?, situation? |
which guide(s) to read, scored by keyword |
README and each guide are also exposed as resources (litmus://README.md, litmus://01-unit-test.md, …). Everything is read from disk at call time, so editing a guide takes effect immediately — no rebuild.
Development
The MCP server lives in mcp/ (TypeScript). Because Claude Code clones plugins without running npm install, the server ships as a single self-contained bundle at mcp/bundle/litmus-mcp.mjs, which must be committed.
cd mcp
npm install
npm run smoke # parser checks against the real guides
npm run bundle # rebuild mcp/bundle/litmus-mcp.mjs (commit the result)
node test-handshake.mjs # spawn the bundle and exercise the MCP protocol
Hooks, guides, and the skill are plain files — no build step; edit and commit. The version lives only in .claude-plugin/plugin.json; the MCP server reads it from there at runtime, so it can never drift.
State & privacy
- Volatile per-session change markers live in your OS temp dir and are cleaned after 24h.
- Persistent config / onboarding / cadence state live in
~/.claude/litmus(or$LITMUS_DATA), outside the plugin cache so they survive updates. - No network calls. No usage tracking. Nothing leaves your machine.
License
MIT © retemper
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。