breaking-change-detector

Use for backward compatibility audits, serialization safety, and breaking change detection. Also use when checking if a Zod schema has .catch() defaults for Durable Object snapshots or hibernation. Trigger on ANY of: 'will this break existing clients', 'is this change safe', 'breaking changes', 'contract migration', 'backward compatible', 'field removal', 'enum value changes', 'status code changes', 'event type rename', 'replay safety', 'does fromJSON use safeParse or parse', '.catch() defaults', 'hibernation safety', 'Durable Object snapshot', 'narrowing a type', 'is this safe to merge', 'API contract safety'. Covers contracts, API endpoints, database schema, serialized state, WebSocket protocols, and event sourcing. Skip for internal refactoring or adding new optional fields.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "breaking-change-detector" with this command: npx skills add apankov1/quality-engineering/apankov1-quality-engineering-breaking-change-detector

Breaking Change Detector

Audits breaking changes that could disrupt active sessions or lose client compatibility across 6 categories. Includes executable utilities for categories 1, 3, 5, and 6; categories 2 and 4 are checklist/static-analysis guided.

When to use: Modifying shared contract/interface packages, changing database schema or migrations, RPC/API endpoint signature changes, WebSocket message format changes, serialized state schema changes, before merging any contract/schema changes.

When not to use: Adding new optional fields (non-breaking), internal refactoring without API changes, documentation or test-only changes.

Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired Action
"Nobody uses the old format"Active sessions and stored data use the old format right nowCheck backward compatibility
"We'll fix the clients"Clients update on their own schedule, not yoursKeep old format supported
"It's just a rename"A rename IS a removal + addition -- all consumers need updatingDeprecate, don't rename
"The migration handles it"Migrations run once; replay/recovery may encounter old data indefinitelyUse tolerant reader pattern

Included Utilities

// Breaking change classification (zero dependencies)
import {
  classifyFieldChange,
  classifySerializedSchema,
  classifyDeserializerSafety,
  classifyEventTypeChanges,
  classifyStatusCodeChanges,
  classifyEnumValueChanges,
  classifyApiFieldSemantics,
} from './breaking-change.ts';

Backward Compatibility Checklist

When modifying contracts or schemas:

  • All existing fields preserved (or deprecated with fallback)
  • New fields are optional or have .catch() defaults
  • Type changes are widening only
  • Database migration handles existing data
  • Old event formats still supported for replay
  • WebSocket protocol versioned
  • API endpoints maintain compatibility
  • Tests validate old data still deserializes correctly
  • Serialized state schemas use .catch() for all fields
  • fromJSON() methods use safeParse() with graceful fallback

Violation Rules

SlugRuleSeverity
contract_field_removalRemoved/renamed fields in shared interfacesmust-fail
schema_without_catchSerialized schema fields missing .catch() defaultmust-fail
strict_parse_in_deserializeUsing .parse() instead of .safeParse() in fromJSONmust-fail
migration_drops_columnColumn removal without data migrationmust-fail
endpoint_removedAPI endpoint removed without deprecation periodmust-fail
event_type_renamedEvent type name changed (incompatible with replay)must-fail

Coverage

CategoryUtilityStatus
1. Contract fieldsclassifyFieldChange()Code + tests
2. Database schema--Doc-only (requires SQL diffing)
3. RPC/API endpointsclassifyStatusCodeChanges(), classifyEnumValueChanges(), classifyApiFieldSemantics()Code + tests (API-level diff helpers)
4. WebSocket protocol--Doc-only (requires message schema diffing)
5. Serialized stateclassifySerializedSchema(), classifyDeserializerSafety()Code + tests
6. Event sourcingclassifyEventTypeChanges()Code + tests

Categories 2 and 4 require static analysis of SQL migrations or protocol schemas. Category 3 includes API-level helpers here, but full endpoint/spec diffing still needs OpenAPI/RPC schema tooling. See categories.md for detection commands and safe patterns.

Output Format

## CRITICAL -- Will Disrupt Active Sessions

### Contract: Removed UserState.score field
**File**: src/contracts/types.ts:42
**Impact**: Active sessions fail on state load
**Fix**: Deprecate instead:
  /** @deprecated Use points instead */
  score?: number;
  points: number;

## WARNING -- Migration Required

### Database: Renamed column without migration
**File**: migrations/0036_rename_field.sql:5
**Impact**: Existing rows have NULL values
**Fix**: Add data migration step

## SAFE Changes

- Added optional field `UserState.metadata`
- New API endpoint `orders.archive`
- Widened type `Status: 'active' | 'paused'` to include `'archived'`

Companion Skills

This skill provides breaking change detection, not schema authoring or migration guidance. For broader methodology:

  • Search schema evolution on skills.sh for migration strategies, versioning patterns, and backward compatibility tooling
  • Schema boundary validation pairs with breaking change detection — use zod-contract-testing for compound state matrices and schema evolution testing
  • Serialized schemas with .catch() defaults need structured error logging — use observability-testing to assert log output when old data triggers fallback paths

Framework Adaptation

This skill applies to any system with shared contracts/interfaces, persistent state, event sourcing, real-time protocols, or RPC/API layers with independent client release cycles.

See categories.md for detailed detection patterns, code examples, and safe alternatives for each of the 6 categories.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

pairwise-test-coverage

No summary provided by upstream source.

Repository SourceNeeds Review
General

barrier-concurrency-testing

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

websocket-client-resilience

No summary provided by upstream source.

Repository SourceNeeds Review