Preface¶
The common pain point when using agents to write papers in DeepSeek Harness (DSH) is not “can’t write,” but rather the gradual drift during revisions: p-values and citation numbers silently change after polishing; AI rewrites “associated with” as “caused”; sentences retain modification residue like as requested by the reviewer; or a previously rejected idea slips back into the final draft. Using Humanizer or AI Detector afterward often results in complete paragraph rewrites or a probability score, making it difficult to monitor the boundary between evidence and deliverables during the writing process.
Below is the introduction of maintainer xmutfyh’s dsh-plugin-writing-guard (GitHub 21 stars). It is a scientific paper writing guard for DSH: local, deterministic, zero-network, zero-LLM, continuously checking style, locking evidence, cross-referencing target journals, and auditing deliverable leakage throughout the paper workflow.
What is This¶
Writing Guard is an academic writing plugin for DeepSeek Harness, positioned as “de-AI-ifying · safeguarding evidence · targeting the journal · keeping deliverables clean.” The plugin does not hide AI usage traces but identifies and reduces mechanical, template-based, defensive AI writing. It compares numbers, citations, causal expressions, and scope before and after polishing to prevent silent drift of scientific facts. It can also distill a Journal Profile from representative papers of a target journal and report fit levels per chapter.
The workflow can be summarized as:
Writing Rules → Agent revision → automatic guard → targeted revision
It works continuously within the DSH paper workflow, rather than writing everything first and then humanizing in one go.
Four Pillars¶
STYLE — De-AI-ifying¶
Detection scope includes:
- Modification residue: e.g.,
revised,as requested,本轮(this round),审稿人要求(reviewer requested) - Defensive writing: concession stacking, limitation pre-emption, generic value claims, unnecessary epistemic retreat
- Mechanical rhetoric: overuse of
不是X而是Y(not X but Y),rather than, triple parallelism, dash/colon abuse - LLM high-frequency words:
delve,tapestry,testament,leverage, etc. (alerted by density rules, not per instance) - Chinese clichés, “的” (de) chains, abnormal average sentence length, etc.
English density thresholds are calculated by word count, and Chinese by CJK character count, with dual thresholds to reduce false positives on terminology.
EVIDENCE — Safeguarding Evidence¶
Compares and protects before and after AI polishing:
- Numbers, percentages, p-values, confidence intervals, units
\cite/\ref, Figure/Table numbering, DOI- Causal vs. evidential force: e.g.,
associated withshould not be silently changed tocaused - Negatives and null results:
no significant differenceshould not disappear or flip - Scope boundaries and evidence status: should not be changed from “observed/reported” to direct claims
Each issue comes with a findingKind: INVARIANT / VIOLATION / CANDIDATE / ADVISORY, and outputs a completeness regression report.
JOURNAL — Targeting the Journal¶
Generates a corpus-aware Journal Profile by statistically analyzing multiple representative papers from the target journal. It currently compares five signal types:
- Syntactic structure: sentence length, paragraph length, etc.
- Voice and person: passive voice, first-person usage
- Citations: bibliographic citations, figure/table references
- Scientific claims: claim density, causal/evidential strength, hedging, scope, null findings
- Rhetorical structure: rhetorical move coverage, canonical order, section-bound transition fit
Journal Fit is reported per chapter, along with corpus size and confidence. Weights are: syntactic structure 20%, voice/person 10%, citations 15%, scientific claims 35%, rhetorical structure 20. The documentation emphasizes Scientific Integrity > Journal Fit.
DELIVERY — Keeping Deliverables Clean¶
Checks whether the work context, rejected alternatives, and modification processes leak into the final product without factual basis. CAL (Context-to-Artifact Leakage) is an engineering term: language can change, but evidence cannot; rejected alternatives should not enter the final product.
Five DSH Tools¶
| Tool | Purpose |
|---|---|
writing_rules |
Returns a quick reference for writing discipline, loaded before writing |
writing_audit |
Main audit entry point: checks STYLE, compares pre/post-revision Scholarship/Epistemic invariants, can load Style Profile and Journal Profile |
writing_style_profile |
Learns style metrics from the author’s past papers, outputs JSON for audit use |
writing_journal_profile |
Distills a Journal Profile from representative papers of the target journal, outputs JSON for audit use |
writing_delivery_audit |
DELIVERY layer: detects rejected alternatives, modification residue, and source leakage (CAL detection) |
Minimal example for writing_delivery_audit:
auditDelivery({
text: 'Remove Toast from the login form',
surface: 'commit',
baseline: 'export default function LoginForm() { return <div><Input /></div>; }',
rejectedTerms: ['Toast'],
})
// → findings: [REJECTED_ALTERNATIVE_LEAKAGE, UNJUSTIFIED_NEGATIVE_REFERENCE]
Document Awareness and Automatic Auditing¶
Rules vary by document type for the same text. writing_audit can be specified via the profile parameter or automatically detected from the file path (keywords: rebuttal / cover_letter / manuscript):
| profile | Description | Example: as requested by the reviewer |
|---|---|---|
manuscript |
Paper body | Modification residue, alerted |
rebuttal |
Point-by-point response letter | Normal expression, not alerted |
cover_letter |
Submission cover letter | Residue, alerted |
review / notes / unknown |
Other | Handled conservatively |
The plugin listens to tools/post-execute: for paper-type files (.md / .tex / .txt) written/edited via write / edit, it automatically audits and injects results into the model’s next request. Audit state is persisted per file, and only incremental updates (new / resolved / still present) are injected; no injection occurs if no change, and it automatically captures pre-modification text to run Scholarship Lock + Epistemic Lock.
Installation and Activation¶
Recommended installation via npm (current version 1.7.0, MIT license):
dsh plugin --profile web add dsh-plugin-writing-guard
dsh web
Also supports installation from GitHub or local source:
# Install from GitHub (lib/ is committed, no build needed)
dsh plugin --profile web add github:xmutfyh/dsh-plugin-writing-guard
# Install from GitHub tarball
dsh plugin --profile web add https://github.com/xmutfyh/dsh-plugin-writing-guard/archive/refs/heads/master.tar.gz
# Install from local source directory
dsh plugin --profile web add ./path/to/dsh-plugin-writing-guard
# Restart to take effect
dsh web
Requires Node.js >= 18. After installation, the plugin runs with the current dsh process permissions. Review the source code and MIT license before installation.
Typical Usage¶
- Call
writing_rulesbefore writing to load writing discipline. - When comparing against author style or target journal, use
writing_style_profileandwriting_journal_profileto generate JSON, then load them inwriting_audit. - During writing and revision,
writing_auditautomatically or manually checks STYLE and evidence invariants;write/editon.md/.tex/.txtfiles trigger incremental automatic auditing. - Before finalizing, use
writing_delivery_auditto check for leakage of rejected alternatives and process residue.
Comparison with Humanizer / AI Detector (per README): Writing Guard focuses on pre-writing rules, in-process checks, and automatic monitoring; does not rewrite entire paragraphs; style issues are explainable; rules run locally with zero network and zero LLM. Humanizer leans more toward post-writing revision, and the two can be used complementarily.
Use Cases and Notes¶
Suitable for:
- Users writing or revising Chinese/English papers, response letters, or cover letters with agents in DSH
- Scientific writers needing to monitor numbers, citations, p-values, and causal expressions before and after polishing
- Scenarios requiring calibration of chapter writing distribution against representative papers of a target journal
Notes:
- Rules are based on regex and normalization, so they cannot cover all semantic paraphrasing; the DELIVERY layer detects leakage patterns expressible by regex, and final review still requires human oversight.
- Supports both Chinese and English, with density thresholds calculated independently by language.
- All rules run locally; no paper content is collected or uploaded; state is stored in
~/.dsh/plugins/dsh-plugin-writing-guard/. - The repository contains 380+ deterministic tests; CI executes build + tests on every push/PR.
Conclusion¶
dsh-plugin-writing-guard embeds paper writing guards into the DSH workflow: preventing bad AI writing as you go, locking evidence, optionally cross-referencing journals, and auditing deliverable leakage. If you are looking for local, explainable academic writing assistance within the DSH ecosystem, start from the community directory or GitHub.
- Directory page: https://www.skillhub.cn/plugins/xmutfyh/dsh-plugin-writing-guard
- GitHub: https://github.com/xmutfyh/dsh-plugin-writing-guard