test-discipline

Enforce same-commit test updates for API and counted-resource changes.

Updated Mar 18, 2022
One-click install
npx skills add https://github.com/mpaulosky/dotfiles --skill test-discipline-mpaulosky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/mpaulosky/dotfiles/tree/main/.copilot/skills/test-discipline
Command: npx skills add https://github.com/mpaulosky/dotfiles --skill test-discipline-mpaulosky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests and CI pipelines frequently break or block contributors when tests that assert file counts, expected arrays, or public API behavior become stale after code or content changes. This Skill documents a discipline to ensure tests are updated in the same commit as any API, interface, or counted-resource change so pipelines remain reliable and contributors are not blocked.

Core Features & Use Cases

  • Same-commit test updates: Mandates updating related tests whenever function signatures, exported interfaces, or counted resources change.
  • Filesystem-aware assertions: Emphasizes keeping EXPECTED_* arrays and file-count assertions synchronized with actual repository files.
  • CI triage guidance: Advises checking assertion arrays and filesystem state first when investigating CI failures to avoid wasted debugging.
  • Use Case: A developer changes an authentication API signature and updates the corresponding test assertions in the same commit to prevent downstream CI breaks.

Quick Start

Update tests in the same commit whenever you change public APIs, remove or add counted files, or adjust exported interfaces so CI and other contributors are not blocked.

Frequently Asked Questions about test-discipline

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

FAQPage Schema
How do I keep test assertions in sync when changing API signatures?

To keep test assertions in sync with API changes, update corresponding test arrays and expected file counts in the same commit as the API signature or interface modification to prevent stale assertions from breaking CI pipelines.

Why do my CI pipelines break after adding or deleting repository files?

CI pipelines break after file changes because expected file count assertions and EXPECTED_* arrays become stale. Synchronize filesystem-aware test assertions with actual repository files in the same commit to prevent pipeline failures and contributor blocks.

What is the best way to triage CI failures caused by stale test assertions?

The best way to triage CI failures from stale test assertions is to check assertion arrays and filesystem state first. Investigating expected file lists and public API tests before debugging code avoids wasted effort on outdated assertion mismatches.

Do I need to update public API tests when modifying exported interfaces?

Yes, you need to update public API tests when modifying exported interfaces. Mandating same-commit test updates for function signatures, counted resources, and exported interfaces ensures CI pipelines remain reliable and other contributors are not blocked.

Can I use test-discipline for repositories with filesystem-aware assertion arrays?

Yes, this applies to repositories with filesystem-aware assertion arrays, expected file lists, and public interface tests. It covers scenarios like adding documentation pages, changing function signatures, or deleting scenario files within CI pipelines and developer workflows.

When should I not use same-commit test updates for API changes?

Same-commit test updates for API changes should not be skipped when assertions, expected file counts, or public interface tests exist in the repository. Bypassing this discipline allows stale assertions to break CI and block downstream contributors.