agentleFS
reaatechreaatech/mcp-changelog/skills/change-detection/SKILL.md

change-detection

Skill0 starsChanged 3 months agoMITView on GitHub

The change-detection skill provides capabilities for comparing MCP tool schemas between versions and classifying changes as breaking, non-breaking, or patch. This skill wraps mcp-schema-evolution's detector with git-specific context.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Incremental detection: Only compare changed portions of large schemas

    line 297
  2. Distinctive:

    Early termination: Stop on first breaking change if only checking for breaks

    line 300

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Change Detection Skill

Purpose

The change-detection skill provides capabilities for comparing MCP tool schemas between versions and classifying changes as breaking, non-breaking, or patch. This skill wraps mcp-schema-evolution's detector with git-specific context.

Capabilities

1. Schema Comparison

  • Compare two versions of MCP schemas
  • Detect structural changes in tool definitions
  • Identify field-level modifications
  • Track type changes and constraint modifications

2. Change Classification

  • Breaking Changes: Require major version bump
  • Non-Breaking Changes: Compatible with minor version bump
  • Patch Changes: Documentation and metadata updates

3. Multi-Schema Comparison

  • Compare multiple schemas across a monorepo
  • Track changes per schema file
  • Aggregate changes across schemas
  • Detect cross-schema conflicts

Usage Examples

Basic Change Detection

import { diffToolSnapshots } from '@mcp-schema-evolution/core';

const detector = new diffToolSnapshots();

const changes = oldTools, newTools);
    if (!result.ok) { throw new Error(result.error.message); }
    const changes = result.value;
    // await detector.detect(oldSchema, newSchema);

console.log(changes);
// [
//   {
//     type: 'breaking',
//     category: 'field_renamed',
//     toolName: 'createUser',
//     path: 'inputSchema.properties.name',
//     description: 'Field "name" was renamed to "full_name"',
//     severity: 'high',
//     oldValue: { type: 'string' },
//     newValue: { type: 'string' },
//     migration: { action: 'rename', from: 'name', to: 'full_name' }
//   },
//   {
//     type: 'non-breaking',
//     category: 'field_added',
//     toolName: 'createUser',
//     path: 'inputSchema.properties.middle_name',
//     description: 'Optional field "middle_name" was added',
//     severity: 'low'
//   }
// ]

Multi-Schema Detection

import { MultiSchemaDetector } from '@mcp-schema-evolution/core';

const detector = new MultiSchemaDetector();

const changes = oldTools, newTools);
    if (!result.ok) { throw new Error(result.error.message); }
    const changes = result.value;
    // await detector.detectMulti(
  [
    { path: 'schema.json', schema: oldSchema1 },
    { path: 'packages/auth/schema.json', schema: oldSchema2 }
  ],
  [
    { path: 'schema.json', schema: newSchema1 },
    { path: 'packages/auth/schema.json', schema: newSchema2 }
  ]
);

console.log(changes);
// Changes are tagged with their source schema path

Change Classification

import { ChangeClassifier } from '@mcp-schema-evolution/core';

const classifier = new ChangeClassifier();

const change = {
  category: 'type_changed',
  toolName: 'getUser',
  path: 'outputSchema.properties.age',
  oldValue: { type: 'string' },
  newValue: { type: 'number' }
};

const classification = classifier.classify(change);
console.log(classification);
// {
//   type: 'breaking',
//   severity: 'high',
//   reason: 'Type change from string to number is not backward compatible',
//   versionImpact: 'major'
// }

Semantic Version Suggestion

import { VersionSuggester } from '@mcp-schema-evolution/core';

const suggester = new VersionSuggester();

const suggestion = suggester.suggest({
  currentVersion: '1.2.3',
  changes: [
    { type: 'breaking', category: 'field_removed' },
    { type: 'breaking', category: 'tool_renamed' },
    { type: 'non-breaking', category: 'field_added' }
  ]
});

console.log(suggestion);
// {
//   suggestedVersion: '2.0.0',
//   bumpType: 'major',
//   rationale: '2 breaking changes detected requiring major version bump'
// }

Change Categories

Breaking Changes (Major Version)

CategoryDescriptionExample
TOOL_REMOVEDTool deletedlegacySearch removed
TOOL_RENAMEDTool renamedsearch → query
FIELD_REMOVEDRequired field deletedemail removed from createUser
FIELD_RENAMEDField renamed without aliasname → full_name
TYPE_CHANGEDIncompatible type changestring → number
REQUIRED_CHANGEDOptional → Requiredage now required
CONSTRAINT_CHANGEDConstraint tightenedmaxLength: 100 → maxLength: 50
DEFAULT_CHANGEDDefault removed or changed incompatiblyDefault "" removed

Non-Breaking Changes (Minor Version)

CategoryDescriptionExample
TOOL_ADDEDNew tool addedgetUser tool added
FIELD_ADDEDOptional field addedmiddle_name added to createUser
FIELD_ADDEDRequired field with defaultstatus with default "active"
TYPE_CHANGEDType widenednumber → number | null
REQUIRED_CHANGEDRequired → Optionalphone now optional
CONSTRAINT_CHANGEDConstraint relaxedmaxLength: 50 → maxLength: 100
DEFAULT_CHANGEDDefault added or relaxedAdded default "US" for country

