Get the FREE Ultimate OpenClaw Setup Guide →

diff

npx machina-cli add skill ConaryLabs/Mira/diff --openclaw
Files (1)
SKILL.md
2.2 KB

Semantic Diff Analysis

Analyze git changes semantically with classification, impact analysis, and risk assessment.

Arguments: $ARGUMENTS

Instructions

  1. Parse optional arguments:

    • --from REF → Starting git ref (default: HEAD~1 or staged changes)
    • --to REF → Ending git ref (default: HEAD)
    • --no-impact → Skip impact analysis (faster)
  2. Use the mcp__mira__diff tool:

    diff(from_ref="...", to_ref="...", include_impact=true)
    
  3. Present results in sections:

Change Classification

  • NewFunction: Entirely new functions/methods
  • ModifiedFunction: Changed existing functions
  • DeletedFunction: Removed functions
  • NewFile: New files added
  • Refactored: Structural changes without behavior change

Impact Analysis

  • What callers are affected by these changes
  • Which modules depend on modified code
  • Potential ripple effects

Risk Assessment

  • Breaking changes: API signature changes, removed exports
  • Security relevance: Auth, input validation, crypto changes
  • Test coverage: Are changes covered by tests?

Examples

/mira:diff
→ Analyzes staged/working changes vs HEAD

/mira:diff --from main
→ Analyzes current branch vs main

/mira:diff --from v1.0 --to v1.1
→ Analyzes changes between tags

/mira:diff --no-impact
→ Quick classification without call graph analysis

Example Output

## Semantic Diff Analysis

### Changes (5 files, +142 -38 lines)

**New Functions:**
- `validate_token()` in src/auth.rs:45

**Modified Functions:**
- `handle_login()` in src/auth.rs:23 (added rate limiting)
- `create_session()` in src/session.rs:67 (changed return type)

### Impact Analysis
- `handle_login()` is called by 3 endpoints
- `create_session()` change affects 12 callers

### Risk Assessment
[WARNING] **Breaking**: `create_session()` return type changed
[SECURITY] **Security**: Rate limiting added (positive)

Source

git clone https://github.com/ConaryLabs/Mira/blob/main/plugin/skills/diff/SKILL.mdView on GitHub

Overview

Analyze git changes semantically with classification, impact analysis, and risk assessment. This helps you understand what changed, how it affects callers and modules, and what to test for during reviews.

How This Skill Works

The skill parses optional arguments (--from, --to, --no-impact) to determine the diff range, then calls the mcp__mira__diff tool with include_impact=true. It presents results in three sections: Change Classification, Impact Analysis, and Risk Assessment, detailing new/modified/deleted elements, affected call sites, and potential breaking or security implications.

When to Use It

  • Analyze changes between two refs to understand what was added, modified, or removed
  • Review staged changes vs HEAD to preview what will be committed
  • Compare current branch against a base branch (e.g., main) to assess drift
  • Assess impact across callers and modules before merging
  • Identify potential breaking or security implications and test coverage gaps

Quick Start

  1. Step 1: Run /mira:diff with optional --from <ref> and --to <ref> to define the range
  2. Step 2: Read the output sections: Change Classification, Impact Analysis, Risk Assessment
  3. Step 3: Use the findings to guide code reviews, testing, and release readiness

Best Practices

  • Specify --from and --to for reproducible, audit-friendly diffs
  • Use --no-impact for fast classification when deep analysis isn’t needed
  • Review all Change Classification categories to spot subtle refactors
  • Correlate Impact Analysis with dependent modules and call graphs
  • Cross-check findings against existing tests and expand coverage if needed

Example Use Cases

  • Analyze staged/working changes vs HEAD to preview a commit
  • Compare current feature branch against main to verify integration points
  • Review changes between tags v1.0 and v1.1 for release notes
  • Perform quick classification with --no-impact during early reviews
  • Audit for breaking API changes and verify test coverage implications

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers