Skip to content

Ruiqi-Yan/HumanizeCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HumanizeCode

English | 简体中文

A Claude Code / OpenCode skill that removes signs of AI-generated code from a codebase while preserving behavior. It is the code-focused companion to the prose humanizer skill, with one non-negotiable difference: code has to keep working, so verification is built into the workflow.

How it works

AI-generated code has a fingerprint: redundant comments, decorative banners, emoji, dictionary-length names, reflexive try/except, defensive null-guards in places that cannot fail, tiny single-use functions, speculative abstraction, dead code, and a suspiciously uniform shape. This skill rewrites those tells into the style a competent human on your team would use, without changing what the code does.

It runs a test-guarded detect-modify-verify loop:

  1. Scope and safety net (Phase 0). Map the functional contract, enumerate the edge cases that must keep working, run the existing tests for a green baseline, and write tests to fill any gaps. These tests are the arbiter for everything that follows.
  2. Detect. Scan for AI tells, looking for clusters and style fractures rather than isolated patterns.
  3. Modify. Rewrite flagged code into the surrounding codebase's style. Behavior-preserving changes only.
  4. Verify. Re-run the suite after every change. If a test goes red, a "defensive" block was actually load-bearing: restore it, or move the check to the system boundary where it belongs.

Repeat until there are no remaining tells and the full suite is green.

The prime directive: never trade correctness for naturalness. The tests, not a gut feeling, decide whether a guard is slop or a safeguard.

Installation

Claude Code

mkdir -p ~/.claude/skills
git clone https://github.com/Ruiqi-Yan/HumanizeCode.git ~/.claude/skills/humanize-code

Or copy the skill file manually:

mkdir -p ~/.claude/skills/humanize-code
cp SKILL.md ~/.claude/skills/humanize-code/

OpenCode

mkdir -p ~/.config/opencode/skills
git clone https://github.com/Ruiqi-Yan/HumanizeCode.git ~/.config/opencode/skills/humanize-code

Usage

/humanize-code

Clean up the AI tells in src/auth/ — keep the behavior identical and the tests green.

Or ask directly:

Humanize the code in this module: remove the AI patterns but don't change what it does.

The skill will establish a test baseline first, then work through the detect-modify-verify loop and report which "defensive" blocks turned out to be real safeguards.

Pattern catalog

24 numbered patterns across six groups. Examples in the skill span Python and JavaScript/TypeScript; the patterns are language-agnostic.

A. Comments and documentation

  1. Redundant comments that restate the code
  2. Over-structured docstrings and headers on everything
  3. Decorative comment dividers and banners
  4. Emoji in code, comments, and docs
  5. Exhaustive project-structure trees with file icons
  6. Diff-anchored comments that narrate a change

B. Naming

  1. Over-descriptive, dictionary-length names
  2. Generic placeholder names and leftover scaffolding

C. Defensive code and error handling

  1. try/except around code that cannot fail
  2. Over-broad exception catching that swallows errors
  3. Reflexive null-guards and default-value fallbacks
  4. Field-name guessing
  5. Excessive type and argument validation in internal code

D. Structure and abstraction

  1. Over-decomposition into tiny single-use functions
  2. Speculative abstraction and unrequested design patterns
  3. Suspiciously uniform shape
  4. Dead code, redundant helpers, and unused imports
  5. Non-idiomatic solutions
  6. Over-engineered scaffolding for trivial scripts

E. Project artifacts

  1. Commit messages
  2. PR descriptions
  3. Unrequested README sections
  4. Hallucinated and undeclared dependencies (slopsquatting)

F. The meta-signal

  1. Style fractures

What it won't touch

Over-correcting code is worse than over-correcting prose, because you can break it. The skill deliberately preserves:

  • Defensive code at real boundaries (HTTP params, user input, third-party responses, env vars).
  • Comments that explain a genuine why.
  • Type annotations and descriptive names that match the project's conventions.
  • Test code (legitimately uniform and repetitive).
  • Framework-required boilerplate and machine-generated files.
  • A single isolated tell. It looks for clusters, not one-offs.

Status and contributing

This skill is under active testing and iteration. Its reliability has not yet been fully established, and it may produce false positives or remove code incorrectly. Use it with caution. The patterns, workflow, and exit criteria are still being refined against real codebases, so expect changes. Bug reports, new pattern examples, and pull requests are very welcome.

Acknowledgements

This skill builds directly on the prose-focused humanizer skills, and adapts their structure and philosophy to code:

The pattern catalog synthesizes observations from many write-ups, studies, and community discussions on AI-generated code. Thanks to all of the authors below for documenting these patterns:

Spotting AI-written code (code-review perspective)

LLM code quality, smells, and technical debt

Defensive-coding overuse and over-engineering

Hallucinated dependencies (slopsquatting)

Behavioral guidelines that informed the workflow

License

MIT

About

Claude Code skill that removes signs of AI-generated code

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors