humanize-beagle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHumanize
文本人性化处理
Apply fixes from a previous run with automatic safe/risky classification.
review-ai-writing应用此前运行结果中的修复内容,并自动区分安全/高风险修复类别。
review-ai-writingUsage
使用方法
text
/beagle-docs:humanize-beagle [--dry-run] [--all] [--category <name>]Flags:
- - Show what would be fixed without changing files
--dry-run - - Fix entire codebase (runs review with --all first)
--all - - Only fix specific category:
--category <name>content|vocabulary|formatting|communication|filler|code_docs
text
/beagle-docs:humanize-beagle [--dry-run] [--all] [--category <name>]标志说明:
- - 显示将要修复的内容但不修改文件
--dry-run - - 修复整个代码库(先以--all参数运行review)
--all - - 仅修复特定类别:
--category <name>content|vocabulary|formatting|communication|filler|code_docs
Instructions
操作步骤
1. Parse Arguments
1. 解析参数
Extract flags from :
$ARGUMENTS- - Preview mode only
--dry-run - - Full codebase scan
--all - - Filter to specific category
--category <name>
从中提取标志:
$ARGUMENTS- - 仅预览模式
--dry-run - - 全代码库扫描
--all - - 过滤到特定类别
--category <name>
2. Pre-flight Safety Checks
2. 预执行安全检查
bash
undefinedbash
undefinedCheck for uncommitted changes
检查未提交的更改
git status --porcelain
If working directory is dirty, warn:
```text
Warning: You have uncommitted changes. Creating a git stash before proceeding.
Run `git stash pop` to restore if needed.Create stash if dirty:
bash
git stash push -u -m "beagle-docs: pre-humanize backup"git status --porcelain
若工作目录存在未提交内容,发出警告:
```text
警告:您有未提交的更改。继续前将创建git暂存。如需恢复请运行`git stash pop`。若目录未清理,创建暂存:
bash
git stash push -u -m "beagle-docs: pre-humanize backup"3. Load Review Results
3. 加载评审结果
Check for existing review file:
bash
cat .beagle/ai-writing-review.json 2>/dev/nullIf file missing:
- If flag: Run
--allfirst/beagle-docs:review-ai-writing --all - Otherwise: Fail with: "No review results found. Run first."
/beagle-docs:review-ai-writing
If file exists, validate freshness:
bash
undefined检查是否存在已有的评审文件:
bash
cat .beagle/ai-writing-review.json 2>/dev/null若文件缺失:
- 若使用标志:先运行
--all/beagle-docs:review-ai-writing --all - 否则:报错提示:"未找到评审结果,请先运行。"
/beagle-docs:review-ai-writing
若文件存在,验证时效性:
bash
undefinedGet stored git HEAD from JSON
从JSON中获取存储的git HEAD
stored_head=$(jq -r '.git_head' .beagle/ai-writing-review.json)
current_head=$(git rev-parse HEAD)
if [ "$stored_head" != "$current_head" ]; then
echo "Warning: Review was run at commit $stored_head, but HEAD is now $current_head"
fi
If stale, prompt: "Review results are stale. Re-run review? (y/n)"stored_head=$(jq -r '.git_head' .beagle/ai-writing-review.json)
current_head=$(git rev-parse HEAD)
if [ "$stored_head" != "$current_head" ]; then
echo "警告:评审在提交版本$stored_head时运行,但当前HEAD已更新为$current_head"
fi
若评审结果已过期,提示:"评审结果已过期,是否重新运行评审?(y/n)"4. Load Reference Material
4. 加载参考资料
Read the appropriate reference files based on the findings being fixed:
- Read when applying
references/vocabulary-swaps.mdorai_vocabulary_highfixesai_vocabulary_low - Read for strategy details and before/after examples for any category
references/fix-strategies.md - Read for tone/register guidance when rewriting prose
references/developer-voice.md
Only load what you need — if fixing only vocabulary, skip the voice guide.
根据待修复的问题类型读取对应参考文件:
- 修复或
ai_vocabulary_high问题时,读取ai_vocabulary_lowreferences/vocabulary-swaps.md - 修复任意类别问题时,读取获取策略细节及前后示例
references/fix-strategies.md - 改写文本时,读取获取语调/语体指导
references/developer-voice.md
仅加载所需资料——若仅修复词汇问题,可跳过语体指南。
5. Filter Findings
5. 筛选问题
If is set, filter findings to that category only.
--categoryPartition remaining findings by :
fix_safetySafe Fixes (auto-apply):
- - Delete conversational artifacts
chat_leak - - Delete knowledge cutoff references
cutoff_disclaimer - - Delete filler phrases
filler_phrase - - Delete restating first sentence
heading_restatement - - Remove emoji from technical text
emoji_decoration - - Remove excessive bold formatting
boldface_overuse - - Swap high-signal AI words
ai_vocabulary_high - - Delete obvious code comments
narrating_obvious - - Delete "In today's..." openers
synthetic_opener - - Delete or neutralize praise
sycophantic_tone - - Delete unattributed claims
vague_authority - - Remove qualifiers
excessive_hedging - - Delete summary padding
generic_conclusion - - Use "is/are" naturally
copula_avoidance - - Delete rhetorical questions
rhetorical_device - - Replace formulaic em dashes with commas, parentheses, or colons
em_dash_overuse - - Remove horizontal rules before headings
thematic_break - - Convert AI title-case headings to sentence case
title_case_heading - - Normalize curly quotes/apostrophes to straight
curly_quotes - - Delete "Not just X, but also Y" filler constructions
negative_parallelism - - Delete "Despite its... faces challenges..." formulaic wrappers
challenges_and_prospects
Needs Review Fixes (require confirmation):
- - Rewrite with specifics
promotional_language - - Restructure sections
formulaic_structure - - Pick consistent term
synonym_cycling - - Rewrite commit scope
commit_inflation - - Rewrite or delete docstring
tautological_docstring - - Trim parameter docs
exhaustive_enumeration - - Rewrite docstring voice
this_noun_verbs - - Reduce cluster density
ai_vocabulary_low - - Rewrite error message
apologetic_error - - Simplify three-item lists used as filler comprehensiveness
rule_of_three - - Restructure boldfaced inline-header vertical lists
inline_header_list - - Convert small tables to prose
unnecessary_table - - Restore specific facts replaced by vague praise
regression_to_mean
若设置了,仅保留该类别下的问题。
--category按对剩余问题进行分类:
fix_safety安全修复(自动应用):
- - 删除对话痕迹
chat_leak - - 删除知识截止日期相关表述
cutoff_disclaimer - - 删除冗余短语
filler_phrase - - 删除标题重复表述
heading_restatement - - 移除技术文本中的表情符号
emoji_decoration - - 移除过度加粗格式
boldface_overuse - - 替换高辨识度AI词汇
ai_vocabulary_high - - 删除冗余代码注释
narrating_obvious - - 删除诸如“In today's...”的模板式开头
synthetic_opener - - 删除或中和奉承语气
sycophantic_tone - - 删除无来源的断言
vague_authority - - 移除修饰性限定词
excessive_hedging - - 删除总结性冗余内容
generic_conclusion - - 自然使用“is/are”
copula_avoidance - - 删除反问句
rhetorical_device - - 将公式化破折号替换为逗号、括号或冒号
em_dash_overuse - - 移除标题前的水平分隔线
thematic_break - - 将AI生成的标题格式转换为句首大写
title_case_heading - - 将弯引号/撇号统一为直引号
curly_quotes - - 删除“Not just X, but also Y”这类冗余结构
negative_parallelism - - 删除“Despite its... faces challenges...”这类模板式套话
challenges_and_prospects
需人工确认的修复(需交互确认):
- - 改写为具体表述
promotional_language - - 重构章节结构
formulaic_structure - - 选用统一术语
synonym_cycling - - 改写提交范围
commit_inflation - - 改写或删除文档字符串
tautological_docstring - - 精简参数文档
exhaustive_enumeration - - 改写文档字符串语体
this_noun_verbs - - 降低AI词汇密度
ai_vocabulary_low - - 改写错误提示信息
apologetic_error - - 简化用作冗余填充的三项列表
rule_of_three - - 重构加粗行内标题的垂直列表
inline_header_list - - 将小型表格转换为文本
unnecessary_table - - 恢复被模糊赞美替代的具体事实
regression_to_mean
6. Apply Safe Fixes
6. 应用安全修复
If :
--dry-runmarkdown
undefined若使用:
--dry-runmarkdown
undefinedSafe Fixes (would apply automatically)
安全修复(将自动应用)
| # | File | Line | Type | Action |
|---|---|---|---|---|
| 1 | README.md | 3 | synthetic_opener | Delete "In today's rapidly evolving..." |
| 2 | src/auth.py | 15 | narrating_obvious | Delete "# Check if user exists" |
| 3 | README.md | 42 | ai_vocabulary_high | Replace "utilize" with "use" |
| ... |
Otherwise, apply fixes grouped by file to minimize file I/O:
1. Sort findings by file, then by line number (descending, to avoid offset drift)
2. For each file, apply all safe fixes in reverse line order
3. For git artifacts (`git:commit:*`, `git:pr:*`), skip — these can't be auto-fixed. Report them for manual attention.| 序号 | 文件 | 行号 | 类型 | 操作 |
|---|---|---|---|---|
| 1 | README.md | 3 | synthetic_opener | 删除“In today's rapidly evolving...” |
| 2 | src/auth.py | 15 | narrating_obvious | 删除“# Check if user exists” |
| 3 | README.md | 42 | ai_vocabulary_high | 将“utilize”替换为“use” |
| ... |
否则,按文件分组应用修复以减少文件I/O:
1. 按文件名排序问题,再按行号降序排列(避免行偏移问题)
2. 对每个文件,按行号逆序应用所有安全修复
3. 对于git artifacts(`git:commit:*`, `git:pr:*`),跳过——无法自动修复,需人工处理并提示。7. Handle Needs Review Fixes
7. 处理需人工确认的修复
If , list them:
--dry-runmarkdown
undefined若使用,列出如下内容:
--dry-runmarkdown
undefinedNeeds Review Fixes (would prompt interactively)
需人工确认的修复(将交互式提示)
| # | File | Line | Type | Original | Suggested |
|---|---|---|---|---|---|
| 4 | README.md | 8 | promotional_language | "powerful, enterprise-grade solution" | "authentication library" |
| ... |
Otherwise, for each fix, prompt interactively:
```text
[README.md:8] Promotional language: "powerful, enterprise-grade solution"
Suggested: "authentication library"
(y)es / (n)o / (e)dit / (s)kip all:Track user choices:
- - Apply this fix as suggested
y - - Skip this fix
n - - User provides custom replacement
e - - Skip all remaining interactive fixes
s
| 序号 | 文件 | 行号 | 类型 | 原文 | 建议修改 |
|---|---|---|---|---|---|
| 4 | README.md | 8 | promotional_language | "powerful, enterprise-grade solution" | "authentication library" |
| ... |
否则,对每个修复进行交互式提示:
```text
[README.md:8] 推广性表述: "powerful, enterprise-grade solution"
建议修改: "authentication library"
(y)确认 / (n)跳过 / (e)编辑 / (s)跳过全部:记录用户选择:
- - 按建议应用修复
y - - 跳过该修复
n - - 用户自定义替换内容
e - - 跳过所有剩余交互式修复
s
8. Validate Results
8. 验证结果
For each modified markdown file, verify basic validity:
bash
undefined对每个修改后的markdown文件,验证基本有效性:
bash
undefinedCheck for broken markdown (unclosed code blocks, broken links)
检查markdown是否存在错误(未闭合代码块、无效链接)
Simple check: matching ``` pairs
简单检查:```是否成对出现
grep -c '```' "$file" | awk '{print ($1 % 2 == 0) ? "OK" : "WARNING: odd number of code fences"}'
For modified source files, check syntax is still valid:
**Python:**
```bash
python3 -c "import ast; ast.parse(open('$file').read())"TypeScript/JavaScript:
bash
npx -y acorn --ecma2020 "$file" > /dev/null 2>&1If validation fails for any file, revert that file:
bash
git checkout -- "$file"
echo "Reverted $file due to validation failure"grep -c '```' "$file" | awk '{print ($1 % 2 == 0) ? "OK" : "WARNING: odd number of code fences"}'
对修改后的源码文件,检查语法是否仍有效:
**Python:**
```bash
python3 -c "import ast; ast.parse(open('$file').read())"TypeScript/JavaScript:
bash
npx -y acorn --ecma2020 "$file" > /dev/null 2>&1若任意文件验证失败,回滚该文件:
bash
git checkout -- "$file"
echo "因验证失败,已回滚$file"9. Report Results
9. 生成结果报告
markdown
undefinedmarkdown
undefinedHumanize Summary
文本人性化处理总结
Applied Fixes
已应用修复
- README.md:3 - Deleted synthetic opener
- README.md:42 - Replaced "utilize" with "use"
- src/auth.py:15 - Deleted obvious comment
- README.md:3 - 删除模板式开头
- README.md:42 - 将"utilize"替换为"use"
- src/auth.py:15 - 删除冗余注释
Interactive Fixes
交互式修复
- README.md:8 - Rewrote promotional language (user approved)
- docs/guide.md:22 - Skipped by user
- README.md:8 - 改写推广性表述(用户已确认)
- docs/guide.md:22 - 用户已跳过
Skipped (Git Artifacts)
已跳过(Git Artifacts)
- git:commit:abc1234 - Chat leak in commit message (amend manually)
- git:commit:abc1234 - 提交信息中存在对话痕迹(需手动修改)
Validation
验证结果
- README.md: OK
- src/auth.py: OK
- README.md: 正常
- src/auth.py: 正常
Diff Summary
差异摘要
```bash
git diff --stat
```bash
git diff --stat10. Cleanup
10. 清理工作
On successful completion (all validations pass):
bash
rm .beagle/ai-writing-review.jsonIf any validation fails, keep the file and report:
text
Review file preserved at .beagle/ai-writing-review.json
Fix issues and re-run, or restore with: git stash pop若所有验证通过,执行清理:
bash
rm .beagle/ai-writing-review.json若存在验证失败,保留文件并提示:
text
评审文件已保留在.beagle/ai-writing-review.json
修复问题后重新运行,或使用git stash pop恢复Core Principles
核心原则
- Delete first, rewrite second. Most AI patterns are padding. Removing them improves the text.
- Use simple words. Replace "utilize" with "use", "facilitate" with "help", "implement" with "add".
- Keep sentences short. Break compound sentences. One idea per sentence.
- Preserve meaning. Never change what the text says, only how it says it.
- Match the register. Commit messages are terse. READMEs are conversational. API docs are precise. Read for the full register guide.
references/developer-voice.md - Don't overcorrect. A slightly formal sentence is fine. Only fix patterns that read as obviously AI-generated.
- Understand regression to the mean. LLMs produce the most statistically likely output. Specific, unusual facts get replaced with generic, positive descriptions. When humanizing, restore specificity — replace vague praise with concrete details.
- Score density, not individual words. AI vocabulary words co-occur. One or two may be coincidental; a cluster of 3+ is a strong AI tell.
- 先删除,再改写。多数AI生成内容为冗余填充,删除后文本质量会提升。
- 使用简单词汇。将"utilize"替换为"use","facilitate"替换为"help","implement"替换为"add"。
- 保持短句。拆分复合句,每句表达一个核心观点。
- 保留原意。绝不修改文本的核心信息,仅调整表述方式。
- 匹配语体。提交信息需简洁,README需口语化,API文档需精准。详见中的完整语体指南。
references/developer-voice.md - 不过度修正。略带正式的表述无需修改,仅修复明显AI生成的模式化内容。
- 理解均值回归。大语言模型会生成统计概率最高的内容,特定、独特的事实会被模糊的正面描述替代。人性化处理时需恢复具体性——用具体细节替代模糊赞美。
- 关注词汇密度而非单个词汇。AI词汇常集中出现,1-2个可能是巧合,3个及以上则大概率为AI生成内容。
Example
示例
bash
undefinedbash
undefinedPreview all fixes without applying
预览所有修复但不应用
/beagle-docs:humanize-beagle --dry-run
/beagle-docs:humanize-beagle --dry-run
Fix only vocabulary issues
仅修复词汇问题
/beagle-docs:humanize-beagle --category vocabulary
/beagle-docs:humanize-beagle --category vocabulary
Full codebase scan and fix
全代码库扫描并修复
/beagle-docs:humanize-beagle --all
/beagle-docs:humanize-beagle --all
Preview filler fixes only
仅预览冗余内容修复
/beagle-docs:humanize-beagle --category filler --dry-run
undefined/beagle-docs:humanize-beagle --category filler --dry-run
undefinedRules
规则
- Always load reference material before applying fixes (step 4)
- Never modify files without a stash or clean working directory
- Apply safe fixes in reverse line order to avoid offset drift
- Never auto-fix git artifacts (commits, PRs) — report them for manual action
- Validate every modified file before considering it done
- Revert files that fail validation
- Write JSON report before displaying summary
- Clean up JSON report only on full success
- 应用修复前必须加载参考资料(步骤4)
- 未创建暂存或工作目录未清理时,绝不修改文件
- 按行号逆序应用安全修复以避免行偏移
- 绝不自动修复git artifacts(提交、PR)——需提示人工处理
- 所有修改后的文件必须经过验证才算完成
- 验证失败的文件需回滚
- 显示总结前需生成JSON报告
- 仅在完全成功时清理JSON报告