lint-changed

Detects new detekt violations on changed Kotlin files by diffing SARIF reports against the base branch.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/Zeyad-37/tech-agency --skill lint-changed-zeyad-37
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lint-changed
Source: https://github.com/Zeyad-37/tech-agency/tree/main/.claude/skills/lint-changed
Command: npx skills add https://github.com/Zeyad-37/tech-agency --skill lint-changed-zeyad-37

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq.

What problem does it solve? When a project's full-repo detekt run is broken by hundreds of pre-existing violations and no committed baseline, developers cannot tell which violations their own branch introduced. This Skill lints only the Kotlin files changed on the current branch and diffs the SARIF output against the base branch, surfacing only new violations. ## Core Features & Use Cases - SARIF diffing: Runs detekt on changed files in both the current tree and a detached worktree of the base branch, then reports only violations present in the new output. - Safe base comparison: Reads the base branch from a throwaway git worktree instead of stashing or checking out, so uncommitted work and concurrent sessions are unaffected. - Configurable base branch: Accepts a --base flag or auto-resolves the remote HEAD branch, so branches cut from epic integration branches diff against the correct base. - Use Case: Before pushing a Kotlin change in a repo where ./gradlew detekt fails on legacy code, run this Skill to confirm your branch introduces zero new violations. ## Quick Start Ask the AI to lint the Kotlin files changed on the current branch against the base branch and report only newly introduced detekt violations.

Frequently Asked Questions about lint-changed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I lint only changed Kotlin files with detekt?▼

Run detekt on the files changed versus the base branch using git diff --name-only with the merge base, then pass that file list to the detekt Gradle task or CLI. Diffing the SARIF output against the base branch filters out pre-existing violations.

How to find only new detekt violations introduced by my branch?▼

Generate SARIF reports for the changed files in both your working tree and a detached worktree of the base branch, then diff the (file, line, ruleId, message) tuples with jq and comm. Tuples present only in the new report are violations your branch introduced.

Can I run detekt against a base branch without stashing my changes?▼

Yes. Create a detached git worktree of the base branch in a temporary directory and run detekt there, leaving your current worktree untouched. This avoids the dangers of git stash pop on a clean tree and works alongside concurrent sessions.

What are the limitations of running detekt on individual files?▼

File-scoped detekt may miss rules that rely on cross-file context, such as unused-public-API checks. Renamed files also appear as new files and may report violations that existed under the old name, so results are best-effort compared to a baseline-driven full-repo run.

Why does the lint diff report every violation as new?▼

This happens when the baseline detekt run produces no SARIF output, making the baseline look empty. The workflow treats a missing baseline SARIF as a hard failure rather than silently reporting all pre-existing violations as new.