test-discipline

Update stale tests to match changed APIs and filesystem expectations.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/sachinnair90/gitgloss --skill test-discipline-sachinnair90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/sachinnair90/gitgloss/tree/main/.copilot/skills/test-discipline
Command: npx skills add https://github.com/sachinnair90/gitgloss --skill test-discipline-sachinnair90

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents stale tests from breaking CI by keeping assertions, expected counts, and public-interface checks aligned with the code and files they validate.

Core Features & Use Cases

  • API-change discipline: Update tests in the same commit whenever a function signature, export, or public contract changes.
  • Filesystem assertion sync: Keep expected file counts and named lists aligned with the real contents on disk.
  • CI failure triage: Check assertion arrays first when test failures appear after docs, features, or scenarios are added or removed.

Quick Start

Use the test-discipline skill to review my recent API or file-count change and tell me which tests or expected arrays must be updated in the same commit.

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 when API changes break CI?

To keep tests in sync when API changes break CI, update stale assertions and expected counts in the same commit as the modified public interfaces or exported functions. This ensures test validation aligns with the new contracts before CI runs.

What is the best way to sync filesystem assertions with actual disk state?

Syncing filesystem assertions with actual disk state requires validating that expected arrays and file counts match the real contents on disk. This prevents stale test expectations from failing after documents or features are added or removed.

Why do expected file count arrays fail after adding new scenarios?

Expected file count arrays fail after adding new scenarios because the hardcoded assertions no longer match the actual disk state. You must update the expected lists in the same commit to reflect the newly added or removed inventory items.

Do I need to update assertions in the same commit as API changes?

Yes, you need to update assertions in the same commit as API changes. Same-commit synchronization ensures that exported function signatures, public contracts, and their associated tests are validated together before CI runs.

How do I triage CI failures caused by stale test assertions?

To triage CI failures caused by stale test assertions, check the assertion arrays first when failures appear after document, feature, or scenario inventories are modified. Update the expected counts to match the actual disk state.

When should I update tests for modified public interfaces?

You should update tests for modified public interfaces whenever a function signature, export, or public contract changes. This prevents stale tests from breaking CI by keeping validation aligned with the code it checks.