code-humanizer skill

A skill that finds AI slop in code: duplicate helpers, empty abstractions, weak tests. It cleans one pattern per commit.

  • 95 ★ on the repository
  • Last commit
  • MIT
Skill

Extended access

Why this level

  • In fix mode the skill edits code and creates commits; by default it only produces a report.
All reasons and checks

leonardnju/code-humanizer

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add skills/code-humanizer

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • In fix mode the skill edits code and creates commits; by default it only produces a report.

This is third-party code. Review the repository files before installing.

What it does

The skill hunts for signs of AI agent work in code: duplicates of existing helpers, `_v2` clones, abstractions with one implementation, broad `except Exception`, narrating comments and tests that assert only a mock. The catalogue has 16 patterns in five tiers, each with detection signals and before and after examples. The default mode is scan and report: a findings table with pattern number, severity from 0 to 4, evidence, a proposed fix and behaviour risk. Fixes run after approval, one pattern per commit, with the test suite run after each step. Guard mode audits new changes before and after an implementation.

Who it is for. Developers whose repository was largely written by agents and who want redundant abstractions and duplicates gone without breaking behaviour.

Good fit when

  • An agent's PR adds new helpers that repeat `utils`.
  • The repository was written in a vibe-coding style and a slop report is wanted before release.
  • A new feature should run in guard mode so the agent inspects the repository first.
  • Mess is tolerated in `experiments/` but not in `src/`.

Not a fit when

  • The project has no tests; the skill then only reports findings and edits nothing.
  • Prose or documentation needs cleaning; separate humanizer skills exist for text.
  • General refactoring is wanted; the skill preserves behaviour and leaves unrelated code alone.

Example request

Use code-humanizer to scan this PR; I need a report only, no edits.

Limitations

Without tests the skill runs in report mode only. Severity 1 findings, meaning justified ones such as a documented fallback import, are left alone. Test slop is report-only by default. The last commit in the repository dates to July 2026. Fixes that affect behaviour go into separate commits labelled `[BEHAVIOR]`. Latent bugs are only reported and never silently fixed.

How to disable. Delete `~/.claude/skills/code-humanizer` or the skill folder inside a project. A skill installed through `npx skills` is removed with the same manager.

FAQ

How do I install code-humanizer in Claude Code?

Run `npx skills add LeonardNJU/code-humanizer`. Manual install means cloning the repository into `~/.claude/skills/code-humanizer`.

Does the skill change code without asking?

No. By default it only scans and reports; fixes follow your approval, one pattern per commit.

How is it different from the prose humanizer?

This catalogue targets code: 16 patterns in five tiers, from duplication to weak tests. It does not look for writing tells such as em-dashes.

What does guard mode do?

It applies the same catalogue before and after an implementation: first inspecting the repository before helpers are created, then checking only the resulting diff.

Which agents work with it?

Any agent that reads `SKILL.md` skills: Claude Code, Codex, Cursor, Cline, Gemini, Copilot and others.

Discussion

No questions or reviews yet.

Skills

A cleanup skill for agent-written code: finds surplus tests, self-checks and fallbacks and deletes them, keeping behavior

SkillExtended access140Repository stars

A skill that finds redundant abstractions and duplicate state in code and removes them safely, one proved cut at a time.

SkillExtended access203Repository stars

A skill that runs a full refactor so agents read code more easily: it finds hidden links and needless dependencies.

SkillExtended access1.1KRepository stars

An evidence-first development skill: the agent wraps code in a spec and a gauntlet of checks so line-by-line review becomes optional

SkillExtended access759Repository stars

A Codex skill for reviewing AI-written code: explains blocks, names files and lines, checks goals against evidence.

SkillExtended access133Repository stars

A code review skill with four independent probes, evidence-backed findings and a merge gate derived from JSON

SkillExtended access479Repository stars

README in short

Install steps, sample prompts, scan, fix and guard modes and the pattern catalogue by tier are described. Three iron rules apply: behaviour is preserved, no tests means no edits, one pattern class per commit. A field run on a 13.4k-line Python repository is included.

README badge

Original SKILL.md

---
name: code-humanizer
version: 0.2.0
description: Use when AI-written code needs structural cleanup or when implementing a change under a guard against AI coding slop — duplicated reimplementations of existing helpers, try-import fallbacks, broad exception swallowing, speculative abstraction layers, _v2 copies, dead "for future use" code, narrating comments — including requests to "deslop", "remove AI slop", "humanize code", review an AI-generated PR beyond tests passing, or prevent these patterns in the current change.
license: MIT
compatibility: any-agent
---

# Code Humanizer

Remove signs of AI-generated code from a repository, or prevent the same patterns in the current change with Guard mode. The prose [humanizer](https://github.com/blader/humanizer) removes AI *writing* patterns; this handles AI *coding* patterns — the structural debt agents leave behind when they optimize for "tests pass" instead of "codebase stays healthy."

**Core principle:** AI code slop is not ugly code — it is code that *works* but degrades the repository: it reimplements what already exists, adds abstraction nobody asked for, swallows errors it should surface, and hedges against situations that cannot occur. Unlike prose, code has an oracle: **the test suite decides what "meaning-preserving" means. Use it constantly.**

## Iron rules

Rules 1–4 govern **cleanup of pre-existing code** in Modes A/B. In Guard mode they apply to any cleanup performed after implementation, not to the requested feature work itself. Rule 5 applies in every mode.

1. **Behavior preservation is absolute.** "Cleanup" that changes behavior is a bug with good intentions. This includes *error types and error timing* — swapping an accidental `AttributeError` for a "nicer" `ValueError` changes behavior for every caller that catches it. If you find a latent bug or an ugly-but-load-bearing behavior: **flag it in the report; never fix it silently as part of cleanup.**
2. **No tests → no cleanup edits.** Run the test suite first. If it doesn't exist, doesn't pass, or doesn't cover the pre-existing code you'd clean, you may only **report** that debt (Mode A). Offer to write characterization tests first. This does not forbid implementing a requested change in a project whose tests are incomplete; report the verification gap.
3. **Report before rewriting pre-existing code.** Default to Mode A (scan → report). Only enter Mode B (fix) when the maintainer approves, or was explicit that they want fixes. Guard mode may directly avoid or remove slop introduced by the current change.
4. **One pattern-class per cleanup commit.** Each commit that removes pre-existing slop handles one kind and passes the full suite. A red test reverts the commit — do not "fix forward" into unrelated code. Ordinary feature commits under Guard mode need not be split by pattern when the prevention is inseparable from the implementation.
5. **Search before you judge duplication.** Build a mental index of the repo's existing helpers *before* scanning or implementing (grep `utils`, `helpers`, `common`, validators, existing base classes). You cannot recognize a reimplementation if you don't know what exists.

## Pattern catalog

Severity per finding: **0** absent · **1** present but justified (→ exempt, do not touch) · **2** minor debt · **3** clear debt, raises future maintenance cost · **4** severe, breaks semantics or architecture boundaries.

### Tier 1 — Duplication and reinvention

**1. Reimplementing an existing helper** *(the signature AI tell)*
**Signals:** new private function whose body resembles something in `utils`/`helpers`/a sibling module; a regex/validation/parsing/formatting block that the repo already owns; new code that imports nothing from the package it lives in.
**Problem:** agents write code from the prompt outward, not from the repo inward. Every duplicate forks future fixes.
```python
# Before — repo already has utils.validate_email
def _is_valid_email(s):
    pattern = r"^[\w.+-]+@[\w-]+\.[\w.]+$"
    if re.match(pattern, s):
        return True
    return False

Report a problem