Get the FREE Ultimate OpenClaw Setup Guide →

brewcode:text-human

npx machina-cli add skill kochetkov-ma/claude-brewcode/text-human --openclaw
Files (1)
SKILL.md
9.9 KB

Text Humanizer

Detect and remove AI-generated artifacts from code and documentation. Process commits, files, or folders with parallel sub-agents.

Language References

LanguageReferenceLoad When
Java/Kotlin@reference/java.md*.java, *.kt, *.groovy, Spring, Maven/Gradle
TypeScript/JS/React@reference/typescript.md*.ts, *.tsx, *.js, *.jsx, Node.js, React
Python@reference/python.md*.py, Django, FastAPI, Flask

Multi-language projects: Load ALL relevant references.


Argument

First token = scope (required):

InputAction
NoneUse AskUserQuestion: "What to humanize?" Options: "Commit hash (git diff)" / "File path" / "Folder path"
Commit hash (7+ hex)Process all text files from commit
File pathProcess single file
Folder pathProcess all files in folder
"entire project"Use AskUserQuestion: "Too broad — specify scope." Options: "Specific folder" / "File pattern (e.g. src/**/*.java)"

Everything after first token = custom prompt (optional). Free-form text, no quotes needed. Overrides or extends default humanization rules for this run. Passed to every sub-agent prompt.

Custom Prompt Handling

  1. Parse: split args into scope (first token) and customPrompt (rest)
  2. If customPrompt is present, prepend it to every sub-agent Task prompt as:
    CUSTOM INSTRUCTIONS (highest priority, override defaults):
    <customPrompt>
    
  3. Custom prompt wins over default rules on conflict

Architecture

Orchestrator -> Detect Language -> Load Reference -> Analyze -> Classify -> Split (3-10 blocks) -> Parallel Task agents -> Aggregate

Phase 1: Scope Analysis

Commit Mode

Process all text files from commit. No extension filtering: git diff --name-only <hash>^..<hash>

File Inclusion Rules

IncludeExclude
Source code (*.java, *.kt, *.py, *.ts, *.js, etc.)Binary files (*.class, *.pyc, *.exe)
Config (*.xml, *.yaml, *.yml, *.json, *.toml)Images (*.png, *.jpg, *.gif, *.ico)
Docs (*.md, *.txt, *.rst)Archives (*.zip, *.tar, *.gz)
Build files (pom.xml, package.json, pyproject.toml)Generated (target/, build/, dist/, node_modules/)
SQL (*.sql, *.ddl)Lock files, IDE files

Path Mode

