rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:HeliosTangDev/dsh-ops-conventions
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
在 AI 动手前把「你的操作约定清单」确定性地注入一次,并可选地硬拦截写操作,解决「约定记了,但干活时不提就不用」的问题。
插件本身不含任何个人约定:它只做「提醒 + 拦截 + 配置」。规则内容全部来自你自己的
INDEX.md(以及可选的补充文件)。
read <你的 INDEX.md> 并执行清单 + 可选补充文本;约 1 行,不改 VERSION 不会重复刷屏。VERSION 文件后,下一轮(任何轮次)会重新注入。read 过 INDEX.md 时,拒绝写类工具(write/edit/…,可加 pwsh/bash/cmd 等);读过后本会话放行。todoFile 后,还要求先跑一次 todoCheckCmd 校验器(防止报过时待办)。maintReport 后,报告里有 Issues 就注入一条摘要。structGates 后,写某个区域前必须先跑该区域的结构检查器。git clone https://github.com/HeliosTangDev/dsh-ops-conventions.git
cd dsh-ops-conventions
node install.mjs # 默认装到 ~/.dsh/profiles/desktop
node install.mjs /path/to/profile # 指定 profile
node install.mjs /path/to/profile --uninstall # 卸载
在 profile 的 package.json 里加:
"dsh-ops-conventions": "https://github.com/HeliosTangDev/dsh-ops-conventions/releases/latest/download/dsh-ops-conventions.tgz"
然后在该 profile 目录执行 pnpm install,重启 DSH。
在 dsh-m 市场里搜索 dsh-ops-conventions 安装。
在 profile 的 cordis.patch.yml 里追加(所有字段都可选,不配也能用):
- id: dsh-ops-conventions
name: "dsh-ops-conventions"
config:
enabled: true # 总开关:false = 保持加载但零行为(不做注入/拦截/扫描),改后重启
skillsDir: "D:\\my-conventions" # 你的约定目录(里面放 INDEX.md + VERSION)
# bellExtra: "额外的提醒文本" # 直接追加一行文本
# bellExtraFile: "D:\\my-conventions\\BELL.txt" # 或指向文件(每次注入现读,改文件不用重启)
# enforce: false # 只提醒、不拦截
# blockedTools: ["write","edit","multi_edit","apply_patch","notebook_edit","pwsh","bash"]
# todoFile: "D:\\my-work\\tasks\\OPEN.md"
# todoCheckCmd: "powershell -NoProfile -ExecutionPolicy Bypass -File D:\\tools\\todo_check.ps1"
# maintReport: "D:\\my-work\\tasks\\MAINT-LATEST.md"
# structGates:
# - id: docs
# pathRe: "docs[/\\\\]" # 命中这些路径时……
# checkRe: "docs_check\\.py" # 这条命令就是该门检查器
# checker: "python D:\\tools\\docs_check.py"
# 可选:现场状态行(宿主版本 / 维护报告 / 待办条数),默认关闭
# status: true
# statusTodoJson: "D:\\my-work\\todo.json" # 读条目数用
# hostVersionFile: "D:\\tools\\host_version.txt" # 宿主版本缓存(由你自己的脚本写)
# asarCandidates: ["C:/apps/DSH/resources/app.asar"]
# 可选:只读状态工具 ops_status(agent 可直接调用查看状态),默认关闭
# statusTool: true
# memoryDir: "D:\\my-memory\\memories" # 统计记忆库 .md 数量与最近更新时间
# todoLastFile: "D:\\my-work\\todo_last.txt" # 上次校验器输出(可选)
# 可选:版本引用核对(上一条回复写了非现场版本时警告),默认关闭
# versionWarning: true
# versionWarnFile: "D:\\my-work\\VERSION-WARN.md"
# installedProfileDirs: ["C:/Users/me/.dsh/profiles/desktop"]
# 可选:回复合规扫描(在下一轮检查上一条回复,命中注入警告并落文件),默认关闭
# replyWarnFile: "D:\\my-work\\VERSION-WARN.md"
# replyChecks:
# - id: no-next-time
# pattern: "下次注意"
# message: "不许用「下次注意」结案"
# - id: status-needs-time # pattern 命中后,require 不命中才算违规
# pattern: "bell=v\\d+"
# require: "@\\d{1,2}:\\d{2}"
# message: "报状态要带命令、采样时间与数据年龄"
# replyCheckBlock: true # 违规后本轮拒绝写类工具(连续两轮自动解除)
# 可选:窄工具 ops_run(只跑白名单里的脚本),默认关闭
# narrowTool: true
# narrowConfigFile: "D:\\my-work\\tools-run.json" # 白名单文件,改它不用重启
# narrowRoot: "D:\\my-work\\tools" # 白名单文件没写 rootDir 时的兜底根目录
disabled: false
ops_run,默认关闭)只解决一件事:让 agent 在不放开任意执行的前提下,跑你指定的那几个脚本。
id 和参数;路径、cwd、解释器全部来自白名单文件,不接受任意 path/args/cwd。allowedArgs(字面量白名单,不做通配);未知 id / 未授权参数直接拒。shell: false,cwd 固定为 rootDir,有 timeoutMs 与 maxOutputBytes,超时/截断如实上报。narrow run id=… exit=… timeout=… duration=…)。白名单文件格式(仓库里 tools-run.example.json 可照抄):
{
"rootDir": "D:\\my-work\\tools",
"scripts": [
{
"id": "todo-check",
"path": "D:\\my-work\\tools\\todo_check.ps1",
"launcher": ["powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File"],
"allowedArgs": ["-Json"],
"timeoutMs": 60000,
"maxOutputBytes": 20000
}
]
}
约束:path 必须是绝对路径、不得含 ..、必须落在 rootDir 之内;launcher 是固定前缀(跑 .ps1 常用上面那串),不会拼进任何调用方参数。不要把解释器、路径或 cwd 做成可传参——那样等于通用执行器,一个提示注入就能当后门。
D:\my-conventions\
INDEX.md # 你的清单入口(写清“做什么事读哪份清单”)
VERSION # 一个数字;改它 = 让门铃重新注入
INDEX.md 示例:
# 操作约定索引
| 要做的事 | 读这份 |
|---|---|
| 写/改脚本 | ops-scripts/SKILL.md |
| 改完验证 | ops-check/SKILL.md |
skills/ 示例清单(会提示你去换成自己的目录);write/edit/multi_edit/apply_patch/notebook_edit;Get-Content "$env:USERPROFILE\.dsh\ops-conventions\ops-conventions.log" -Tail 5
应看到 plugin loaded skillsDir=...、inject vN chars=...;被拦截时应看到 guard deny ...。
node install.mjs --uninstall
或从 profile package.json 删除依赖、node_modules/dsh-ops-conventions,并删掉 cordis.patch.yml 里对应条目,然后重启。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。