Skip to main content
F

dsh-feizhuanyewanjia

feizhuanyewanjia/dsh-feizhuanyewanjia

Task gates for DSH. For any deliverable (site, deck, game, report, drawing) the agent restates the requirement, splits it into 3-8 verifiable gates, and waits for acceptance after each. Gates can run check scripts that refuse to pass. Built for beginners to save tokens: catch mistakes in a text table, not after 244 steps.

Install

dsh plugin --profile web add github:feizhuanyewanjia/dsh-feizhuanyewanjia

README

非专业玩家 · dsh-feizhuanyewanjia

把「一口气做完、然后返工八轮」的活儿,拆成几道能验收的关。 —— 一个给 DSH(DeepSeek Harness)用的任务关卡闸门插件。

中文 · English


中文

为什么做这个插件

起因是一次图纸转 CAD。我把两张工程图丢给 AI,说"转成 DWG"。它一口气做了 244 步、跑了 9 轮、烧掉 ¥5.18 —— 而那只是几张图。最后的结果还是不对:断裂位置画错、K 放大图画错、刃口朝向画错。

后来复盘,问题特别清楚:

  1. 它第 1 轮就宣布"已用 AutoCAD 打开、校核并打印出图" —— 但它说的"校核"根本不算数,错了好几处。
  2. 三个错误全是"读图理解"错误,没有一处是 CAD 技术错误 —— 也就是说,最贵的返工,源头在最便宜的环节。
  3. 真正的"复述我看懂了什么"发生在第 5 轮 —— 而这件事本该是第 1 步。

一句话:错不在"画",在"没验收就先画"。而这恰好是最便宜能拦住的地方。

于是有了这个插件:在"变贵之前"设一道关,停下来问你一句。

给新手:为什么这样反而更省 token

这个插件最直接的用途,是给不会写 prompt 的人省 token。

新手最常见的一句话是:「帮我做个网站」「把这两张图转成 CAD」。一句话扔过去,模型只能自己脑补需求,于是开始一个几百步的长会话 —— 而每一步都要把整段历史重新发一遍。

省 token 靠三件事

#机制为什么省
1先复述,再动手把"你到底要什么"用三行文字钉死。新手不用自己会问这些问题 —— 插件替他问
2拆成短会话成本 ≈ 上下文长度 × 步数。拆关之后每关都是新会话,基数从 20–60 万降到 8–12 万,同样步数直接便宜一个量级
3错误卡在便宜的地方同一个错误,在第 1 关(一张文字表、几千 token)发现,和在 244 步之后发现,代价差两个数量级

两次真实的跑法(不是假想)

测试一:公司官网(48 页 / 4 语言 / 含后台)—— 3 关走完,1 次打回(删掉「方案」页,在文字阶段就改完,没有波及任何一个页面)。

测试二:单人文字跑团(两部剧本 / 12 + 10 幕 / 5 个结局)—— 3 关走完,1 次打回(规则改成"剧情评级制")。

和"不分关"的历史数据对比

不分关(历史实测)分关(这两次)
轮数图纸转 CAD:9 轮,其中 6 轮在返工4 次交互(3 关 + 1 次打回)
步数244 步每关 20–70 步,单关即收口
缓存读取59.1M单关 5–12M
费用(峰时价)¥5.18单关 ¥0.3–0.8

估算结论(保守取值):

  • 轮数少 50%+ —— 9 轮返工型 → 4 次交互
  • token 省 60%–75% —— 同一量级的任务,从 ¥5 量级降到 ¥1.5–2 量级

口径说明,不糊弄:这两次是"分关实测",没有同一任务的"不分关"对照组。 上面的对比用的是同一套成本模型反推(成本 ≈ 上下文 × 步数,缓存按 96.8% 折扣), 并以历史真实会话(9 轮 244 步 59.1M ¥5.18)作为对照基准。数字是估算,量级是可复现的。

什么时候它反而更贵

任务比一轮对话便宜的时候。 每多一道关就多一次交互。改个错字、问个概念、跑个单条命令 —— 直接做,别拆关。插件自己也知道这一点:它内置了「小任务不启用」的判断。

它做什么

任何要交付一个东西的任务(网站、PPT、小游戏、图纸、报告、跑团剧本……),它都会:

