Skills

Software Test Creation

Write failing tests for a TDD slice based on acceptance criteria and codebase conventions.

Install

npx skills add stencila/stencila --skill software-test-creation -g -a claude-code -y
Repository
stencila/stencila914
Category
Testing
Updated
3d ago
License
Apache-2.0
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Write failing tests for a TDD slice based on acceptance criteria and codebase conventions. Use when the "red" phase of red-green-refactor requires tests that define expected behavior before implementation exists. Discovers codebase test conventions first, writes test files that compile or parse but fail because the implementation does not yet exist, and reports test metadata. Works with any language or test framework.

Overview

Write failing tests for a TDD slice as part of a red-green-refactor cycle. This skill handles the "red" phase: given slice scope, acceptance criteria, and target packages, it discovers the codebase's existing test conventions, writes test files that compile or parse but fail because the implementation does not yet exist, and reports the test file paths and test command.

The core principle is discover first, prescribe only as fallback. The agent must adapt to whatever language, framework, and conventions the codebase already uses. Language-specific defaults are provided only for the case where no existing test conventions can be found.

The tests must:

  • Cover the slice's acceptance criteria
  • Follow the codebase's existing test conventions (framework, assertion style, directory layout, naming)
  • Compile or parse successfully (no syntax errors)
  • Fail because the code under test does not exist or does not yet behave correctly
  • Be minimal, test only what the slice requires, not more
  • Earn their maintenance cost, every test must provide meaningful confidence beyond what the compiler, type system, or trivial construction already guarantees

Not every acceptance criterion should become an automated unit or integration test. If a slice includes documentation, comments, commit-message, changelog, release-note, or other non-executable deliverables, do not create tests that inspect source files merely to assert those artifacts exist. Those criteria should instead be treated as implementation or review obligations to be satisfied by the implementation/refactor/human-review stages. Only write automated tests for executable behavior or other machine-checkable product behavior where such tests are a natural fit.

Required Inputs

This skill requires the following information to operate:

Read the whole SKILL.md on GitHub

More in Testing