AimRule
AimRule turns policy text, chat logs, and source files into an editable, nested business-rule canvas inside DeepSeek Harness — then exports Mermaid, pseudocode, YAML, and test cases.
AimRule 是 DeepSeek Harness 的插件:把政策条文、对话记录和源码变成可编辑的 嵌套业务规则画布,再导出 Mermaid、伪代码、YAML 和测试用例。

Full bilingual manual / 完整中英说明 · Release / 版本 · License / 许可 · Trademark / 商标
English
What it does
- Unstructured → rules: policy clauses, chat logs, source files, workspace files/folders, uploads.
- Editable nested canvas: start / judge / calc / action / end / module, with real edges and a right inspector.
- Canvas history and reusable modules: every canvas in the workspace, plus a searchable module picker with content preview and AI reuse detection.
- Tests and exports: deterministic tests, AI-suggested cases, Mermaid / pseudocode / YAML / test cases.
How it fits into Harness
AimRule is a normal DSH plugin bundle. It does not start another server or require a second model key.
| Harness capability | How AimRule uses it |
|---|---|
dsh.bundle.patch |
registers the host half under /aimrule/api |
conversation.input.left |
adds the AimRule icon to the chat composer |
| session workspace | reads/writes <workspace>/.aimrule/flows/<id>.md |
| default model | extraction, local edits, AI tests, module detection |
| theme tokens | follows the Harness light/dark theme |
| agent tools | five aimrule_* tools on the same canvas |
chat composer icon
│
▼
AimRule modal ──── host /aimrule/api ──── default model
│ │
└──── workspace ─────┴── .aimrule/flows/<id>.md
The modal is bound to the current session's workspace; the workspace is a locked label, not a selector. 切换 changes canvases in that workspace, and the clock button opens canvas history. There is no sidebar entry; the composer icon is the entry point.
Install
npm install @aimrule/dsh-plugin-flow
Or install the release tarball aimrule-dsh-plugin-flow-<version>.tgz with the
DSH plugin manager, or enable the aimrule bundle in your profile. Refresh the
page after installation; no configuration is required.
Use it
- Click the AimRule icon next to
+in the chat composer. - The workspace is fixed to the current session. Use 切换 to choose/create a canvas, or the clock button for 画布历史.
- Type a rule, or
+to reference chat records, canvas nodes/modules, workspace files/folders, or uploads. Press Enter. - Refine the canvas; run 测试 (Tests); open 导出 (Export).
| Canvas / 画布 | History / 历史 |
|---|---|
![]() |
![]() |
| Modules / 模块 | Tests / 测试 |
|---|---|
![]() |
![]() |
Repository layout
| Path | What it is |
|---|---|
aimrule/ |
The DSH plugin package: host, built client, shared code, tests, docs. |
aimrule/README.md |
Full bilingual manual. |
scripts/release.mjs |
Release tool: bump, build, test, pack, commit, tag. |
dist/ |
Generated tarball/ZIP, local only, git-ignored. |
LICENSE |
GNU AGPL-3.0 text. |
aimrule/NOTICE, aimrule/TRADEMARK.md |
Copyright and trademark policy. |
aimrule/client.js is committed intentionally: DSH loads it as the built client
bundle. The packaged installation artifacts are the tarball/ZIP under dist/.
Development and release
cd aimrule
node build.mjs
node test/host-check.mjs
node test/render-check.mjs
node test/evaluate-check.mjs
From the repository root:
node scripts/release.mjs patch
node scripts/release.mjs patch --push
License
AGPL-3.0-or-later. The AimRule name and logo follow a separate trademark policy; modified public forks must rebrand. Closed-source or commercial use needs a commercial license. Not legal advice.
中文
它是什么
- 非结构化材料 → 规则:政策条文、对话记录、源码、工作区文件/文件夹、上传 文档。
- 可编辑的嵌套画布:开始 / 判断 / 计算 / 动作 / 结束 / 模块,真实连线, 右侧检查器。
- 画布历史与模块复用:工作区全部画布,加上可搜索、可预览、带 AI 复用检测的 模块选择器。
- 测试与导出:确定性测试、AI 建议用例,以及 Mermaid / 伪代码 / YAML / 测试用例。
和 Harness 怎么集成
AimRule 是标准的 DSH 插件 bundle,不启动第二个服务,也不需要第二个模型 Key。
| Harness 能力 | AimRule 的用法 |
|---|---|
dsh.bundle.patch |
注册宿主半区,API 在 /aimrule/api |
conversation.input.left |
在聊天输入框加 AimRule 图标 |
| 会话工作区 | 读写 <workspace>/.aimrule/flows/<id>.md |
| 默认模型 | 条文提炼、局部改造、AI 用例、模块检测 |
| 主题 token | 自动跟随 Harness 亮色/暗色 |
| Agent 工具 | 五个 aimrule_* 工具操作同一张画布 |
聊天输入框图标
│
▼
AimRule 弹层 ──── 宿主 /aimrule/api ──── 默认模型
│ │
└──── 当前工作区 ─────┴── .aimrule/flows/<id>.md
弹层绑定当前会话的工作区,工作区是锁定标签,不是下拉选择器;切换 换的是 同一工作区里的画布,时钟按钮打开画布历史。AimRule 没有侧栏入口,入口就是 聊天输入框的图标。
安装
npm install @aimrule/dsh-plugin-flow
也可以把发布 tarball aimrule-dsh-plugin-flow-<version>.tgz 交给 DSH 插件管理器,
或在 profile 里启用 aimrule bundle。安装后刷新页面即可,无需配置。
使用步骤
- 点聊天输入框
+旁的 AimRule 图标。 - 工作区已锁定为当前会话;用 切换 选/建画布,或点时钟按钮打开画布历史。
- 输入规则,或用
+引用对话记录、画布节点/模块、工作区文件/文件夹、上传附件, 按 Enter 生成。 - 调整画布,点 测试 跑用例,点 导出 拿工程产物。
| 画布 | 画布历史 |
|---|---|
![]() |
![]() |
| 模块 | 测试 |
|---|---|
![]() |
![]() |
仓库结构
| 路径 | 说明 |
|---|---|
aimrule/ |
DSH 插件包:宿主、构建后的客户端、共享代码、测试、文档。 |
aimrule/README.md |
完整中英使用说明。 |
scripts/release.mjs |
发布脚本:升版本、构建、测试、打包、提交、打 tag。 |
dist/ |
本地生成的 tarball/ZIP,已被 git 忽略。 |
LICENSE |
GNU AGPL-3.0 全文。 |
aimrule/NOTICE、aimrule/TRADEMARK.md |
版权与商标规则。 |
aimrule/client.js 是插件运行所需的构建产物,需要提交;真正的安装包在 dist/。
开发与发布
cd aimrule
node build.mjs
node test/host-check.mjs
node test/render-check.mjs
node test/evaluate-check.mjs
在仓库根目录发布:
node scripts/release.mjs patch
node scripts/release.mjs patch --push
许可
代码采用 AGPL-3.0-or-later 开源;AimRule 名称和图标另按商标规则,修改后的公开 分支必须换名换标;闭源或商业使用需单独商业许可。不构成法律意见。




No comments yet. Be the first to write one.