dsh-output-styles 0.2.0

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.
Files changed (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.es.md +197 -0
  3. package/README.ja.md +197 -0
  4. package/README.ko.md +197 -0
  5. package/README.md +197 -0
  6. package/README.zh.md +197 -0
  7. package/cordis.patch.yml +40 -0
  8. package/docs/VERIFICATION.zh.md +93 -0
  9. package/lib/client.js +83 -0
  10. package/lib/index.js +415 -0
  11. package/lib/invariant-LV6hQX5s.js +442 -0
  12. package/lib/invariant.js +2 -0
  13. package/lib/types/client/index.d.ts +30 -0
  14. package/lib/types/client/index.d.ts.map +1 -0
  15. package/lib/types/client/locales.d.ts +13 -0
  16. package/lib/types/client/locales.d.ts.map +1 -0
  17. package/lib/types/config.d.ts +73 -0
  18. package/lib/types/config.d.ts.map +1 -0
  19. package/lib/types/index.d.ts +31 -0
  20. package/lib/types/index.d.ts.map +1 -0
  21. package/lib/types/invariant.d.ts +59 -0
  22. package/lib/types/invariant.d.ts.map +1 -0
  23. package/lib/types/runtime.d.ts +144 -0
  24. package/lib/types/runtime.d.ts.map +1 -0
  25. package/lib/types/style-command.d.ts +68 -0
  26. package/lib/types/style-command.d.ts.map +1 -0
  27. package/lib/types/style-library.d.ts +78 -0
  28. package/lib/types/style-library.d.ts.map +1 -0
  29. package/lib/types/types.d.ts +78 -0
  30. package/lib/types/types.d.ts.map +1 -0
  31. package/package.json +138 -0
  32. package/src/client/index.ts +104 -0
  33. package/src/client/locales.ts +14 -0
  34. package/src/config.ts +110 -0
  35. package/src/index.ts +51 -0
  36. package/src/invariant.ts +144 -0
  37. package/src/runtime.ts +439 -0
  38. package/src/style-command.ts +89 -0
  39. package/src/style-library.ts +348 -0
  40. package/src/types.ts +86 -0
  41. package/styles/concise.md +17 -0
  42. package/styles/explanatory.md +14 -0
  43. package/styles/formal.md +14 -0
  44. package/styles/step-by-step.md +16 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 dsh-output-styles contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.es.md ADDED
@@ -0,0 +1,197 @@
1
+ <div align="center">
2
+
3
+ # 🎨 dsh-output-styles
4
+
5
+ **El `outputStyles` de Claude Code para DeepSeek Harness** — cambia el estilo de salida del modelo en tiempo de ejecución, por sesión y de forma duradera.
6
+
7
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
8
+ [![CI](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml/badge.svg)](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
9
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
10
+ [![DSH](https://img.shields.io/badge/deepseek--harness-0.1.0--rc.6-4d6bfe.svg)](#)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6.svg)](#)
12
+
13
+ 🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ `/style concise` — y todas las respuestas siguientes serán concisas. `/style step-by-step` — y el modelo narra pasos numerados. `/style off` — de vuelta al valor por defecto del proyecto. Un comando por sesión, persistente entre reinicios y con cero cambios en el bucle del agente.
20
+
21
+ ## ✨ Características
22
+
23
+ | | |
24
+ |---|---|
25
+ | 🗂️ **Biblioteca de estilos** | Un archivo Markdown por estilo (`styles/*.md`); frontmatter para los metadatos, cuerpo = la directiva del modelo. `name` toma por defecto el nombre del archivo y puede contener espacios (`Diagrams first`). |
26
+ | ⌨️ **Comando `/style`** | Sin argumentos lista los estilos (con descripciones) + la selección actual; `/style <name>` cambia; `/style off` restaura el valor por defecto del proyecto. Todo el resto tras `/style` es el nombre del estilo. |
27
+ | 💾 **Persistencia por sesión** | La elección vive en el dominio de almacenamiento `output_style`, con clave sessionId: dos sesiones nunca interfieren y la elección sobrevive a los reinicios. |
28
+ | 🧩 **Inyección en el system prompt** | Una contribución `systemPrompt.section()` (orden 90) inyecta el cuerpo del estilo de la sesión actual en cada ensamblado; los cuerpos se truncan según un presupuesto configurable. |
29
+ | 🎭 **`keep-coding-instructions` de Claude Code** | Los estilos con `keep-coding-instructions: false` (el valor por defecto, como Claude Code) reemplazan todo el system prompt — para estilos que dejan atrás la ingeniería de software. |
30
+ | 📌 **Estilos forzados** | `force: true` aplica un estilo incondicionalmente, anulando cualquier selección de sesión; dos estilos forzados hacen fallar la carga. |
31
+ | 🔁 **Compatibilidad con Claude Code** | Carga colecciones JSON `outputStyles` (`{ name, description, prompt }`), entradas individuales o matrices estilo `settings.json`; las entradas no analizables se omiten con un aviso. |
32
+ | 📚 **Directorios en capas** | `stylesDir` es una lista; los directorios posteriores anulan los anteriores (el `styles/` incluido es la capa más baja; desactívalo con `includeBuiltins: false`). |
33
+ | 🔄 **Recarga en caliente** | Los cambios en los archivos de estilo se detectan sin reiniciar (`watchStyles: false` para desactivarlo). |
34
+ | ⚙️ **Valor por defecto del proyecto sobre ajustes** | Las sesiones que nunca eligieron uno recurren a `output-style.style` de los ajustes de DSH y, a continuación, a `defaultStyle`. |
35
+ | 🖱️ **Selector web** | Una entrada `dsh.client` (`dsh-output-styles/client`) decora el comando `/style` del host con un selector emergente basado en proyecciones. |
36
+ | 📊 **Proyección de sesión** | Una proyección `style` (`{ options, currentValue }`) para la Web UI, plegada a partir de los comandos asentados en el log de sesión. |
37
+ | 🧯 **Fallo ruidoso, omisión limpia** | La configuración incorrecta lanza al cargar; un archivo de estilo defectuoso se omite con un aviso y nunca rompe el perfil. |
38
+ | 🌐 **Documentación en cinco idiomas** | EN · 中文 · 日本語 · 한국어 · Español. |
39
+
40
+ ## 🚀 Inicio rápido
41
+
42
+ ```sh
43
+ # 1. Instalar — el paquete es una capa de bundle, así que un comando compone
44
+ # storage + storage-json + storage-domain + la fila del plugin:
45
+ dsh plugin --profile <name> add dsh-output-styles
46
+
47
+ # 2. Arrancar y cambiar
48
+ dsh --profile <name>
49
+ /style # → output style off y luego una línea por estilo
50
+ /style concise # → switched to concise
51
+ /style Diagrams first # → los nombres con espacios también funcionan
52
+ /style off # → de vuelta al valor por defecto del proyecto
53
+ ```
54
+
55
+ La capa es idempotente sobre los perfiles web (la inserción por id reemplaza las filas con el mismo id), que componen `storage` de fábrica. Para el selector web, añade la fila del cliente al perfil:
56
+
57
+ ```yaml
58
+ - id: output-styles-client
59
+ name: 'dsh-output-styles/client'
60
+ ```
61
+
62
+ ## 🎬 Demo
63
+
64
+ ```
65
+ You > /style
66
+ output style off
67
+ concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
68
+ explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
69
+ formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
70
+ step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
71
+
72
+ You > /style concise
73
+ switched to concise
74
+
75
+ You > Preséntate en una sola frase.
76
+ AI > Soy un agente de codificación de IA que se ejecuta sobre la plataforma de plugins DeepSeek Harness y se basa en el modelo deepseek-v4-pro.
77
+ ```
78
+
79
+ ## 🧠 Cómo funciona
80
+
81
+ ```mermaid
82
+ flowchart LR
83
+ U[Escribes /style concise] --> C[registro de comandos]
84
+ C -->|command/run registrado| L[(log de sesión)]
85
+ C -->|put {style, source}| D[(dominio output_style)]
86
+ D --> R[OutputStyleRuntime]
87
+ R -->|cuerpo en cada ensamblado| S[sección systemPrompt orden 90]
88
+ S --> M[Petición al modelo]
89
+ M -->|system prompt completo| H[request/header registrado]
90
+ ```
91
+
92
+ Todo lo que ve el modelo es reconstruible desde el log de sesión — sin nuevos tipos de eventos de sesión ni cambios en el bucle del agente. El nombre del estilo viene de `command/run`, el texto inyectado exacto de `request/header`, y el marcador de procedencia `{ kind: 'plugin', plugin: 'dsh-output-styles' }` viaja en el registro del dominio. Los estilos se aplican solo a la conversación principal; las sesiones de los subagentes mantienen sus propios prompts (igual que Claude Code).
93
+
94
+ ## ⚙️ Configuración
95
+
96
+ Todo ajuste es un campo `Config` de Schemastery validado (los valores inválidos fallan la carga):
97
+
98
+ | Campo | Defecto | Significado |
99
+ |---|---|---|
100
+ | `stylesDir` | `[]` | Directorios de la biblioteca de estilos, resueltos contra cwd; las entradas posteriores anulan las anteriores. `[]` = solo el `styles/` incluido. Una cadena simple es una lista de un solo directorio. |
101
+ | `maxStyleChars` | `4000` | Presupuesto del cuerpo del estilo (puntos de código, ≥ 1); los cuerpos más largos se truncan con un marcador. |
102
+ | `defaultStyle` | `''` | Estilo para las sesiones que nunca eligieron uno (y no existe un valor por defecto en ajustes); `''` = sin estilo. |
103
+ | `compatJson` | `true` | Carga las entradas JSON `outputStyles` de Claude Code (objetos individuales o matrices). |
104
+ | `sectionOrder` | `90` | Orden de la sección inyectada (0 = persona, 100–199 = guía de herramientas). |
105
+ | `truncationMarker` | `"\n\n[style truncated]"` | Marcador añadido en el punto de truncado. |
106
+ | `includeBuiltins` | `true` | Incluye el `styles/` incluido en el paquete como la capa de menor prioridad. |
107
+ | `watchStyles` | `true` | Recarga la biblioteca cuando un archivo de estilo cambia en disco. |
108
+
109
+ ## 📚 Biblioteca de estilos
110
+
111
+ <details>
112
+ <summary><code>styles/concise.md</code></summary>
113
+
114
+ ```markdown
115
+ ---
116
+ name: concise
117
+ description: Terse, direct answers — minimal prose, no preamble.
118
+ whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
119
+ keep-coding-instructions: true
120
+ ---
121
+
122
+ You are in the concise output style for this conversation.
123
+ - Lead with the direct answer; skip preamble, restatements, and filler.
124
+ - 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
125
+ ```
126
+
127
+ </details>
128
+
129
+ Campos del frontmatter:
130
+
131
+ | Campo | Defecto | Significado |
132
+ |---|---|---|
133
+ | `name` | nombre del archivo | Objetivo del cambio; letras, dígitos, espacios y guiones (sin espacio inicial/final; `off` está reservado). |
134
+ | `description` | — (obligatorio) | Una frase mostrada en los listados y en el selector. |
135
+ | `whenToUse` | — | Guía opcional añadida a los listados. |
136
+ | `keep-coding-instructions` | `false` | Conserva el prompt del harness (identidad, persona, guía de herramientas) cuando es `true`; lo reemplaza por completo cuando es `false` (semántica de Claude Code). |
137
+ | `force` | `false` | Se aplica incondicionalmente, anulando cualquier selección de sesión; como máximo un estilo puede activarlo. |
138
+
139
+ <details>
140
+ <summary>JSON de Claude Code <code>outputStyles</code> (<code>compatJson: true</code>)</summary>
141
+
142
+ ```json
143
+ { "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
144
+ ```
145
+
146
+ Las matrices heredadas de `settings.json` (`[{ … }, { … }]`) se cargan tal cual; las entradas incorrectas se omiten con un aviso.
147
+
148
+ </details>
149
+
150
+ ## ⌨️ Referencia de comandos
151
+
152
+ | Entrada | Resultado |
153
+ |---|---|
154
+ | `/style` | Lista la selección actual + una línea por estilo (nombre — descripción) |
155
+ | `/style concise` | Cambia (escritura duradera), `switched to concise` |
156
+ | `/style Diagrams first` | Los nombres de varias palabras son todo el resto |
157
+ | `/style off` | Restaura el valor por defecto del proyecto (valor por defecto de ajustes, luego `defaultStyle`) |
158
+ | `/style nope` | `error: unknown output style "nope" (available: …)` |
159
+
160
+ ## 🖱️ Selector web
161
+
162
+ La entrada `dsh.client` decora la invocación sin argumentos del comando `/style` del host con un selector emergente: una fila «off» más una fila por estilo de la biblioteca (`description · whenToUse`), con la fila activa marcada. Al elegir se envía `/style <name>` a través del Remote de comandos, de modo que cada cambio conserva el ciclo de vida duradero de comandos del host y la proyección `style` sigue siendo el único dato mostrado.
163
+
164
+ ## 🔍 Verificación de conflictos
165
+
166
+ Se contrastó con el ecosistema DSH antes del desarrollo (instantánea 2026-08): ningún repositorio `style`/`output-style` bajo [topic:dsh-plugin](https://github.com/topics/dsh-plugin), ninguna categoría de output-style en las cuatro [listas awesome](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) principales, y ninguna entrada en el [catálogo dsh-hub](https://github.com/omdsh-dev/dsh-hub-workshop). Los vecinos más cercanos — [dsh-soul-md](https://github.com/Scorp1o117/dsh-soul-md) (persona) y [dsh-claude-marketplace](https://github.com/ben7am1n/dsh-claude-marketplace) (estilos de salida diferidos explícitamente a v0.2+) — son adyacentes, no conflictivos.
167
+
168
+ ## 🆚 Diferencias con Claude Code
169
+
170
+ | | Claude Code | dsh-output-styles |
171
+ |---|---|---|
172
+ | Archivos de estilo | `.claude/output-styles` en los niveles usuario/proyecto/gestionado | Directorios `stylesDir` + `styles/` incluido, gana el directorio posterior |
173
+ | Estilos personalizados | Markdown, frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | Los mismos campos (`force` = `force-for-plugin`) + `whenToUse` |
174
+ | JSON heredado | Matriz `outputStyles` en `settings.json` | Se carga tal cual (`compatJson: true`) |
175
+ | Entrada en vigor | Tras `/clear` o una sesión nueva | Inmediatamente — el system prompt se reensambla en cada petición |
176
+ | Subagentes | Los estilos no se aplican | Igual — las sesiones de los subagentes mantienen sus propios prompts |
177
+ | Cambio | Menú `/config` o ajuste `outputStyle` (el comando `/output-style` se eliminó en v2.1.91) | Comando `/style` + selector web + ajustes `output-style.style` |
178
+
179
+ ## 🧪 Desarrollo
180
+
181
+ ```sh
182
+ pnpm install
183
+ pnpm run typecheck # ambos proyectos tsc
184
+ pnpm test # vitest — 87 pruebas
185
+ pnpm run build # artefactos lib/ (bundles de host + cliente)
186
+ pnpm pack # tarball para dsh plugin add
187
+ ```
188
+
189
+ La estructura sigue [omdsh-dev/plugin-template](https://github.com/omdsh-dev/plugin-template): `src/index.ts` (metadatos del plugin), `src/config.ts` (esquema), `src/runtime.ts` (servicio de runtime + activación), `src/invariant.ts` (invariantes), `src/client/` (selector web), `styles/` (estilos integrados).
190
+
191
+ ## 📄 Licencia
192
+
193
+ [Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
194
+
195
+ ---
196
+
197
+ <sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>
package/README.ja.md ADDED
@@ -0,0 +1,197 @@
1
+ <div align="center">
2
+
3
+ # 🎨 dsh-output-styles
4
+
5
+ **DeepSeek Harness 向け Claude Code `outputStyles`** —— モデルの出力スタイルを実行時に、セッション単位で、永続的に切り替えます。
6
+
7
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
8
+ [![CI](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml/badge.svg)](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
9
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
10
+ [![DSH](https://img.shields.io/badge/deepseek--harness-0.1.0--rc.6-4d6bfe.svg)](#)
11
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6.svg)](#)
12
+
13
+ 🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ `/style concise` —— これ以降の返信はすべて簡潔になります。`/style step-by-step` —— モデルが番号付きの手順で説明します。`/style off` —— プロジェクトのデフォルトに戻ります。セッションごとに 1 コマンド、再起動をまたいで保持され、agent loop には一切変更を加えません。
20
+
21
+ ## ✨ 機能
22
+
23
+ | | |
24
+ |---|---|
25
+ | 🗂️ **スタイルライブラリ** | スタイルごとに 1 つの Markdown ファイル(`styles/*.md`)。frontmatter にメタデータ、本文がモデルへの指示です。`name` は既定でファイル名になり、空白を含めます(`Diagrams first`)。 |
26
+ | ⌨️ **`/style` コマンド** | 引数なしでスタイル一覧(説明付き)と現在の選択を表示。`/style <name>` で切り替え、`/style off` でプロジェクトのデフォルトを復元します。`/style` より後の残り全体がスタイル名です。 |
27
+ | 💾 **セッション単位の永続化** | 選択は `output_style` ストレージドメインに sessionId をキーとして保持され、2 つのセッションが干渉することはなく、選択は再起動後も残ります。 |
28
+ | 🧩 **システムプロンプト注入** | `systemPrompt.section()` の貢献(order 90)が、毎回の組み立てで現在のセッションのスタイル本文を注入します。本文は設定可能なバジェットで切り詰められます。 |
29
+ | 🎭 **Claude Code `keep-coding-instructions`** | `keep-coding-instructions: false`(Claude Code と同じ既定)のスタイルはシステムプロンプト全体を置き換えます——ソフトウェアエンジニアリングから離れるスタイル向けです。 |
30
+ | 📌 **強制スタイル** | `force: true` はセッションの選択を無視して無条件にスタイルを適用します。強制スタイルが 2 つあると読み込みに失敗します。 |
31
+ | 🔁 **Claude Code 互換性** | `outputStyles` JSON コレクション(`{ name, description, prompt }`)を読み込みます。単一エントリまたは `settings.json` 形式の配列に対応し、解析不能なエントリは警告付きでスキップします。 |
32
+ | 📚 **ディレクトリの階層化** | `stylesDir` はリストで、後方のディレクトリが前方のものを上書きします(同梱の `styles/` が最下層で、`includeBuiltins: false` で無効化)。 |
33
+ | 🔄 **ホットリロード** | スタイルファイルの変更は再起動なしで反映されます(`watchStyles: false` で無効化)。 |
34
+ | ⚙️ **settings とプロジェクトデフォルト** | 一度も選択していないセッションは、DSH settings の `output-style.style`、次いで `defaultStyle` にフォールバックします。 |
35
+ | 🖱️ **Web ピッカー** | `dsh.client` エントリ(`dsh-output-styles/client`)が、ホストの `/style` コマンドを投影ベースのポップアップピッカーで装飾します。 |
36
+ | 📊 **セッション投影** | Web UI 向けの `style` 投影(`{ options, currentValue }`)。セッションログ内で確定したコマンドから折りたたまれます。 |
37
+ | 🧯 **失敗は明示、スキップはクリーンに** | 設定ミスは読み込み時に例外を投げます。不正なスタイルファイルは警告付きでスキップされ、プロファイルを壊すことはありません。 |
38
+ | 🌐 **5 言語のドキュメント** | EN · 中文 · 日本語 · 한국어 · Español。 |
39
+
40
+ ## 🚀 クイックスタート
41
+
42
+ ```sh
43
+ # 1. インストール——このパッケージは bundle レイヤーなので、1 コマンドで
44
+ # storage + storage-json + storage-domain + プラグイン行が構成されます:
45
+ dsh plugin --profile <name> add dsh-output-styles
46
+
47
+ # 2. 起動して切り替え
48
+ dsh --profile <name>
49
+ /style # → output style off、その後にスタイルごとに 1 行
50
+ /style concise # → switched to concise
51
+ /style Diagrams first # → 空白を含む名前も使えます
52
+ /style off # → プロジェクトのデフォルトに戻る
53
+ ```
54
+
55
+ このレイヤーは web プロファイルに対して冪等です(id 単位の挿入が同 id の行を置き換えます)。web プロファイルには `storage` があらかじめ含まれています。Web ピッカーを使うには、プロファイルにクライアント行を追加します:
56
+
57
+ ```yaml
58
+ - id: output-styles-client
59
+ name: 'dsh-output-styles/client'
60
+ ```
61
+
62
+ ## 🎬 デモ
63
+
64
+ ```
65
+ You > /style
66
+ output style off
67
+ concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
68
+ explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
69
+ formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
70
+ step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
71
+
72
+ You > /style concise
73
+ switched to concise
74
+
75
+ You > 一文だけで自己紹介してください。
76
+ AI > 私は DeepSeek Harness プラグインプラットフォーム上で動作する、deepseek-v4-pro モデルベースの AI コーディングエージェントです。
77
+ ```
78
+
79
+ ## 🧠 仕組み
80
+
81
+ ```mermaid
82
+ flowchart LR
83
+ U[/style concise と入力] --> C[コマンドレジストリ]
84
+ C -->|command/run を記録| L[(セッションログ)]
85
+ C -->|put {style, source}| D[(output_style ドメイン)]
86
+ D --> R[OutputStyleRuntime]
87
+ R -->|毎回の組み立てで本文を注入| S[systemPrompt セクション order 90]
88
+ S --> M[モデルリクエスト]
89
+ M -->|完全なシステムプロンプト| H[request/header を記録]
90
+ ```
91
+
92
+ モデルが見るものはすべてセッションログから再構築できます——新しいセッションイベント型も agent-loop の変更も不要です。スタイル名は `command/run` から、注入された正確なテキストは `request/header` から得られ、出所マーカー `{ kind: 'plugin', plugin: 'dsh-output-styles' }` はドメインレコードに残ります。スタイルはメイン会話のみに適用され、サブエージェントのセッションは独自のプロンプトを保持します(Claude Code と一致)。
93
+
94
+ ## ⚙️ 設定
95
+
96
+ すべての調整項目は検証付きの Schemastery `Config` フィールドです(不正な値は読み込みに失敗します):
97
+
98
+ | フィールド | 既定 | 意味 |
99
+ |---|---|---|
100
+ | `stylesDir` | `[]` | スタイルライブラリのディレクトリ。cwd を基準に解決され、後方のエントリが前方のものを上書きします。`[]` = 同梱の `styles/` のみ。裸の文字列は単一ディレクトリのリストとみなされます。 |
101
+ | `maxStyleChars` | `4000` | スタイル本文のバジェット(コードポイント、≥ 1)。長い本文はマーカー付きで切り詰められます。 |
102
+ | `defaultStyle` | `''` | 一度も選択していないセッション(かつ settings の既定もない)向けのスタイル。`''` = スタイルなし。 |
103
+ | `compatJson` | `true` | Claude Code `outputStyles` の JSON エントリ(単一オブジェクトまたは配列)を読み込みます。 |
104
+ | `sectionOrder` | `90` | 注入セクションの順序(0 = persona、100–199 = ツールガイダンス)。 |
105
+ | `truncationMarker` | `"\n\n[style truncated]"` | 切り詰め位置に付加されるマーカー。 |
106
+ | `includeBuiltins` | `true` | パッケージ同梱の `styles/` を最優先度の低いレイヤーとして含めます。 |
107
+ | `watchStyles` | `true` | スタイルファイルがディスク上で変更されたときにライブラリを再読み込みします。 |
108
+
109
+ ## 📚 スタイルライブラリ
110
+
111
+ <details>
112
+ <summary><code>styles/concise.md</code></summary>
113
+
114
+ ```markdown
115
+ ---
116
+ name: concise
117
+ description: Terse, direct answers — minimal prose, no preamble.
118
+ whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
119
+ keep-coding-instructions: true
120
+ ---
121
+
122
+ You are in the concise output style for this conversation.
123
+ - Lead with the direct answer; skip preamble, restatements, and filler.
124
+ - 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
125
+ ```
126
+
127
+ </details>
128
+
129
+ frontmatter フィールド:
130
+
131
+ | フィールド | 既定 | 意味 |
132
+ |---|---|---|
133
+ | `name` | ファイル名 | 切り替え対象。英字、数字、空白、ハイフン(先頭・末尾の空白は不可。`off` は予約済み)。 |
134
+ | `description` | —(必須) | 一覧とピッカーに表示される 1 文。 |
135
+ | `whenToUse` | — | 一覧に追記される任意の利用ガイダンス。 |
136
+ | `keep-coding-instructions` | `false` | `true` のときハーネスのプロンプト(アイデンティティ、persona、ツールガイダンス)を保持し、`false` のとき完全に置き換えます(Claude Code のセマンティクス)。 |
137
+ | `force` | `false` | セッションの選択を無視して無条件に適用します。設定できるのは最大 1 つのスタイルです。 |
138
+
139
+ <details>
140
+ <summary>Claude Code <code>outputStyles</code> JSON(<code>compatJson: true</code>)</summary>
141
+
142
+ ```json
143
+ { "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
144
+ ```
145
+
146
+ レガシーの `settings.json` 配列(`[{ … }, { … }]`)はそのまま読み込まれ、不正なエントリは警告付きでスキップされます。
147
+
148
+ </details>
149
+
150
+ ## ⌨️ コマンドリファレンス
151
+
152
+ | 入力 | 結果 |
153
+ |---|---|
154
+ | `/style` | 現在の選択 + スタイルごとに 1 行(name — description)を一覧表示 |
155
+ | `/style concise` | 切り替え(永続書き込み)、`switched to concise` |
156
+ | `/style Diagrams first` | 複数語の名前は残り全体が対象 |
157
+ | `/style off` | プロジェクトのデフォルトを復元(settings の既定、次いで `defaultStyle`) |
158
+ | `/style nope` | `error: unknown output style "nope" (available: …)` |
159
+
160
+ ## 🖱️ Web ピッカー
161
+
162
+ `dsh.client` エントリは、ホストの `/style` コマンドの引数なし呼び出しをポップアップピッカーで装飾します:「off」行 + ライブラリのスタイルごとに 1 行(`description · whenToUse`)で、アクティブな行がマークされます。選択するとコマンド Remote を通じて `/style <name>` が送信されるため、どの切り替えもホストの永続的なコマンドライフサイクルを経由し、`style` 投影が唯一の表示事実であり続けます。
163
+
164
+ ## 🔍 競合チェック
165
+
166
+ 開発前に DSH エコシステムを調査しました(2026-08 スナップショット):[topic:dsh-plugin](https://github.com/topics/dsh-plugin) 配下に `style`/`output-style` のリポジトリはなく、4 つの主要な [awesome リスト](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) に output-style カテゴリはなく、[dsh-hub カタログ](https://github.com/omdsh-dev/dsh-hub-workshop) にもエントリはありません。最も近い隣接プロジェクト——[dsh-soul-md](https://github.com/Scorp1o117/dsh-soul-md)(persona)と [dsh-claude-marketplace](https://github.com/ben7am1n/dsh-claude-marketplace)(出力スタイルは明示的に v0.2+ へ先送り)——は隣接していて、競合はしません。
167
+
168
+ ## 🆚 Claude Code との違い
169
+
170
+ | | Claude Code | dsh-output-styles |
171
+ |---|---|---|
172
+ | スタイルファイル | ユーザー/プロジェクト/マネージド階層の `.claude/output-styles` | `stylesDir` ディレクトリ + 同梱の `styles/`。後方のディレクトリが優先 |
173
+ | カスタムスタイル | Markdown、frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | 同じフィールド(`force` = `force-for-plugin`)+ `whenToUse` |
174
+ | レガシー JSON | `settings.json` 内の `outputStyles` 配列 | そのまま読み込み(`compatJson: true`) |
175
+ | 反映タイミング | `/clear` 後または新しいセッション | 即時——システムプロンプトはリクエストごとに再構築 |
176
+ | サブエージェント | スタイルは適用されない | 同じ——サブエージェントのセッションは独自のプロンプトを保持 |
177
+ | 切り替え | `/config` メニューまたは `outputStyle` 設定(`/output-style` コマンドは v2.1.91 で削除) | `/style` コマンド + Web ピッカー + settings `output-style.style` |
178
+
179
+ ## 🧪 開発
180
+
181
+ ```sh
182
+ pnpm install
183
+ pnpm run typecheck # 両方の tsc プロジェクト
184
+ pnpm test # vitest — 87 テスト
185
+ pnpm run build # lib/ 成果物(ホスト + クライアント bundle)
186
+ pnpm pack # dsh plugin add 用の tarball
187
+ ```
188
+
189
+ 構成は [omdsh-dev/plugin-template](https://github.com/omdsh-dev/plugin-template) に従います:`src/index.ts`(プラグインメタデータ)、`src/config.ts`(スキーマ)、`src/runtime.ts`(ランタイムサービス + アクティベーション)、`src/invariant.ts`(不変条件)、`src/client/`(Web ピッカー)、`styles/`(組み込みスタイル)。
190
+
191
+ ## 📄 ライセンス
192
+
193
+ [Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
194
+
195
+ ---
196
+
197
+ <sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>