Introduction¶
The plugin-based design of DeepSeek Harness (DSH) allows custom logic to be inserted into the model inference pipeline. When building agents or tuning models, model outputs often contain an overly rigid “AI flavor,” such as frequent use of empty buzzwords like “empower” and “closed-loop,” or overly perfect parallel structures. The dsh-humanizer plugin provides a solution: before generation, it injects specific writing constraints into the System Prompt; after generation, it detects and scores the text for “AI flavor” using pure code logic.
Plugin Overview¶
dsh-humanizer is a Bundle plugin running in DSH, maintained by developer liuwenji007.
It integrates style-injection logic into DSH Profiles through the dsh.bundle.patch mechanism and uses dsh.profile.bundles to enable configuration stacking and reuse. The plugin does not rely on an external LLM for detection; instead, it works through local regular expression matching and statistical logic, making it “zero token” consuming and “result reproducible.”
Core Features¶
1. Pre-generation Style Constraint Injection¶
When the plugin is enabled, it injects a set of positive writing rules into the model’s System Prompt. These rules aim to break the common templated output of AI:
* Require concrete content and avoid empty phrasing.
* Emphasize clear viewpoints and avoid meaningless elevation of conclusions.
* Prohibit decorative use of Emojis.
* Maintain varied sentence lengths and avoid mechanical parallel structures.
2. AI Flavor Detection Report¶
The plugin provides a detection tool based on pure code. It analyzes specific patterns in the text to determine the concentration of “AI flavor.” The detection result is deterministic and does not involve guessing or ambiguous judgment.
3. Tool Reuse¶
In addition to automatically taking effect within a DSH context, developers can also directly reuse its core detection logic in a Node.js environment.
Installation and Activation¶
This is a Bundle plugin. After installation, it automatically enters the Bundles chain of the Profile.
Installation command:
dsh plugin --profile <profile名> add link:/abs/path/to/dsh-humanizer
Note: The
dsh-humanizerpackage name in the npm registry is already taken by another author (used only for writing polishing). This plugin has not yet been published to public npm. For now, installation via the local or source-code path shown above is recommended. After release, the package name will use the scoped name@liuwenji007/dsh-humanizer.
Configuration¶
Configure dsh-humanizer in the Profile’s cordis.patch.yml. Style injection is enabled by default:
- id: dsh-humanizer
config:
enabled: true # 是否注入人味风格 system prompt(默认 true)
domain: copywriting # 写作域:copywriting / general(默认 copywriting)
voice: '' # 可选:提供 2~3 段写作样本,用于「声音校准」
| Field | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
When set to false, only style injection is disabled; the detect_ai_flavor tool remains available. |
domain |
string | copywriting |
Determines the style of the injected framing prompt. |
voice |
string | '' |
If a non-empty string is provided, the sample is added to the Prompt to imitate a specific writing rhythm. |
Usage¶
1. Automatic Activation (Style Injection)¶
When enabled is true, the above style constraints are automatically included before every model generation. This approach controls quality during generation rather than rewriting after generation.
2. Manual Detection (Conversational)¶
Directly invoke the detection tool in a DSH session. Tell the model: “Help me test whether this text has AI flavor.” The system returns a report like the following:
AI 味分数: 100/100 — 明显 AI 味(高密度模式命中)
命中模式: 6 条
· 空转词汇 ×3 "赋能" "闭环"
· Emoji 装饰 ×2 "🚀" "💡"
· 总结腔 ×2 "总的来说" "未来可期"
3. Direct Reuse of Detection Logic (Code Level)¶
Without interacting through DSH, directly import the detection logic in code:
import { detectAiFlavor } from 'dsh-humanizer/lib/patterns.js';
const r = detectAiFlavor('你的文本');
// 返回值示例:
// {
// score: 85,
// verdict: 'ai', // 'human' | 'mild' | 'ai'
// hits: [
// { name: '空转词汇', count: 3, samples: ['赋能', '抓手'] }
// ]
// }
Detection Rules and Judgment Logic¶
The plugin includes 22 enumerable built-in rules (including 10 Chinese and 12 English), such as:
* Empty buzzwords: e.g., “empower,” “closed-loop,” “lever.”
* Empty boilerplate phrases: e.g., “It is worth noting,” “In conclusion.”
* Elevated wording: e.g., “far-reaching significance,” “pivotal.”
* Era context tone, negation parallel structure, guide tone (“Let’s dive in”), conclusion tone, parallel triples, Emoji decoration, official-document tone, etc.
Score calculation and judgment:
* Each rule has a weight (1–3); the raw score is obtained by accumulating count × weight.
* It is density-normalized to a 0–100 score based on text length.
* 80-character minimum: Text under 80 characters is counted as 80 characters for density calculation, preventing a single hit from causing the score to skyrocket.
* Judgment thresholds:
* ai: score ≥40, or 4 or more hits with score ≥25.
* mild: score ≥15, or 2 or more hits.
* human: otherwise.
Boundaries and Limitations¶
The plugin is based on literal matching. It is essentially a “ruler” rather than a “judge,” so be aware of the following limitations when using it:
- Quotation and usage confusion: It cannot tell whether the user is using these terms or quoting/giving examples of them.
- Regular expressions cannot fully distinguish: It cannot distinguish whether enumeration or parallel structures are natural rhetoric or boilerplate, which can cause some false positives (e.g., triple adjectives in English).
- Density-driven scoring: The score is sensitive to text density. Although the 80-character minimum has been added to mitigate this, a single hit in ultra-short text can still lead to a relatively high score.
It is recommended to use it as an auxiliary reference rather than an absolute standard.
Summary¶
dsh-humanizer delegates “style” to the System Prompt (pre-generation constraints) and “judgment” to code (the detection tool). It is suitable for DSH users who need to control output tone, perform AI-flavor analysis, or build specific personas. Before installing, it is recommended to review the source code and license to ensure compliance with local environment requirements.
- Directory page: dsh-humanizer
- GitHub: liuwenji007/dsh-humanizer