Shampoo
Gets the flakes out of your test suite. No rinse, no repeat.
Credo checks and a rule catalog for ExUnit tests that fail at random or cannot fail at all.
The Hex package for the elixir-test-critic catalog is called Shampoo.

88 rules across 14 categories, each paired with a runnable good_test.exs
and bad_test.exs and traced to one of ten foundational principles. CI
re-executes every example on every push across Elixir 1.17–1.19 and OTP
27–28.
It ships as a [Claude Code][cc] skill so an LLM can use the rules to review
or write your tests, and reads as plain Markdown if you'd rather browse them
yourself.
Install
As a Claude Code plugin:
/plugin marketplace add iautom8things/shampoo
/plugin install elixir-test-critic
Claude Code auto-loads the skill whenever you ask it to review, write, or
discuss Elixir tests. You can also invoke it explicitly:
/elixir-test-critic review test/my_app/accounts_test.exs
The plugin also ships an elixir-test-critic agent for delegated reviews. It
loads the same skill and reads the same rule files, so another agent or
workflow can hand it a test file or a diff and get back cited findings.
To install it on every machine from a shared ~/.claude/settings.json,
declare the marketplace and enable the plugin there:
{
"extraKnownMarketplaces": {
"elixir-test-critic": {
"source": { "source": "github", "repo": "iautom8things/shampoo" }
}
},
"enabledPlugins": { "elixir-test-critic@elixir-test-critic": true }
}
Update later with /plugin marketplace update elixir-test-critic, remove with
/plugin uninstall elixir-test-critic.
Prefer to read the rules yourself? Start at [toc/RULES_REFERENCE.md][toc]
for the condensed catalog, or browse [rules/][rules] directly.
Credo checks
Add the Hex package next to your Credo dependency in mix.exs.
defp deps do
[
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:shampoo, "~> 0.4.0", only: [:dev, :test], runtime: false}
]
end
For an unreleased change, replace the :shampoo entry with a GitHub
dependency pinned to the commit you reviewed.
{:shampoo, github: "iautom8things/shampoo",
ref: "<reviewed-commit-sha>", only: [:dev, :test], runtime: false}
Use checks.extra for the test checks so Credo keeps its defaults. Credo 1.7
uses each check's files option to filter the files in the current profile.
The build-config profile applies that filter and enables just the build-time
check, so the ordinary lint run keeps its existing file selection.
config_files = ["config/", "apps/*/config/"]
%{
configs: [
%{
name: "default",
checks: %{
extra: [
{Shampoo.Check.AsyncGlobalState, []},
{Shampoo.Check.UnverifiedMoxExpect, []},
{Shampoo.Check.ShortReceiveTimeout, []},
{Shampoo.Check.ProcessSleepInTest, []},
{Shampoo.Check.TrivialAssertion, []},
{Shampoo.Check.NamedProcessOutsideSupervision, []}
]
}
},
%{
name: "build-config",
files: %{included: config_files},
checks: %{
enabled: [{Shampoo.Check.NondeterministicConfig, files: [included: config_files]}]
}
}
]
}
Run mix deps.get, mix credo, and mix credo --config-name build-config.
All seven checks report high-priority
warnings and accept Credo's standard check options, including priority and
files. Test-only checks recognize *_test.exs files under test/, including
umbrella apps and files scanned by absolute path.