# Write Vibe Tests

Write or refactor Mistral Vibe tests with proper decoupling.

- Repository: https://github.com/mistralai/mistral-vibe (5270 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mistralai/mistral-vibe --skill write-vibe-tests -g -a claude-code -y`
Codex: `npx skills add mistralai/mistral-vibe --skill write-vibe-tests -g -a codex -y`
Cursor: `npx skills add mistralai/mistral-vibe --skill write-vibe-tests -g -a cursor -y`
Gemini CLI: `npx skills add mistralai/mistral-vibe --skill write-vibe-tests -g -a gemini-cli -y`

## Description

Write or refactor Mistral Vibe tests with proper decoupling. Use when adding behavior coverage, testing ports/adapters, replacing brittle mocks, creating fakes, adding characterization tests before refactors, or changing tests under tests/ for vibe/core, vibe/app_server, vibe/acp, tools, config, sessions, skills, hooks, MCP, or setup.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Write Vibe Tests

Use this skill to make Vibe architecture testable, not just well-shaped. Tests should protect observable behavior while allowing internals to move.

## Core Principle

Test behavior through stable boundaries. Do not couple tests to private methods, internal call choreography, or temporary structure.

If a refactor changes no observable behavior but breaks many tests, the tests are probably coupled to implementation details.

## Vibe Test Boundaries

| Code area | Preferred test boundary |
| --- | --- |
| Core use cases and services | Public function/class API, typed events, model outputs, persisted state |
| Tools | Owning app-server capability contract, typed invocation/results, permissions and user-facing errors; `BaseTool.invoke`/`run` for retained BaseTool implementations |
| LLM/backend orchestration | Native Unified Runtime through serialized app-server RPCs, with deterministic fake completion/discovery services |
| Config | Pydantic model validation, layer merge outputs, migration results |
| Sessions | Runtime session operations, durability/recovery and app-server projections; JSONL/metadata only for the supported read-only historical importer |
| Terminal UI (`vibe/cli-rust`) | Rust unit tests for pure logic, `client-e2e` scenarios and goldens for rendering and interaction (see `vibe/cli-rust/AGENTS.md`) |
| ACP | ACP session updates and protocol-facing content, not core internals |

## Prefer Fakes Over Mocks

Prefer in-memory implementations and fake adapters that implement real contracts.

- Put reusable test doubles in `tests/stubs/` and name them `Fake*`.
- Make fakes small and behavior-oriented.
- Mock only at hard process, network, time, or third-party boundaries when a fake would be more complex than the behavior under test.
- Avoid assertions like "method X was called with Y" unless the call itself is the observable contract.

## Legacy Or Refactor Workflow

When code is hard to test:

The rest: https://github.com/mistralai/mistral-vibe/blob/HEAD/.vibe/skills/write-vibe-tests/SKILL.md
