Diffloupe

From markerikson/opencode-config-example · View interactive version

Diffloupe is an AI agent skill from the GitHub repository markerikson/opencode-config-example. Run DiffLoupe AI code analysis for diff understanding and review

How to use this skill

Skill file

DiffLoupe Skill

DiffLoupe is an AI-powered diff analysis tool that provides:

When to Use

Invocation

Use the wrapper script:

~/.config/opencode/scripts/diffloupe.ts <command> [args]

CLI Reference

Analyze Local Changes

diffloupe.ts analyze [target]

Targets:
  staged (default)    # git diff --cached
  unstaged            # git diff
  HEAD                # git diff HEAD
  branch:NAME         # git diff NAME...HEAD
  commit:HASH         # single commit
  range:A..B          # commit range

Options:
  -i, --intent "..."    # Stated intent for alignment
  --intent-file PATH    # Read intent from file
  -v, --verbose         # Full output
  --json                # JSON output
  -C, --cwd PATH        # Run in directory

Analyze GitHub PRs

diffloupe.ts pr <identifier>

Identifiers:
  123                   # PR number (current repo)
  owner/repo#123        # Cross-repo PR
  https://github.com/.../pull/123  # URL

Options:
  -R, --repo owner/repo # Specify repository
  -v, --verbose         # Full output
  --json                # JSON output

Preview Without API Call

diffloupe.ts summarize [target]

Options:
  --stats               # Only file list + tokens
  --files-only          # Only file list
  --json                # JSON output

Output Structure (JSON)

{
  "intent": {
    "summary": "...",
    "purpose": "...",
    "scope": "feature|bugfix|refactor|config|docs|test|mixed",
    "affectedAreas": ["..."],
    "suggestedReviewOrder": ["file1.ts", "file2.ts"]
  },
  "risks": {
    "overallRisk": "low|medium|high|critical",
    "summary": "...",
    "confidence": "high|medium|low",
    "risks": [
      {
        "severity": "low|medium|high|critical",
        "category": "security|breaking-change|performance|...",
        "description": "...",
        "evidence": "...",
        "file": "...",
        "mitigation": "..."
      }
    ]
  },
  "alignment": {
    "alignment": "aligned|partial|misaligned",
    "confidence": "high|medium|low",
    "summary": "...",
    "matches": ["..."],
    "mismatches": ["..."],
    "missing": ["..."],
    "unstated": ["..."]
  }
}

Integration Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.