Plugins · CCPP Tester
CCPP Tester
ccpp-tester is the only agent allowed to write tests. CPO refuses test writes to every other agent, so Claude never tests its own code.
When Claude writes code and its tests together, the tests share the code's assumptions. When a test goes red, Claude tends to change the test: it flips the expectation to what the code returned, swaps the failing input, narrows the assertion, raises the timeout, or skips it. The suite turns green and the defect stays.
ccpp-tester removes that option. It is a Claude Code agent shipped in the cpo plugin, and CPO rules make it
the only agent that can create, change or delete a test-side file (tests, helpers, fixtures, snapshots). The
main agent asks it for tests; it writes them without reading the code under test, as an adversary whose job
is to catch the code doing something other than what the user asked.
ccpp-tester is plain software: an agent prompt, a skill and CPO policies. It runs on your own Claude Code session. CCPP calls no model.
ccpp-tester is in alpha (0.2). Its rules recognize TypeScript and JavaScript test files (bun test, Vitest, Jest), and its mutation testing covers them only.
How it works
- CPO blocks. The main agent writes
src/quote.test.ts. CPO undoes the write and tells it to launchcpo:ccpp-testerwith what the code must do. - ccpp-tester reads what the user asked. It extracts the steps of the parent session's transcript (the user's words, what the agent did and said, never its reasoning) and treats the main agent's task message as a claim to check, not as the specification.
- It writes the tests blind. It reads the repository for conventions (existing tests, runner config, docs, types) but CPO refuses it the source files other agents wrote this session. Every expected value has a source: a user message, a document, a spec.
- It runs them. A red test is a finding about the code and stays red.
- It attacks its own tests with mutation testing (StrykerJS for TypeScript): every mutant that survives is a wrong implementation the suite accepts.
- It reports to the main agent: the tests, the source of each expectation, the red tests, the mutation score. The main agent fixes the code, not the test.
Quick start
-
Install the
cpoplugin (CPO quick start). The agent and its skill come with it. -
Add the enforcement policies to the project's
.claude/policies/. They are not a published profile yet: copy thetests-by-ccpp-tester*andccpp-tester-*policies from the CCPP repository. Without them the agent works, but nothing stops the main agent from writing its own tests. -
Ask for a behavior, not for a test:
Add a 10% discount from 100 units in quote(). Have ccpp-tester cover it.Claude launches
cpo:ccpp-tester. When it writes a test itself, CPO refuses and points it there.
Reference
| Page | |
|---|---|
| Enforcement | The CPO policies: who may write tests, what the tester may read. |
| Writing tests | Sources, dictation, mutation testing. |
| Reports and contests | The report format, and what happens when a test is disputed. |