Interval Difference Analyzer logo

Interval Difference Analyzer

Community
ArabelaTso
interval-difference-analyzer

Analyze differences in program intervals between two versions of a program (old and new) to identify added, removed, or modified intervals. Use when comparing program versions, analyzing variable ranges, detecting behavioral changes in numeric computations, validating refactorings, or assessing migration impacts. Supports optional test suite integration to validate interval changes. Generates comprehensive reports highlighting intervals requiring further testing or verification.

Overview

PublisherArabelaTso
RepositorySkills-4-SE
Skill nameinterval-difference-analyzer
Stars
258
Forks
25
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ArabelaTso on GitHub. Read the source before you install it.

Installation

Install the Interval Difference Analyzer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/interval-difference-analyzer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git /tmp/Skills-4-SE
mkdir -p .claude/skills
cp -r /tmp/Skills-4-SE/skills/interval-difference-analyzer .claude/skills/interval-difference-analyzer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Interval Difference Analyzer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Interval Difference Analyzer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Interval Difference Analyzer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Interval Difference Analyzer

Overview

Analyze differences in program intervals (variable value ranges) between two versions of a program to detect behavioral changes, identify potential bugs, and guide testing efforts.

Core Workflow

1. Setup Program Versions

Prepare both program versions for analysis:

bash
OLD_VERSION=/path/to/old/program
NEW_VERSION=/path/to/new/program
TEST_SUITE=/path/to/tests  # Optional

2. Extract Intervals

Extract interval information from both versions:

bash
python scripts/interval_analyzer.py \
    --program $OLD_VERSION \
    --output old_intervals.json

python scripts/interval_analyzer.py \
    --program $NEW_VERSION \
    --output new_intervals.json

3. Compare Intervals

Compare intervals and identify differences:

bash
python scripts/compare_intervals.py \
    --old old_intervals.json \
    --new new_intervals.json \
    --output interval_diff_report.json

4. Review Report

Examine the generated report for:

  • Added intervals (new variables or wider ranges)
  • Removed intervals (deleted variables or narrower ranges)
  • Modified intervals (changed bounds)
  • Behavioral implications
  • Testing recommendations

What Are Program Intervals?

Program intervals represent the possible ranges of values that variables can take during program execution.

Example:

python
def calculate_discount(price, discount_rate):
    # Intervals:
    # price: [0, 10000]
    # discount_rate: [0.0, 1.0]
    # discount: [0, 10000]
    discount = price * discount_rate
    return discount

Why intervals matter:

  • Detect overflow/underflow risks
  • Identify boundary condition changes
  • Validate numeric computation correctness
  • Guide test case generation

Interval Extraction Methods

Method 1: Static Analysis

Analyze code to infer possible value ranges without execution.

Method 2: Dynamic Analysis

Execute program with test inputs and observe actual ranges.

Method 3: Abstract Interpretation

Use abstract domains to compute sound interval approximations.

Interval Comparison

Identifying Added Intervals

Pattern: New variables or wider ranges in new version

Implications:

  • New computation paths
  • Potential new bugs
  • Requires new tests

Identifying Removed Intervals

Pattern: Deleted variables or narrower ranges in new version

Implications:

  • Simplified computation
  • Reduced intermediate state
  • May affect debugging

Identifying Modified Intervals

Pattern: Changed bounds for existing variables

Example:

python
# Old version: age: [0, 120]
# New version: age: [0, 150]  # Widened!

Implications:

  • Relaxed constraints
  • May accept invalid inputs
  • Requires validation testing

Behavioral Change Detection

Overflow/Underflow Detection

Check if new intervals exceed type bounds.

Example:

python
# Old: result: [0, 1000000] ✓ Safe (int32)
# New: result: [0, 10000000000] ✗ Overflow risk!

Precision Loss Detection

Check if new intervals lose precision.

Example:

python
# Old: result: [0.0, 100.0] (float)
# New: result: [0, 100] (int) - precision loss!

Boundary Condition Changes

Check if interval boundaries change critically.

Example:

python
# Old: index: [0, 99]
# New: index: [-1, 99]  # Negative index possible!

Testing Recommendations

Priority Levels

Critical: Test immediately

  • Overflow/underflow risks
  • Negative indices
  • Division by zero
  • Type mismatches

High: Test soon

  • Widened intervals
  • Boundary changes
  • Precision loss

Medium: Test when convenient

  • Narrowed intervals (safer)
  • Removed intermediate variables

Low: Optional testing

  • Cosmetic changes
  • Unchanged intervals

Test Case Generation

Generate test cases targeting interval boundaries:

python
# Interval: x: [0, 100]
test_cases = [0, 1, 50, 99, 100]

# For modified interval: [0, 100] → [0, 150]
additional_tests = [101, 125, 149, 150]

Report Format

The analyzer generates a comprehensive JSON report:

json
{
  "summary": {
    "total_intervals_old": 45,
    "total_intervals_new": 48,
    "added_intervals": 5,
    "removed_intervals": 2,
    "modified_intervals": 8
  },
  "differences": [
    {
      "type": "modified",
      "variable": "age",
      "old_interval": "[0, 120]",
      "new_interval": "[0, 150]",
      "severity": "high",
      "implications": ["Accepts wider range"],
      "testing_priority": "high",
      "suggested_tests": [121, 135, 149, 150]
    }
  ],
  "recommendations": [
    "Test modified intervals with boundary values",
    "Verify no overflow in calculations"
  ]
}

Integration with Test Suites

Validate Intervals with Tests

Run existing tests and verify intervals:

bash
python scripts/validate_intervals.py \
    --program $NEW_VERSION \
    --intervals new_intervals.json \
    --test-suite $TEST_SUITE

Generate Tests from Intervals

Automatically generate tests for interval boundaries:

bash
python scripts/generate_interval_tests.py \
    --intervals interval_diff_report.json \
    --output generated_tests.py

Best Practices

  1. Use both static and dynamic analysis: Combine for better coverage
  2. Focus on critical intervals: Prioritize safety-critical variables
  3. Test boundary values: Always test interval bounds
  4. Document intentional changes: Mark expected interval modifications
  5. Automate analysis: Integrate into CI/CD pipeline

Resources

  • references/interval_analysis.md: Detailed interval analysis techniques
  • references/abstract_interpretation.md: Abstract interpretation theory
  • scripts/interval_analyzer.py: Main interval extraction tool
  • scripts/compare_intervals.py: Interval comparison engine
  • scripts/validate_intervals.py: Test suite validation
  • scripts/generate_interval_tests.py: Test case generator

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Interval Difference Analyzer AI skill do?

Analyze differences in program intervals between two versions of a program (old and new) to identify added, removed, or modified intervals. Use when comparing program versions, analyzing variable ranges, detecting behavioral changes in numeric computations, validating refactorings, or assessing migration impacts. Supports optional test suite integration to validate interval changes. Generates comprehensive reports highlighting intervals requiring further testing or verification.

Why use Interval Difference Analyzer on TypingMind?

Because you install it once and use it with any model. Interval Difference Analyzer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Interval Difference Analyzer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/interval-difference-analyzer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Interval Difference Analyzer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Interval Difference Analyzer?

As many as you like. As long as a model supports skills, you can use Interval Difference Analyzer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Interval Difference Analyzer AI skill free?

Yes. It is published on GitHub by ArabelaTso under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