Skip to main content

dsh-plugin-writing-guard

17Stars1Forks2Issues0Watchers

DSH Paper Writing Discipline Guardian: Detects AI-generated formulaic language and defensive phrasing, safeguards numbers, citations, and claim strength before and after editing, and aligns with target journal's writing style.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
master
academic-paperacademic-writingai-detectionai-writingdeepseek-harnessdefensive-writingdsh-pluginevidence-based-writing

Install

cmdweb profile
$ dsh plugin --profile web add dsh-plugin-writing-guard

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin xmutfyh/dsh-plugin-writing-guard for me: review the repository at https://github.com/xmutfyh/dsh-plugin-writing-guard first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

At a Glance

A writing discipline guardian for academic authors: When writing or revising papers in DSH, it automatically detects AI mechanical phrasing, defensive self-deprecation, and revision process residuals, and performs integrity checks on numbers, citations, and claim strength before and after polishing, upholding the bottom line that "language can be changed, evidence cannot."

Core Capabilities

  • Revision Process Residual Detection: Identifies terms that only appear in revision contexts like "revised/as requested/本轮/审稿人要求/投稿前/修订稿"; handles document types like rebuttal/cover_letter separately
  • STYLE AI Voice Removal: Detects "不是X而是Y" (not X but Y), triple parallelism, dash/colon abuse, high-frequency LLM words like delve/tapestry, abstract adverb density, and hollow buzzword overload
  • EVIDENCE Integrity Lock: When original is enabled, compares numbers, percentages, p-values, \cite/\ref, DOIs, claim strength, negatives/null results, scope boundaries, and evidence status (reported/observed/measured…) before and after revision
  • Journal Writing Fit: Generates Journal Profile based on multiple representative papers from target journals, reporting syntactic/voice/citation/scientific claim/rhetorical structure fit percentages and confidence per section
  • Author Style Drift Detection: Builds rhythm fingerprints from author historical papers (sentence/paragraph length patterns), detects sentence length distribution deviation in new manuscripts
  • Auto Incremental Audit: Monitors write/edit operations on paper files (.md/.tex/.txt with paper path features or in knowledge base layouts like 01_manuscript), compares by file fingerprint, only injects new/resolved items to avoid repetitive alerts

Technical Implementation

  • Language: TypeScript
  • Key Dependencies: @deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-llm, Node.js built-in fs/path/os
  • Architecture Pattern: Cordis plugin + tools hook injection; listens to tools/pre-execute to capture pre-revision preimage (exec.token keyed), tools/post-execute triggers audit, agent/turn-stopping maintains per-turn injection count; injects audit results as additionalContexts into next turn via dsh-llm's createUserMessage
  • Entry File: src/index.ts (i.e., lib/index.js, built artifacts already committed to lib/) + cordis.patch.yml (injects plugin lines to host composite)

Use Cases

When Chinese/English paper authors use AI to assist with revisions in DSH, they fear two things most: AI's habitual addition of "correct but unnecessary" transitional phrases and defensive clichés, and the quiet corruption of numbers, citations, and claim strength after polishing. This plugin is suitable for continuous baseline checking in the paper writing/revision process: review while writing, check while revising, and especially run incremental review closer to submission. It does not rewrite text—it only marks the locations, severity, and modification suggestions for rule hits; the decision always remains with the author.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness0.1.0-rc.6+Minimum version declared in peerDependency; otherwise cordis hooks and tools events won't be available
Node.js>=18engines.node constraint
PlatformCross-platformOnly depends on Node standard library fs/path/os; no native modules
@deepseek-ai/cordis^4.0.1Provides Context, tools event registration
@deepseek-ai/dsh-tools^0.1.0-rc.6defineTool tool definition
@deepseek-ai/dsh-llm^0.1.0-rc.6createUserMessage context injection

Installation

dsh plugin --profile web add github:xmutfyh/dsh-plugin-writing-guard

Configuration Options