你说需求
  ↓
它复述需求(目标 / 交付物 / 约束)—— 写不出就是没听懂
  ↓
它拆出 3~8 道关卡,每关写清:只做什么 / 产出什么 / 判据 / 它的意见
  ↓
一次弹窗:① 复述对不对 ② 保留哪几关    ← 只停这一次
  ↓
逐关推进,每关做完停下,等你 ✅ / ❌
  ↓
打回只重做那一关;同一关连续失败 2 次 → 强制换做法
  ↓
全部通过 → 自动归档产物 + 出一张「关卡账单」

六个核心机制

机制作用
关卡清单由你裁决它先提议、附自己的意见(必留 / 可合并 / 可跳过),你勾选保留哪几关
可执行判据关卡可挂一个 check 脚本,pass 前自动跑,不通过就拒绝过关
自动归档关卡声明产物路径,通过时自动复制进 gN/,事后能翻
成本账本每关的 token 差值与估算费用,出成一张表(横向比较关卡用)
模板自学习跑完的任务可存成模板,下次同类任务直接复用;用错模板会主动警告
经验库踩过的坑写进库里,下次相关任务的 plan 自动提醒(内置 9 条 + 可增长)

装

# 本地开发(改源码即生效)
dsh plugin --profile desktop add link:/path/to/dsh-feizhuanyewanjia

# 从 npm
dsh plugin --profile desktop add dsh-feizhuanyewanjia

装完刷新一次页面。工具名是 gates。

用

你:帮我做个公司官网
   (它会先复述需求,再给关卡清单,一次弹窗问你两件事)
你:对,勾 ①②④
   (然后一关一关来,每关停下等你)
你:❌ 手机版溢出了
   (只重做那一关)

其它动作:

gates action=status      # 看当前走到哪
gates action=ledger      # 看关卡账单
gates action=templates   # 看可用模板
gates action=pitfall     # 看经验库
gates action=where       # 看存档落在哪

它真的有用吗(实测)

项目结果
公司官网(48 页 / 4 语言)3 关走完,1 次打回(删「方案」页);G3 的判据自动验了 11 项(场景结构、骰子分布、内部链接 768 条 0 死链)
单人文字跑团(两班剧本)3 关走完,1 次打回;判据抓出两个真 bug:一个剧本只有一个出口、一个正则写错(全角括号当成了分组)
插件自身49 项测试,覆盖判据 / 归档 / 账本 / 模板 / 经验库 / 崩溃防护

它的边界(先说清楚)

  • 它不替你想。 关卡拆得好不好,取决于需求和判据写得好不好。
  • 判据只能验"能验的"。 文件的齐不齐、链接死没死、骰子均不均匀 —— 能自动验;手感、美感、说服力 —— 只能你来。
  • 小任务不启用。 一句话能做完的事、纯问答、改个字 —— 直接做,别拆关。
  • 它不省钱的前提是你用它。 多一道验收就多一轮交互,只有"这个任务比一轮对话贵"的时候才划算。

设计原则

  1. 关卡要卡在贵之前 —— 能在一张文字表里问清的事,绝不拖到画完图再问。
  2. 判据要可核对 —— 表格数字、截图、试玩、路径;不要"看起来舒服"。
  3. 经验要落地 —— 踩过的坑写进库,下次自动提醒,而不是留在对话里。
  4. 模型的自证不算数 —— 它说"已校核"等于没说,必须有你能核的产物。

文档

许可

MIT


English

Why this exists

It started with a drawing → CAD job. Two engineering drawings, one sentence: "convert to DWG." The agent ran 244 steps across 9 turns and burned ¥5.18 — and the output was still wrong: the break position, the detail view, the edge orientation.

The post-mortem was blunt:

  1. It announced "opened in AutoCAD, verified, printed" in turn 1 — its self-check was worthless.
  2. All three errors were reading-comprehension errors, not CAD errors. The most expensive rework came from the cheapest step.
  3. The first real "here's what I understood" happened in turn 5 — that should have been step 1.

In short: the failure wasn't in drawing, it was in drawing before anyone verified.

So this plugin inserts gates — checkpoints that stop before things get expensive and ask you one question.

For beginners: why this saves tokens