find <path> -type f \( -name "*.java" -o -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.md" \) | grep -v -E "(target/|node_modules/|\.git/|build/|dist/|__pycache__/)"

Block Count

FilesLinesBlocks
1-2<2001 (direct)
3-5<5003
6-10500-15005
11-201500-30007
21+3000+10

Single file: process directly without Task delegation.

Phase 2: File Classification

Haiku (Simple)

TypePatterns
Config*.properties, *.yaml, *.yml, *.toml, *.ini
Data*.json, *.csv
Text*.txt, *.md
Simple SQLSingle CREATE/ALTER, no CTEs/subqueries
Small files<50 lines, no logic

Sonnet (Complex)

TypePatterns
Source with logicBusiness logic, algorithms
TestsTest files for any framework
Complex SQLCTEs, window functions, JOINs, subqueries
Config classesFramework configuration

Note: See language-specific references for detailed classification rules.

Phase 3: Block Formation

Group files by type, complexity (avoid mixed haiku/sonnet), line count balance. Keep related files together (same package/directory).

Data files block: YAML, JSON, CSV with comments → haiku for unicode fixes

Phase 4: Parallel Execution

Launch all Task calls in single message for true parallelism.

Task(subagent_type="developer", model="haiku", prompt="> **Context:** BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook).\n\n[CUSTOM_INSTRUCTIONS_IF_ANY]\nBlock 1: [files] [rules] Return JSON")
Task(subagent_type="developer", model="sonnet", prompt="> **Context:** BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook).\n\n[CUSTOM_INSTRUCTIONS_IF_ANY]\nBlock 2: [files] [rules] Return JSON")

If custom prompt was provided, prepend to EVERY sub-agent prompt (after the Context line):

> **Context:** BC_PLUGIN_ROOT is available in your context (injected by pre-task.mjs hook).

CUSTOM INSTRUCTIONS (highest priority, override defaults):
<user's custom prompt text>
---

<output_format> { "files_processed": N, "changes": [{"file": "path", "removed_comments": N, "fixed_unicode": N, "simplified_docs": N}] } </output_format>

Phase 5: Aggregation

Collect JSON results from all agents → merge statistics → generate unified report.


<humanization_rules>

AI Artifacts (Universal)

PatternAction
// Added by AI, // Claude suggestion, // AI-generated, // Generated byDelete
# Added by AI, # Claude suggestionDelete
/* Suggested by */Delete block
AI-invented issue numbers (BUG-001, FIX-123, ISSUE-1)Delete
Unicode long dash (U+2014)Replace → --
Unicode arrows (→, ←, ⇒)Replace → ->, <-, =>
Unicode bullets (•, ◦)Replace → - or *
Unicode quotes (" " ' ')Replace → " or '

Real vs Fake Issue References

Keep project-specific ticket patterns (INTELDEV-XXXXX, JIRA-XXXXX, GH-XXX). Remove generic AI-invented patterns (BUG-001, FIX-123, ISSUE-42).

Documentation Cleanup (General Principles)

RemoveKeep
Private/internal function docsPublic API documentation
Test file documentationComplex algorithm explanation
Obvious classes/functions (name = purpose)Non-obvious behavior/side effects
Trivial parameter docs (restates name)@throws/Raises with conditions
Trivial return docs (restates function)External API contracts

Key Rule: Never convert block docs to inline comments. Delete unnecessary docs entirely; for useful descriptions with trivial params, strip params and keep description.

Comments (Universal)

Keep WHY, remove WHAT.

RemoveKeep
// Initialize the list// Retry 3x due to flaky external API
// Loop through items// Uses UTC to match database timezone
// Check if null// Thread-safe: synchronized on class lock
Stale // TODO: refactor this// HACK: workaround for <issue-link>

Formatting (Universal)

IssueFix
/* single line */// single line or # single line
3+ blank linesMax 2
Trailing whitespaceRemove
Mixed tabs/spacesSpaces

</humanization_rules>


File Type Rules

TypeRules
Source codeFull doc cleanup per language reference
Test filesRemove all docs, keep test descriptions
SQL/XMLPreserve structural comments
MarkdownRemove AI disclosures, fix unicode
YAML/PropertiesFix unicode, keep config explanations
JSON/CSVCheck for comments with unicode, usually skip

YAML/Data Files

Check for unicode in comments. Section comments are valuable.

ActionExample
FIX# Lane 90001→10001# Lane 90001->10001
KEEP# ===== VAN loads for test =====
SKIPPure data without comments

SQL/XML Comments

Structural comments are valuable. Analyze neighboring files first.

ActionExample
KEEPSection headers -- ============ TABLES ============
KEEPBlock separators <!-- ===== Mappers ===== -->
KEEPColumn/field documentation
REMOVEExact duplicates, AI markers

Custom Prompt Mode

Custom prompt overrides or extends default rules. Use for:

  • Restricting scope: "only remove AI artifacts, don't touch docs"
  • Adding rules: "also remove all @author tags"
  • Excluding files: "skip test files"
  • Style reference: "use style from src/main/Service.java as reference"

Output Format

## Humanization Report

### Execution Summary
| Metric | Value |
|--------|-------|
| Total files | N |
| Blocks | M |
| Haiku/Sonnet | X/Y |

### Block Results
[Per-block tables with file metrics]

### Totals
| Metric | Count |
|--------|-------|
| Files processed | N |
| Comments removed | X |
| Docs simplified | Y |
| Unicode fixed | Z |

Best Practices

  • Load language reference first
  • Process all commit files (include yaml/data files)
  • Check yaml for unicode (comments may have arrows)
  • Preserve valuable comments (they add context)
  • Skip binaries (avoid corruption)
  • Honor style reference if provided
  • Keep public API docs
  • Group files by complexity
  • Launch agents in parallel

Error Handling

ErrorAction
Agent timeoutContinue with other blocks
File read errorSkip, note in report
Binary fileSkip, note in report
No changesReport "No humanization required"

Examples

/text-human 3be67487                                              # Commit - all files
/text-human src/main/java/MyService.java                          # Single file
/text-human src/main/java/services/                               # Folder
/text-human 3be67487 don't touch docs on public records           # Commit + custom prompt
/text-human src/ only remove AI artifacts and fix unicode         # Path + custom prompt
/text-human 3be67487 also remove all @author tags                 # Commit + extra rule

Source

git clone https://github.com/kochetkov-ma/claude-brewcode/blob/main/brewcode/skills/text-human/SKILL.mdView on GitHub

Overview

Text Humanizer detects and removes AI-generated artifacts from code and documentation. It cleans comments, simplifies docs, fixes unicode, and makes code more readable by processing commits, files, or folders with parallel sub-agents.

How This Skill Works

The tool loads language-specific references for the target files, identifies AI-generated artifacts and comments, and cleans or restructures them. It follows a workflow: Orchestrator detects language, loads references, analyzes and classifies content, splits into 3-10 blocks, runs parallel sub-agent tasks, and aggregates the results into a human-friendly output.

When to Use It

  • Humanizing code for contributors or handover
  • Removing AI-generated comments from source files
  • Cleaning and standardizing project documentation
  • Fixing Unicode issues in code or docs
  • Improving overall code readability across a multi-language repo

Quick Start

  1. Step 1: Define scope (commit hash, file path, folder path, or 'entire project')
  2. Step 2: Optionally add CUSTOM INSTRUCTIONS to steer the humanization
  3. Step 3: Run the task and review the aggregated results

Best Practices

  • Run on targeted scope (commit, file, or folder) with appropriate extension filters
  • Load all relevant language references in multi-language projects
  • Use a custom prompt to enforce project-specific rules or tone
  • Review cleaned artifacts to ensure essential comments and explanations are preserved
  • Leverage parallel sub-agents to speed up processing on large codebases

Example Use Cases

  • Process a Java file to strip generated AI comments and normalize whitespace
  • Clean Markdown docs in a repo and fix broken Unicode characters
  • Process a git diff to humanize all touched text files
  • Run on a multi-language project (JavaScript and Python) to remove AI artifacts
  • Convert AI-generated code comments into human-friendly explanations in a Kotlin module

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers