Skip to main content

Knows when a PR doesn't belong in your codebase.

Project description

VibeDiff

What changed, who wrote it, and does it belong.

PyPI Python License


AI agents write code that compiles, passes tests, and feels completely foreign in your codebase. It works — but it doesn't fit. Your naming is snake_case, the PR is camelCase. Your project uses properties, the PR is full of getter/setter methods straight out of a Java textbook. The author committed 500 lines without changing a single AI-generated variable name.

VibeDiff learns how your project actually writes code, then tells you when a PR doesn't match.

╭──────────────────────────────── VibeDiff ─────────────────────────────────╮
│                                                                           │
│  ████      3 file(s)  +180  -12                                           │
│  ██ ██                                                                    │
│  ██  ██      AI Detection           █████████░░░░░░      58    medium     │
│  ██ ██       Style Drift            ██████░░░░░░░░░      42    medium     │
│  ████        Collaboration          ██████████░░░░░      65    mixed      │
│              Idiom Contamination    ██████░░░░░░░░░      40    medium     │
│                                                                           │
╰──────────────────────────────────────────────────────────────────────────╯

──────────────── AI Detection  58/100 (medium) ─────────────────
  restating_comments    4 comments that restate the code  ███░░
  verbose_names         3/5 functions have 4+ word names  ██░░░
  low_burstiness        CV 0.31 (expected >0.6)           ██░░░

────────────────── Style Drift  42/100 (medium) ────────────────
  naming_convention     expected snake_case, got camelCase ███░░
  comment_density       expected 8%, got 22%               ██░░░

─────────────── Collaboration  65/100 (mixed) ──────────────────
  unresolved_todos      3 TODO comments left in            ██░░░
  generic_names         4/12 variables have generic names  ██░░░

──────────── Idiom Contamination  40/100 (medium) ──────────────
  getter_setter         3 getter/setter methods [java]     ███░░
  error_return_pattern  4 Go-style error returns [go]      ██░░░

Install

pip install vibediff

Usage

vibediff review HEAD~1              # review last commit
vibediff review main..feature       # review a range
vibediff review --pr 42             # review a GitHub PR (requires gh CLI)
vibediff learn                      # learn your codebase conventions
vibediff review HEAD~1 --format json  # JSON output for CI
vibediff review HEAD~1 --format md    # markdown output for PR comments

What it does

Every diff gets a letter grade (A–F) from 4 analyzers:

Analyzer What it finds
AI Detection Restating comments, verbose naming, uniform line complexity, excessive is None guards
Style Drift Naming convention mismatch, comment density deviation, function length drift, import style mismatch
Collaboration Unresolved TODOs, generic variable names, placeholder stubs, uniform style across files
Idiom Contamination Java getters in Python, Go error-returns, C-style null checks, JS callback patterns

Style Drift requires a fingerprint — run vibediff learn in your repo first.

GitHub Action

# .github/workflows/vibediff.yml
name: VibeDiff
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: doncarbon/VibeDiff@main

To enable drift detection, commit your fingerprint and pass it:

      - uses: doncarbon/VibeDiff@main
        with:
          fingerprint: .vibediff-cache/fingerprint.json

Built by Hamza · MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibediff-0.1.1.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibediff-0.1.1-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file vibediff-0.1.1.tar.gz.

File metadata

  • Download URL: vibediff-0.1.1.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vibediff-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d6cd213c066413beaac3e512fb6600fe0121ebe488488a23568338975dd92e9
MD5 ed22afb977c33c5645ba10b5fbf29b8a
BLAKE2b-256 1f4338ef0ab8149406028a566759c2f4f1f7867381cb0c3fea601e44adbf5acd

See more details on using hashes here.

File details

Details for the file vibediff-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vibediff-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vibediff-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04bc07cd2fb4fd10d5d7cd08c719781368f015a4ba2fefe4d70b0a74146e6b96
MD5 e20a822203aed098f6368b372f187467
BLAKE2b-256 395d8a40922297a32e401bc2af8ae95ea6d0bdf88e8891249b0dd1a580d64fda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page