dsh-commit-review: Adding /commit and /review to the DSH Web GUI

Preface

The philosophy of DSH is to combine capabilities through plugins. dsh-commit-review is a DSH plugin maintained by the-qian, adding two slash commands, /commit and /review, to the Web GUI for handling commits and reviews of current git changes. The plugin is licensed under MIT, and both the package name and repository name are dsh-commit-review.

What It Is

dsh-commit-review integrates into the Web profile in the form of dsh.bundle.patch, providing two command entry points for the DSH Web GUI:

  • /commit: Analyzes current git changes and creates a commit.
  • /review: Reviews current uncommitted changes and outputs a report.

The plugin itself is purely host-side, zero-dependency, and requires no build steps; lib/index.js is the final artifact.

Core Capabilities

/commit

/commit analyzes current git changes and actually creates a commit, rather than merely outputting commit suggestions. It supports Conventional Commits types and scopes. The commit guidance can be provided via command arguments, for example:

/commit fix the login bug

The git safety conventions listed in the documentation include:

  • No config changes
  • No force push
  • No skipping hooks
  • If hooks fail, create a new commit after fixing rather than amending
  • Never commit secrets such as .env files, credentials, or private keys

/review

/review reviews current uncommitted changes and outputs a Markdown review report graded by severity. This command only reviews and does not modify any files.

The optional modifiers listed in the verified documentation include security, performance, simplicity, style, i18n, with-context, and guidance; the example for guidance is not shown in the verified documentation, so its usage will not be expanded upon here.

Modifiers use a space-separated syntax, for example:

/review security

This is because the DSH command parser [a-z0-9_-] does not support colons, so forms like /review:security are not used.

Pre-checks and Execution Boundaries

When pre-checks fail, such as when the directory is not a git repository, the working tree is clean, or git is not installed, the plugin directly returns a card notification. When the working tree is clean, the documentation suggests using /review HEAD~1 to review a specific commit.

The commit and review actions are executed by the model using its own tools, subject to the DSH sandbox and approval policies. Command registration is automatically mounted and unmounted with the plugin’s lifecycle, wrapped using ctx.effect.

Installation and Enablement

First, run the installation command to add the plugin to the web profile:

dsh plugin --profile web add https://github.com/the-qian/dsh-commit-review.git

After installation, the profile needs to be restarted because the bundle layer is assembled at boot:

dsh web

After restarting, type / in the input box to see commit and review in the command palette.

Typical Usage

Without parameters:

/commit
/review

With guidance or modifiers:

/commit fix the login bug
/review security
/review performance
/review simplicity
/review style
/review i18n
/review with-context

Suitable Scenarios and Notes

Suitable for developers who want to standardize git commit and code review workflows in the DSH Web GUI. Before use, it is recommended to:

  • Check the source code and license to confirm they meet project requirements.
  • Use it in trusted repositories; the plugin creates commits and relies on DSH’s sandbox and approval policies to execute actions.
  • Avoid including sensitive files such as secrets, credentials, and private keys in the commit scope.
  • When the working tree is clean, use /review HEAD~1 to review a specific commit as prompted.

Since the plugin runs with the permissions of the current DSH process, it is advisable to confirm the source and code before installation.

  • GitHub: https://github.com/the-qian/dsh-commit-review
  • Directory page: https://www.skillhub.cn/plugins/the-qian/dsh-commit-review
羽毛球分组比赛记分
小程序二维码

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

Xiaoye