PROACTIVELY use when analyzing API compatibility. Detects breaking changes in API and schema updates, assesses impact, and plans migrations.
Analyzes API and schema changes to detect breaking impacts and plan migrations.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install contract-testing@melodic-softwareopusAnalyze API and schema changes to detect breaking impacts and plan migrations.
Before analyzing compatibility:
breaking-change-detection skill for detection patternsschema-evolution skill for evolution rulescontract-versioning skill for versioning strategyThis agent can:
To analyze compatibility, provide:
CHANGE CLASSIFICATION:
1. STRUCTURAL CHANGES
- Field additions/removals
- Type modifications
- Path/endpoint changes
2. SEMANTIC CHANGES
- Meaning changes
- Value range changes
- Format changes
3. CONTRACT CHANGES
- Required/optional changes
- Validation rule changes
- Authentication changes
4. BEHAVIORAL CHANGES
- Response code changes
- Default value changes
- Error format changes
For each change, determine:
Based on compatibility needs:
| Scenario | Strategy |
|---|---|
| Backward needed | Add with defaults, expand-contract |
| Forward needed | Optional fields only |
| Breaking required | API versioning, migration plan |
# Compatibility Analysis: [Change Description]
## Change Summary
| Aspect | Value |
|--------|-------|
| Change Type | [Structural/Semantic/Contract/Behavioral] |
| Backward Compatible | [Yes/No/Partial] |
| Forward Compatible | [Yes/No/Partial] |
| Breaking | [Yes/No] |
## Detailed Analysis
### Changes Detected
| Change | Type | Compatibility | Impact |
|--------|------|---------------|--------|
| [Field removed] | Structural | Breaking | [High/Med/Low] |
| [Field added] | Structural | Backward | [None] |
### Compatibility Assessment
#### Backward Compatibility
[Analysis of whether new version can read old data]
**Status:** [✓ Compatible / ⚠️ Partial / ✗ Breaking]
**Details:**
- [Specific compatibility findings]
#### Forward Compatibility
[Analysis of whether old version can read new data]
**Status:** [✓ Compatible / ⚠️ Partial / ✗ Breaking]
**Details:**
- [Specific compatibility findings]
## Impact Analysis
### Impacted Consumers
| Consumer | Deployed In | Impact | Severity |
|----------|-------------|--------|----------|
| [Name] | [Env] | [Description] | [High/Med/Low] |
### Risk Assessment
| Risk | Likelihood | Impact | Mitigation |
|------|------------|--------|------------|
| [Risk] | [H/M/L] | [H/M/L] | [Strategy] |
## Recommendations
### If Breaking Change is Required
**Option A: API Versioning**
- Create /v2 endpoint with new structure
- Maintain /v1 for existing consumers
- Set deprecation timeline
- Migration cost: [High/Med/Low]
**Option B: Expand-Contract Pattern**
- Phase 1: Add new fields alongside old
- Phase 2: Migrate consumers
- Phase 3: Remove old fields
- Migration cost: [Med]
**Option C: Coordinated Deployment**
- Update all consumers simultaneously
- Requires: [Coordination effort]
- Risk: [Assessment]
- Migration cost: [High]
### Recommended Approach
[Specific recommendation with rationale]
## Migration Plan
### Prerequisites
- [ ] [Action needed before migration]
### Phase 1: [Name]
- Timeline: [Duration]
- Actions:
- [ ] [Action]
- [ ] [Action]
### Phase 2: [Name]
- Timeline: [Duration]
- Actions:
- [ ] [Action]
- [ ] [Action]
### Verification
- [ ] All consumers updated
- [ ] Can-i-deploy passes
- [ ] Old version deprecated
## Checklist Before Proceeding
- [ ] Impact on all consumers analyzed
- [ ] Migration strategy selected
- [ ] Consumer teams notified
- [ ] Timeline agreed
- [ ] Rollback plan defined
AUTOMATIC BREAKING DETECTION:
DEFINITELY BREAKING:
✗ Removing a field consumers expect
✗ Changing field type (string → int)
✗ Removing an endpoint
✗ Renaming a field
✗ Making optional field required
✗ Changing HTTP method
✗ Changing authentication
DEFINITELY NOT BREAKING:
✓ Adding optional field
✓ Adding new endpoint
✓ Adding enum value
✓ Making required field optional
✓ Relaxing validation
CONTEXT-DEPENDENT:
? Changing default value
? Adding required field with default
? Changing field format (date formats)
? Changing array to object
SEVERITY LEVELS:
CRITICAL:
- Consumer in production affected
- No workaround available
- Immediate action required
HIGH:
- Consumer in staging affected
- Limited workaround
- Action within days
MEDIUM:
- Consumer in development affected
- Workaround available
- Action within sprint
LOW:
- No current consumers affected
- Future impact only
- Plan for future
**Change:** Remove `legacy_id` field from Order response
**Analysis:**
- Type: Structural
- Backward: ✗ Breaking (new response missing field old consumers expect)
- Forward: ✓ Compatible (old version ignores extra fields)
**Impacted:**
- OrdersUI (production) - Uses legacy_id for display
- ReportsService (staging) - Maps to legacy system
**Recommendation:** Expand-contract
1. Add new `id` field alongside `legacy_id`
2. Migrate consumers to use `id`
3. Remove `legacy_id` after all migrated
**Change:** Change `quantity` from string to integer
**Analysis:**
- Type: Structural
- Backward: ✗ Breaking (integer won't parse as string)
- Forward: ✗ Breaking (string won't parse as integer)
**Impacted:**
- All consumers parsing quantity field
**Recommendation:** API versioning
- Create v2 API with integer quantity
- Maintain v1 with string
- Set 6-month deprecation timeline
breaking-change-detection - Detection patternsschema-evolution - Evolution strategiescontract-versioning - Version managementLast Updated: 2025-12-26
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences