| name | deai |
| description | Reduce AI detection rate in writing (Chinese & English). Use when de-AIing, humanizing, or auditing text for AI traces in any format (LaTeX, Typst, Markdown, plain text). |
De-AI Writing Assistant (Chinese & English)
Detect and remove AI writing traces to reduce AI detection rate. Supports Chinese and English, multiple document formats, and both automated checking and LLM-guided rewriting.
Core Principle
AIGC detectors recognize sentence-structure fingerprints (skeleton repetition), not individual words. The same skeleton used 3+ times triggers detection far more than any single word choice. Fix skeletons first, vocabulary second.
Steps
- Parse
$ARGUMENTS to determine: target file/text, language (--lang zh|en|auto), mode (--mode check|rewrite|audit), and format.
- If
--lang auto or unspecified, auto-detect language by checking CJK character ratio.
- Choose the appropriate workflow:
Mode: check (default) -- Automated Detection
- Run the detection script:
python3 $SKILL_DIR/scripts/deai_check.py <file> --analyze --lang <zh|en|auto>
- Review the report: section-by-section density scores, prioritized trace listing.
- Present findings to user with actionable suggestions.
Mode: rewrite -- LLM-Guided Rewriting
- First run
check to identify AI traces.
- Read
$SKILL_DIR/references/REWRITING_GUIDE.md for rewriting strategies.
- Read the language-specific pattern file:
- Chinese:
$SKILL_DIR/references/PATTERNS_ZH.md
- English:
$SKILL_DIR/references/PATTERNS_EN.md
- For each flagged section (highest density first):
a. Apply skeleton-level transformations (vary sentence structure, break parallelisms).
b. Apply vocabulary-level fixes (replace AI-typical words/phrases).
c. Preserve all technical content, data, citations, and math.
- Second-pass audit: Re-run detection on the rewritten text. If traces remain, fix them.
- Output in diff-comment format showing original vs. revised with change explanations.
Mode: audit -- Two-Pass Full Audit
- Run
check to get baseline scores.
- Perform
rewrite on all flagged sections.
- Re-run
check on rewritten output.
- Generate before/after comparison report with density score improvements.
Mode: style-profile -- Style Extraction
Analyze reference articles and output a JSON style profile. The profile captures 8 dimensions of writing style and can be used during rewrite mode to match the target author's voice.
- Run the style profiler:
python3 $SKILL_DIR/scripts/style_profile.py ref1.txt ref2.txt --output profile.json
- The output JSON includes: sentence patterns (mean/std/CV), word choice (formality, preferred words), rhetoric, structure, narrative perspective, emotion, rhythm, and punctuation profile.
- When using
rewrite mode, optionally pass --style-profile profile.json to guide the LLM toward the target style.
Model Profile: --profile
Control which model-specific detection rules are loaded:
generic (default): Universal patterns only, no model-specific tics
deepseek: Adds DeepSeek-specific patterns (量子/赛博 buzzwords, 三-fixation, parenthetical overload, tree numbering)
claude: Skips all model-specific patterns
mixed: Loads all model-specific patterns
Detection Philosophy
What We Check (Priority Order)
- Structural skeleton repetition (highest signal) -- same sentence pattern used 3+ times
- Template expressions -- phrases that fit any paper/article in any field
- Over-confident claims -- absolute assertions without evidence
- Empty phrases -- vague adjectives replaceable by specific data
- Vague quantification -- "many studies" without citations
- AI vocabulary -- words that appear 5-20x more often in AI text
What We Preserve
- All technical content, data, and reasoning
- LaTeX/Typst commands, math environments, citations, labels
- Necessary causal connections and logical flow
- Chapter-level introductory paragraphs (style-guide recommended)
- Statistically qualified claims (with p-values, percentages)
Rewriting Rules
- Zero fabrication: Never add data, metrics, claims, or citations
- Skeleton over lexicon: Change sentence structure, not just swap synonyms
- Content preservation: Technical content is sacred; only modify how it's expressed
- Vary everything: No two adjacent paragraphs should share the same structure
- Implicit causality: Delete connector words when context makes causality obvious
- Specific over vague: Replace vague claims with concrete data when available; mark as [PENDING] if not
Output Format
% ============================================================
% De-AI Edit (Line X - [Section])
% ============================================================
% Original: [AI-trace text]
% Revised: [Humanized text]
%
% Changes:
% 1. [Type]: [Details]
% 2. [Type]: [Details]
%
% Warning: [PENDING VERIFICATION] if any claims need evidence
% ============================================================
Change Types
- skeleton_vary -- Changed sentence structure to break repetition
- delete_empty -- Removed vague adjective/adverb
- add_specific -- Replaced vague claim with concrete data
- split_sentence -- Divided sentence >50 words (ZH) or >40 words (EN)
- downgrade_claim -- Added academic hedging
- delete_connector -- Removed redundant causal connector
- replace_template -- Replaced template expression with specific content
- replace_vocabulary -- Replaced AI-typical word with natural alternative
- vary_parallelism -- Broke mechanical parallelism (firstly/secondly/finally)
- merge_fragments -- Combined fragmented sentences for natural flow
Density Score Interpretation
| Score | Chinese | English | Action |
|---|
| >15% | >10% | Critical | Rewrite section immediately |
| 10-15% | 5-10% | High | Rewrite soon |
| 5-10% | 3-5% | Medium | Review and revise |
| <5% | <3% | Low | Minor polish only |
Script Reference
| Script | Purpose |
|---|
deai_check.py <file> --analyze | Full document analysis with density scores |
deai_check.py <file> --section <name> | Check specific section |
deai_check.py <file> --score | Section scores only |
deai_check.py <file> --fix-suggestions | JSON suggestions for programmatic fixing |
deai_check.py <file> --lang zh|en|mixed|auto | Specify language |
deai_batch.py <file> --all-sections | Batch analysis of all sections |
deai_batch.py <file> --chapter <file> | Process specific chapter file |
style_profile.py ref1.txt ref2.txt | Extract 8-dimension style profile as JSON |
style_profile.py *.md -o profile.json | Save style profile to file |
Troubleshooting
- If section detection fails, use
--section to specify manually.
- For mixed-language documents, use
--lang mixed to run both Chinese and English patterns simultaneously.
- If false positive rate is high, check if claims are statistically qualified (p-values, percentages).
- For non-academic text (blog posts, emails), focus on vocabulary and template patterns; structural skeleton analysis is less relevant.