@dsmm/dsmm 0.3.36 → 0.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,14 +4,14 @@ DSMM 是 DeepSeek Harness(DSH)的插件。它让不同 Agent 分工处理任
4
4
 
5
5
  比如,让 Planner 拆解任务、Coding 写代码、Reviewer 检查结果,再由 Orchestrator 协调。各个角色可以用不同的模型,不必共用一套配置。
6
6
 
7
- 当前发布版本为 `@dsmm/dsmm@0.3.36`,支持 DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`。安装前请确认客户端版本;范围外的 DSH 版本不受支持。Desktop 使用自带运行时,独立命令行环境需要 Node.js 22 或更高版本。
7
+ 当前发布版本为 `@dsmm/dsmm@0.3.38`,支持 DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`。安装前请确认客户端版本;范围外的 DSH 版本不受支持。Desktop 使用自带运行时,独立命令行环境需要 Node.js 22 或更高版本。
8
8
 
9
9
  官方 DSH rc.3 以 `engines.dsh` 优先于 peer ranges 判定兼容性;锁文件保留 `0.2.1-rc.2` 作为开发基线。
10
10
 
11
11
  历史会话仅保守支持已有的原生读取和已验证的受限恢复路径,不承诺补齐旧版本行为或自动迁移。继续执行须满足当前身份与权限检查,历史批准不会恢复为当前授权。
12
12
 
