Skip to content
Back to skills

Naturalize

BSecurity

Rewrites machine-sounding text so it reads as a person wrote it, keeping its facts, or audits it for AI tells. Use for "humanize this text", "make this sound less like AI", "check this for AI tells". Not for new copy (use copywrite).

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 6, 2026
ai-agentspythongobashgitdocumentation

Works with

  • cli

Security analysis

B75/100
  • criticalSends environment variables or credentials to an external URL

Pro scans all 2 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add DoctorMozg/claude-pipelines --skill naturalize --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Naturalize?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Naturalize
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/doctormozg-naturalize/badge)](https://www.skillsdirectory.com/skills/doctormozg-naturalize)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: naturalize
description: 'Rewrites machine-sounding text so it reads as a person wrote it, keeping its facts, or audits it for AI tells. Use for "humanize this text", "make this sound less like AI", "check this for AI tells". Not for new copy (use copywrite).'
argument-hint: <text or @file:path> [mode:audit|profile] [register:<name>] [preserve:<terms>] [voice:@file:<profile>] [allow:<punctuation>] [research:yes]
allowed-tools: Agent, Bash(${CLAUDE_PLUGIN_ROOT}/scripts/forbidden-punctuation.sh *), Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/text_checks.py *), Bash(diff -u *), Bash(git rev-parse *), Bash(date *), Read, Write, Edit, Glob, Grep, AskUserQuestion
---

# Text Naturalization Pipeline

## Overview

Rewrites machine-sounding text in one pass with no approval gates. A script scans the text, `expert-naturalizer` (sonnet) edits only what it flagged plus the shapes the structural reference describes and removes banned punctuation, and checks confirm every fact unit survived and no new tell appeared, with one fix-only re-dispatch. Word lists live only in the script's pattern table, which the agent never reads. It doesn't make text pass AI detectors, and `voice:` moves text toward a writer's measured habits without impersonating them. File input is overwritten in place, with the original kept in the task folder and a diff shown at the end.

## When to Use

Rewrites existing AI-generated prose so it reads as human-written, or audits it for AI tells.

### When NOT to use

- User wants original technical documentation written from scratch — use `document` (which already runs naturalize as Phase 3)
- User wants new promotional copy written rather than existing text rewritten — use `copywrite` (which also naturalizes)
- User wants to fix grammar in human-written text — this skill assumes AI patterns are present and may damage natural prose
- User wants to translate text — use `translate`

## Input

`$ARGUMENTS` — the text to rewrite or a file reference. Forms accepted:

- Inline text following the skill invocation (the entire arg block becomes the input)
- `@file:<path>` — read text from the specified file; the rewrite overwrites it in place
- `mode:audit` — report only: writes its report and task files under `.mz/`, no other file
- `mode:profile` — build a voice profile from `@file:` samples
- `register:<name>` — names the audience for `voice:`, and in profile mode groups the `@file:` samples that follow it; the default is `general`
- `preserve:<term>[,<term>...]` — terms the rewrite keeps verbatim, such as a flagged domain word
- `voice:@file:<path>` — a voice profile as `mode:profile` writes it (free-form notes work, without rate caps). The agent rewrites toward the register it matches
- `allow:<name>[,<name>...]` — punctuation the ban lets through: `em-dash`, `en-dash`, `semicolon`, `ellipsis`, `arrow`
- `research:yes` — `pipeline-web-researcher` pulls patterns newer than the shipped pattern table, added to that run's scan
- `unit:<path>` — worker mode, set by mz-orchestrate. The brief's `## Spec` names the files and choices, and `<PLUGIN_ROOT>/shared/worker-mode.md` overrides every question in this skill and its phase files. See Worker Mode below.

If `$ARGUMENTS` is empty, ask via `AskUserQuestion` for either inline text or a file path. Never guess.

## Constants

