Introduction¶
The plugin ecosystem of DeepSeek Harness (DSH) emphasizes “everything is a plugin”. When executing Git-related commands in DSH, agreements on commit message format, force push methods, and PR title/description completeness need to be made manually. dsh-git-conventions is used to turn these agreements into configurable check rules, covering git commit, git push, and gh pr create. Below is an introduction to its positioning, features, installation method, and typical usage.
What is it¶
dsh-git-conventions is a static plugin for DeepSeek Harness that runs on both Host and Client. It provides configurable Git commit/push/PR specifications. The rule text is configured by the user on the settings page and persisted to settings.yaml via host settings; the plugin’s interceptor logic does not hardcode any rules.
Repository address: https://github.com/CN-WenYu/dsh-git-conventions. License is MIT.
Core Features¶
Commit Message Validation¶
The plugin performs Conventional Commits structure checks on the inline message of git commit -m. If the message is non-compliant, execution is rejected, and the non-compliant points and current rules are displayed.
It only processes inline messages for -m / --message. Since the guard executes synchronously, it cannot read file contents pointed to by -F / --file, so file messages will not be intercepted.
Push Safety¶
When git push uses bare --force or -f, the plugin prompts to use --force-with-lease. This reminder takes effect when useForceWithLease=true.
PR Completeness¶
When gh pr create is missing --title or --body, the plugin rejects execution and provides a prompt to complete it. Since the tools/execute pipeline does not support parameter rewriting, the implementation here is validation rather than automatically injecting missing titles or descriptions.
Rules and Switches¶
Rule text comes from the settings page configuration. When the rule text is left empty or cleared, it falls back to the default rules for the current language, and validation still takes effect.
The settings page and intercepted messages support Simplified Chinese / English, following the host’s language preference. When “Force Intercept” is disabled (enforce=false), the guard no longer intervenes, and all commands are allowed; the corresponding configuration item is enforce=false.
Installation and Activation¶
Perform installation first, then configuration, and finally verify with commands:
-
Confirm the target profile is
web. -
Install by package name:
dsh plugin --profile web add dsh-git-conventions
- Configure rule text,
enforce, anduseForceWithLeasein the DSH settings page.
After the above steps, the plugin will intercept or allow relevant commands based on the current configuration.
Typical Usage¶
Normal Pass¶
The following examples execute normally when they comply with the rules:
git commit -m "feat(agent): 新增 git 提交规范拦截"
git commit -m "fix(commit): 修正 subject 校验的空消息边界"
git push --force-with-lease
gh pr create --title "feat: 支持 scope 校验" --body "动机与背景 / 主要改动 / 测试与验证 / 影响范围"
Intercepted¶
The following commit messages will be rejected for failing Conventional Commits structure checks:
git commit -m "新增提交规范拦截"
git commit -m "feat: 新增提交规范拦截。"
The first lacks the <type>(<scope>): <subject> prefix; the second ends the subject with a period.
The following push commands will receive a reminder to use --force-with-lease when useForceWithLease=true:
git push --force
git push -f
The following PR commands will be rejected for missing title or description:
gh pr create --title "feat: 新增校验"
gh pr create --body "缺少标题"
Scenarios and Notes¶
dsh-git-conventions is suitable for developers who need to constrain Git workflows in DSH: commit messages must follow Conventional Commits structure, reduce misuse of bare --force, and PR creation must include at least a title and description.
Notes before use:
- The plugin will intervene in command checking within the current DSH process and runs with the permissions of the current dsh process; source code and license should be checked before installation.
- It only checks inline messages for
-m/--messageand does not read file contents for-F/--file. - When
enforce=false, all commands are allowed. - When the rule text is left empty or cleared, it falls back to the default rules for the current language, and validation still takes effect.
- The validation for
gh pr createdoes not rewrite parameters; it will only reject and prompt to complete when--title/--bodyis missing. - When installing via npm package name, no extra schemastery dependency link needs to be added; when installing via workspace path, the dependency link needs to be added.
Conclusion¶
dsh-git-conventions transforms Git commit, push, and PR specifications from manual agreements into configurable check rules in the settings page. The rule text is maintained by the user, and the plugin is only responsible for structure checking and interception prompts based on the current configuration.
The Community Directory is an independent site and is not equivalent to the official app store; see the GitHub repository: https://github.com/CN-WenYu/dsh-git-conventions.