The most direct use of this plugin is saving tokens for people who don't write prompts well.

The classic beginner move is one sentence — "build me a website", "turn these two drawings into CAD". The model fills in the blanks itself and starts a multi-hundred-step marathon, and every step re-sends the entire history.

Three mechanisms

  1. Restate before acting — pin the requirement down in three lines. You don't need to know what to ask; the plugin asks it for you.
  2. Short sessions instead of one long one — cost ≈ context length × steps. Gates reset the context, so the base drops from 200k–600k to 80k–120k: an order of magnitude cheaper for the same work.
  3. Catch errors where they're cheap — the same mistake found at gate 1 (a text table, a few thousand tokens) versus after 244 steps: two orders of magnitude.

Two real runs

  • Test 1 — corporate site (48 pages / 4 languages / admin): 3 gates, 1 rejection — fixed at the text stage, before any page existed.
  • Test 2 — solo tabletop scenario (two campaigns, 22 scenes, 5 endings): 3 gates, 1 rejection — the rules were rewritten before the script was touched.

Against an ungated baseline

Ungated (historical)Gated (these two)
Roundsdrawing→CAD: 9 turns, 6 of them rework4 exchanges (3 gates + 1 rejection)
Steps24420–70 per gate
Cache reads59.1M5–12M per gate
Cost (peak pricing)¥5.18¥0.3–0.8 per gate

Estimated outcome (conservative): 50%+ fewer rounds; 60–75% fewer tokens — the same class of task drops from ~¥5 to ~¥1.5–2.

Honest caveat: these were gated runs with no same-task control group. The comparison is derived from one cost model (cost ≈ context × steps, cache at 96.8% off), anchored on a real historical session (9 turns / 244 steps / 59.1M / ¥5.18). The numbers are estimates; the order of magnitude is reproducible.

When it costs more

When the task is cheaper than one exchange. Each gate is an extra round trip. Typo fixes, quick questions, single commands — just do them.

What it does

For any task that delivers an artifact (a site, a deck, a game, a drawing, a report, a scenario):

you describe the task
  ↓
it restates the requirement (goal / deliverable / constraints)
  ↓
it proposes 3–8 gates, each with: only-do / artifact / criteria / its own advice
  ↓
ONE dialog: ① is my restatement right? ② which gates do you keep?
  ↓
gate by gate — it stops after each one and waits for ✅ / ❌
  ↓
a rejected gate is redone alone; two failures in a row forces a different approach
  ↓
on completion: artifacts archived + a per-gate cost ledger

Six mechanisms

MechanismEffect
You own the gate listIt proposes with its own advice (must-keep / mergeable / skippable); you decide
Executable criteriaA gate can carry a check script. pass runs it and refuses to pass on failure
Auto-archiveGates declare artifact paths; they're copied into gN/ on pass
Cost ledgerPer-gate token deltas and estimated cost, in one table
Template learningSave a finished task's gate structure as a template; wrong-template usage triggers a warning
Pitfall libraryRecorded mistakes are re-surfaced on related plan calls (9 built-in + user-growable)

Install

dsh plugin --profile desktop add link:/path/to/dsh-feizhuanyewanjia
# or from npm
dsh plugin --profile desktop add dsh-feizhuanyewanjia

Refresh the page afterwards. The tool is called gates.

Real results

CaseOutcome
Corporate site (48 pages, 4 languages)3 gates, 1 rejection; gate 3 auto-verified 11 criteria (structure, dice distribution, 768 internal links with 0 dead ends)
Solo tabletop scenario (two campaigns)3 gates, 1 rejection; the criteria caught two real bugs (a scene with a single exit, a regex where full-width parentheses were treated as a group)
The plugin itself49 tests across criteria / archiving / ledger / templates / pitfalls / crash guards

Limits (up front)

  • It doesn't think for you. Gate quality is bounded by requirement and criteria quality.
  • Criteria only verify what's verifiable. File completeness, dead links, dice uniformity — yes. Feel, taste, persuasiveness — no.
  • It stays out of small tasks. One-liners, pure Q&A, a typo fix: just do it.
  • It only saves money if you use it. Each gate is an extra round trip; it pays off only when the task costs more than one exchange.

License

MIT

Related plugins