Patch Changes

CategoryDescriptionExample
DESCRIPTION_CHANGEDDocumentation updatedTool description clarified
EXAMPLE_CHANGEDExample modifiedExample value updated
METADATA_CHANGEDSchema metadata updatedVersion bump only

Configuration Options

interface DetectionConfig {
  // Strictness level for change detection
  strictness: 'loose' | 'normal' | 'strict';

  // Whether to detect field renames automatically
  detectRenames: boolean;

  // Similarity threshold for rename detection (0-1)
  renameThreshold: number;

  // Custom change rules
  customRules: ChangeRule[];

  // Whether to include patch-level changes
  includePatchChanges: boolean;
}

const config: DetectionConfig = {
  strictness: 'normal',
  detectRenames: true,
  renameThreshold: 0.8,
  customRules: [
    {
      name: 'no-required-field-removal',
      severity: 'error',
      check: (change) => {
        if (change.category === 'field_removed' && change.oldValue?.required) {
          return { valid: false, message: 'Cannot remove required field' };
        }
        return { valid: true };
      }
    }
  ],
  includePatchChanges: false,
};

Best Practices

1. Provide Migration Hints

// Good: Includes migration guidance
{
  type: 'breaking',
  category: 'field_renamed',
  description: 'Field "name" was renamed to "full_name"',
  migration: {
    action: 'rename',
    from: 'name',
    to: 'full_name',
    codeExample: '{ full_name: data.name }'
  }
}

// Bad: No migration guidance
{
  type: 'breaking',
  description: 'Field changed'
}

2. Include Full Context

// Good: Complete context
{
  type: 'breaking',
  category: 'type_changed',
  toolName: 'createUser',
  path: 'inputSchema.properties.age',
  oldValue: { type: 'string', description: 'Age as string' },
  newValue: { type: 'number', description: 'Age as number' },
  description: 'Field "age" type changed from string to number',
  severity: 'high'
}

// Bad: Missing context
{
  type: 'breaking',
  description: 'Type changed'
}

3. Handle Nested Changes

// Good: Full path for nested fields
{
  category: 'field_added',
  path: 'inputSchema.properties.address.properties.country',
  description: 'Required nested field "country" added to "address"'
}

// Bad: Unclear path
{
  category: 'field_added',
  path: 'country',
  description: 'Field added'
}

Error Handling

// Incompatible schema versions
class IncompatibleSchemaError extends Error {
  constructor(oldVersion: string, newVersion: string) {
    super(`Cannot compare schema v${oldVersion} with v${newVersion}`);
    this.name = 'IncompatibleSchemaError';
  }
}

// Missing required schema fields
class InvalidSchemaError extends Error {
  constructor(message: string) {
    super(`Invalid schema for change detection: ${message}`);
    this.name = 'InvalidSchemaError';
  }
}

Performance Considerations

  • Incremental detection: Only compare changed portions of large schemas
  • Parallel processing: Compare independent tools concurrently
  • Caching: Cache comparison results within a run
  • Early termination: Stop on first breaking change if only checking for breaks

Testing Strategies

describe('diffToolSnapshots', () => {
  it('should detect field rename as breaking', async () => {
    const oldSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: { name: { type: 'string' } } } }]
    });
    const newSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: { full_name: { type: 'string' } } } }]
    });

    const changes = oldTools, newTools);
    if (!result.ok) { throw new Error(result.error.message); }
    const changes = result.value;
    // await detector.detect(oldSchema, newSchema);
    expect(changes).toContainEqual(expect.objectContaining({
      type: 'breaking',
      category: 'field_renamed',
      toolName: 'createUser'
    }));
  });

  it('should detect optional field addition as non-breaking', async () => {
    const oldSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: { name: { type: 'string' } } } }]
    });
    const newSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: {
        name: { type: 'string' },
        email: { type: 'string' }
      } } }]
    });

    const changes = oldTools, newTools);
    if (!result.ok) { throw new Error(result.error.message); }
    const changes = result.value;
    // await detector.detect(oldSchema, newSchema);
    expect(changes).toContainEqual(expect.objectContaining({
      type: 'non-breaking',
      category: 'field_added'
    }));
  });

  it('should classify required field addition as breaking', async () => {
    const oldSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: { name: { type: 'string' } }, required: ['name'] } }]
    });
    const newSchema = createSchema({
      tools: [{ name: 'createUser', inputSchema: { properties: {
        name: { type: 'string' },
        email: { type: 'string' }
      }, required: ['name', 'email'] } }]
    });

    const changes = oldTools, newTools);
    if (!result.ok) { throw new Error(result.error.message); }
    const changes = result.value;
    // await detector.detect(oldSchema, newSchema);
    expect(changes).toContainEqual(expect.objectContaining({
      type: 'breaking',
      category: 'field_added'
    }));
  });
});

Resources

  • ARCHITECTURE.md - System architecture
  • Change Detector section - Detailed module spec
  • mcp-schema-evolution detector - Reusable detector skill

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.