test-discipline

Enforce test updates in the same commit when APIs change.

413|64|Updated Feb 7, 2023
One-click install
npx skills add https://github.com/christianhelle/refitter --skill test-discipline-christianhelle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/christianhelle/refitter/tree/main/.copilot/skills/test-discipline
Command: npx skills add https://github.com/christianhelle/refitter --skill test-discipline-christianhelle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When APIs or public interfaces change, tests must be updated in the same commit. When test assertions reference counts or expected arrays, they must be kept in sync with disk reality. Stale tests block CI for other contributors.

Core Features & Use Cases

  • Enforces updating tests on API changes within the same commit
  • Maintains synchronization between test assertions and repository state
  • Helps CI pass by avoiding outdated expectations

Quick Start

Update tests in the same commit alongside API changes to keep CI green.

Frequently Asked Questions about test-discipline

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

FAQPage Schema
How do I keep tests in sync with API changes in the same commit?

To keep tests in sync with API changes, you must update test assertions in the same commit to maintain CI parity. This prevents stale tests from blocking continuous integration for other contributors.

What problems arise when test assertions do not match on-disk reality?

When test assertions do not match on-disk reality, stale tests block CI pipelines. Synchronizing test expectations with repository state ensures CI passes and avoids outdated assertions on file counts or structures.

How to enforce updating tests when public interfaces change?

You can enforce updating tests when public interfaces change by applying checks that trigger immediate test updates. This surfaces guidance to align tests with new APIs within the same commit.

Does this approach work for projects with assertions on file counts and structures?

Yes, this approach works for software projects with assertions on file counts, structures, or behavior. It ensures these assertions reflect on-disk reality across commits to keep CI green.

Why does CI break for other contributors when API changes are committed?

CI breaks for other contributors because outdated tests with expected arrays or file counts fail. Updating tests alongside API changes in the same commit maintains synchronization and prevents CI blocks.

When do I need to update tests to maintain CI parity?

You need to update tests to maintain CI parity whenever APIs or public interfaces change. Updating test assertions in the same commit ensures tests align with new APIs and repository state.