test-discipline

Enforces updating tests in the same commit as API or file changes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stale tests and out-of-sync assertions break CI for other contributors when APIs change or counted files are added without updating test expectations. ## Core Features & Use Cases - Same-commit test updates: Ensures any change to a function signature, public interface, or exported API is accompanied by corresponding test updates before committing. - Assertion-to-disk synchronization: Keeps expected count arrays (e.g., EXPECTED_FEATURES, EXPECTED_SCENARIOS) aligned with the actual files on disk. - CI triage guidance: Directs checking assertion arrays first when CI fails, before debugging complex failures. - Use Case: After adding a new docs page like distributed-mesh.md to a features directory, update the EXPECTED_FEATURES array in the same commit so the next contributor's CI run passes. ## Quick Start Apply the test-discipline skill to review my pending commit and verify that all API changes and added files have matching test updates.

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 changing an API?

Update the corresponding tests in the same commit as the API change. If you modify a function signature, public interface, or exported API, adjust the affected test files before committing so CI does not break for other contributors.

How to update test assertions when adding new files?

Add the new file's entry to the expected array in the same commit that adds the file. For example, adding a docs page to a features directory requires appending its name to the EXPECTED_FEATURES array so the count matches disk reality.

Why does CI fail after adding a new feature file?

CI fails because test assertion arrays like EXPECTED_FEATURES still reflect the old file count. Check assertion arrays first before debugging complex failures, since stale expectations are a common cause of breakage.

Can passing CI still hide stale test assertions?

Yes, stale assertions can pass while being wrong, so green CI does not guarantee correct coverage. Treat assertion arrays as evolving with content rather than static, and verify them against the filesystem periodically.

When should test updates be committed relative to code changes?

Test updates belong in the same commit as the code change, never deferred. Committing API changes without test updates leaves gaps for other contributors and blocks their CI runs.