返回目录
开发工具 插件

dsh-output-styles

PerryLink/dsh-output-styles

Claude Code outputStyles for DeepSeek Harness - session-scoped, durable, runtime-switchable model output styles (/style command, output_style storage domain, systemPrompt injection)

Stars
3
Forks
0
Issues
0
更新
1 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:PerryLink/dsh-output-styles

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

🎨 dsh-output-styles

Claude Code outputStyles for DeepSeek Harness — switch the model's output style at runtime, per session, durably.

/style concise — and every reply from now on is terse. /style off — back to the project default.

License DSH plugin Node CI Version npm version npm downloads

English · 简体中文 · Español · Português · हिन्दी


Compatibility

Surface Status
Harness DeepSeek Harness 0.1.0-rc.6
Node ^22.19.0 || >=24.0.0
Platforms All (host + web client)
Model Any (system-prompt injection)

What you get

dsh-output-styles is the Claude Code outputStyles equivalent for DeepSeek Harness: a /style command that switches the model's output style at runtime, persisted per session, injected at every prompt assembly.

  • Style library — one Markdown file per style (styles/*.md); frontmatter for metadata, body = the model directive. Six built-ins ship in the box (concise, explanatory, formal, learning, proactive, step-by-step), including Claude Code-parity proactive and learning.
  • /style command — no argument lists styles (with descriptions) plus the current selection; /style <name> switches; /style off restores the project default.
  • Session-scoped persistence — the choice lives in the output_style storage domain, keyed by sessionId, and survives restarts.
  • System-prompt injection — a systemPrompt.section() contribution (order sectionOrder) injects the current session's style body at every assembly, truncated at a configurable budget.
  • Claude Code paritykeep-coding-instructions, force-for-plugin (force alias), outputStyles JSON compatibility, layered stylesDir directories, hot reload, and project-default fallback over the DSH settings seam.
  • *Renderer registry (`output.render.)** —ctx.outputRendererslets any plugin register a pure presenter, applied through theoutput.render/beforewaterfall; built-in renderersconciseandstep-by-step`.
  • Per-session/per-tool rulesrules: [{ match: { tool: 'bash' }, style: 'concise' }] name the renderer for matching requests; editable through the output-style-rules settings section.
  • /export — render the current session to Markdown or sanitized HTML through the render pipeline; every render keeps the original text beside the rendered one.

Quick start

# 1. install the bundle into your profile
dsh plugin --profile web add "github:PerryLink/dsh-output-styles#main"

# or from npm (published releases)
dsh plugin --profile web add dsh-output-styles

# 2. restart and verify the row
dsh --profile web --dump-config | grep -A3 'id: output-styles'

Demo

You > /style
      output style off
      concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
      explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
      formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
      learning — Collaborative learn-by-doing mode with short "Insights" and small hands-on steps for the user. (Pairing, onboarding, …)
      proactive — Execute immediately, assume reasonable defaults, and prefer action over planning. (Routine multi-step work, …)
      step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)

You > /style concise
      switched to concise

You > 请只用一句话介绍你自己。
AI  > 我是运行在 DeepSeek Harness 插件化平台上、基于 deepseek-v4-pro 模型的 AI 编码代理。

How it works

flowchart LR
    U[You type /style concise] --> C[command registry]
    C -->|command/run logged| L[(session log)]
    C -->|put {style, source}| D[(output_style domain)]
    D --> R[OutputStyleRuntime]
    R -->|body at every assembly| S[systemPrompt section order 90]
    S --> M[Model request]
    M -->|full system prompt| H[request/header logged]

Everything the model sees is reconstructable from the session log — no new session event type, no agent-loop changes. The style name comes from command/run, the exact injected text from request/header, and the provenance marker { kind: 'plugin', plugin: 'dsh-output-styles' } rides in the domain record. Styles apply to the main conversation only; subagent sessions keep their own prompts (matching Claude Code).

Install & uninstall

  • git channel (latest main): dsh plugin --profile web add "github:PerryLink/dsh-output-styles#main" — the prepare script builds with production dependencies only.
  • npm channel (published releases): dsh plugin --profile web add dsh-output-styles.
  • tarball channel: pnpm pack in this repo, then dsh plugin --profile web add ./dsh-output-styles-<version>.tgz.
  • uninstall: dsh plugin --profile web remove dsh-output-styles.

Configuration

All tunables are Schemastery Config fields (changeable from cordis.yml). Invalid values fail the load.

Key Default Meaning
stylesDir [] Style-library directories, resolved against cwd; later entries override earlier ones. [] = the bundled styles/ only
maxStyleChars 4000 Style-body budget (≥ 1); longer bodies are truncated with a marker
defaultStyle '' Style for sessions that never selected one (and no settings default exists); '' = no style
compatJson true Load Claude Code outputStyles JSON entries (single objects or arrays)
sectionOrder 90 Order of the injected section (0 = persona, 100–199 = tool guidance)
truncationMarker "\n\n[style truncated]" Marker appended at the truncation point
includeBuiltins true Include the package's bundled styles/ as the lowest-priority layer
watchStyles true Reload the library when a style file changes on disk
rules [] Per-session/per-tool render rules: [{ match: { tool?, contentType?, session? }, style, priority? }]
enableExport true Register the /export command (Markdown/HTML session export, renderer-aware)

Tools & surfaces

Surface Kind Notes
/style command List styles, switch, or restore the project default
/export command Render the current session to Markdown or sanitized HTML
output_style storage domain Session-scoped style choice, keyed by sessionId
systemPrompt.section() contribution Injects the current style body at every assembly
output.render.* renderer registry ctx.outputRenderers + the output.render/before waterfall
style projection { options, currentValue } folded from settled commands
Web picker client entry dsh-output-styles/client decorates /style with a popup picker

Command reference

Input Outcome
/style List the current selection + one line per style (name — description)
/style concise Switch (durable write), switched to concise
/style Diagrams first Multi-word names are the whole remainder
/style off Restore the project default (settings default, then defaultStyle)
/style nope error: unknown output style "nope" (available: …)
/export Render the current session to Markdown through the renderer pipeline
/export html Render to sanitized HTML
/export --renderer=concise Render with one renderer forced (rules bypassed)

Style library

One Markdown file per style; frontmatter for metadata, body = the model directive. name defaults to the file name and may contain spaces (Diagrams first).

Field Default Meaning
name file name Switch target; letters, digits, spaces, and hyphens (off is reserved)
description — (required) One sentence shown in listings and the picker
whenToUse Optional guidance appended to listings
keep-coding-instructions false Keep the harness prompt when true; replace it when false (Claude Code semantics)
force-for-plugin false Apply unconditionally, overriding any session selection; force is an alias, at most one style may set it

With compatJson: true, Claude Code outputStyles JSON entries ({ name, description, prompt }) load beside Markdown styles; unparseable entries are skipped with a warning.

Renderer protocol

The output.render.* protocol turns presentation into an extension point. A renderer is a pure presenterpresenter(text, context) maps args to display data, never touches the DOM — matched by tool name and content type, ordered by priority.

  • Waterfall first: every render request passes through output.render/before ({ text, context }); listeners must call next().
  • Rules: rules: [{ match: { tool: 'bash' }, style: 'concise' }] names the renderer for matching requests; ties break by priority, then rule order.
  • Built-ins: concise (whitespace compaction + budget truncation) and step-by-step (consistent step numbering).
  • Auditability: every render result carries { original, rendered, rendererId, changed }; the rendered text is what surfaces, the original stays reconstructable from the session log.

Web picker

The dsh.client entry decorates the host /style command's bare invocation with a popup picker: an "off" row plus one row per library style (description · whenToUse), the active row marked. Picking submits /style <name> through the command Remote, so every switch keeps the host's durable command lifecycle. The picker follows the Web UI's shipped zh/en locale pair.

Differences from Claude Code

Claude Code dsh-output-styles
Style files .claude/output-styles at user/project/managed levels stylesDir directories + bundled styles/, later directory wins
Custom styles Markdown, frontmatter name/description/keep-coding-instructions/force-for-plugin Same fields (force-for-plugin accepted verbatim, force as alias) + whenToUse
Legacy JSON outputStyles array in settings.json Loaded verbatim (compatJson: true)
Taking effect After /clear or a new session Immediately — the system prompt re-assembles per request
Subagents Styles do not apply Same — subagent sessions keep their own prompts
Switching /config menu or outputStyle setting (the /output-style command was removed in v2.1.91) /style command + Web picker + settings output-style.style

Conflict check

Screened against the DSH ecosystem before development (2026-08 snapshot): no style/output-style repository under topic:dsh-plugin, no output-style category in the four major awesome lists, and no entry in the dsh-hub catalog. The closest neighbors — dsh-soul-md (persona) and dsh-claude-marketplace (output styles explicitly deferred to v0.2+) — are adjacent, not conflicting.

Permissions & data

  • Permissions: declares fs:read, fs:watch, storage:read, storage:write, and settings:read in its workshop manifest.
  • Data: the style choice lives in the output_style storage domain (keyed by sessionId); no other state is persisted, no network requests.
  • Session log: the style name comes from command/run, the exact injected text from request/header; the provenance marker { kind: 'plugin', plugin: 'dsh-output-styles' } rides in the domain record.

Security boundaries

  • Public services only. Contributes systemPrompt, commands, storage, and settings; no engine / agent-loop / apiproxy / official-UI changes.
  • Model-visible ⟺ logged. Everything the model sees is reconstructable from the session log — no new session event type, no agent-loop changes.
  • Original always kept. Every render (and /export) keeps the original text beside the rendered one; sanitized HTML is used for HTML export.

Known limitations

  • Main conversation only. Styles apply to the main conversation; subagent sessions keep their own prompts (matching Claude Code).
  • Truncation. Style bodies longer than maxStyleChars are truncated with a marker.
  • Skipped style files. A bad style file is skipped with a warning and never breaks the profile.

Development

pnpm install
pnpm run typecheck   # both tsc projects
pnpm test            # vitest — 107 tests
pnpm run verify      # typecheck + tests + self-contained (the prepublishOnly gate)
pnpm run build       # lib/ artifacts (host + client bundles)
pnpm pack            # tarball for dsh plugin add

Releases: pushing a v* tag whose suffix matches the package.json version triggers the Publish workflow — full verification, then an npm publish with provenance.

Topics

deepseek-harness, dsh, dsh-plugin, output-style, output-styles, claude-code

Contributors

  • @PerryLink — author and maintainer: plugin architecture, style library, bundle install, Web picker, five-language docs, and CI/release tooling.

PerryLink DSH Plugin Family

This project is one of the 15 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:

Plugin One-liner
dsh-mcp-panel Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-doublecheck Engineering-discipline guard: requirements grill, test gates, adversary review
dsh-background-agents Durable background child agents with a Web UI sidebar, messaging and interrupt
dsh-lsp-actions LSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-output-styles Claude Code outputStyles-equivalent runtime style switching
dsh-checkpoint-rewind Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-permission-rules Claude Code-style declarative allow/deny/ask permission rules with audit
dsh-auto-review Second-model auto-review on the approval chain, fail-closed by default
dsh-memento Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool
dsh-skill-pack-security Security-audit skill pack: secret scan, dependency and supply-chain review
dsh-session-pin Pin sessions in the Web sidebar with durable ordering
dsh-composer-history Terminal-style input history for the web composer: arrows, Ctrl+R search
dsh-github GitHub PR/issues integration for DSH, every write gated by approval
dsh-plugin-guide Plugin-development knowledge base as an on-demand agent skill
dsh-claude-move Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH

License

Apache License 2.0 © 2026 dsh-output-styles contributors

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类开发工具
规则置信度

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: claude-code。