13
13
  - 源码仓库:[hugefiver/dsmm](https://github.com/hugefiver/dsmm)
14
- - 安装来源:[npm (@dsmm/dsmm)](https://www.npmjs.com/package/@dsmm/dsmm);发布资产:[GitHub Releases (v0.3.36)](https://github.com/hugefiver/dsmm/releases/tag/v0.3.36)
14
+ - 安装来源:[npm (@dsmm/dsmm)](https://www.npmjs.com/package/@dsmm/dsmm);发布资产:[GitHub Releases (v0.3.38)](https://github.com/hugefiver/dsmm/releases/tag/v0.3.38)
15
15
 
16
16
  ---
17
17
 
@@ -22,7 +22,7 @@ DSMM 是 DeepSeek Harness(DSH)的插件。它让不同 Agent 分工处理任
22
22
  ### 初次安装
23
23
 
24
24
  1. 打开 DeepSeek Harness Desktop,进入 **插件(Plugins)** 页面。
25
- 2. 点击 **添加插件(Add plugin)**,输入 `@dsmm/dsmm@0.3.36` 并确认。
25
+ 2. 点击 **添加插件(Add plugin)**,输入 `@dsmm/dsmm@0.3.38` 并确认。
26
26
  3. 安装完成后,检查插件是否处于启用状态。如果界面提示需要重启,请按提示重启客户端。
27
27
 
28
28
  Desktop 的插件由客户端自己管理。全局 npm 安装和独立 npm 版 `dsh` 命令不能替代这一步。
@@ -34,7 +34,7 @@ DSH Desktop 当前不支持在界面中用同名版本原位覆盖更新插件
34
34
  1. 保存好正在进行的任务,**正常退出并完全关闭 DSH Desktop**。
35
35
  2. 使用 Desktop 安装自带的命令行工具更新配置。以下示例适用于 Windows 默认安装路径(`%LOCALAPPDATA%\Programs\DeepSeek Harness\`):
36
36
  ```powershell
37
- & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add @dsmm/dsmm@0.3.36 --save-exact --ignore-scripts --registry=https://registry.npmjs.org
37
+ & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add @dsmm/dsmm@0.3.38 --save-exact --ignore-scripts --registry=https://registry.npmjs.org
38
38
  ```
39
39
  *若安装在自定义路径,请替换为对应的实际位置;非 Windows 系统请参考 Desktop 自身菜单或官方指引,不要混用非 Desktop 的独立 CLI 命令。*
40
40
  3. 重新打开 DSH Desktop 即可加载新版本。
@@ -41,42 +41,14 @@ base Deepwork prompt, run `pnpm run generate:roles`. CI uses
41
41
  `pnpm run check:roles` and fails if `agent-presets/` or `prompts/deepwork.md` is
42
42
  stale. Generated assets are package resources, not an alternate source of truth.
43
43
 
44
- Ordinary native presets use `prompts/source/deepwork/general.md` while Deepwork is
45
- active. A neutral opening replaces the harness identity and the stock model announcement
46
- is omitted. Custom persona instructions, model selection, effort and delegation stay in place. DSMM identity comes from an explicit DSMM preset or trusted invocation,
47
- not mode activation or `defaultActive`. The full `deepwork/default.md` workflow and
48
- role/model workflow calibrations apply only to admitted DSMM roles. Ordinary
49
- Agents receive general guidance, a behavior-only calibration for the current model,
50
- lazy skills and applicable model-parameter tuning; they acquire no planner/critic
51
- dispatch requirement or DSMM role tools. Both preset types select calibration using
52
- the current prompt assembly rather than the preceding request header.
53
-
54
- Model guidance is subordinate to the selected role and the current runtime's tools
55
- and permissions. Role and workflow prompts contain usage guidance rather than a
56
- static Host contract or duplicate skill/MCP inventories; availability comes from
57
- the current runtime catalog. The six development workflow skills describe their software
58
- engineering stage in both discovery metadata and their frontmatter. Other tasks can
59
- use domain skills and native delegation without loading a development workflow.
60
- Model identifiers and families select resources in code; calibration text, headings
61
- and tags are model-neutral. Source filenames retain selector identities. Kimi
62
- K3 and earlier, and names without a determinate version, use `deepwork/kimi.md`.
63
- K3.1 and later numeric generations, including K3.2 and K4+, exclusively use
64
- `deepwork/kimi-k3-1.md`. Prompt-only K aliases such as `k3p1` leave reasoning-family
65
- classification unchanged. Existing `kimi-k27` names retain their K2.7 meaning
66
- and the old calibration. Selection preserves the first model identity and keeps
67
- structured provider metadata outside model matching. Gemini 4 and later, including Argon,
68
- receive the `gemini-4` additive layer. No injected self-identification
69
- or textual model guard is needed. Prompt selection does not change provider,
70
- effort, fallback chains or DSH model capabilities. Fable and Mythos from 5.2 onward select
71
- `deepwork/claude-fable-5-2.md` for admitted roles and categories. It directs the
72
- agent to finish actionable work in its assignment and diagnose a failure before retrying.
73
-
74
- The K3.1+ scope-and-delivery calibration selectively adapts Senpi `2026.11.3-3`'s
75
- `kimi-k3-1.ts` at published source `29eedcbe7c0cdf1c89eac7c94d4093b485925303`.
76
- Its source embeds the complete MIT copyright and permission notice, retained in
77
- the packaged resource. The additive guidance prioritizes current intent, bounded
78
- action, complete outcomes, evidence reuse, and truthful handoff under the local
79
- role and workflow contracts; it adds no effort lock or workflow gate.
44
+ Active Deepwork uses one DSMM-maintained source for model-neutral execution guidance: `prompts/source/shared/working-principles.md`. [Prompt assembly](../src/prompts.ts) inserts it after `general` for ordinary presets, or after role activation and before `default` for DW roles. Both paths then select [family calibration](model-routing.md#model-family-prompt-calibration) from the current route. A nonempty `overrideSection` replaces the common section, leaving applicable family calibration intact. With Deepwork off, neither section is injected.
45
+
46
+ - **Ordinary native preset:** active Deepwork supplies [general guidance](../prompts/source/deepwork/general.md), shell safety, lazy skills and a short behavior summary for the model. The neutral opening omits the stock model announcement. The native persona, model, effort and delegation authority stay in place; activating Deepwork does not grant a DSMM role or its planner/critic tools.
47
+ - **Admitted DSMM role:** the explicit preset or trusted invocation supplies the persona and permissions. Deepwork adds the common workflow, then the selected model base and additive guidance. Planner uses its own base followed by applicable additives. A category keeps its own family guidance followed by the matching additive, without a base-agent Gemini, GLM or planner layer.
48
+
49
+ The runtime catalog determines tool and skill availability. The six development skills apply at their respective software engineering stages; other work uses applicable domain skills and native delegation. A later user request supersedes only conflicting earlier user instructions. A permission gate may use the Host's explicitly offered approval for the same operation; user refusal or final denial ends it. If independent review is required, self-review does not satisfy it.
50
+
51
+ Generalized model guidance draws on OMO `59b4ac1f67` and Senpi `2026.11.23`. The [K3.1+ resource](../prompts/source/deepwork/kimi-k3-1.md) retains the complete MIT notice for Senpi `2026.11.3-3`, `kimi-k3-1.ts` at `29eedcbe7c0cdf1c89eac7c94d4093b485925303`. These identify source material, independently of the model version that selects it.
80
52
 
81
53
  Locale guidance is registered in the exact Agent scope independently of Deepwork
82
54
  mode, the Deepwork module and subagent tools. It uses that Agent's captured
@@ -126,12 +98,17 @@ Harness failures and unmet requirements remain explicit rather than being treate
126
98
  as product failures or successful completion.
127
99
 
128
100
  Frontend work follows brief → build → subtract → verify. Small edits preserve
129
- existing styles and required content; visual QA uses comparable real before/after
130
- states, separates defects from taste, and discloses missing evidence. Research
131
- reporting loads the native `report-fidelity` skill on demand for source support, units, derived
132
- calculations, quotations and translation meaning, without mandatory ledgers or
133
- large-workflow requirements for simple questions. These local adaptations preserve
134
- DSH ownership of tasks, lifecycle, permissions and persistence.
101
+ existing styles and required content. The state-and-flow route writes a state table for
102
+ unknown, failed, empty, loaded, saving and save-failed states, plus request-target binding,
103
+ stale responses, cancellation, re-entry and keep/clear behavior. Visual QA uses comparable
104
+ real before/after states, separates defects from taste and discloses missing evidence.
105
+ Held, failed, switch, twice and re-entry checks follow real user paths and record confirmed
106
+ interception, request counts and targets, persisted results, and keep/clear observations.
107
+ Source-only findings are TRACED; unobserved conditions are UNVERIFIED. Cleanup covers only
108
+ run-owned resources. Research reporting loads the native `report-fidelity` skill on demand
109
+ for source support, units, derived calculations, quotations and translation meaning, without
110
+ mandatory ledgers or large-workflow requirements for simple questions. These local adaptations
111
+ preserve DSH ownership of tasks, lifecycle, permissions and persistence.
135
112
 
136
113
  Planner, plan-critic and reviewer guidance treats a confirmed state as usable until there is evidence of a change. The design and review skills keep database transactions short: no locks across long-running application work, precautionary rereads before writeback or broad integrity scans. GPT-family guidance protects the normal path from speculative defenses in both ordinary Deepwork and admitted role prompts.
137
114
 
@@ -192,7 +169,10 @@ The full `skills/frontend/` tree is maintained in this repository and shipped in
192
169
  the npm package. `scripts/frontend-recipe.mjs`, fixed upstream commits,
193
170
  `skills/frontend/.frontend-materialized.json`, and
194
171
  `skills/frontend/ATTRIBUTION.md` define its provenance and integrity boundary.
195
- Third-party licenses and notices remain with their resources.
172
+ Third-party licenses and notices remain with their resources. The local
173
+ `references/perfection/state-and-flow.md` and state/flow additions to `references/visual-qa.md`
174
+ reference OMO `59b4ac1f67` in the attribution notice; they are not fixed-pin materialization
175
+ inputs and require no new inventory entries.
196
176
 
197
177
  Ordinary build and `check:frontend` are offline. They require the complete local
198
178
  resource set and never download or replace files. `pnpm run sync:frontend` is the
@@ -124,15 +124,19 @@ Provider call IDs can repeat across requests. Reuse never blocks delegation: amb
124
124
 
125
125
  ## Model-family prompt calibration
126
126
 
127
- With Deepwork enabled, prompt assembly uses the first recognized identity in the effective model name. A provider name or a later model in the same string cannot supply a missing family or version. Ordinary presets receive neutral behavior guidance; DW roles retain their existing base, planner or category layers.
128
-
129
- - GPT and Codex use their family calibration regardless of generation, including GPT-6.2 and later. Codex keeps its DW base wherever that base applies.
130
- - Gemini major 4 and later inherit the `gemini-4` additive. Both numeric names (`gemini4.1`, `gemini-5-pro`) and explicit major wildcards (`gemini-4.x-pro`, `gemini5.x:latest`) qualify. A wildcard supplies only its major; bare `4.x` does not identify Gemini.
131
- - SWE major 2 and later share the `swe-2` additive and its ordinary behavior guidance. For example, `swe-3` and `swe-20` qualify; `swe-1` and `swe-latest` do not.
132
- - Opus 5 and later select the `claude-opus-5` base for the orchestrator and the corresponding neutral guidance for ordinary presets. Other DW roles keep their existing layers.
133
- - Fable and Mythos 5.2 and later share the `claude-fable-5-2` additive. Kimi K3.1 and later use `kimi-k3-1`; older and unversioned Kimi identities keep `kimi`.
134
-
135
- Version thresholds compare numeric components, so 5.10 follows 5.2. A malformed version does not select a version-specific layer. These thresholds select prompts only; native capabilities and request parameters are unchanged.
127
+ With Deepwork active, [prompt assembly](../src/prompts.ts) selects guidance from the first recognized model identity in the current route. A provider name or later model name cannot supply its family or version. Ordinary presets get a short behavior summary for recognized models; admitted DW roles use the resources below. Selection changes prompt text, not native capabilities, reasoning effort or fallback routes.
128
+
129
+ | Recognized model | DW calibration |
130
+ | --- | --- |
131
+ | GPT or Codex, any generation | Shared `gpt` execution guidance; Codex models also use the native tool-compatibility base where a model base applies. |
132
+ | Claude, any generation (including Opus, Fable and Mythos) | One `claude` additive across roles and categories. |
133
+ | Grok or DeepSeek | `grok` or `deepseek` additive across roles and categories. Grok prompt recognition leaves its reasoning family unknown. |
134
+ | Gemini | `gemini` where a model base applies; major 4 and later also receive `gemini-4`. `gemini-4.x-pro` qualifies; bare `4.x` does not identify Gemini. |
135
+ | GLM | `glm` where a model base applies. |
136
+ | Kimi | K3.1 and later (including `k3p1`, K3.2 and K4) use `kimi-k3-1`; older and unversioned identities use `kimi`. `kimi-k27` denotes K2.7. |
137
+ | SWE | `swe-2` for major 2 and later; neither `swe-1` nor `swe-latest` qualifies. |
138
+
139
+ Numeric thresholds apply to the recognized model's own version. Planner and category composition, source attribution and generated assets are described in [maintenance](maintenance.md#generated-role-assets).
136
140
 
137
141
  ## Generic model parameters
138
142
 
package/dsh-plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": "0.15",
4
4
  "id": "com.hugefiver.dsmm",
5
5
  "name": "DSMM",
6
- "version": "0.3.36",
6
+ "version": "0.3.38",
7
7
  "facets": {
8
8
  "host": {
9
9
  "entry": "lib/index.js",
@@ -1,5 +1,5 @@
1
1
  export type DsmmModelFamily = "gpt" | "codex" | "claude" | "gemini" | "glm" | "kimi" | "deepseek" | "unknown";
2
- type ModelIdentifier = Exclude<DsmmModelFamily, "unknown"> | "swe";
2
+ type ModelIdentifier = Exclude<DsmmModelFamily, "unknown"> | "grok" | "swe";
3
3
  type ModelSeries = "opus" | "sonnet" | "haiku" | "sol" | "terra" | "astra" | "luna";
4
4
  interface ModelNameRecognition {
5
5
  identifier: ModelIdentifier;
@@ -68,11 +68,11 @@ function identifierFor(marker) {
68
68
  /** Model fields are complete names here; route owners separate provider metadata. */
69
69
  export function recognizeModelName(model, options = {}) {
70
70
  const name = model.trim().toLowerCase();
71
- const markers = name.matchAll(/(?<![a-z0-9])(?:(?:chatgpt|gpt|codex|claude|fable|mythos|gemini|glm|deepseek|kimi|opus|sonnet|haiku|sol|terra|astra|luna)(?=\d|[^a-z0-9]|$)|(?:k2[-_.\s/]*p[5-8]|swe)(?![a-z0-9])|k(?=\d)|\d+)/gu);
71
+ const markers = name.matchAll(/(?<![a-z0-9])(?:(?:chatgpt|gpt|codex|claude|grok|fable|mythos|gemini|glm|deepseek|kimi|opus|sonnet|haiku|sol|terra|astra|luna)(?=\d|[^a-z0-9]|$)|(?:k2[-_.\s/]*p[5-8]|swe)(?![a-z0-9])|k(?=\d)|\d+)/gu);
72
72
  let first;
73
73
  let consumedEnd = 0;
74
74
  for (const marker of markers) {
75
- if (marker.index < consumedEnd || marker[0] === "mythos" && !options.promptAliases)
75
+ if (marker.index < consumedEnd || (marker[0] === "mythos" || marker[0] === "grok") && !options.promptAliases)
76
76
  continue;
77
77
  // Outside prompt selection, only the historical SWE-2 marker participates in classification.
78
78
  if (marker[0] === "swe" && !options.promptAliases && !/^[-_.\s/]+2(?![a-z0-9])/u.test(name.slice(marker.index + marker[0].length)))
@@ -150,7 +150,7 @@ export function recognizeModelName(model, options = {}) {
150
150
  consumedEnd = parsed.end;
151
151
  continue;
152
152
  }
153
- const family = identifier === "swe" || /^k2[-_.\s/]*p8$/u.test(marker[0]) ? "unknown" : identifier;
153
+ const family = identifier === "grok" || identifier === "swe" || /^k2[-_.\s/]*p8$/u.test(marker[0]) ? "unknown" : identifier;
154
154
  const version = /^\.x/u.test(name.slice(parsed.end)) ? undefined : parsed.version;
155
155
  first = {
156
156
  identifier, family, series, version: parsed.version, versionParts: parsed.versionParts,
package/lib/prompts.js CHANGED
@@ -9,8 +9,9 @@ Use this workflow only while the \`{{modeName}}\` mode is effectively active. Th
9
9
  Skills are native metadata and lazy bodies, never automatically injected. Load matching skills only through the actual native skill catalog. Treat \`[dsmm safety]\` messages as binding feedback. Implementing does not authorize a commit; a commit does not authorize push/tag/rebase/release.
10
10
  Understand the requested outcome and relevant facts first. Load the full \`brainstorming\` skill through the native catalog when an unresolved requirement or design choice materially affects a software change. Development workflow skills apply only at the corresponding engineering stage; use domain skills directly for other tasks. Ask only for a material scope, acceptance, security, data, API/protocol, permission or irreversible-action decision, missing input that would materially change delivery, or an explicit checkpoint. Role-first boundaries and orchestrator-owned planner/critic responsibilities remain unchanged.
11
11
  </dsmm-deepwork-mode>`;
12
- const commonDeepworkPrompt = [activation, asset("deepwork/default.md"), asset("shared/shell-safety.md")].join("\n\n---\n\n");
13
- export const BASE_DEEPWORK_PROMPT = [commonDeepworkPrompt, readSharedPromptAsset("avoid-ai-slop.md")].join("\n\n---\n\n");
12
+ const workingPrinciples = asset("shared/working-principles.md");
13
+ const roleDeepworkPrompt = [activation, workingPrinciples, asset("deepwork/default.md")].join("\n\n---\n\n");
14
+ export const BASE_DEEPWORK_PROMPT = [roleDeepworkPrompt, asset("shared/shell-safety.md"), readSharedPromptAsset("avoid-ai-slop.md")].join("\n\n---\n\n");
14
15
  function kimiVariant(version) {
15
16
  return version !== undefined && (version[0] > 3 || version[0] === 3 && version[1] >= 1) ? "kimi-k3-1" : "kimi";
16
17
  }
@@ -19,24 +20,25 @@ function generalModelCalibration(model) {
19
20
  switch (recognized?.identifier) {
20
21
  case "gpt":
21
22
  case "codex":
22
- return "Lead with the result and its supporting evidence. Reuse checks that still cover the claim; qualify only what remains uncertain. Do not write defensive code or design for imaginary failures. Never penalize the 90% normal path for a case the contract makes impossible. Trust internal guarantees; enforce required checks at real boundaries.";
23
+ return "Read every named source completely, then narrow further discovery to the question that matters. When a proposed check, hash, or extra round cannot establish a required fact, skip it. Report material progress rather than each step; state the result and its evidence directly.";
23
24
  case "gemini":
24
25
  return recognized.gemini4OrLater
25
- ? "Ground claims about files and runtime behavior in what you observed. Distinguish a proposed change from an applied one, and a successful build from evidence that the requested behavior works."
26
+ ? "When information is needed, give a short opener and make the first available calls in the same turn. Check date-sensitive claims; distinguish observation from inference, proposals from edits, and a build from exercised behavior. Retry transient technical errors only when the operation is safe and idempotent; diagnose other technical errors before changing approach. Do not work around an access refusal."
26
27
  : "Deliver the full requested result without adjacent cleanup or speculative additions. Keep explanations separate from changes the user asked you to make.";
27
28
  case "glm":
28
- return "Answer once the evidence settles the question. Put the conclusion first, followed by the facts that support it and any gap that changes the answer.";
29
+ return "Use low-cost reads, searches, or runs in short act-inspect-verify cycles. Once the evidence answers the question, stop searching and lead with the conclusion. Ask only about unresolved user-owned choices.";
29
30
  case "kimi":
30
31
  return kimiVariant(recognized.version) === "kimi-k3-1"
31
- ? "Carry the user's latest choice through to an observable result. Keep unrelated defects outside the change, and name any requested part that remains unfinished."
32
+ ? "Carry the user's latest choice through to an observable result while retaining compatible earlier requirements. Extend the owning implementation without parallel copies or dead code; leave unrelated defects for follow-up and name any requested part left unfinished."
32
33
  : "Once the evidence settles the next in-scope action, take it rather than comparing equivalent approaches again. Reopen the decision only if a new fact matters.";
34
+ case "grok":
35
+ return "Define observable completion and deliver every requested part in order without stubs or scope substitution. Consolidate repeated logic; for visual work, capture the current state, list defects, and fix only those defects.";
36
+ case "deepseek":
37
+ return "Read supplied and named context before acting, investigate missing facts, and turn analysis into the next action. Event updates add input rather than ending active work; finish with an independent, reader-first result.";
33
38
  case "swe":
34
39
  return recognized.swe2OrLater ? "Use the failing case or interface contract to choose the next change. When that choice is settled, carry it out and report what happened rather than promising to act." : "";
35
40
  case "claude":
36
- if (recognized.fable52OrLater)
37
- return "Complete the parts of the request that are still feasible. If one part is blocked, deliver the independent results and identify the specific blocker instead of ending with a checklist.";
38
- if (recognized.opus5OrLater)
39
- return "Keep the result bounded by the request. Reuse evidence that still applies, and report the outcome without extra polish or repeated checks.";
41
+ return "The latest user request supersedes earlier user instructions only where they conflict. Progress reports supply evidence, not new user instructions. Complete actionable work rather than ending with a plan or offer. Extend the owning implementation and exercise the changed surface; reuse checks that still cover it. If part is blocked, finish independent work and name the blocker.";
40
42
  }
41
43
  return "";
42
44
  }
@@ -44,8 +46,9 @@ export function promptModelVariants(role, model) {
44
46
  const recognized = recognizeModelName(model, { promptAliases: true });
45
47
  const identifier = recognized?.identifier;
46
48
  const gpt = identifier === "gpt" || identifier === "codex";
47
- const additive = recognized?.fable52OrLater ? ["claude-fable-5-2"] : gpt ? ["gpt"] : recognized?.identifier === "kimi" ? [kimiVariant(recognized.version)] : recognized?.gemini4OrLater ? ["gemini-4"] : recognized?.swe2OrLater ? ["swe-2"] : [];
48
- const base = role === "planner" ? "planner" : role === "orchestrator" && recognized?.opus5OrLater ? "claude-opus-5"
49
+ const additive = identifier === "claude" ? ["claude"] : identifier === "grok" ? ["grok"] : identifier === "deepseek" ? ["deepseek"]
50
+ : gpt ? ["gpt"] : identifier === "kimi" ? [kimiVariant(recognized.version)] : recognized?.gemini4OrLater ? ["gemini-4"] : recognized?.swe2OrLater ? ["swe-2"] : [];
51
+ const base = role === "planner" ? "planner"
49
52
  : recognized?.family === "codex" ? "codex" : gpt ? "gpt" : identifier === "gemini" ? "gemini" : identifier === "glm" ? "glm" : "default";
50
53
  return [...new Set([base, ...additive])].filter((variant) => variant !== "default");
51
54
  }
@@ -59,7 +62,7 @@ export function roleModelCalibration(role, model) {
59
62
  : identifier === "gemini" || identifier === "glm" || identifier === "claude" ? identifier : "unknown";
60
63
  // Categories carry only their own family layer + additive model calibration,
61
64
  // not the base-agent Gemini/GLM/planner workflow variants.
62
- return [category.calibrations.get(family), ...layers.filter((_layer, index) => ["gpt", "kimi", "kimi-k3-1", "gemini-4", "swe-2", "claude-fable-5-2"].includes(variants[index]))].filter(Boolean).join("\n\n---\n\n");
65
+ return [category.calibrations.get(family), ...layers.filter((_layer, index) => ["gpt", "claude", "grok", "deepseek", "kimi", "kimi-k3-1", "gemini-4", "swe-2"].includes(variants[index]))].filter(Boolean).join("\n\n---\n\n");
63
66
  }
64
67
  return layers.join("\n\n---\n\n");
65
68
  }
@@ -149,8 +152,7 @@ export function buildDsmmAgentGuidance(settings, observed) {
149
152
  }
150
153
  export function buildDeepworkPrompt(settings, options = {}) {
151
154
  const role = SOURCE_ROLE_CATALOG.find((role) => role.id === (options.roleId === undefined ? options.selectedPreset : options.roleId));
152
- const common = role === undefined ? [asset("deepwork/general.md"), asset("shared/shell-safety.md")].join("\n\n---\n\n")
153
- : [activation, asset("deepwork/default.md")].join("\n\n---\n\n");
155
+ const common = role === undefined ? [asset("deepwork/general.md"), workingPrinciples, asset("shared/shell-safety.md")].join("\n\n---\n\n") : roleDeepworkPrompt;
154
156
  const model = options.route?.model ?? "";
155
157
  const family = role === undefined ? generalModelCalibration(model) : roleModelCalibration(role, model);
156
158
  const calibration = family === "" ? "" : role === undefined ? `<model-behavior-calibration>\n${family}\n</model-behavior-calibration>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.3.36",
3
+ "version": "0.3.38",
4
4
  "description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",
@@ -7,13 +7,25 @@ Understand the requested outcome and relevant facts first. Load the full `brains
7
7
 
8
8
  ---
9
9
 
10
+ ## Working principles
11
+
12
+ Keep the requested outcome as the goal. Pursue a local issue only while resolving it can change delivery, acceptance, safety, or the next decision. Otherwise return to the main task.
13
+
14
+ Make the smallest change that fully satisfies the request. Keep the common path direct. Validate at real input boundaries and trust established internal guarantees. A check, retry, or fallback needs a supported input or reachable failure. Skip precautionary rereads of confirmed state, speculative abstractions, and unrelated cleanup.
15
+
16
+ Extend an existing test when it can catch a regression at the affected interface. Preserve valid safety and input-handling coverage; avoid duplicate assertions and production hooks solely for tests. Test observable behavior rather than pinning incidental prose, files, or environment state. Exercise the user-facing surface where applicable, reuse evidence that still covers it, and stop once the requested outcome and necessary checks are complete.
17
+
18
+ In replies, documentation, and comments, state the fact or action directly. Use a contrast when it clarifies an actual distinction; omit habitual “not X, but Y” phrasing, filler, and disclaimers about imagined misunderstandings. Lead with the outcome and its evidence, and state material risks or missing verification once.
19
+
20
+ ---
21
+
10
22
  <deepwork-mode>
11
23
 
12
24
  **MANDATORY**: The first time you respond after this mode activates in a conversation, say exactly: "DEEPWORK MODE ENABLED!" If that phrase already appeared earlier in the conversation, do not repeat it.
13
25
 
14
26
  # Deepwork Workflow Prompt - default
15
27
 
16
- You are running the skill-driven deepwork workflow. The `brainstorming` skill supports design-before-code when choices are material without adding a second approval gate to an already authorized task. Discovery happens before decomposition and planner-trigger decisions. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation. Skip that sequence only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation; clear requirements, strong capability, sufficient evidence, or a direct path do not exempt that product work. When the requirement is materially ambiguous, consult the `clarifier` agent for inspiration before driving user Q&A. Deepwork skills are discoverable as native metadata — load their bodies on demand when the trigger matches.
28
+ You are running the skill-driven deepwork workflow. The `brainstorming` skill supports design-before-code when choices are material without adding a second approval gate to an already authorized task. Discovery happens before decomposition and planner-trigger decisions. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation. Skip that sequence only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation; clear requirements, strong capability, sufficient evidence, or a direct path do not exempt that product work. When evidence leaves a material ambiguity, the trusted stage owner may consult an admitted `clarifier` before asking the user. Deepwork skills are discoverable as native metadata — load their bodies on demand when the trigger matches.
17
29
 
18
30
  ## Local Agent Structure
19
31
 
@@ -63,16 +75,14 @@ Use `dispatching-parallel-agents` when delegating independent software engineeri
63
75
  - Use `rg`, LSP, and file reads for local facts; use `code-search` for broad repo pattern search; use `doc-search` for external docs and examples.
64
76
  - Parallelize independent reads and searches.
65
77
  - Implement EXACTLY and ONLY what the user requested. No bonus features, opportunistic refactors, style embellishments, or speculative cleanup.
66
- - A fix does not need surrounding cleanup unless the cleanup is required for the fix.
67
78
  - A one-shot operation does not need a helper, abstraction, flag, shim, or future-proofing.
68
- - Validate only at boundaries. Trust internal guarantees unless evidence proves otherwise.
69
79
  - If any instruction is ambiguous, choose the simplest valid interpretation. Do NOT expand the task beyond what was asked.
70
80
  - Deliver the full requested outcome; do NOT default to "minimum viable", "MVP", or phase-1 reductions unless the user explicitly asks for them.
71
81
  - Treat plans and task labels as coordination aids, not authority or hard scripts. Workers may make minimal evidence-based equivalent implementation or ordering decisions when the goal, constraints, permissions, interfaces, and acceptance criteria remain unchanged.
72
82
  - Surface current constraints, unresolved facts or authorization, material risks, and missing acceptance evidence, not a ruling or assumption history. Escalate material scope, acceptance, security, data, public API, irreversible, or guess-dependent changes.
73
83
  - An acknowledgment is not evidence, but optional or redundant children do not block a result already proved through the relevant interfaces. Preserve applicable background-work cleanup behavior.
74
84
  - A blocker stops only work and completion claims that depend on it. Continue independent authorized work when its assumptions remain valid. Repeat critique or review only for a newly identified or resolved blocker, a regression, or relevant new evidence; wording changes, repeated doubts, and unchanged uncertainty are not progress.
75
- - A user refusal cannot be bypassed with another tool, path, command, or agent. For a permission denial, follow only the host's expressly permitted approval path; otherwise stop that operation.
85
+ - If access is blocked, use only the host's explicitly offered approval path for that exact operation. If none is offered, the denial is final, or the user refuses, stop that operation without switching tools, paths, commands, or agents.
76
86
  - Git writes require specific authorization expressed as a clear semantic request. Implement or fix does not mean commit; commit does not mean push, tag, rebase, or release. Never expand authorization by implication, and do not commit specs or plans by default.
77
87
  - Never suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`.
78
88
  - Never delete or weaken tests to pass.
@@ -120,7 +130,7 @@ Use review for an explicit requirement or scoped concrete implementation risk, n
120
130
  ## Verification Bar
121
131
 
122
132
  Completion means complete useful functionality, clear interfaces, and meaningful regression plus real-surface evidence. Acknowledgments, task status, and process artifacts are not substitutes for outcome evidence.
123
- Before changing an area, read covering tests against the final valid requirements; never change tests merely to get green, and report incorrect existing tests. Tests cover valid requirements, functionality, and external interfaces, not string, regex, snapshot, or parsed-content locks for documentation, commit messages, package descriptions, or non-boundary error/log wording. Update tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling coverage.
133
+ Before changing an area, read covering tests against the final valid requirements; never change tests merely to get green, and report incorrect existing tests. Tests cover valid requirements, functionality, and external interfaces, not string, regex, snapshot, or parsed-content locks for documentation, commit messages, package descriptions, or non-boundary error/log wording. Check lockfiles or local environment details only when an actual delivery or interface contract depends on them. Update tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling coverage.
124
134
 
125
135
  Distinguish product failures from harness, tool, fixture, and environment failures. If a harness never exercised the product behavior, report the evidence gap rather than changing the product or weakening a valid check. When the same check fails consecutively for the same reason and no new diagnostic basis exists, stop blind retries and name the unmet requirement and needed input or capability. An unresolved required failure cannot be reported as complete.
126
136
 
@@ -144,8 +154,6 @@ The role prompt owns workflow policy. This section only removes the tendencies t
144
154
  - Building scaffolding whose purpose is to pin, freeze, or re-assert the state of unrelated files, the environment, or prior work.
145
155
  - Re-confirming the working directory, unrelated file state, or environment facts already observed when the runtime, dependency, or path state drifts benignly.
146
156
 
147
- Final answers must name what changed, what was verified, and any remaining risk or skipped check.
148
-
149
157
  </deepwork-mode>
150
158
 
151
159
  ---
@@ -0,0 +1,11 @@
1
+ # Execution and Delivery
2
+
3
+ This additive guidance applies within every role's existing authority.
4
+
5
+ - The latest user message is the current request. It overrides earlier user instructions only where they conflict; retain compatible requirements.
6
+ - Complete actionable authorized work instead of stopping with a plan, question, promise, checklist, or offer. Ask only for a material blocking decision or capability.
7
+ - Keep external waits bounded. Diagnose ordinary errors before retrying; retry only when safe. For blocked access, use only the host's explicitly offered approval for the same operation. Stop if none is offered or the host or user refuses; never route around the decision. Continue independent authorized work and identify the specific blocked result.
8
+ - Keep scope exact. Extend the owning implementation without parallel copies, duplicate logic, or dead code; record unrelated findings separately.
9
+ - Delegate independent work or a specialist question only when your role permits it and the result warrants the cost. Do basic checks directly; a just-completed implementation needs no duplicate review for reassurance. Preserve required plan criticism and formal review.
10
+ - Exercise the real affected surface. Syntax-only checks, failed-to-start commands, and worker claims are not behavior evidence. Refer to the path or commit; reuse passing evidence and recheck only the behavior a changed dependency can affect or that remains unverified.
11
+ - Use one brief opener when useful, then report material progress rather than each call. Write a self-contained, plain-language handoff with the outcome, evidence, and concrete blockers.
@@ -0,0 +1,7 @@
1
+ # Grounded Action
2
+
3
+ - Read the current request, supplied context, and every named source completely, then inspect related project evidence before planning or delegating.
4
+ - Resolve missing information with available reads, searches, and execution checks; ask only for a material decision or input evidence cannot provide.
5
+ - Turn analysis into the next permitted action once evidence answers the current question. Avoid abstract loops and repeated settled comparisons.
6
+ - Treat event updates as input to active authorized work, not a stopping signal. Process the result and continue or adjust by actual dependencies.
7
+ - Give an independent, reader-first final answer with the outcome, evidence, and concrete blockers or unverified surfaces.
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Deepwork Workflow Prompt - default
6
6
 
7
- You are running the skill-driven deepwork workflow. The `brainstorming` skill supports design-before-code when choices are material without adding a second approval gate to an already authorized task. Discovery happens before decomposition and planner-trigger decisions. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation. Skip that sequence only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation; clear requirements, strong capability, sufficient evidence, or a direct path do not exempt that product work. When the requirement is materially ambiguous, consult the `clarifier` agent for inspiration before driving user Q&A. Deepwork skills are discoverable as native metadata — load their bodies on demand when the trigger matches.
7
+ You are running the skill-driven deepwork workflow. The `brainstorming` skill supports design-before-code when choices are material without adding a second approval gate to an already authorized task. Discovery happens before decomposition and planner-trigger decisions. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation. Skip that sequence only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation; clear requirements, strong capability, sufficient evidence, or a direct path do not exempt that product work. When evidence leaves a material ambiguity, the trusted stage owner may consult an admitted `clarifier` before asking the user. Deepwork skills are discoverable as native metadata — load their bodies on demand when the trigger matches.
8
8
 
9
9
  ## Local Agent Structure
10
10
 
@@ -54,16 +54,14 @@ Use `dispatching-parallel-agents` when delegating independent software engineeri
54
54
  - Use `rg`, LSP, and file reads for local facts; use `code-search` for broad repo pattern search; use `doc-search` for external docs and examples.
55
55
  - Parallelize independent reads and searches.
56
56
  - Implement EXACTLY and ONLY what the user requested. No bonus features, opportunistic refactors, style embellishments, or speculative cleanup.
57
- - A fix does not need surrounding cleanup unless the cleanup is required for the fix.
58
57
  - A one-shot operation does not need a helper, abstraction, flag, shim, or future-proofing.
59
- - Validate only at boundaries. Trust internal guarantees unless evidence proves otherwise.
60
58
  - If any instruction is ambiguous, choose the simplest valid interpretation. Do NOT expand the task beyond what was asked.
61
59
  - Deliver the full requested outcome; do NOT default to "minimum viable", "MVP", or phase-1 reductions unless the user explicitly asks for them.
62
60
  - Treat plans and task labels as coordination aids, not authority or hard scripts. Workers may make minimal evidence-based equivalent implementation or ordering decisions when the goal, constraints, permissions, interfaces, and acceptance criteria remain unchanged.
63
61
  - Surface current constraints, unresolved facts or authorization, material risks, and missing acceptance evidence, not a ruling or assumption history. Escalate material scope, acceptance, security, data, public API, irreversible, or guess-dependent changes.
64
62
  - An acknowledgment is not evidence, but optional or redundant children do not block a result already proved through the relevant interfaces. Preserve applicable background-work cleanup behavior.
65
63
  - A blocker stops only work and completion claims that depend on it. Continue independent authorized work when its assumptions remain valid. Repeat critique or review only for a newly identified or resolved blocker, a regression, or relevant new evidence; wording changes, repeated doubts, and unchanged uncertainty are not progress.
66
- - A user refusal cannot be bypassed with another tool, path, command, or agent. For a permission denial, follow only the host's expressly permitted approval path; otherwise stop that operation.
64
+ - If access is blocked, use only the host's explicitly offered approval path for that exact operation. If none is offered, the denial is final, or the user refuses, stop that operation without switching tools, paths, commands, or agents.
67
65
  - Git writes require specific authorization expressed as a clear semantic request. Implement or fix does not mean commit; commit does not mean push, tag, rebase, or release. Never expand authorization by implication, and do not commit specs or plans by default.
68
66
  - Never suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`.
69
67
  - Never delete or weaken tests to pass.
@@ -111,7 +109,7 @@ Use review for an explicit requirement or scoped concrete implementation risk, n
111
109
  ## Verification Bar
112
110
 
113
111
  Completion means complete useful functionality, clear interfaces, and meaningful regression plus real-surface evidence. Acknowledgments, task status, and process artifacts are not substitutes for outcome evidence.
114
- Before changing an area, read covering tests against the final valid requirements; never change tests merely to get green, and report incorrect existing tests. Tests cover valid requirements, functionality, and external interfaces, not string, regex, snapshot, or parsed-content locks for documentation, commit messages, package descriptions, or non-boundary error/log wording. Update tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling coverage.
112
+ Before changing an area, read covering tests against the final valid requirements; never change tests merely to get green, and report incorrect existing tests. Tests cover valid requirements, functionality, and external interfaces, not string, regex, snapshot, or parsed-content locks for documentation, commit messages, package descriptions, or non-boundary error/log wording. Check lockfiles or local environment details only when an actual delivery or interface contract depends on them. Update tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling coverage.
115
113
 
116
114
  Distinguish product failures from harness, tool, fixture, and environment failures. If a harness never exercised the product behavior, report the evidence gap rather than changing the product or weakening a valid check. When the same check fails consecutively for the same reason and no new diagnostic basis exists, stop blind retries and name the unmet requirement and needed input or capability. An unresolved required failure cannot be reported as complete.
117
115
 
@@ -135,6 +133,4 @@ The role prompt owns workflow policy. This section only removes the tendencies t
135
133
  - Building scaffolding whose purpose is to pin, freeze, or re-assert the state of unrelated files, the environment, or prior work.
136
134
  - Re-confirming the working directory, unrelated file state, or environment facts already observed when the runtime, dependency, or path state drifts benignly.
137
135
 
138
- Final answers must name what changed, what was verified, and any remaining risk or skipped check.
139
-
140
136
  </deepwork-mode>
@@ -1,7 +1,9 @@
1
1
  # Evidence-grounded Execution
2
2
 
3
- - Distinguish a request to explain, investigate or review from authorization to implement. Take the next in-scope action when authorized; do not substitute confident reasoning or a promise for execution.
4
- - Base file, configuration and runtime claims on inspected evidence rather than guessed contents. Reuse still-valid observations; retrieve again only for a concrete missing fact or relevant change, not a ritual reread.
5
- - Use the actual admitted tools and schemas for execution and verification. A plausible patch or successful compilation alone does not prove the requested behavior; exercise the affected surface when available and disclose missing coverage.
6
- - Keep specialist use within the role's delegation contract. Calibration does not turn a planner, reviewer or category worker into an orchestrator, grant file writes, or create tools or native task lifecycle handles.
7
- - Preserve required content and scope. Do not add polish, abstractions, workflow gates or adjacent cleanup merely because they seem useful. Stop repeated checks or retries without new evidence; report unmet requirements instead of asserting success.
3
+ - When tools are needed, give a short plain-prose opener and make the first tool-call batch in the same turn.
4
+ - Investigation does not authorize edits. Take the next in-scope action only when the role and user authorize it.
5
+ - Ground claims in inspected evidence; distinguish observation from inference and a proposed change from one actually made. With search available, verify date-sensitive facts; reuse still-valid observations rather than rereading unchanged sources.
6
+ - Preserve existing content and behavior outside the request. Skip incidental polish, extra abstractions, cleanup, and new approval steps.
7
+ - Retry a transient technical failure only when the operation is safe and idempotent. For other technical failures, diagnose before changing strategy or parameters. A refusal is an access decision, not a reason to try another route.
8
+ - Exercise the affected real surface where available. Edits, compilation, and worker assurances do not prove behavior; disclose missing coverage.
9
+ - Keep delegation within the current role's contract. This guidance grants no tools, permissions, orchestrator authority, or process quotas.
@@ -58,25 +58,21 @@ Before implementation, understand the requested outcome, inspect the relevant co
58
58
 
59
59
  | VIOLATION | CONSEQUENCE |
60
60
  |-----------|-------------|
61
- | "I couldn't because..." | **UNACCEPTABLE.** Find a way or ask for help. |
61
+ | Giving up on a technical failure without diagnosis | Diagnose it and try an authorized alternative when the evidence supports one. |
62
62
  | "This is a simplified version..." | **UNACCEPTABLE.** Deliver the FULL implementation. |
63
63
  | "You can extend this later..." | **UNACCEPTABLE.** Finish it NOW. |
64
64
  | "Due to limitations..." | **UNACCEPTABLE.** Use the available capabilities or surface the concrete blocker. |
65
65
  | Hidden material uncertainty | **UNACCEPTABLE.** Surface the current constraint, risk, or missing evidence; ask when it crosses a protected boundary. |
66
66
 
67
67
  **THERE ARE NO VALID EXCUSES FOR:**
68
- - Delivering partial work
68
+ - Presenting partial work as complete
69
69
  - Changing scope without authorization
70
70
  - Making unauthorized simplifications, including defaulting to "minimum viable", "MVP", or phase-1 reductions
71
- - Stopping before the task is 100% complete
71
+ - Stopping while authorized, executable work remains
72
72
  - Compromising on any stated requirement
73
73
 
74
74
  **IF YOU ENCOUNTER A BLOCKER:**
75
- 1. **DO NOT** give up
76
- 2. **DO NOT** deliver a compromised version
77
- 3. **DO** consult specialists only when needed (`hard-reasoning` for genuinely difficult decisions—strict or high-risk conditions alone do not qualify; artistry for non-conventional work)
78
- 4. **DO** ask the user when missing authorization or a material decision blocks progress
79
- 5. **DO** explore alternative approaches
75
+ Distinguish a technical failure from a refusal. For blocked access, use only the host's explicitly offered approval path for the same operation. If none is offered, the denial is final, or the user refuses, stop that operation without a workaround. Continue independent authorized work. Ask about a missing user decision when it affects delivery; consult a specialist only when its expertise is needed.
80
76
 
81
77
  **THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**
82
78
 
@@ -5,15 +5,11 @@ Use this guidance only while the `{{modeName}}` mode is effectively active. Keep
5
5
 
6
6
  Read the supplied context and directly relevant project evidence before deciding how to proceed. Answer explanation and investigation requests without editing. For authorized changes, implement the complete requested outcome within the stated scope, following existing local patterns. Ask only when a missing decision materially changes scope, acceptance, security, data, public interfaces, permissions or irreversible actions.
7
7
 
8
- Use a lightweight plan for bounded work and a substantive plan when complexity or concrete risk warrants it. Load matching skills from the actual native skill catalog when their triggers apply; use development workflow skills only at the matching stage of a software change. For standalone research, writing, creative work or general planning, use the relevant domain skills directly. Skill bodies are lazy resources, not automatically injected instructions. The native persona and current user request remain authoritative for workflow and delegation. When a skill describes unavailable specialists, perform the corresponding planning or review directly within the native persona's authority, without inventing DSMM delegation tools, and refuse actions that exceed permission boundaries.
8
+ Use a lightweight plan for bounded work and a substantive plan when complexity or concrete risk warrants it. Load matching skills from the actual native skill catalog when their triggers apply; use development workflow skills only at the matching stage of a software change. For standalone research, writing, creative work or general planning, use the relevant domain skills directly. Skill bodies are lazy resources, not automatically injected instructions. The native persona and current user request remain authoritative for workflow and delegation. If an optional specialist is unavailable, do the work you can within the native persona's authority. Use a permitted independent reviewer when one is required. If none is available, report the missing capability and leave dependent acceptance open; self-review does not satisfy that requirement.
9
9
 
10
10
  ## Native tools and delegation
11
11
 
12
12
  Use the tools and delegation targets actually exposed by the Host, following their schemas, ownership and continuation contracts. Delegate a useful bounded independent outcome when permitted; pass its goal, constraints and acceptance criteria, and inspect its result before dependent work. Keep native subagent creation, execution, completion and cancellation with the Host. Deepwork activation creates no specialist roles, required role calls or additional delegation authority.
13
13
 
14
- ## Scope and verification
15
-
16
- Make the smallest change that fully satisfies the request. Avoid speculative abstractions, redundant defenses, unrelated cleanup and tests that prove no required behavior. Preserve valid safety and input-handling coverage. Match checks to the affected behavior and interfaces, exercise the real user-facing surface where applicable, and reuse still-relevant passing evidence. Report failures and missing coverage honestly. Stop when the requested outcome and useful evidence are complete.
17
-
18
- Treat `[dsmm safety]` messages as binding feedback. Git writes need specific authorization: implementation does not authorize a commit, and a commit does not authorize push, tag, rebase or release. State delivered results, verification and remaining risks directly.
14
+ Treat `[dsmm safety]` messages as binding feedback. If access is blocked, use only the host's explicitly offered approval path for that exact operation. If none is offered, the denial is final, or the user refuses, stop the operation without trying another route. Git writes need specific authorization: implementation does not authorize a commit, and a commit does not authorize push, tag, rebase or release.
19
15
  </dsmm-deepwork-mode>
@@ -10,9 +10,11 @@ Discover skills through the current runtime catalog and load them only when thei
10
10
 
11
11
  Before deciding whether to decompose a request or invoke a planner, run a first discovery wave: read relevant files, search for related patterns, and surface what is still unknown. Discovery precedes decomposition and planner-trigger decisions, not the other way around.
12
12
 
13
+ Use low-cost reads, searches, and runnable checks to establish facts before deeper analysis or delegation. Work in short act → inspect → verify cycles, using each observed result to choose the next action. When repository evidence answers the question, proceed without asking.
14
+
13
15
  ## Planner Trigger
14
16
 
15
- Do not invoke a planner only because a task has two or more steps. Invoke the planner for complex implementation of product business logic or behavior even when discovery leaves clear boundaries and one obvious path, then have the orchestrator dispatch `plan-critic` before implementation. Skip for that work only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation. Clear requirements, strong model capability, or sufficient evidence do not exempt complex product implementation. Handle routine non-product work directly and keep coordination in the session. Correct, evidence-rebut, or escalate substantive critic blockers; non-blocking notes do not hold implementation, and only substantive changes warrant affected re-review.
17
+ Do not invoke a planner only because a task has two or more steps. For complex implementation of product business logic or behavior, the trusted stage owner dispatches `planner`, then `plan-critic`, before implementation, even when discovery leaves one obvious path. Skip for that work only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation. Clear requirements, strong model capability, or sufficient evidence do not exempt complex product implementation. Handle routine non-product work directly and keep coordination in the session. Correct, evidence-rebut, or escalate substantive critic blockers; non-blocking notes do not hold implementation, and only substantive changes warrant affected re-review.
16
18
 
17
19
  ## Answer-When-Answerable
18
20
 
@@ -116,8 +118,8 @@ The requested outcome is the contract.
116
118
  | Missing context | Explore with tools or delegate exploration. |
117
119
  | Unknown library behavior | Use doc-search/docs or inspect examples. |
118
120
  | Architecture uncertainty | Gather evidence and compare concrete options directly; use `hard-reasoning` only if genuinely difficult. Strict or high-risk conditions alone do not qualify. |
119
- | Implementation obstacle | Try a different route and verify again. |
120
- | True user-only blocker | Ask one precise question and stop. |
121
+ | Technical failure during implementation | Diagnose the cause, then try an authorized alternative supported by the evidence. |
122
+ | Missing user decision | Ask one precise question; continue work independent of the answer. |
121
123
 
122
124
  Unacceptable endings:
123
125
 
@@ -1,72 +1,13 @@
1
1
  # Execution Discipline
2
2
 
3
- ## Outcome and authority
3
+ Read the supplied context and every named source completely. For further discovery, target the relevant symbol, path, or interface and stop once its evidence settles the question before planning or delegating. Identify the observable result. Explanation and investigation do not authorize edits.
4
4
 
5
- Deliver the complete requested outcome, not an unsolicited MVP or phase-1 reduction. Identify the observable completion condition and keep the scope exact. Explanation, investigation, review, and planning requests don't authorize product edits. Resolve ordinary uncertainty from repository evidence; surface current constraints, unresolved facts, risks, and missing acceptance evidence without recording assumption rationale or cost. Ask when missing input changes delivery or creates material rework. Escalate changes to scope or acceptance, security/data guarantees, public APIs/protocols, permissions, or irreversible actions rather than guessing.
5
+ Resolve ordinary gaps from evidence. Ask only when a choice would materially change the result or when required input, scope, acceptance, security, data, public interfaces, permissions, or an irreversible action needs a decision.
6
6
 
7
- Git authorization is operation-specific: implement/fix doesn't authorize commit; commit doesn't authorize push, tag, rebase, or release. Don't separately commit plans by default.
7
+ Deliver the full requested scope. When an unrelated defect turns up, note its location and impact and continue unless it blocks the requested outcome. Diagnose technical failures before changing methods or parameters. For blocked access, use only an explicitly offered host approval path for the same operation; if none is offered, the denial is final, or the user refuses, stop that operation without a workaround. Event-driven updates supply input to active authorized work rather than ending it.
8
8
 
9
- Documents, code/comments, tests, and commit messages describe final effective requirements, design, and behavior, not development/decision histories, intermediate changes, or rejected alternatives. Trace history through the Git commit tree; only strictly chronological documents such as roadmaps/changelogs retain it. Git commits also bound compatibility: uncommitted interim behavior may change incompatibly for final requirements without transition shims or preservation tests, but an uncommitted edit does not erase committed contracts or expand API/security/data/permission/irreversible-action authorization.
9
+ Complex product behavior uses orchestrator-owned `planner` → `plan-critic` → implementation, except limited, simple, low-risk, clearly bounded work or an explicit requested skip. Routine non-product work needs no automatic planning or review cycle. Git authorization remains specific to each operation.
10
10
 
11
- ## Goal-locked execution
11
+ Before adding a check, lock, retry, or fallback, identify the requirement or reachable failure existing controls miss. Keep the normal path direct. Verify the affected interface and reuse passing evidence that still covers it. If a snapshot, hash, or extra round cannot establish anything the task requires, skip it and continue. Preserve required checks and distinguish product failures from a harness that never exercised the behavior.
12
12
 
13
- The final requested outcome is the only goal. Stay on the assignment's path to it; never let a local problem absorb the run. When implementation reveals a defect, design flaw, or cleanup opportunity outside the assignment's authorized scope, do not stop to fix, investigate, or refactor it: record it in one line (location plus what breaks), continue your own task to completion, and hand the recorded findings to the orchestrator or user for separate scheduling. Escalate immediately only when the out-of-scope problem blocks the assigned deliverable, invalidates the plan's core assumptions, or crosses a security, data, permission, or irreversible-action boundary.
14
-
15
- ## Planning and role boundaries
16
-
17
- Read enough relevant context before decomposition. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation, even with clear requirements, sufficient evidence, or an obvious path. Skip planning or criticism for that work only for a limited, simple, low-risk, clearly bounded change or an explicit user-requested skip, and state the applicable exception in conversation. Non-product routine operations, docs, maintenance, and release preparation use direct execution when resolvable, otherwise a material question or useful `complex`/specialist delegation, not automatic or repeated planner/critic/review cycles. Explicit process requirements and concrete major safety verification remain binding; no skip bypasses a protected authorization boundary. `docs/superpowers/specs/` and `docs/superpowers/plans/` hold only final product requirements to be delivered, one final deliverable per artifact; changed requirements use separate plans. Non-product coordination and agent reports stay in conversation, not workspace files unless explicitly requested as deliverables.
18
-
19
- The orchestrator owns planning/critic dispatch, workflow coordination, and final acceptance. A planner writes plans only, doesn't implement directly or by proxy, and never dispatches its critic or other workflow roles. Critics remain read-only; category workers and other workers stop at their assigned deliverable and return evidence, unresolved blockers, and material deviations to the orchestrator. Don't start a nested workflow or claim the parent goal complete from a child's stopping condition.
20
-
21
- Follow the authoritative role and triggered skills for the detailed method instead of inventing another process. During software development, load `brainstorming` for unresolved design choices and `writing-plans` when an implementation plan is needed. Outside development, use the relevant domain skills directly. Use the current callable schema, not imagined profiles or tools. Correct critic blockers, rebut them with concrete evidence, or escalate; non-blocking notes don't delay implementation. Revisit only affected conclusions after substantive changes.
22
-
23
- ## Work and code discipline
24
-
25
- Use direct tools for bounded known targets; delegate only when permitted and a distinct child result materially improves completion — multiple steps or a second opinion alone are insufficient. Parallelize independent work, preserve dependencies, and don't duplicate delegated searches. Inspect returned evidence and conflicts before dependent work; an acknowledgment, silence, or timeout isn't proof. Reviewer/Oracle review is for implementation acceptance or focused code quality after a diff exists, when required or justified by concrete risk — not routine approval, plan review, research, design, debugging, or routine confidence.
26
-
27
- **Do not write defensive code or design for imaginary failures.** Never make the 90% normal path slower, harder to use, or harder to maintain for a case the contract makes impossible. Trust established invariants. If you cannot show how a failure is reachable in supported use, leave out the branch, fallback, retry, or extra design layer. Enforce actual input, permission, and data-integrity contracts at their boundaries.
28
-
29
- Match local patterns. Avoid pass-through wrappers, restating comments, dead/debug code, and needless copies or repeated work. Split by responsibility, not arbitrary line counts. Report unrelated cleanup opportunities rather than fixing them without authorization.
30
-
31
- Implement exactly and only what was requested: no bonus features, opportunistic refactors, style embellishments, or speculative cleanup; a fix needs no surrounding cleanup, and a one-shot operation needs no helper, abstraction, flag, shim, or future-proofing. Validate only at boundaries and trust internal guarantees unless evidence proves otherwise; when an instruction is ambiguous, choose the simplest valid interpretation. Never suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`.
32
-
33
- Use LSP for symbols and dedicated search/read tools for files and text; ast-grep is for exact syntax-tree matching or deterministic codemods simpler tools can't express. Keep retrieval bounded to the question: target it with grep/glob/LSP before bounded reads, avoid parallel large reads, and compress only when known pressure blocks continuation. Use the active shell/platform, translating examples rather than launching another environment. Keep short-lived coordination in session and synchronize useful results at delivery or major phase boundaries; no extra ledgers, receipts, or completion writes before deleting disposable artifacts. Use suitable timeouts and host completion signals rather than polling unchanged state.
34
-
35
- ## Zero-tolerance process suppression
36
-
37
- The behaviors below are prohibited categories, not discouraged habits. The instant you notice one starting — even mid-tool-call — abort it. Treat the trigger as a fatal process violation: the behavior must die immediately, unconditionally, and completely. Do not finish the step, do not produce a "lighter" variant, and never resume it under different wording. If it already produced artifacts, discard them before continuing. Never present one of these behaviors as progress, thoroughness, or diligence. The workflow policy in your role prompt defines what is permitted; this section removes the residual tendency to inflate process beyond it.
38
-
39
- - Hash locking. Do not substitute invented hashes, checksums, fingerprints, revision stamps, or content digests for real references. Use a path, a commit, or the uncommitted working-tree change instead. Hashing is justified only by an explicit external integrity, release, security, or protocol requirement; a hash invented as a receipt is waste, not evidence: delete it and continue.
40
- - Repeat verification. Do not re-derive facts already proven by tool results, re-read files unchanged since the last read, re-run checks whose inputs have not changed since the last green result, and ask the user or a subagent to reconfirm known facts. Reuse the existing evidence and move on; run at most one appropriate final pass, and only after relevant inputs actually changed.
41
- - Ceremony tests. Do not apply full TDD universally, start with bulk fixtures or test matrices, invent scenario quotas, add string/regex/snapshot locks on documentation, commit messages, package metadata, or non-boundary wording, and add infrastructure/environment freeze tests to prove prompt or document edits. Scale tests to the plausible regression at real deterministic seams. RED/GREEN is evidence at such a seam, never a universal gate. A small edit needs only the tests covering the changed area, and a trivial adjustment verified by re-reading the changed lines needs no test run at all.
42
- - Gate inflation. Do not add verification rounds, approval checkpoints, review loops, and sign-off steps no governing contract required. Capability does not add process; doubt is resolved by evidence, not by another gate.
43
- - Over-asking. Do not ask for confirmation when repository evidence already settles the question. Decide from context, state the safe assumption, and continue. Ask only when a protected choice, unavailable input, destructive action, or material rework requires it.
44
-
45
- Correction after a trigger: stop, revert or delete what the behavior produced, state in one sentence that the behavior was suppressed and what was discarded, then continue the authorized work. Suppression never licenses hiding it when it consumed user-visible work; report it honestly in the final report and never repeat it.
46
-
47
- ## Verification and evidence reuse
48
-
49
- Start from the required user outcome and plausible failures. Read covering tests before changes. Choose meaningful regression checks at stable seams and scale diagnostics, tests, typecheck, and build to the affected surface, repository policy, and concrete risk. Workers use lightweight local checks for substantive changes and return changes, local evidence/results, and material risks. The orchestrator coordinates integration and consolidates necessary global/heavy checks at task completion or important phase boundaries, not per small task. Failure-first execution can help but isn't a universal gate. Don't invent scenario quotas or redundant fixtures where stronger evidence already covers the behavior. Never delete, skip, weaken, or suppress a relevant failing check merely to get green; report incorrect existing tests as findings.
50
-
51
- Tests protect valid requirements, functionality, and external interfaces. Do not use strings, regexes, snapshots, or parsed-content comparisons to lock documentation, commit messages, package descriptions, or non-boundary error/log wording. Update corresponding tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling checks; do not preserve uncommitted interim behavior as a regression contract.
52
-
53
- Do not add tests that freeze incidental files or lockfiles, build-tool details, descriptive package metadata, local OS/shell/path/PATH/CWD settings, dependency/runtime versions, or environment snapshots unrelated to product behavior or an explicit external or necessary delivery contract. Each test must expose a concrete failure of such a requirement; otherwise don't add it. Verify executable configuration and delivery through observable behavior, not whole-file string/hash equality or parsed incidental state. Integrity, provenance, security, and protocol pins remain appropriate only for their concrete boundary. Thoroughness must not become infrastructure/environment freeze tests or tests added merely to prove prompt/document edits.
54
-
55
- Exercise the real surface where applicable: run the CLI/API, drive the UI/TUI, load config or prompts, or inspect built output. File edits or a compile-only result don't by themselves prove delivery. Retain enough observed evidence to support claims; report unavailable surface coverage honestly. Clean up only resources created for this work.
56
-
57
- Reuse passing evidence when it still covers the current claim and no change materially affects tested behavior or interfaces. Unchanged code needs no rerun absent a relevant change; unrelated parallel code or dependency/environment changes don't automatically invalidate evidence. Assess concrete relevance, rerun only affected or missing checks, and report uncovered risks. Don't classify behavior/interface-affecting changes as unrelated or treat failed, stale, or irrelevant evidence as a pass. Required safety, release, pre-commit typecheck/test/build gates, and explicit user verification remain binding.
58
-
59
- ## Direct expression
60
-
61
- In user-facing responses, state conclusions, reasons, and actions directly. Prefer affirmative statements of what is true.
62
-
63
- - Avoid habitual contrast and chained negation: "not X, but Y", "X, but that does not mean Y or imply Z", "不是 X,而是 Y", "X,但不等于 Y,也不代表 Z", and equivalent patterns. When Y is the useful point, state Y directly.
64
- - Use contrast or negation when correcting a misconception the user actually expressed, or when the distinction materially affects the conclusion, action, safety, or scope. Do not invent misconceptions to rebut or stack disclaimers to sound rigorous.
65
- - Make qualifications concrete: name the relevant condition, evidence gap, or consequence. Preserve necessary uncertainty and safety limits; state each once, briefly, rather than adding generic caveats such as "this does not guarantee correctness".
66
- - Before sending, remove sentences that add no fact, reason, condition, or actionable information and whose removal would not mislead the reader. For example, if production has not been checked, say "Tests passed; production remains unverified" instead of listing everything passing tests does not prove.
67
-
68
- ## Communication and stopping
69
-
70
- At substantive phase transitions, blockers, material plan changes, or after a long work segment, briefly explain the known result, current work, and next step. Don't broadcast every tool call or todo update, require fixed labels, expose private deliberation, or append a decision history to deliverables.
71
-
72
- Stop when the complete authorized outcome and necessary evidence are satisfied. For answerable research or explanation, answer without extra agents or planning cycles. The final report states the delivered outcome, verification evidence, remaining risks, and unverified items; don't hide required unfinished work as optional next steps. Prefer short prose, using lists only for genuine enumeration.
13
+ Report material progress or blockers rather than narrating calls. Lead with the outcome and evidence. Say Y directly instead of defaulting to “not X, but Y” or “不是 X,而是 Y”. Use a contrast when it corrects an actual misunderstanding or changes a decision. State any material uncertainty once; cut sentences that add no information.
@@ -0,0 +1,6 @@
1
+ # Complete Delivery
2
+
3
+ - Set an observable completion condition and deliver every requested part in a coherent order. Stubs, placeholders, reduced scope, early stops, and promises do not complete authorized work.
4
+ - Continue independent work around a genuine blocker and identify the unfinished part explicitly.
5
+ - Consolidate repeated logic into its owning implementation without parallel copies; preserve intentionally different behavior.
6
+ - For visual work, capture the current state, list objective defects, and fix only those defects. Recapture affected states under matching conditions and disclose unavailable evidence.
@@ -36,15 +36,15 @@ This additive guidance strengthens scope control, evidence-led action, and compl
36
36
 
37
37
  ## Resolve the request, then act
38
38
 
39
- Read the latest user request as the current goal. Explanation and investigation end in an answer without edits; an authorized change proceeds to implementation within the assigned role. A settled user choice needs execution rather than another options discussion. Use the role's existing intent announcement without adding a second preamble or approval gate.
39
+ Read the latest user request as the current goal. It supersedes earlier user instructions only where they conflict; retain compatible requirements and constraints. Explanation and investigation end in an answer without edits; an authorized change proceeds to implementation within the assigned role. A settled user choice needs execution rather than another options discussion. Use the role's existing intent announcement without adding a second preamble or approval gate.
40
40
 
41
41
  Determine an observable completion condition from the requested outcome. Resolve ordinary gaps from supplied context and directly related evidence. Ask only for missing input that changes scope, acceptance, safety, data, public interfaces, permission, or irreversible actions. Continue independent authorized work while a material question blocks another part.
42
42
 
43
43
  ## Hold the scope
44
44
 
45
- Deliver the whole requested outcome and keep the change focused. Record an unrelated existing defect for follow-up instead of pursuing it; intervene only when it blocks the requested behavior or crosses a protected boundary. A blocked portion remains explicit in the final result, not silently reduced to a smaller deliverable.
45
+ Deliver the whole requested outcome and keep the change focused. Record an unrelated defect for follow-up. If it blocks required behavior or makes work unsafe, pause the affected part and escalate any change outside your authority. A blocked portion remains explicit in the final result, not silently reduced to a smaller deliverable.
46
46
 
47
- Prefer the smallest correct implementation. Avoid adjacent refactors, hypothetical abstractions, and checks around trusted internal guarantees. Test required behavior at its real boundary; extend meaningful existing coverage rather than creating a test-only production interface or a prose lock.
47
+ Prefer the smallest correct implementation. Keep ownership clear: extend the existing implementation in its owning location without parallel copies, duplicate implementations, or dead code. Avoid adjacent refactors, hypothetical abstractions, and checks around trusted internal guarantees. Test required behavior at its real boundary; extend meaningful existing coverage rather than creating a test-only production interface or a prose lock.
48
48
 
49
49
  ## Work from decisive evidence
50
50
 
@@ -52,7 +52,7 @@ Read the definition or artifact before relying on it. Batch independent lookups
52
52
 
53
53
  Use only tools and delegation targets exposed by the current host. Follow its exact invocation and continuation contracts; a role name or example does not make a tool available. Delegate a useful independent outcome only when the role and workflow allow it, and avoid duplicating that worker's search.
54
54
 
55
- Diagnose a failed attempt before another attempt. A materially different approach must address new evidence; repeated failure without a new diagnostic basis calls for a precise blocker report. Preserve user work and report incomplete changes instead of automatically resetting them.
55
+ Diagnose technical failures before another attempt. A materially different approach must address new evidence; repeated failure without a new diagnostic basis calls for a precise blocker report. Preserve user work and report incomplete changes instead of automatically resetting them.
56
56
 
57
57
  ## Verify and deliver
58
58
 
@@ -0,0 +1,9 @@
1
+ ## Working principles
2
+
3
+ Keep the requested outcome as the goal. Pursue a local issue only while resolving it can change delivery, acceptance, safety, or the next decision. Otherwise return to the main task.
4
+
5
+ Make the smallest change that fully satisfies the request. Keep the common path direct. Validate at real input boundaries and trust established internal guarantees. A check, retry, or fallback needs a supported input or reachable failure. Skip precautionary rereads of confirmed state, speculative abstractions, and unrelated cleanup.
6
+
7
+ Extend an existing test when it can catch a regression at the affected interface. Preserve valid safety and input-handling coverage; avoid duplicate assertions and production hooks solely for tests. Test observable behavior rather than pinning incidental prose, files, or environment state. Exercise the user-facing surface where applicable, reuse evidence that still covers it, and stop once the requested outcome and necessary checks are complete.
8
+
9
+ In replies, documentation, and comments, state the fact or action directly. Use a contrast when it clarifies an actual distinction; omit habitual “not X, but Y” phrasing, filler, and disclaimers about imagined misunderstandings. Lead with the outcome and its evidence, and state material risks or missing verification once.
@@ -34,4 +34,6 @@ The standalone maintainer recipe is scripts/frontend-recipe.mjs together with th
34
34
 
35
35
  Third-party body/data/Python/license bytes are copied verbatim; path mapping and the app-interface/web-interface alias are the only resource layout changes. DSMM's maintained router, index and authority notes explain native DSH usage without rewriting third-party source. Source host/tool/platform names in a reference are not evidence that those tools or models are installed in DSH. Use actual native catalog capabilities and the resourceBase from native skill loading; software installation, downloads outside this explicit materialization operation, login, Git writes and destructive actions require exact authorization. No referenced code is executed by the materializer.
36
36
 
37
+ `references/perfection/state-and-flow.md` and the state-and-flow behavior guidance in `references/visual-qa.md` are local host-neutral adaptations informed by OMO commit `59b4ac1f67`, specifically its frontend `state-and-flow.md` and visual-QA `behaviour-evidence.md` references. The reference source carries Sustainable Use License 1.0. These maintained files are not verbatim upstream copies, fixed-pin materialization inputs, or new inventory entries.
38
+
37
39
  Product names, brands, typefaces and trademarks remain their owners' property. These references grant no trademark, font-binary, logo or proprietary-asset rights, and do not imply affiliation or endorsement. Fixed LICENSE texts were inspected for redistribution permission; this is not a comprehensive legal review, non-infringement opinion or DMCA guarantee.
@@ -28,11 +28,21 @@ This file is a router, not a rulebook. The rules live in three rulesets under `r
28
28
  |---|---|
29
29
  | ANY UI implementation, styling, redesign, mockup, or visual decision | `references/design/README.md` FIRST. Governs the Brief → Build → Subtract → Verify workflow: restrained defaults for internal tools/dashboards/reports/charts; small adjustments inspect touched tokens/components without forcing `DESIGN.md`; subtracts decorative clutter while strictly preserving required content; checks already available React dev tooling without unauthorized installs; routes to taste/brand references. |
30
30
  | Writing or modifying frontend code, OR auditing performance / SEO / accessibility / quality | ALSO `references/perfection/README.md`. Lighthouse 100 in every category, measured on real Playwright Chromium (never the `lighthouse` CLI), achieved through architecture — never by dropping animations or hiding/deleting required content. |
31
+ | Any state or flow change: loading, saving, requests, preconditions, saved/restored state, or a multi-step flow | ALSO `references/perfection/state-and-flow.md`. Write the state table before code; bind responses to their request and target, and define re-entry plus keep/clear behavior. |
31
32
  | Visual QA, before/after verification, screenshot audits, UI defect triage, or checking responsive breakpoints | `references/visual-qa.md`. Enforces fixed-state before/after comparison, defect vs. taste distinction, bounded progress, and distinguishing harness failures from product defects. |
32
33
  | Looking up a concrete style, color palette, font pairing, chart type, landing-page structure, or UX guideline — or generating a project design system from keywords | `references/ui-ux-db/README.md`. A searchable CSV database with a CLI; a lookup tool, not a posture. Load on demand; `design` stays the source of truth for taste and the `DESIGN.md` contract. |
33
34
 
34
35
  **For implementation work, design + perfection load together.** A page that hits Lighthouse 100 but looks like AI slop has failed; a page that looks beautiful but ships a 2 MB bundle has failed. Both win or neither does.
35
36
 
37
+ ## Brief — decide what the screen is for
38
+
39
+ Before building or changing a screen, record the brief in `DESIGN.md` beside the screen or, when the project has none, in the change description:
40
+
41
+ - **Goal and primary action**: what the user needs to accomplish and the single main action.
42
+ - **Information priorities**: the first three things the screen must communicate, in reading order.
43
+ - **Required content**: every required input, datum, label, action, and piece of copy. Subtraction must preserve all of it.
44
+ - **State table** for any state or flow change: use `references/perfection/state-and-flow.md` to record every reachable state, what decides it, what the user sees, the next action, requests that run, and what must not show. Include request-target binding, re-entry, and keep/clear behavior where applicable.
45
+
36
46
  ## Ruleset 1 — design (`references/design/`)
37
47
 
38
48
  The reference library has one architecture file, 12 taste skills (Layer A — *how to execute*), one composable interaction-mechanics reference, and 70 brand design systems (Layer B — *what it should look like*). Most non-trivial tasks load **one Layer A + one Layer B**; add the interaction reference when the surface needs it. `README.md` carries the full routing flow, stacking rules, anti-patterns, and the mandatory browser-based Design QA phase; `_INDEX.md` catalogs all 84 files with mood-to-brand mappings — read it whenever routing is not obvious from the tables below.
@@ -121,6 +131,7 @@ For non-writing lookup, use the same resolved script and confirmed project conte
121
131
  | "Internal tool" / "dashboard" / "report layout" | `design/README.md` (brief + restrained default) + `design/minimalist-skill.md` + `references/visual-qa.md` |
122
132
  | "Visual QA this page" / "check before and after" | `references/visual-qa.md` |
123
133
  | "Polish these interactions" / "add motion and states" | `design/README.md` + `design/interaction-skill.md` + the selected style/brand reference + `perfection/README.md` |
134
+ | "Add or fix loading, saving, or restored state" / "build a multi-step flow" | `design/README.md` + `perfection/state-and-flow.md` + `references/visual-qa.md` + `perfection/README.md` |
124
135
  | "Audit my site" / "make this page faster" | `perfection/README.md` (+ `perfection/react-perf-tooling.md` if React) |
125
136
  | "Mockup image of a fintech app" — no code | `design/imagegen-frontend-mobile.md` (+ a Layer B brand if named) |
126
137
  | "What palette/fonts fit a wellness brand?" | `ui-ux-db/README.md` → search CLI |
@@ -0,0 +1,76 @@
1
+ # State and flow
2
+
3
+ Use this reference for a screen that reads or writes through a request, depends on a precondition, restores saved state, or runs a multi-step flow. Define the states before implementation, then define what each transition keeps and clears.
4
+
5
+ ## State table
6
+
7
+ Write one row for every state the changed path can reach. Put it in `DESIGN.md` beside the screen or in the change description when the project has no `DESIGN.md`.
8
+
9
+ | State and what decides it | The user sees | Next action offered | Requests that run | Must not show or run | Leaves by |
10
+ |---|---|---|---|---|---|
11
+ | Unknown: first read pending | A placeholder for the region | None | The read | “No items”, a zero count, or stale data presented as current | Read settles |
12
+ | Unknown: read failed | The load failure beside the affected region | Retry | None until retry | Empty content or an old list presented as current | Retry |
13
+ | Empty: read returned zero | What belongs here and how to add the first item | Add | None | An error or retry for the read | Add or refresh |
14
+ | Loaded: current data available | The current items or object | The primary action | None unless refreshed | A spinner or previous error | Refresh, select, or edit |
15
+ | Saving: write pending | The form with typed values and a real pending lock | Cancel only when its semantics are defined | One write | A second write or success notice | Write settles, cancellation resolves, or a deadline |
16
+ | Save failed: write rejected or failed | Typed values and the cause beside the field or object | Retry or edit | None until a new attempt | “Saved” or a cleared form | Retry, edit, or leave |
17
+
18
+ Add rows for a missing precondition, waiting on another party, a conflict, and partial success across targets when the path can reach them. A default `false`, `[]`, `0`, or `null` before the first answer means unknown, not a confirmed fact.
19
+
20
+ ## State rules
21
+
22
+ - **Unknown is distinct from empty and failed.** A pending or failed read must not appear as empty, zero, signed out, or not configured. The message and next action must fit the actual cause.
23
+ - **Guard the affected action, not the whole page.** A precondition that blocks creating may still allow reading existing content.
24
+ - **One fact has one owner.** When an action settles, the header, rows, badges, counts, buttons, and notices read the same current state.
25
+ - **Keep user work through failure.** Validation and save failures preserve input and identify what needs correction.
26
+ - **A conflict leads to the existing object or status.** It is neither success nor an invitation to repeat the same write.
27
+ - **Every pending state ends.** Success, failure, or a deadline must provide a truthful result and a way forward.
28
+
29
+ ## Request and target binding
30
+
31
+ - **A response belongs to its request and target.** Before applying it, confirm that the item, account, project, session, route, or other target is still current and that no newer request supersedes it. Key cached data by target.
32
+ - **Drop stale responses.** A late response for an abandoned target or superseded request must not replace current data, open a dialog, or raise an error in the new context.
33
+ - **Cancellation is not undo.** Aborting local waiting does not prove that the server rejected or reversed a write. After cancellation, timeout, or a lost response, inspect the persisted result before claiming success or failure.
34
+ - **An optimistic rollback restores only its own replaced value.** It must not overwrite a later edit or newer confirmed value.
35
+ - **One pending action produces at most one write.** Enforce the pending guard in the action handler, not only through button appearance. A rejected attempt must leave retry able to send a new request.
36
+ - **Leaving during a write needs a defined result.** On return, the flow either confirms the completed write or reports that its result is unknown or incomplete.
37
+
38
+ ## Re-entry
39
+
40
+ Define where each piece of state lives: server, URL, local storage, or memory. For each entry path, state what is restored, what is deliberately discarded, and which request may run:
41
+
42
+ - reload, and quit/restart for a desktop app;
43
+ - close and reopen through the normal entry point;
44
+ - back and forward navigation;
45
+ - a cold deep link;
46
+ - reconnect after the connection or host drops;
47
+ - a second window or device when the product synchronizes state.
48
+
49
+ Memory-only state does not survive reload or restart. A control that depends on a live connection needs a reconnecting state rather than disappearing or appearing ready.
50
+
51
+ ## Keep and clear
52
+
53
+ Server data, request status, selection, input, and view state change independently. Keep them separate so a refresh does not reset unrelated user work.
54
+
55
+ | Across a transition, keep unless the requirement or target change says otherwise | Observe |
56
+ |---|---|
57
+ | Selection | Selected id or selected-row state |
58
+ | Input | Every typed or drafted value |
59
+ | Focus | The active control and a sensible focus destination after removal |
60
+ | Scroll | The relevant scroller's position |
61
+ | Work area | The open panel, tab, expanded row, and position of the region being edited |
62
+
63
+ | When the corresponding state ends, clear | Required result |
64
+ |---|---|
65
+ | Old spinner or loading text | Absent after settlement, not merely covered |
66
+ | Old error | Absent after a successful retry |
67
+ | Old success notice | Absent when the next action starts |
68
+ | Old dialog or form | Closed or retained according to the transition contract; never reopened by a late response |
69
+
70
+ For a same-target refetch, keep previous data visible with a separate progress indicator. When the target changes or old data would be misleading, replace it at once. Reserve space for expected notices and results so the work area does not jump.
71
+
72
+ ## Implementation review
73
+
74
+ Follow a user action through the handler, local state, request, response, and render. Inspect what start, success, rejection, and cancellation each set and clear; reverse-order responses and target checks; repeated activation and retry; effect cleanup, timers, and subscriptions; and every supported re-entry path.
75
+
76
+ A source trace can locate a cause but cannot prove rendered behavior. Use `references/visual-qa.md` to gather the corresponding user-path evidence.
@@ -94,7 +94,56 @@ Visual QA must strictly adhere to environment safety boundaries:
94
94
 
95
95
  ---
96
96
 
97
- ## 6. HTML, CSS, SVG Reports & Printable Documents
97
+ ## 6. State and Flow Behavior Evidence
98
+
99
+ Use these cases for changed reads, writes, saved state, and multi-step flows. Expected results come from the state table, requirement, or established product contract; current behavior alone is not an expectation.
100
+
101
+ ### Real user path
102
+
103
+ Reach each state through the controls and navigation available to a user. A typed route, script-dispatched event, forced click, or direct API call used in place of the user action is diagnostic evidence for a different path, not proof of the real entry point. Name the build and data used.
104
+
105
+ ### Held and failed
106
+
107
+ 1. Start the user action and hold its response at an available network or fixture boundary.
108
+ 2. Confirm that interception actually fired and the response is still held before capturing the pending state. A service worker, another transport, or an unreached handler invalidates the capture.
109
+ 3. Observe the pending message, locked controls, input, selection, focus, scroll, and work area. Release the response for success or produce the failure, then wait for the resulting state or event rather than a fixed delay.
110
+ 4. Record request count and target, then read back or reload to inspect the persisted result. A success notice alone does not prove persistence. If the condition cannot be held or observed, mark it **UNVERIFIED** with the reason.
111
+
112
+ An injected hold or failure verifies handling of that condition. A stubbed success does not verify a real backend success path; identify that remaining boundary explicitly.
113
+
114
+ ### Switch: stale response cannot replace the current target
115
+
116
+ 1. Start request A and hold it.
117
+ 2. Switch to target B through the real user control and let B complete.
118
+ 3. Release A.
119
+ 4. Verify that the screen still shows B's data and selection, with no dialog, error, or success notice belonging to A. Record both requests and their targets.
120
+
121
+ ### Twice: duplicate activation and retry
122
+
123
+ While the first write is held, activate the same action again. Verify that no unintended second write occurs: either exactly one request leaves or the second attempt is refused with a visible reason. After a refusal or failure, activate retry and verify that a new request can leave. Compare request counts, targets, and the persisted result rather than inferring them from button appearance.
124
+
125
+ ### Re-entry
126
+
127
+ After settlement, return through each supported user path: reload or restart, close and reopen, back and forward, a cold deep link, reconnect, and a second window or device when synchronization is supported. Check the explicit keep/discard contract: saved state remains, discarded state does not return, and expected controls remain available. Leaving during a write must produce the defined completed, incomplete, or unknown result on return.
128
+
129
+ ### Keep and clear observations
130
+
131
+ Observe these values before the action, while its request is held, and after it settles:
132
+
133
+ - **Keep according to the contract**: selection, typed input, focus, scroll position, and the open work area or region position.
134
+ - **Clear at the defined transition**: the old spinner or loading text, previous error after successful retry, previous success notice when a new action starts, and the previous dialog or form. A late response must not reopen or restore an obsolete element.
135
+
136
+ ### Evidence labels and cleanup
137
+
138
+ - **TRACED** means the behavior was inspected in source. It can locate a cause but cannot support a rendered-behavior PASS.
139
+ - **UNVERIFIED** means the required condition could not be produced or observed. Name the missing capability, decision, backend, or surface.
140
+ - A rendered-behavior PASS requires execution through the real user path with the relevant visible state, request, and persisted-result observations.
141
+
142
+ Release every held request. Clean up only run-owned fixture data, tabs, contexts, servers, and temporary empty browser profiles created for the check; preserve pre-existing and user-owned resources.
143
+
144
+ ---
145
+
146
+ ## 7. HTML, CSS, SVG Reports & Printable Documents
98
147
 
99
148
  Visual QA applies to non-interactive documents and data visualizations:
100
149
 
@@ -104,12 +153,13 @@ Visual QA applies to non-interactive documents and data visualizations:
104
153
 
105
154
  ---
106
155
 
107
- ## 7. Deliverable: Visual QA Report Format
156
+ ## 8. Deliverable: Visual QA Report Format
108
157
 
109
158
  When concluding visual verification, report:
110
159
 
111
160
  1. **Surfaces Tested**: Routes, components, and viewports tested (375 / 768 / 1280px).
112
161
  2. **Baseline Status**: Captured pre-change baseline / comparative before-after / baseline unavailable (disclosed).
113
- 3. **States Verified**: Default, hover, focus, disabled, loading, empty, and error states.
114
- 4. **Defects Remediated**: Objective defects identified and resolved during the run.
115
- 5. **Unverified Boundaries**: Any surfaces not verified due to environment, authentication, or missing browser tooling.
162
+ 3. **States Verified**: Default, hover, focus, disabled, unknown, empty, loaded, saving, failed, and applicable held, switch, twice, and re-entry cases.
163
+ 4. **Request and Result Evidence**: Request counts and targets, persisted results, and keep/clear observations for applicable state transitions.
164
+ 5. **Defects Remediated**: Objective defects identified and resolved during the run.
165
+ 6. **Unverified Boundaries**: Any surfaces not verified due to environment, authentication, missing product decisions, or missing browser tooling. Distinguish **UNVERIFIED** from source-only **TRACED** findings.
@@ -1,3 +0,0 @@
1
- <task-completion-calibration>
2
- While you can still complete part of your assignment, do that work rather than ending the turn with a checklist or an offer to continue. Diagnose an ordinary tool failure before trying again; retry when the cause is understood and repeating the operation is safe. A permission denial ends that operation. Finish independent work within your role, then report the result and any remaining blocker.
3
- </task-completion-calibration>
@@ -1,24 +0,0 @@
1
- # Bounded Execution
2
-
3
- ## Scope fidelity
4
-
5
- - Deliver the requested scope exactly, neither silently expanding it nor omitting required parts.
6
- - Prefer a complete bounded result over extra ceremony or adjacent improvements.
7
- - Workflow economy cannot override the governing planning policy: complex business or behavior implementation defaults to `planner` → `plan-critic` → implementation, with only the applicable limited/simple/low-risk/clearly-bounded or explicit-user-request exception.
8
-
9
- ## Tool and delegation economy
10
-
11
- - Use direct tools when a few calls can complete the current stage; direct-tool efficiency is not permission to skip required planning.
12
- - Dispatch only for a matching specialist domain or an independent, sizeable work track.
13
- - Do not dispatch an agent to review the same implemented work the parent just completed; this does not remove orchestrator-owned pre-implementation plan criticism.
14
-
15
- ## Evidence cadence
16
-
17
- - Reuse passing evidence while it still covers the claim and no change materially affects tested behavior or interfaces; rerun only affected or missing checks.
18
- - Preserve every required final review and required evidence; efficiency never removes them.
19
- - Prefer a path, a commit, or the uncommitted working-tree change over an invented hash, checksum, or revision stamp. Treat RED/GREEN as evidence at a real deterministic seam rather than a universal gate.
20
- - Scale process to the request rather than defaulting upward, and recheck only what the current step depends on when runtime or path state drifts.
21
-
22
- ## Communication
23
-
24
- - Start with one sentence stating the intended outcome, stay quiet between tool calls, and finish with a short outcome-first report.