/contree:tddfrom contree
Guides outside-in, consumer-driven TDD with test trees. Walks through RED-GREEN-REFACTOR using journey, system, component, adapter, port contract, and unit tests.
Ships in contree. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Implement one observable behaviour at a time through outside-in, consumer-driven TDD.
Begin with the consumer described by the current tree. Keep the implementation flat until passing tests reveal branching. Let that branching create demand for deeper units instead of predicting them in advance.
Read TEST_TREES.md before writing tests or implementation.
Select one observable behaviour from one tree. Its test file's hierarchy mirrors the tree verbatim.
Use the test kind named by the current tree. The list classifies the current test; it is not an implementation order.
Before setting up mocks for a test, understand what that test asserts: its observable result and any intentional side effects. Everything else the subject does to produce that behaviour is an implementation detail.
A side effect is an external impact the operator expects this test to guarantee. Set up the mock to record the interaction. Assert that it was called correctly with the meaningful arguments.
An implementation detail is an interaction the test needs only because the subject currently works that way. Set up the mock to behave realistically only for the exact invocation and arguments. Do not assert against the interaction. Assert the subject's observable result. An incorrect interaction must not make the test pass.
1 Write a test 2 (RED) Test goes red 3 (GREEN) Implement to green the test 4 (REFACTOR) Observe too much branching in the test or tree - too many conditions 5 Imagine a unit that can encapsulate some of that branching 6 Create a mock and a stub implementation for that unit 7 Make the consumer call the unit; the mock passes the tests while the stub throws NotImplemented 8 TDD out the new unit (GOTO 1 but this time for the new unit)
Write and run one test at a time. Each test specifies an output or side effect of the subject given its public input and initial state. Observe RED before changing implementation. Confirm that the failure comes from the required behaviour. If a test expected to be red passes, show that it can fail before trusting it.
Implement only enough real behaviour to pass the current test. Run it and observe GREEN. Do not add behaviour for tests that do not exist.
During REFACTOR, inspect the passing test and its tree for too much branching in the test or tree under different conditions. Branching creates demand for a unit that encapsulates some of that branching. Do not predict units before that demand is observable.
Create a mock for the unit. Give the mock a visible reason naming the branching it replaces. Create a stub implementation that throws NotImplemented. Simplify the consumer tests so they pass only when the mock is consumed correctly. Make the consumer call the unit. The consumer tests pass through the mock while running the code throws NotImplemented.
The passing mock and throwing stub are the signal to TDD the new unit. Add its tree from the behaviour the consumer requires. Return to step 1 with that unit. Replace the throwing stub through its own RED-GREEN-REFACTOR cycle.
Refactor only the behaviour just implemented. Duplication is a hint; branching under different conditions is the reason to extract a unit.
none when coverage lands.TDD is complete when:
NotImplemented stub remains.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub elimydlarz/claude-code-plugins --plugin contree15 skills in this plugin
/bootstrap-test-treesCompose mental-model and test-tree setup, then implement every existing-project tree through a second subagent wave. TRIGGER when: the operator asks to bootstrap, backfill, discover, or implement a project's existing behaviour as test trees and tests./changeSet expected behaviour by writing or modifying test trees before code changes. TRIGGER when: the user describes a feature, capability, behaviour change, removal, or modification they want — even loosely (e.g. 'I want X', 'let's add Y', 'can we make it do Z', 'change how X works', 'remove this behaviour')./change-without-meRun the complete Contree arc from idea to independently reviewed working software without routine operator phase transitions: change sets the contract, sync audits it, tdd closes every gap, mutation and completion sync prove the result, and second-opinion findings are repaired before completion. TRIGGER when: the user wants the full workflow, asks to take an idea through implementation, asks to make the project complete, or wants change/sync/tdd handled end to end./diff-for-humansGenerate a single image that explains the current change to a human, using OpenAI's gpt-image-2 model — foregrounding the technical substance the change touches (contracts, databases, behaviour, test trees). TRIGGER when: the user runs /diff-for-humans, or asks to see, picture, illustrate, or visualise the current change or diff./fix-architectureRepair every reported architecture violation with partitioned subagent work and rerun boundary feedback until green. TRIGGER when: architecture lint reports violations or an operator asks to fix dependency direction, purity, composition-root, or cycle problems./second-opinionGet an independent review of completed work from OpenAI's gpt-5.6-sol with high reasoning effort — sends the work and test-tree contract through the Responses API with OPENAI_API_KEY and surfaces its critique. TRIGGER when: sync has just finished, the user asks for a second opinion, an independent review, or a sanity check on completed work before a PR or release.