analyze-code-densitylisted
Install: claude install-skill Max-Levitskiy/skills
# Code Density Analyzer (score mode)
Detect AI-code slop — repeated logic, filler constructs, and reviewer-repellent
patterns — and score how dense the code is. This skill only reports; it never
edits code.
## Step 0: Determine target and mode
**Diff mode** (preferred) — use when inside a git repository and any of:
- the user names a branch/PR/commit range → target = that range's diff
- uncommitted changes exist → target = `git diff HEAD` (staged + unstaged)
**Standalone mode** — use when the user names specific files/snippets, or no git
repo is present. If ambiguous, ask: "Analyze the current diff, or specific files?"
## Step 1: Assemble the analysis input
Both modes: number all lines (`cat -n` style) and prefix each file with its path.
Diff mode:
1. Collect the diff and the full post-change content of each changed file
(subagents need surrounding context, not just hunks).
2. Build repo-context excerpts, bounded to ~300 lines total: for each changed
file, include the signatures + docstrings of util/helper modules it imports
or that live in obviously shared locations (`utils/`, `lib/`, `common/`,
`helpers/`), plus one sibling file as a convention sample. Use
`grep -rn "def \|function \|class " <shared dirs> | head -80` to build a
signature index rather than pasting whole files.
3. If the diff exceeds ~3000 changed lines, split by top-level directory and run
the whole analysis per split, then report per-split scores.
Standalone mode: the named file