Skip to content
cccskills
FreePublished on GitHub

tdd

Write the failing test before the code that satisfies it, for new behaviour and for bug fixes, and stop when the test path is not worth its cost. Covers the red-green loop, what a first test should assert, when to skip the loop honestly, and the evidence to report. Use when starting behaviour that has a cheap test path, or fixing a bug that can be reproduced in a test. Triggers - "tdd", "write a failing test first", "regression test", "reproduce this in a test", "test first".

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

TDD

Make the behaviour executable before making it work. The point is not ceremony: a test written first describes what the caller needs, while a test written after describes what the code happens to do.

Write the test in the style the project already uses. Where the project ships a test skill for the language, that skill wins. Failing that, read two neighbouring test files and follow them. Failing both, the shape is: named as a sentence, built from setup, mock, test and verify blocks separated by blank lines, and carrying no comments.

That shape is also the fastest way to write step 2. Name the behaviour, write the verify block first, then work backwards to the setup that makes it reachable.

The loop

  1. Name the behaviour. One sentence, in the caller's terms. That sentence is the test name, and if it will not come out as a sentence the behaviour is not understood well enough to write yet.
  2. Write the smallest failing test. It asserts the behaviour, never the implementation you are about to write.
  3. Run it, and read the failure. It must fail for the reason you expect. A test that passes immediately is testing something else. A test that fails on a missing import is not evidence yet.
  4. Write the smallest code that passes. Not the general case, not the version with the options object nobody asked for.
  5. Run it again. Green.
  6. Clean up while green. Both sides: the code, and the test that is now longer than it needs to be.
  7. Repeat for the next behaviour, not the next line.

For a bug, the same loop with step 1 fixed for you: the test is the reproduction, and it must fail before the fix and pass after it.

What the first test asserts

The behaviour a caller would notice. Not the shape of an intermediate value, not the number of times a collaborator was called, not a snapshot of a structure.

Start at the boundary that is cheap to call. The unit is whatever has a real seam, which is often a function two layers in rather than the exported one.

When to skip

Do not force a test. Skip the loop when the only available test would need broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, or a fixture churn larger than the change.

Skipping is a decision you say out loud, not one you make silently. Name why the test path is not worth it and what you did instead: a script, a manual reproduction, a screenshot from the real app, a log assertion.

Prefer no test to a bad test. A bad test is one that mostly exercises mocks, encodes the implementation, depends on timing or global state, or would be deleted the moment it had proved the fix.

Guardrails

  • Never change an existing test to match a wrong implementation.
  • Never weaken an assertion to get to green. Either the behaviour changed, and the test name changes with it, or there is a bug.
  • Keep a regression test focused on its bug. Unrelated coverage is a separate change.
  • A flaky bug still gets a deterministic test. Pin the signal, not the timing.
  • If the bug is one of a class, land the focused test first and consider the siblings after.

Report the evidence

Not "added a test". Name the test, the failure it produced before the fix, and the run that passed after. If failing-first could not be shown, say why, and name the check used instead.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

One file, one job, and short enough to hold in your head. Covers the size policy (hard-split over 300 lines, split 200 to 300 at a seam, aim for 150), what a natural seam is and where to cut, the exemptions, the dependency rules that decide where the split lands, and the signals that a file is already two files. Use before adding to a file that is already long, when naming a new file, when a function has nowhere obvious to live, or when a review says a file is doing too much. Triggers - "this file is too long", "where should this go", "split this file", "is this file too big", "one responsibility".

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

naming

Free

What things get called. A file is named after its export in the project's case convention, a suffix is a resolution instruction rather than decoration, an index file only re-exports, and some symbol names are always wrong (utils, helpers, V2, Enhanced, New). Covers learning a tree's local vocabulary before adding to it, test and platform-variant naming, and the per-language conventions. Use when creating a file or directory, naming a test file, adding a platform variant, or when a name has to change. Triggers - "what should I call this file", "where does this file go", "naming convention", "kebab or camel", "name this test".

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

Spawn the comment hunter, fix accepted findings, and offer encodings for claimed constraints.

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

Write a short release note people finish reading. Picks the few changes a user will notice from the pull requests since the last release, names each by what the reader can now do, keeps to a length budget, writes every language from the intent instead of translating, and traces every line to a PR. Use when cutting a release, or filling a GitHub Release body, a store "what's new", a package changelog or an in-app what's new screen. Triggers - "write the release notes", "release notes for 0.4.0", "what's new", "changelog for this release", "notes de version".

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

Rust best practices. Use when reading or editing any .rs file, designing a crate's public API, choosing an error type, splitting a workspace, or writing async code on tokio. Triggers - "rust best practices", "is this idiomatic", "should this be a newtype", "anyhow or thiserror", "why does the borrow checker", "review this Rust".

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

Write cargo tests. A test name is a sentence, the body is setup, mock, test and verify blocks separated by blank lines with no comments, and shared setup lives in a named test-support module rather than in each test. Covers naming, the block shape, where a test file goes, async and time, workspaces, and running one crate or one filter. Use when adding or changing any #[test] or #[tokio::test], or when Rust coverage has to come up. Triggers - "write a rust test", "cargo test", "test this crate", "cover this handler".

The English summary is being prepared. Showing the original description.

kromatv/kroma60Updated Oct 19, 2026

See all skills by kromatv

Report a problem with this skill