- **PROJECT_ROOT**: resolved once in setup with `echo "${MZ_MEMORY_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"`; expand `<PROJECT_ROOT>` to it in every command and agent prompt.
- **TASK_DIR**: `<PROJECT_ROOT>/.mz/task/`
- **REPORT_DIR**: `<PROJECT_ROOT>/.mz/reports/`
- **SKILL_DIR**: `${CLAUDE_SKILL_DIR}`
- **PLUGIN_ROOT**: `${CLAUDE_PLUGIN_ROOT}`. Skill and phase files write `<SKILL_DIR>/...` and `<PLUGIN_ROOT>/...` because files opened with Read get no variable substitution; expand each to its absolute path before reading a file, running a command, or passing a path to an agent.
- **TEXT_CHECKS**: `python3 ${CLAUDE_PLUGIN_ROOT}/scripts/text_checks.py`, subcommands `facts`, `scan`, `copy` and `profile`; exit 0 when clean, 1 with problem lines on stdout, 2 on a usage error or unusable input (one stderr line). Run it with the absolute path so the Bash grant matches.
- **STRUCTURAL_REFERENCE**: `${CLAUDE_SKILL_DIR}/references/structural-patterns.md`
- **MAX_FIX_DISPATCHES**: 1 (each extra rewrite pass drifts meaning)
- **CHUNK_THRESHOLD**: 2000 `words` in `findings.json` (above it the agent rewrites section by section)
- **PUNCTUATION_CHECK**: `${CLAUDE_PLUGIN_ROOT}/scripts/forbidden-punctuation.sh` (each `--preserve <term>` exempts a preserved term and each `--allow <name>` an allowed character; exit 0 when clean, 1 with one `file:line: <name> <char>` line per hit, 2 on a usage error or a file it can't read)

## Core Process

### Phase Overview

| Phase   | Goal                           | Details               | Loop                     |
| ------- | ------------------------------ | --------------------- | ------------------------ |
| 0       | Setup                          | Inline below          |                          |
| 1       | Scan and fact inventory        | `phases/scanning.md`  |                          |
| 2       | Rewrite (expert-naturalizer)   | `phases/rewriting.md` |                          |
| 3       | Check and apply                | `phases/checking.md`  | one fix-only re-dispatch |
| audit   | Audit report (`mode:audit`)    | `phases/audit.md`     |                          |
| profile | Voice profile (`mode:profile`) | `phases/profile.md`   |                          |

No phase asks for approval. File input is safe to overwrite because `input.md` keeps the original and the run ends with a diff.

### Phase 0: Setup

1. Resolve `PROJECT_ROOT` with the command in Constants, before any `cd` or worktree switch, and use it for every `.mz/` path below.
1. Parse `$ARGUMENTS`. Detect inline text vs `@file:` reference, `mode:`, `register:`, `preserve:` terms, `voice:`, `allow:` names and `research:yes`. Without `mode:` the run rewrites.
1. If empty → `AskUserQuestion` for input source. Never guess.
1. Both `mode:audit` and `mode:profile`, or an unknown `mode:` value → `AskUserQuestion` with Rewrite, Audit and Profile as options.
1. If `@file:` referenced, read the file and verify it is text (not binary, not too large to fit in context — if >50KB, warn the user).
1. If `voice:` is given, read the profile and verify it is text. A missing or binary profile → `AskUserQuestion` to fix the path or run without one.
1. Every `allow:` name must be one of `em-dash`, `en-dash`, `semicolon`, `ellipsis`, `arrow`. An unknown name → `AskUserQuestion`, listing the valid names.
1. In profile mode every `register:` name must start with a lowercase letter and hold only lowercase letters, digits and hyphens (`client`, `work-2`), the rule `<TEXT_CHECKS> profile` enforces. A name that breaks it → `AskUserQuestion`, quoting the name and the rule.
1. `task_name` = `<YYYY_MM_DD>_naturalize_<slug>` where slug derives from the input (file basename or first 5 words of inline text). On collision append `_v2`, `_v3`.
1. Write the input text verbatim to `<PROJECT_ROOT>/.mz/task/<task_name>/input.md` with the Write tool, which creates the folder (not Bash, which a sandbox may mount read-only). For `@file:` input this copy is the original the diff compares against. In profile mode, write each sample verbatim to `<PROJECT_ROOT>/.mz/task/<task_name>/samples/<register>_<n>.md` instead, `<register>` being the `register:` before it.
1. With `voice:`, write the profile verbatim to `<PROJECT_ROOT>/.mz/task/<task_name>/voice.md` the same way, so the agent and the scripts read it inside the project.
1. Write `state.md` with the schema keys and the State Management keys setup already knows.
1. Emit a visible setup block: `task_name`, mode, input source, words, register, preserve terms, voice profile, allowed punctuation, research flag.

Read each phase file as its phase starts, as `Read <SKILL_DIR>/phases/<file>`. A rewrite runs `phases/scanning.md`, `phases/rewriting.md` and `phases/checking.md`. `mode:audit` runs scanning, then `phases/audit.md`. `mode:profile` runs only `phases/profile.md`.

## Worker Mode

With a `unit:<path>` token, `<PLUGIN_ROOT>/shared/worker-mode.md` overrides every question in this skill and its phase files. These steps replace the parts they name:

- **Brief.** Read it; its `kind` is `change`. Parse the `## Spec` as the argument: the files to rewrite (as `@file:` references or plain paths) and any `preserve:`, `voice:`, `register:`, `allow:` or `research:yes` choices, in those forms or in prose. Every named file must sit inside `owns`; the rewrite is in place, as for any file input.
- **Setup.** Follow worker-mode.md, "Setup", instead of the empty-argument question: `task_name` is `<YYYY_MM_DD>_naturalize_<id-slug>`, started fresh with `_vN` on a collision. `state.md` gets `worker_unit: <path>` and `unattended: worker`, written with the Write tool before Phase 1. With several files, `state.md` stays at the task root and each file runs Phases 1 to 3 in its own subfolder `<task_name>/<file-slug>/`, holding its own input, output, findings, facts and report.
- **Choices.** Where the skill would ask, the spec settles it. A choice the spec doesn't give takes the skill's default: no `preserve:`, no `voice:`, no `register:`, no `allow:` and no research. A missing or binary `voice:` profile, or an unknown `allow:` name, is a blocker: a default isn't the writer's choice.
- **Pipeline.** Run every phase for every file, plus `pipeline-web-researcher` first when the spec asks for research: the scan, the `expert-naturalizer` rewrite and the checks, including the one fix-only re-dispatch.
- **Gates.** There is no approval gate: the overwrite and the diff already run unasked. Log it in `state.md` and the final message as `outcome: auto-approved (worker)` with `authority: mz-orchestrate DAG gate, unit <id>`.
- **Blockers.** No file named, a named file that is missing, binary or over 50KB, a file outside `owns`, inline text with no file to rewrite, a spec asking for `mode:audit` or `mode:profile` (a change unit rewrites files; reports need a session), `text_checks.py` exit 2 on the input, a missing `voice:` profile, an unknown `allow:` name, a `BLOCKED` return from `expert-naturalizer`, a `NEEDS_CONTEXT` that the one re-dispatch doesn't settle, and a `state.md` with a higher `schema_version`: record the question in `state.md`, set `Status: blocked` and end `STATUS: BLOCKED`. Files that need no answer are still rewritten first.
- **Final message.** After the Verification block, add `## Files changed` (rewritten files, one per line), `## Verify` (the brief's `verify` command and its result, or not run and why), `## Concerns` when any check left lines, and the status line last. A check that still reports lines is `STATUS: DONE_WITH_CONCERNS`.

## Common Rationalizations

| Rationalization                                               | Rebuttal                                                                                              |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| "the text looks fine, skip the rewrite"                       | the scan sees phrases and rhythm; template shapes need the agent and the structural reference         |
| "the scan found nothing, rewrite anyway"                      | clean text still goes to the agent, which returns it unchanged; editing it is the failure             |
| "a second humanize pass will help"                            | each pass drifts meaning; one fix-only pass is the cap                                                |
| "paste the pattern list into the dispatch so the agent knows" | naming banned words primes the rewriter to use them                                                   |
| "ask before overwriting the file, to be safe"                 | `input.md` keeps the original and the diff shows every change, so a question only adds a wait         |
| "swap the flagged em dash for a hyphen so the check passes"   | outside chat a spaced hyphen is the same tell, so restructure the sentence                            |
| "the check failed twice, leave its lines out of the summary"  | the rewrite is applied anyway, so those lines are the only record of what's left                      |
| "the profile uses em dashes, so keep them"                    | only `allow:` lifts the ban; the script would flag a kept dash and the fix pass would strip it anyway |

## Red Flags

- You rewrote the text inline without dispatching `expert-naturalizer`.
- You put words from the pattern table into a dispatch.
- You ran a second rewrite over the output.
- You reported a detector result.
- You changed a user's file in `mode:audit`, or wrote anything but its report and task files.
- You asked the user to approve an analysis or the overwrite.
- You overwrote the file before `input.md` held the original.
- You ran the punctuation check on the change report instead of the rewrite.
- You over-edited a code block, table, or proper name.
- You left a `[SPECIFICITY NEEDED]` marker in the text that replaces the user's file.
- You added a citation, statistic, or named source that wasn't in the input.
- You passed the agent the profile's path outside the project instead of `voice.md` in the task folder.
- You "improved" text that was already human-written.

## Verification

A rewrite ends with this block; audit and profile end with their phase file's block.

```
Naturalization complete.
Task dir:    .mz/task/<task_name>/
Report:      <report_path, relative to the project root>
Input:       <source> (<words> words)
Output:      <words> words (delta: <±N>%)
Facts:       Units preserved <a>/<b> | <a>/<b>, changed on purpose: <list> | not run: <reason>
Patterns:    density <x> to <y> per 1,000 words, findings <n> to <m>, introduced <none|list>
Rhythm:      burstiness <b> to <a> | skipped (<reason>) | regressed: <reasons>
Voice:       <register> from <profile>, markers <within profile|over: list> | none
Punctuation: clean | <N> lines left: <list> | not run: <reason>
File update: yes (original at .mz/task/<task_name>/input.md) | no | n/a
```

If any phase is incomplete, print the blocker explicitly.

## References

- `${CLAUDE_SKILL_DIR}/references/structural-patterns.md` — structural shapes with detection questions and positive targets, no word lists. Passed to the agent as `Structural reference:` (absolute path), never read inline.

## Error Handling

- Empty input → `AskUserQuestion`. Never guess.
- `@file:` path does not exist → escalate via AskUserQuestion; offer alternatives.
- `voice:` profile missing or unreadable, an unknown `allow:` name, or a profile-mode `register:` name that breaks the naming rule → AskUserQuestion before anything is written.
- Input is binary or non-text → reject with explanation.
- Input >50KB → warn user and ask whether to proceed (long inputs may exceed context).
- `TEXT_CHECKS` exits 2, or `python3` is missing, on the input scan or inventory → `Status: failed` with its stderr, since a rewrite without findings is blind.
- `TEXT_CHECKS` exits 2 on `extra_patterns.tsv` → remove the named lines and retry once, else drop the extras with a concern.
- `TEXT_CHECKS` exits 2 on a post-rewrite check → that check is `not run` with its stderr.
- `expert-naturalizer` returns `BLOCKED` → leave the user's file untouched, escalate.
- `expert-naturalizer` returns `NEEDS_CONTEXT` → fill the missing context (e.g., preserve list), re-dispatch once.
- `PUNCTUATION_CHECK` exits 2 → record `PunctuationCheck: not run` with its stderr; the final block reports it.
- Update `state.md` before and after every agent dispatch.

## State Management

Update `<PROJECT_ROOT>/.mz/task/<task_name>/state.md` after each phase:

- `Status:` `pending` | `running` | `blocked` | `complete` | `aborted_by_user` | `failed`
- `Phase:` `0` | `1` | `2` | `3` | `audit` | `profile` | `complete`
- `Mode:` `rewrite` | `audit` | `profile`
- `Register:` the `register:` name or the user's audience | `none`
- `InputSource:` `inline` | `file:<path>`
- `InputWords:` `words` from `findings.json`
- `PreserveTerms:` list of terms, `[]` when none
- `VoiceProfile:` `.mz/task/<task_name>/voice.md` | `none`
- `AllowedPunctuation:` list of `allow:` names, `[]` when none
- `ResearchRequested:` `yes` | `no`
- `ExtraPatterns:` `.mz/task/<task_name>/extra_patterns.tsv` | `none`
- `ProfileSamples:` list of `<register>=<path>`, `[]` when none
- `FindingsFile:` / `FactInventory:` the `findings.json` and `facts.json` paths
- `FilesWritten:` cumulative list
- `PunctuationCheck:` `clean` | `concerns` | `not run`
- `FactCheck:` `clean` | `explained` | `concerns` | `not run`
- `TellCheck:` `clean` | `concerns` | `not run`; `VoiceCheck:` and `CopyCheck:` the same plus `n/a`
- `FixDispatched:` `yes` | `no`
- `FileUpdateApplied:` `yes` | `no` | `n/a` (`n/a` for inline input, audit and profile)

State persists to `.mz/task/<task_name>/state.md` under the project root, `${MZ_MEMORY_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}`, resolved once at the start of the run. Schema is **v2**: line 1 is `schema_version: 2`; line 2 is `Status:` with one of `pending`, `running`, `blocked`, `complete`, `aborted_by_user` or `failed`, lowercase and unquoted; then `Phase`, `Started`, `phase_complete` (boolean) and `what_remains` (YAML list of strings), with skill-specific keys below them. Milestones go in `Phase`; the reason for `blocked` or `failed` goes in `what_remains`. Set `phase_complete: false` on phase entry and `true` once the phase's artifacts are written and its gates pass. Refresh `what_remains` on every phase transition; it is `[]` when `Status` is `complete`. Write the file after every phase and before every gate, and re-read it after compaction. Record decisions worth recalling under a heading that reads exactly `## Decisions`, placed before `## Notes`; mz-memory harvests them only once `Status` is `complete`. Under a heading that reads exactly `## Lessons`, add one line whenever a review finding is accepted and fixed, a step fails, gate feedback corrects a mistake, or an approved approach is reversed, in the form `- (review|failure|correction|change) WHEN <situation> → <what to do> — WHY <cause>`, concrete and under about 40 words; mz-memory harvests lessons whatever the `Status`. Treat a legacy `completed` as `complete`. On reading a `schema_version: 1` or unversioned file, put `schema_version: 2` on line 1 and `Status` on line 2, add the missing keys, and log the upgrade. Leave a file with a higher `schema_version` untouched: ask whether to Restart (archive it), start New (`_v2`) or Abort, and stop if nobody can answer.

Never rely on conversation memory for cross-phase state.

Files in this skill

  • SKILL.md12.1 KB
  • phases/rewriting.md6.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.