DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Protect Generated Files — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
P

dsh-protect-generated-files

Protect Generated Files

DeepSeek Harness 插件,可阻止手动编辑生成的文件(锁文件、protobuf/代码生成输出、标记为 @generated 或 DO NOT EDIT 的文件),并告知模型应编辑哪个源文件以及应改为运行什么命令。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:acus9345/dsh-protect-generated-files#49dc364ddb06aeaba0b56f45568ab246263a036f
README兼容性版本

兼容性与来源证明

Protect Generated Files 以 dsh-protect-generated-files 发布,当前版本为 0.2.3。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/10/17

版本

0.2.3stable
2026/10/17

相关插件

正在加载相关插件…

最新版
0.2.3
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 2
周下载
0
最近提交
2026/10/18
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Experimental Inspector@deepseek-ai/dsh-experimental-inspector用于 Host 调试和 Client Runtime 检查的实验性跨 realm CDP hubExperimental Inspector Profile@deepseek-ai/dsh-experimental-inspector-profile用于原始 Session 日志和 Chat 节点检查的可选 Web 捆绑包

README

dsh-protect-generated-files

English | 中文

Agents edit files that nobody should edit by hand. They'll patch a version number straight into pnpm-lock.yaml, fix a typo in user.pb.go, or "correct" a type in Prisma's generated client. The edit looks fine until the next pnpm install or protoc run wipes it out, or, worse, leaves the lockfile disagreeing with package.json in a way that takes an afternoon to untangle.

This DeepSeek Harness plugin refuses write and edit calls on generated files and lockfiles. It also refuses in-place shell edits of them (sed -i, perl -pi, > file, tee file). Instead of a bare "no", the model is told how the file is supposed to change:

dsh-protect-generated-files blocked this edit to db/query.sql.go: its header says it is
generated (`// Code generated by sqlc. DO NOT EDIT.`). A hand edit will be overwritten
the next time it is regenerated, or leave it out of sync with its source.
Instead: edit the SQL queries/schema and run `sqlc generate`.

Install

dsh plugin --profile web add dsh-protect-generated-files

That's the web profile, the browser UI you start with dsh web. If you run DSH another way, use headless (scripts and CI) or acp (editor integrations) instead. Each profile keeps its own plugin list, so add it to every profile you use. It's active right after installing. Remove it with dsh plugin --profile web remove dsh-protect-generated-files.

From a clone

To try local changes, build a tarball and install that:

git clone https://github.com/acus9345/dsh-protect-generated-files
cd dsh-protect-generated-files
npm install
npm pack
dsh plugin --profile web add ./dsh-protect-generated-files-0.2.0.tgz

How it decides a file is generated

There are three ways a file gets flagged.

Lockfiles, by name. package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock(b), deno.lock, Cargo.lock, go.sum, poetry.lock, uv.lock, pdm.lock, Pipfile.lock, Gemfile.lock, composer.lock, mix.lock, pubspec.lock, Podfile.lock, flake.lock, gradle.lockfile, packages.lock.json, conan.lock. Each one comes with the right command for its own package manager, for example "change dependencies with cargo add / cargo update -p <crate>".

Known output paths. Protobuf output (*.pb.go, *_pb2.py, ...), Dart build_runner output, .Designer.cs, minified files and source maps, and anything inside node_modules/, __generated__/, .venv/ or site-packages/. Build-output folders (dist/, target/, .next/, vendor/ and so on) only count when they sit next to a project manifest like package.json, Cargo.toml or go.mod, so a source folder that happens to be called target isn't caught.

A header that says so. It reads the first 15 lines of the file and looks for Code generated ... DO NOT EDIT, @generated, DO NOT EDIT, auto-generated, This file was generated, <auto-generated>, or a Generated by <tool> comment. A header that says the file may be edited ("edit freely", "safe to edit"), or a qualified DO NOT EDIT without ..., doesn't count. When the header names a tool it knows, the hint names that tool too: protoc/buf, Prisma, GraphQL Codegen, OpenAPI generators, sqlc, go generate, Drizzle, Alembic, and others. "Generated by hand" and "generated by ChatGPT" don't count.

The header check only applies to files that already exist. The name and path rules also cover new files, because a lockfile written by hand from scratch is just as wrong.

On Windows, where DSH runs commands through PowerShell, it also watches Set-Content, Add-Content, Out-File and Tee-Object.

When a hand edit is right

It happens: resolving a lockfile merge conflict, or a one-line hotfix in vendored code while you wait for upstream. The model is told it can repeat the identical call once to confirm, and that goes through. Use mode: ask if you want to approve these yourself. If a directory is generated-looking but actually hand-maintained, add it to ignore.

Settings

The easy way: open Plugins in DSH's sidebar, click dsh-protect-generated-files, change what you want and press Save. It applies to the next tool call, no restart needed.

Or add a row like this to ~/.dsh/profiles/<profile>/cordis.patch.yml, or to ~/.dsh/cordis.patch.yml for every profile. Keys you leave out keep their defaults.

- id: protect-generated-files
  config:
    mode: deny                    # or `ask` for an approval prompt
    extraGlobs:                   # your own generated paths, each with the hint the model gets
      'src/api/client/**': 'edit openapi.yaml and run `npm run gen:api`'
    ignore: ['vendor/**']         # never treat these as generated
    defaultGlobs: true            # false: only lockfiles, headers and extraGlobs
    headerLines: 15
    guardShell: true              # also watch sed -i / perl -pi / > / tee
    allowIdenticalRetry: true     # false: a refusal is final
    shellTools: [bash, pwsh]   # pwsh is the shell DSH uses on Windows

extraGlobs is the one most worth setting. Telling the model which script regenerates your code saves it from guessing.

Development

npm install
npm test           # detector unit tests
npm run test:e2e   # real dsh runs against a scripted local model, no API key needed

The install test runs dsh plugin add, which needs pnpm on your PATH.

MIT licensed. Written by acus9345. Bug reports and ideas are welcome in the issues.