test-discipline

Update tests and assertion arrays when APIs or counted resources change.

9|1|Updated Jul 21, 2025
One-click install
npx skills add https://github.com/usepowershell/PoshMcp --skill test-discipline-usepowershell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-discipline
Source: https://github.com/usepowershell/PoshMcp/tree/main/.copilot/skills/test-discipline
Command: npx skills add https://github.com/usepowershell/PoshMcp --skill test-discipline-usepowershell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When public interfaces, function signatures, or counted resources change, tests and assertion arrays often become stale and cause CI failures for other contributors. This Skill codifies the discipline of updating tests in the same commit as API or content changes to prevent blocked pipelines and wasted debugging time.

Core Features & Use Cases

  • Commit-time test updates: Ensure any API or public interface change is accompanied by corresponding test updates in the same commit.
  • Assertion-to-filesystem alignment: Keep expected counts and assertion arrays (e.g., EXPECTED_FEATURES, EXPECTED_SCENARIOS) matched to actual files on disk.
  • CI triage guidance: Prioritize verifying test assertion arrays and filesystem-derived expectations before investigating complex CI failures, reducing wasted effort.

Quick Start

When you change an exported function or add/remove counted files, update the related tests and assertion arrays in the same commit and verify expected counts match the repository before pushing.

Frequently Asked Questions about test-discipline

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

FAQPage Schema
How do I prevent CI failures when API changes break test assertion arrays?

Prevent CI failures by updating test assertions and expected counts in the same commit as API or public interface changes. This keeps filesystem-derived expectations matched to actual files before pushing code.

What is the best way to keep test assertions in sync with counted files on disk?

Keep test assertions in sync by validating filesystem-derived expectations against actual files on disk. Update corresponding assertion arrays like EXPECTED_FEATURES whenever counted resources are added or removed within the same commit.

Why should I update tests in the same commit as API changes?

Updating tests in the same commit as API changes prevents blocked CI pipelines and wasted debugging time. Stale assertion arrays cause CI failures for other contributors when public interfaces or function signatures change without matching test updates.

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

Triage CI failures by first verifying test assertion arrays and filesystem-derived expectations. Prioritize checking if expected counts match the repository before investigating complex CI failures to reduce wasted debugging effort.

Does this approach work with automated test suites that reference file counts?

Yes, this approach applies to codebases with automated test suites that include assertion arrays referencing file counts, expected items, or public interfaces. It ensures expected counts match the repository before pushing changes.

When should I verify filesystem-derived expectations before debugging CI failures?

Verify filesystem-derived expectations before debugging complex CI failures whenever APIs or counted resources change. Prioritize checking if assertion arrays match actual files on disk to avoid wasting effort on stale test data.