ConfigTypeDescriptionDefault
autoBriefbooleanWhether to automatically inject writing discipline quick-check list each turn (confirm before enabling as it may be intrusive; off by default)false
verboseByDefaultbooleanWhether audit output lists each suggestion by default (off only outputs summary)false
autoAuditOnWritebooleanWhether to automatically audit and inject results after writing paper files (monitors write/edit hitting paper paths)true
autoAuditMinSeveritylow / medium / highMinimum severity for auto-audit; levels below this won't be injectedhigh
modeconservative / balanced / strictPreset mode, overrides autoAuditMinSeverity (conservative only high-risk, strict includes low-risk). Explicit autoAuditMinSeverity takes priority—
maxAutoInjectPerTurnnumberMaximum auto-injections per agent per turn (prevents spam)2
projectResidueTermsstring[]Project terms appended to default internal vocabulary; hits reported as medium[]
stateFilestringIncremental audit state file path; defaults to ~/.dsh/plugins/dsh-plugin-writing-guard/state.json—

FAQ

Q: Will it secretly rewrite my paper?

A: No. Full rewriting is not its responsibility—it only outputs the location, severity, and modification suggestions for hits; the original text remains untouched; all rules are deterministic regex/statistics, no LLM calls.

Q: Will it conflict with the "Academic Humanizer" plugin if installed together?

A: No responsibility conflict. Humanizer leans toward handing finished text to another model for rewriting, while Writing Guard leans toward continuous detection of style and evidence integrity during the writing/revision process. They can complement each other: let Writing Guard hold the bottom line first, then have Humanizer do style polishing.

Q: I don't want to be interrupted by auto-audit while writing. How to disable?

A: Set autoAuditOnWrite to false in plugin config; manually invoke the writing_audit tool when needed; also increase maxAutoInjectPerTurn or set autoAuditMinSeverity to high.

Q: How does it automatically capture pre/post revision comparison?

A: The plugin listens to the tools/pre-execute hook, caches file content before write/edit using exec.token as key; after write completes in tools/post-execute, reads the latest file content for comparison. Concurrent edits to the same file don't interfere across different tokens; when preimage is missing, falls back to persistent baseline cache (up to 20 files, 4MB total).

Q: Is the 512KB per file / 4MB total limit a bottleneck?

A: Not for typical papers. Baseline cache is "last observed full text"; files over 512KB skip persistence (no truncation to avoid false integrity results), but this edit is still covered by execution preimage; over 20 files, oldest by timestamp are evicted.

Q: How to troubleshoot errors?

A: State write failures are reported via ctx.logger.warn (previously silently swallowed), logs show specific failure reasons; lost incremental state means next audit reinjects all issues—errors won't be quietly swallowed.

Learning Curve

Beginner — plug-and-play; default config covers 90% of scenarios; only need to configure Journal Profile for more refined journal fit.

Known Issues & Limitations

  • Only supports text file audit: .docx/.doc/.pdf throws error directly, need to convert via anydoc to Markdown first
  • Auto-audit only hits paper path features (paths contain manuscript/paper/回复/rebuttal keywords in Chinese/English, or located in knowledge base directories like 01_manuscript/02_reviews/08_response); files in other locations won't be auto-audited
  • English paper path features use regex word boundaries to avoid false matches like newspaper/synthesis/coverage/paperwork; Chinese is more lenient, substring matching
  • Frequency rules use "absolute count + per-thousand density" dual gating to avoid false hits on terminology; low-sample sections may still generate suggested changes, ultimately author's judgment
  • Journal style adjustments (Journal Fit) always have lower priority than scientific integrity: when original only supports "associated with", no Journal Profile can push to change to "caused"
  • Detection rules are probabilistic signals: hits require manual review; legitimate technical terms and proper limitations ("样本量有限", "结果可能不完全可靠") won't trigger false positives
  • Plugin version, fingerprint rule version, and schemaVersion are written to state.json; on restart, if fingerprintVersion doesn't match, baselines are cleared (no fake resolved/added), first audit after upgrade re-establishes baselines
  • Incremental audit state persistence uses tmp + rename atomic writes; empty/whitespace stateFile path falls back to default path—no silent failure from config errors

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/xmutfyh/dsh-plugin-writing-guard)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory