Skip to content
cccskills
FreePublished on GitHub

testing

Authoritative reference for deciding whether a test should exist and what it must assert. Use before writing or changing tests, and when investigating a test failure.

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

wellwelwel/lagune173 stars(GitHub 173 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md4.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Testing

This skill is the specialized, authoritative description of why a test exists: what deserves one, what it must assert, and what to do when it fails.

Follow the project's established conventions wherever they differ from these defaults. For code conventions and test execution, use the engineering skill when it is installed.

Criteria

Answer these questions before writing a test. If any answer is missing, there is no test to write.

  • What promise does it protect? State the behavior, contract, or rule in the domain's terms.
  • What regression would it catch? Describe an incorrect change that would otherwise go unnoticed.
  • Would an equivalent implementation still pass? A refactor must not invalidate the assertions when the promise is unchanged.

The test's name states the promise in the domain's terms, stays valid after a rename, and identifies what broke when it fails.

What deserves a test

  • A behavior the product promises. Cover rules that can be stated independently of the implementation, such as when an operation is allowed or how a failure is handled.
  • A contract between two parties. When systems exchange data or delegate work, test their agreed obligations. A literal table is valid when it records that agreement, not a copy of the code.
  • A barrier against hostile input. Exercise every validation or parser of untrusted data with hostile input, not only valid input.
  • A rule that holds for a whole set. When the project requires every item in a set to satisfy a rule, check the set in one test so new items are covered automatically.
  • An intentional constraint. Cover the effects of agreed limits, rounding rules, or required formats.

What never gets a test

  • The language, the runtime, or a library. Do not re-test behavior they already guarantee. A wrapper around a call needs a test only if it adds a promise of its own.
  • The shape of a module. Do not test that a function is exported, can be called, or matches its declaration. Leave statically guaranteed properties to static checks.
  • A constant or fixed text read back. Repeating a declared value or label as the expected result proves nothing. Test its effect or, for text generated from other data, the composition rule.
  • The structure of the implementation. Do not assert which internal helper ran, how often, in what order, or with which arguments.
  • A snapshot of the markup. A rendered tree records structure, not interface behavior. Test what the interface promises instead.

Resilience to change

  • Mock only external dependencies. Replace the network, the clock, storage, or the file system, never the project's own modules.
  • Write the expected value by hand. State the literal value the promise requires. Do not derive it from the formula or helper under test, which could carry the same error as the result.
  • Assert the complete promise. Check the required values, not merely that a result exists or has a type. Presence is enough only when it is the entire promise, such as flagging an invalid field regardless of the message.
  • Deterministic or removed. A test whose verdict depends on the real clock, network availability, execution order, or uncontrolled randomness must be made repeatable or removed.
  • Organize cases in a table. When several inputs follow the same rule, use one named case per row (parameterized tests) instead of duplicating test logic.
  • One file per subject, not per source file. Group a subject's promises in one file, regardless of where their implementation lives. A source file does not need a corresponding test file.

When a test fails

A failure asks one question: did the promise change on purpose?

  • Yes: update the test with the intended behavior change so both are reviewed together.
  • No, and the behavior changed: the code is wrong, so fix it.
  • No, and the behavior did not change: investigate the test and its setup. Correct implementation coupling or uncontrolled inputs instead of changing the expectation.

Never make a test pass by weakening its assertion or widening its mocks.

Review

After writing or changing tests, check every test touched by the work against this skill. Rewrite or remove any that no longer meet its criteria.

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

Authoritative architecture reference for Lagune, covering repository layout, the three owners, the published skills, the catalog, the engine command and its fallback, and the tracking-map model. Use when a decision depends on repo shape.

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

wellwelwel/lagune173Updated Oct 26, 2026

cdp

Free

Visual verification of a running page through Chrome's DevTools Protocol, capturing screenshots and measuring the rendered DOM. Use when a frontend change can only be confirmed once rendered, for layout, spacing, alignment, overflow, or theme tokens.

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

wellwelwel/lagune173Updated Oct 26, 2026

Authoritative reference for the Lagune dashboard, a live view of a project's .lagune/ chain with a locked-down local action surface. Use before changing anything under src/dashboard/ or src/types/dashboard/.

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

wellwelwel/lagune173Updated Oct 26, 2026

Authoritative engineering reference covering code conventions, comments, TypeScript type rules, testing, and commit messages. Use before writing or changing any source file, and when suggesting a commit message.

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

wellwelwel/lagune173Updated Oct 26, 2026

lagune

Free

Do the work the prompt asks for, with security guarding the build as it happens. Loads the charter, matches the security knowledge the work touches, builds safe-by-default, then checks its own result against what it used.

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

wellwelwel/lagune173Updated Oct 26, 2026

Establish or update the project's security charter, the safe-by-default principles every later phase must respect. Reads the project's files to learn what it is and uses, weighs any description you give against them, and asks when something is unclear.

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

wellwelwel/lagune173Updated Oct 26, 2026

See all skills by wellwelwel

Report a problem with this skill