software-test-creation

Write failing tests for the red phase of TDD based on acceptance criteria and codebase conventions.

902|58|Updated May 31, 2012
One-click install
npx skills add https://github.com/stencila/stencila --skill software-test-creation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: software-test-creation
Source: https://github.com/stencila/stencila/tree/main/.stencila/skills/software-test-creation
Command: npx skills add https://github.com/stencila/stencila --skill software-test-creation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing tests before implementation requires knowing a codebase's test framework, file layout, and assertion style, which is tedious to discover manually. This Skill automates the red phase of red-green-refactor by discovering existing test conventions and generating failing tests that define expected behavior before the implementation exists.

Core Features & Use Cases

  • Convention Discovery: Scans build files, existing test files, and CI configuration to detect the language, test framework, naming patterns, and test command already in use.
  • Red-Phase Test Generation: Writes syntactically valid test files that fail because the implementation does not yet exist, covering acceptance criteria while skipping trivial or non-testable deliverables like documentation.
  • Fallback Conventions: Applies a language-specific fallback table (pytest, Vitest, JUnit, testthat, and more) when no existing tests can be found, including minimal framework setup.
  • Use Case: Given a slice with acceptance criteria for a new URL validation utility in a TypeScript package, the Skill detects Vitest from package.json, writes failing tests in the conventional location, and reports the exact command to run them.

Quick Start

Write failing tests for the current slice using its acceptance criteria and target packages, following the test conventions already present in this repository.

Frequently Asked Questions about software-test-creation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write failing tests before implementation in TDD?

Provide the slice name, scope, acceptance criteria, and target packages. The Skill discovers your codebase's test framework and conventions, then writes syntactically valid tests that fail because the implementation does not yet exist, and reports the test command.

What test frameworks does this TDD workflow support?

It works with any language or framework by discovering existing conventions first. When no tests exist, a fallback table covers pytest, Vitest, JUnit 5, GoogleTest, xUnit, RSpec, testthat, Go testing, Rust built-in tests, ScalaTest, Bats, and XCTest.

Can it write tests when a project has no existing tests?

Yes. If no test conventions are found in the package, its siblings, or the project root, it applies fallback conventions for the detected language and installs or declares the minimal test framework dependency so tests fail for the right reason.

Why should some acceptance criteria not become automated tests?

Criteria covering documentation, comments, changelogs, or properties already guaranteed by the type system produce trivial or brittle tests. The Skill classifies these as non-test deliverables, omits them, and explains the reasoning in its summary.

What happens if the test file already exists at the target path?

The Skill reads the existing file and extends it by adding new test functions alongside the current ones. It does not remove or modify existing tests unless revision feedback specifically requests changes.