dsh-contract-redline: Paste Contract Text to Instantly Flag Risky Clauses with Local Rules

Preface

When performing administrative, compliance, or internal assistant tasks within DSH, a common requirement is: users provide contract text and expect the assistant to first highlight clauses that are obviously biased towards the other party or prone to disputes, as well as unclear key points throughout the document—rather than directly providing a conclusion on “whether to sign.” Relying entirely on LLMs to read through the text results in high costs, difficult-to-control boundaries, and a tendency to drift into the expression of legal opinions.

Below is an introduction to the community plugin dsh-contract-redline (npm package name @liuhange/dsh-contract-redline): rule matching, pure local scanning, outputting lists of high-risk clauses, unequal rights and obligations, and missing key clauses, while fixedly attaching a disclaimer stating “for risk warning only, not constituting legal advice.”

What is this

dsh-contract-redline is released by the maintainer liuhange789 and is categorized under admin-security in the SkillHub directory. Its positioning is: paste the body text of procurement contracts, lease contracts, service agreements, etc., into DSH, invoke the tool contract_scan to scan clause by clause, and obtain a structured list of risks along with readable report text within the session.

The plugin does not perform OCR, does not connect to the internet, and does not write contract content to disk; it does not determine contract validity, does not output advice on whether to sign, and does not replace a lawyer’s review. The current rule set version is 2026.11 (updated with changes to src/rules.js); the package version is 0.1.4 with an MIT license.

What problems does it solve

Business owners of Small and Medium Enterprises (SMEs), administrators, and HR professionals often need to process multiple contracts annually but may not have dedicated legal counsel or outsource lawyers for every document. Recurring risks summarized in the README include: jurisdiction fixed in the other party’s city, liability for breach binding only to one party, acceptance criteria merely stating “complies with Party A’s requirements,” and deposit terms without defined return conditions. Before formally engaging a lawyer, the plugin lists the locations of such patterned clauses along with brief plain-language explanations, making it convenient for you to discuss them with questions or request that professionals focus on these areas.

Core Functions and Boundaries

Scan results are categorized into three types:

  1. High-Risk Clauses: Original text excerpts matched by rules, accompanied by a pre-written explanation.
  2. Unequal Rights and Obligations: For example, the right to terminate is held by only one party, the cost of early termination is asymmetrical, liability for breach binds only one party, etc.
  3. Missing Key Clauses: Checks the full text against keywords specific to the contract type (e.g., dispute resolution, payment terms, deposit return, etc.).

Will Do: Locate and excerpt clauses, highlight inequality, list missing items, and output report along with complete JSON fields (see Usage section).

Will Not Do: Issue legal opinions, determine validity or illegality, suggest signing or not signing, draft or modify contracts, or connect to external legal databases or perform online queries.

Direct errors will be reported if the text is less than 80 characters to avoid guessing based on fragments. When the contract type is not recognized, only general rules and two basic missing clause checks (dispute resolution, contract duration) will run; for procurement/lease/service-specific rules, contract_type should be specified.

Installation and Activation

Execute the installation command provided in the official README in an environment where DSH is configured:

dsh plugin add @liuhange/dsh-contract-redline

The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to read the source code and MIT license at the GitHub repository to confirm that the rule logic and data processing methods comply with your compliance requirements. The DeepSeek Harness Community Directory (such as the SkillHub Plugin Page) is an independent ecosystem site with no official affiliation to DeepSeek / Hypersphere; the DSH philosophy is “everything is a plugin,” so you can install it on-demand from the directory or npm source.

Typical Usage

Basic usage: Pass the full text string of the contract.

contract_scan(text: "<合同全文>")

When type recognition is inaccurate or needs to override automatic judgment, you can specify contract_type:

contract_scan(
  text: "...",
  contract_type: "lease"   // auto | procurement | lease | service
)

For mixed contracts (e.g., equipment leasing plus maintenance services), multiple specific rule sets may be enabled simultaneously during automatic recognition: the main type remains contract_type, and the actual applicable type set is listed in contract_types.

The output is rendered as a “Contract Risk Quick Check” list in the session; the main JSON fields include: contract_type / contract_type_label, contract_types, clause_count, rule_version, high_risk, unbalanced, missing, summary, disclaimer, and report (complete list text). Each risk item carries a fixed disclaimer text.

Rule Set Overview (2026.11)

Rule implementation is in the repository’s src/rules.js; after modifying the vocabulary or thresholds, simply run npm run build to package. The summary is as follows; refer to the README for trigger details.

General High Risk: Jurisdiction fixed to a party’s location, automatic renewal or extension, overly broad liability statements (e.g., “all losses,” “unlimited joint and several”), unilateral change rights or final interpretation rights.

Procurement / Supply / Service Specific: No clear deadline for payment, unquantifiable acceptance criteria, full upfront payment, etc.

Leasing Specific: Deposit without return conditions, repair liability entirely pushed to one party, asymmetric early termination (linked with the unequal rights and obligations rule), etc.

Unequal Rights and Obligations: Unilateral termination or revocation, asymmetric cost of early termination, liability for breach binding only one party, etc.

Missing Key Clauses: Checks whether corresponding agreements for dispute resolution, contract duration, payment and acceptance, intellectual property ownership, deposit and maintenance, early termination, etc., appear in the full text based on type.

Text such as labor contracts, which are not within the three specific types, will be classified as unrecognized type and scanned only with general rules; the FAQ notes that labor contracts should not be mistakenly scanned using leasing-specific rules, and contract_type should still be explicitly specified if necessary (though the rule set itself does not cover labor contract templates).

Applicable Scenarios and Notes

Suitable For: Performing rapid self-checks before signing within agents or DSH workflows; administrators, procurement, and leasing officers needing a list of “what to ask” regarding clauses; those preferring zero internet connectivity, auditable rule logic over black-box reasoning.

Not Suitable For: Replacing lawyer opinions, full reviews of complex M&A or highly customized agreements, scanning images or PDFs (no OCR), or scenarios requiring lookup of legal articles or case law databases.

Development and Self-Testing: Cloning the repository is not required for installation; the local process in the maintainer’s documentation is npm install, npm test (build plus 25 tests), npm run build. Tests cover sample risk hits, clean contract samples with no key false positives, output not containing phrases like “sign/not sign/invalid/illegal,” and type coverage along with short text errors.

Conclusion

dsh-contract-redline turns contract risk quick checks into a local tool on DSH: paste the text, get the list, carry the disclaimer, and then seek professional in-depth review. Directory and source code:

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye