arabelatso/skills-4-se/behavior-preservation-checker
- community
Checking that the SKILL.md file is still in the repository.
Compare runtime behavior between original and migrated repositories to detect behavioral differences, regressions, and semantic changes. Use when validating code migrations, refactorings, language ports, framework upgrades, or any transformation that should preserve behavior. Automatically compares test results, execution traces, API responses, and observable outputs between two repository versions. Provides actionable guidance for fixing deviations and ensuring behavioral equivalence.
Install
npx vskill@latest install arabelatso/skills-4-se/behavior-preservation-checkerSKILL.md
Behavior Preservation Checker
Overview
Validate that a migrated or refactored codebase preserves the original behavior by automatically comparing runtime behavior, test results, execution traces, and observable outputs between two repository versions.
Core Workflow
1. Setup Repositories
Prepare both repositories for comparison:
2. Run Behavior Comparison
Use the comparison script to analyze behavioral differences:
3. Review Results
Examine the generated report for:
- Test result differences
- Execution trace divergences
- Output mismatches
- Performance regressions
- API contract violations
4. Fix Deviations
Follow actionable guidance to resolve behavioral differences.
Comparison Methods
Method 1: Test-Based Comparison
Run the same test suite on both repositories and compare results:
Workflow:
- Identify common test suite (or create equivalent tests)
- Run tests on original repository
- Run tests on migrated repository
- Compare pass/fail status, assertions, and outputs
Example:
Method 2: Execution Trace Comparison
Capture and compare execution traces:
Workflow:
- Instrument code to capture function calls, arguments, and return values
- Run identical inputs through both versions
- Compare execution traces for divergences
Example:
Method 3: Observable Output Comparison
Compare program outputs for identical inputs:
Workflow:
- Define test inputs (API requests, CLI commands, function calls)
- Capture outputs from both versions (stdout, files, API responses)
- Compare outputs for differences
Example:
Method 4: Property-Based Testing
Use property-based testing to find behavioral differences:
Workflow:
- Define behavioral properties (invariants, contracts)
- Generate random inputs
- Verify properties hold for both versions
- Report any property violations
Example:
Difference Detection
Test Result Differences
What to check:
- Tests that pass in original but fail in migrated
- Tests that fail in original but pass in migrated
- New test failures
- Changed assertion messages
Severity levels:
- Critical: Core functionality tests fail
- High: Integration tests fail
- Medium: Edge case tests fail
- Low: Flaky tests or timing-dependent failures
Execution Trace Differences
What to check:
- Different function call sequences
- Different argument values
- Different return values
- Missing or extra function calls
Example divergence:
Output Differences
What to check:
- Different stdout/stderr
- Different file contents
- Different API response bodies
- Different status codes
- Different error messages
Tolerance levels:
Actionable Guidance
Pattern 1: Logic Error
Symptom: Different outputs for same inputs
Diagnosis:
Guidance:
- Identify the diverging function
- Compare implementations side-by-side
- Check for off-by-one errors, operator changes, or logic inversions
- Add unit test for the specific case
Pattern 2: Missing Functionality
Symptom: Tests pass in original but fail in migrated with "not implemented" or "attribute error"
Diagnosis:
Guidance:
- List all missing functions/methods
- Implement missing functionality
- Verify with targeted tests
Pattern 3: API Contract Violation
Symptom: Different response structure or status codes
Diagnosis:
Guidance:
- Document API contract differences
- Update migrated API to match original contract
- Add contract tests to prevent future violations
Pattern 4: Performance Regression
Symptom: Migrated version is significantly slower
Diagnosis:
Guidance:
- Profile both versions to identify bottlenecks
- Check for algorithmic changes (O(n) → O(n²))
- Look for missing optimizations or caching
- Verify database query efficiency
Pattern 5: State Management Issues
Symptom: Tests fail intermittently or depend on execution order
Diagnosis:
Guidance:
- Identify shared state between tests
- Add proper setup/teardown
- Ensure test isolation
- Check for global variable usage
Report Format
The behavior checker generates a comprehensive JSON report:
Best Practices
- Start with tests: Ensure comprehensive test coverage before migration
- Incremental validation: Check behavior after each migration step
- Document intentional changes: Mark expected behavioral differences
- Use multiple comparison methods: Combine tests, traces, and outputs
- Automate the process: Integrate into CI/CD pipeline
- Set tolerance thresholds: Define acceptable differences (e.g., timing, formatting)
Resources
- [references/comparison_techniques.md](references/comparison_techniques.md): Detailed comparison methodologies
- [references/difference_patterns.md](references/difference_patterns.md): Common behavioral difference patterns
- scripts/behavior_checker.py: Main comparison orchestrator
- scripts/compare_test_results.py: Test result comparison
- scripts/trace_execution.py: Execution trace capture
- scripts/compare_traces.py: Trace comparison and analysis
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/behavior-preservation-checker/SKILL.md
Popularity
- Repository stars
- 63
- Repository forks
- 5
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arabelatso/skills-4-se/behavior-preservation-checker)