返回目录
其他 待识别

dsh-mode

xiyiyiru/dsh-mode

dsh plugin: switch_mode — five working modes, methodology injected at the moment of the switch (npm: @xiyiyiru/dsh-mode)

Stars
0
Forks
0
Issues
0
更新
9 天前

PROJECT TOPICS

项目标签

PROJECT README

README

@xiyiyiru/dsh-mode

Working modes for dsh agents: a switch_mode tool that delivers a phase-appropriate methodology at the moment of the switch — not standing law in the system prompt.

中文 README

给 dsh agent 的工作模式:switch_mode 工具在切换瞬间把对应阶段的方法论作为普通工具结果交付——方法论注入在切换点,引导接下来的阶段,而不是常驻系统提示词的教条。

Why

Agents waste turns when they apply one posture to every task: planning a one-line answer, or improvising a multi-step refactor. Mode guidance fixes the phase mismatch — but only if it arrives exactly when the work style changes, and stops pretending to be permanent rules. Standing prompt-law has the opposite failure: it dilutes into wallpaper the model stops reading.

This plugin makes switching cheap (one tool call), explicit (a visible tool call each time), and non-sticky (the system prompt never changes because of a switch). The tool is stateless since 0.1.0-rc.6: a switch returns the methodology as its ordinary result and writes zero session events.

The five modes

mode when to switch in one-line charter
base default; the entry sentinel answer directly, no ritual — but judge whether a switch is warranted first
planner goal needs a decision-complete plan the executor who receives the plan makes zero further decisions
analyst judgment, root-cause, impact assessment facts referee: gather evidence, state facts and impact, fix nothing, recommend nothing
explorer unfamiliar code, read-only reconnaissance produce structure + responsibilities + key paths; touch nothing
executor plan is approved, only hands remain follow the plan exactly; surface its holes instead of silently improving them

base is the default posture before any switch — there is no mode-less vacuum. Its mindset is mostly a triage rule: multi-tool-call task, artifact changes, or an error to diagnose → switch; one-line answer → answer.

Each mode's full methodology (mindset) is returned verbatim as the switch_mode tool result — see MODES in the API below. Highlights of what each mindset enforces:

  • planner — distinguish goal-input from plan-input (plan gets two rounds of "why" before completion); every list item independently verifiable; no acceptance criterion means no plan; recommended ruling first, alternatives one-line; oral confirmation is not execution approval.
  • analyst — reproduce and bisect before conclusions; root cause at "this line, when this condition holds" granularity, never "probably config"; every claim tagged [已确认] direct evidence / [合理推断] cross-inference / [证据不足] gap stated.
  • explorer — breadth-first for unknown trees, depth-first for known targets; long documents land in files before parsing; the same long text re-sliced repeatedly is a failure mode — stop.
  • executor — check blast radius before touching; look before deleting/overwriting; reversible small ambiguities proceed with a one-line ruling recorded, irreversible ones stop and report; verify after every atomic action, not at the end.

What a switch does (and does not do)

  • ✅ returns the mode's methodology as the ordinary tool result — visible in exactly the phase it guides
  • ✅ stateless since 0.1.0-rc.6: writes zero session events — no log contract to trip on
  • ✅ idempotent re-switch: after compaction, switching to the same mode re-reads its methodology — that is the recovery path
  • ❌ does not modify the system prompt, ever
  • ❌ is not re-injected on retreat or on any later turn
  • ❌ carries no snapshot into other tools' frames (decoupled from the state plugin's task stack since 2026-09-03)

Core behavior section

The plugin's only system-prompt contribution is one static section (mycel:core-behavior, order 10 — right after persona): the mode-independent working principles (root cause before action, honesty about uncertainty, scope discipline, conclusions first, reply completeness). It never changes with switches; the five modes are the variable layer on top of that fixed floor.

Install

dsh plugin --profile <name> add @xiyiyiru/dsh-mode

Peer dependencies (@deepseek-ai/cordis, dsh-agent, dsh-session, dsh-tools, dsh-system-prompt) resolve from your dsh installation automatically — no manual setup.

API

import {
  MODES, CORE_BEHAVIOR, MODE_NAMES, DEFAULT_MODE,
  SWITCH_MODE, SWITCH_MODE_DESCRIPTION,
  type ModeName, type ModeSpec,
} from '@xiyiyiru/dsh-mode'
export what it is
MODES the five ModeSpecs — name, mindset (the methodology text), triggerScenario
CORE_BEHAVIOR the static core-principles section text
MODE_NAMES / DEFAULT_MODE the tool's enum values / 'base'
SWITCH_MODE / SWITCH_MODE_DESCRIPTION the tool's name and model-facing description

Session integration: none. Since 0.1.0-rc.6 the tool is stateless — a switch returns the methodology as its ordinary result and writes zero session events.

Design notes

  • Guidance, not checklist: each mindset steers judgment; it explicitly says "取舍,不必逐条对照" (use judgment, don't tick boxes).
  • Injection at the switch point is the whole point: the methodology is read when the phase begins, costs nothing before or after.
  • Decoupled: no dependency on other mycel plugins; pairs well with (but does not require) @xiyiyiru/dsh-state's task stack — the stack restores your task, the re-switch restores your methodology.

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型待识别
功能分类其他
规则置信度

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。