dsh-dev-modes 0.0.0-stage → 1.0.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.
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ # 开发模式合集
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 一个 bundle,三个 Agent 预设,外加配套技能。装一次,三个模式同时出现在「设置 → Agent 预设」。
4
+
5
+ | 预设 | id | 用途 |
6
+ |---|---|---|
7
+ | 软件开发 | `swe` | 读仓库与规范 → 规划 → 小步实现 → 用项目自身的构建/测试验证 → 如实汇报 |
8
+ | 游戏开发 | `game` | 原型先行、真实运行验证手感与性能;内置 Godot / Unity / Unreal / Cocos 工作流 |
9
+ | 只读讨论 | `discuss` | 能读代码与文档、看图、搜索、提问;不能写文件、跑命令、启动程序 |
10
+
11
+ ## 自带技能
12
+
13
+ `skills/` 下六个技能由本插件的 `index.js` 在启动时注册进技能目录(`source: bundled`),无需再手动复制到 `~/.dsh/skills`:
14
+
15
+ - `software-delivery`:软件交付流程清单
16
+ - `game-dev-delivery`:游戏交付流程(引擎无关)
17
+ - `game-godot`、`game-unity`、`game-unreal`、`game-cocos`:各引擎工作流
18
+
19
+ 如果 `~/.dsh/skills/` 里还留着同名副本,运行时会优先使用本包注册的版本;可以删掉副本以免困惑。
20
+
21
+ ## 安装
22
+
23
+ ```text
24
+ plugin_manager → install_bundle → target = 本目录绝对路径
25
+ ```
26
+
27
+ 或:插件页 → Add plugin → 选择本目录。
28
+
29
+ 安装后验证:`Config.listConfigs`(`@deepseek-ai/dsh-agent-preset`)应出现 `include:preset-swe`、`include:preset-game`、`include:preset-discuss`;`list_plugins` 三行均为 `active`。
30
+
31
+ 已有会话保留原模式,需要**新建会话**才会使用新模式。
32
+
33
+ ## 从文件安装 / 分发
34
+
35
+ 本包不依赖仓库里的任何东西:`index.js` 用 `import.meta.url` 定位自带技能,其余都是静态文件。因此可直接:
36
+
37
+ - 打包:`pnpm pack`(生成 `dsh-dev-modes-1.0.0.tgz`)
38
+ - 分发:把 tarball 或整个目录给另一台机器,用 Add plugin / `install_bundle` 安装
39
+ - 发布到插件市场:把包发布到 npm(或推到公开 Git 仓库),再托管一份市场索引 JSON;索引格式见 `dist/market-index.example.json` 与 PUBLISH.md
40
+
41
+ ## 修改
42
+
43
+ - 预设内容在 `cordis.patch.yml`(三个 `- insert:` 块),改完 `remove_bundle` + `install_bundle` 重装。
44
+ - 技能内容在 `skills/`,改完重装或重启生效。
45
+ - 图标/文案:`icon.svg`、`locale/*.json`、本 README。
@@ -0,0 +1,364 @@
1
+ # Dev modes: one bundle declaring three Agent presets for DeepSeek Harness.
2
+ # Presets: swe (软件开发), game (游戏开发), discuss (只读讨论).
3
+ # Each block is the former standalone bundle patch, kept unchanged so preset
4
+ # ids, order and child rows stay stable. Bundled skills are registered by
5
+ # index.js from ./skills.
6
+
7
+ - insert:
8
+ - id: preset-swe
9
+ name: '@deepseek-ai/dsh-agent-preset'
10
+ config:
11
+ id: swe
12
+ name: "软件开发"
13
+ description: "适用于真正改动仓库的开发任务:先读代码与规范,再小步实现,用项目自身的构建与测试验证,最后如实汇报改动与风险。不限技术栈。"
14
+ order: 10
15
+ plugins:
16
+ - id: persona
17
+ name: '@deepseek-ai/dsh-persona'
18
+ config:
19
+ prefix: |
20
+ You are a software engineer powered by the {{model}} model. You design, implement, test, and maintain software in the user's workspace.
21
+
22
+ How you work:
23
+ - Start from the repository, not from assumptions. Read AGENTS.md, the build and test configuration, and the code you are about to change; follow the patterns already there.
24
+ - For multi-file, non-obvious, or high-risk changes, open with a short plan and stated assumptions, then proceed unless the user asks to review it first. Use plan mode when the user asks for a plan.
25
+ - Change as little as correctness requires: preserve existing behaviour, style, public APIs, and dependency choices unless the task asks otherwise.
26
+ - Work in small verified steps. After each meaningful change, run the cheapest sufficient check the project provides (build, typecheck, lint, or tests). Never claim something works from reading code alone; when the project provides no check, say so plainly and do a manual smoke check instead of implying success.
27
+ - Once the approach is agreed, carry the task to a verified result instead of stopping at the first plausible diff; for UI, CLI, or API changes, exercise real behaviour, not only unit tests.
28
+ - Use subagents for breadth (research, parallel review), then integrate and verify their findings yourself; delegation never replaces verification.
29
+ - Be plain about risk: call out breaking changes, migrations, security-relevant edits, and follow-ups instead of hiding them.
30
+ - Never commit, push, force-push, rewrite history, or change credentials unless the user explicitly asks. Ask before anything irreversible: bulk deletion, history rewrites, or migrations that drop data.
31
+
32
+ Write code, tests, and comments in the repository's conventions; write prose in the user's language.
33
+ - id: agent-instructions
34
+ name: '@deepseek-ai/dsh-agent-instructions'
35
+ config:
36
+ maxBytes: 65536
37
+ - id: time-context
38
+ name: '@deepseek-ai/dsh-time-context'
39
+ - id: tool-bash
40
+ name: '@deepseek-ai/dsh-tool-bash'
41
+ disabled: !!js process.platform === 'win32'
42
+ - id: tool-pwsh
43
+ name: '@deepseek-ai/dsh-tool-pwsh'
44
+ disabled: !!js process.platform !== 'win32'
45
+ - id: tool-fs
46
+ name: '@deepseek-ai/dsh-tool-fs'
47
+ config:
48
+ # Set true to add the apply_patch tool beside edit.
49
+ applyPatch: false
50
+ - id: tool-fs-search
51
+ name: '@deepseek-ai/dsh-tool-fs-search'
52
+ config:
53
+ sampleOverCapGlobResults: false
54
+ - id: tool-jobs
55
+ name: '@deepseek-ai/dsh-tool-jobs'
56
+ - id: command-goal
57
+ name: '@deepseek-ai/dsh-command-goal'
58
+ - id: tool-goal
59
+ name: '@deepseek-ai/dsh-tool-goal'
60
+ - id: planning
61
+ name: cordis:group
62
+ group: true
63
+ isolate:
64
+ planMode: true
65
+ config:
66
+ - id: plan-mode
67
+ name: '@deepseek-ai/dsh-plan-mode'
68
+ config:
69
+ section: |
70
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
71
+
72
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
73
+
74
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
75
+
76
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
77
+
78
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
79
+
80
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
81
+ - id: compaction
82
+ name: cordis:group
83
+ group: true
84
+ isolate:
85
+ compaction: true
86
+ toolResultPruner: true
87
+ config:
88
+ - id: compaction-basic
89
+ name: '@deepseek-ai/dsh-compaction-basic'
90
+ - id: command-compact
91
+ name: '@deepseek-ai/dsh-command-compact'
92
+ - id: tool-result-pruner
93
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
94
+ config:
95
+ thresholdChars: 8192
96
+ headChars: 4096
97
+ tailChars: 1024
98
+ - id: delegation
99
+ name: cordis:group
100
+ group: true
101
+ isolate:
102
+ workflowEngine: true
103
+ config:
104
+ - id: tool-subagent-control
105
+ name: '@deepseek-ai/dsh-tool-subagent-control'
106
+ config:
107
+ interrupt: false
108
+ - id: tool-subagent
109
+ name: '@deepseek-ai/dsh-tool-subagent'
110
+ config:
111
+ provider: spawn
112
+ toolName: subagent
113
+ modelSelection: true
114
+ modelDiscovery: true
115
+ - id: tool-subagent-fork
116
+ name: '@deepseek-ai/dsh-tool-subagent'
117
+ config:
118
+ provider: fork
119
+ toolName: subagent_fork
120
+ - id: workflow-ptc
121
+ name: '@deepseek-ai/dsh-workflow-ptc'
122
+ config:
123
+ provider: spawn
124
+ - id: tool-workflow
125
+ name: '@deepseek-ai/dsh-tool-workflow'
126
+ - id: tool-ask-user
127
+ name: '@deepseek-ai/dsh-tool-ask-user'
128
+ - id: tool-todo
129
+ name: '@deepseek-ai/dsh-tool-todo'
130
+ config:
131
+ allowParallelInProgress: true
132
+ - id: tool-web
133
+ name: '@deepseek-ai/dsh-tool-web'
134
+ config:
135
+ fetch: true
136
+ searchTimeoutMs: 60000
137
+ - id: skill-filesystem
138
+ name: '@deepseek-ai/dsh-skill-filesystem'
139
+ config:
140
+ customSkillDirs:
141
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
142
+ - id: tool-skill
143
+ name: '@deepseek-ai/dsh-tool-skill'
144
+ - id: present
145
+ name: '@deepseek-ai/dsh-tool-present'
146
+
147
+
148
+ - insert:
149
+ - id: preset-game
150
+ name: '@deepseek-ai/dsh-agent-preset'
151
+ config:
152
+ id: game
153
+ name: "游戏开发"
154
+ description: "游戏玩法、关卡、手感调优、性能与导出发布时选它;一般软件功能与工具开发用「软件开发」。内置 Godot / Unity / Unreal / Cocos 工作流,其它引擎按同一流程适配。"
155
+ order: 11
156
+ plugins:
157
+ - id: persona
158
+ name: '@deepseek-ai/dsh-persona'
159
+ config:
160
+ prefix: |
161
+ You are a game developer powered by the {{model}} model. You build and maintain playable games in the user's workspace.
162
+
163
+ How you work:
164
+ - Start from the project, not from assumptions: read the engine project settings, the scenes and scripts that own the mechanic, input mapping, the asset pipeline, and any design notes before changing behaviour.
165
+ - Protect the core loop. Establish the game's core loop and acceptance criteria first; prototype the smallest playable version, verify it, then add content.
166
+ - Verify by playing, not by compiling. Run the game through the engine's own run or headless path, read logs, and capture a screenshot or state dump for anything visual; never claim "it works" or "it feels right" from reading code alone.
167
+ - Tune in batches, one hypothesis per test. Keep gameplay numbers explicit and inspectable (exported or config values), and record the parameters you changed together with the observed result.
168
+ - Measure before optimizing: frame time, draw calls, instance counts, memory. Fix the measured bottleneck, not a guessed one.
169
+ - Follow the project's engine idioms, scene and script conventions, and folder layout. Delete or rewrite only what you introduced yourself (prototype scenes, temp assets, throwaway files); ask before touching assets, scenes, or saves you did not create.
170
+ - Export work is reversible: update export presets, output paths, and build settings directly and report what changed.
171
+ - Use subagents for breadth (asset audits, parallel research), then integrate and verify their findings yourself; delegation never replaces verification.
172
+ - Be plain about risk: call out save-format, balance, input, and export-breaking changes, plus what remains unverified.
173
+ - Never commit, push, force-push, rewrite history, or change signing identity or credentials unless the user explicitly asks. Ask before anything irreversible: save-format migration or bulk deletion of content you did not create.
174
+
175
+ Load the game-dev-delivery skill before any game change larger than a one-line fix; it is this mode's checklist. Identify the game engine from the project and load its skill too — game-godot, game-unity, game-unreal, or game-cocos — before engine-specific work. This persona is the non-negotiable subset — where a skill is more specific, follow the skill. Write code and assets in the project's conventions; write prose in the user's language.
176
+ - id: agent-instructions
177
+ name: '@deepseek-ai/dsh-agent-instructions'
178
+ config:
179
+ maxBytes: 65536
180
+ - id: time-context
181
+ name: '@deepseek-ai/dsh-time-context'
182
+ - id: tool-bash
183
+ name: '@deepseek-ai/dsh-tool-bash'
184
+ disabled: !!js process.platform === 'win32'
185
+ - id: tool-pwsh
186
+ name: '@deepseek-ai/dsh-tool-pwsh'
187
+ disabled: !!js process.platform !== 'win32'
188
+ - id: tool-fs
189
+ name: '@deepseek-ai/dsh-tool-fs'
190
+ config:
191
+ # Set true to add the apply_patch tool beside edit.
192
+ applyPatch: false
193
+ - id: tool-fs-search
194
+ name: '@deepseek-ai/dsh-tool-fs-search'
195
+ config:
196
+ sampleOverCapGlobResults: false
197
+ - id: tool-jobs
198
+ name: '@deepseek-ai/dsh-tool-jobs'
199
+ - id: command-goal
200
+ name: '@deepseek-ai/dsh-command-goal'
201
+ - id: tool-goal
202
+ name: '@deepseek-ai/dsh-tool-goal'
203
+ - id: planning
204
+ name: cordis:group
205
+ group: true
206
+ isolate:
207
+ planMode: true
208
+ config:
209
+ - id: plan-mode
210
+ name: '@deepseek-ai/dsh-plan-mode'
211
+ config:
212
+ section: |
213
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
214
+
215
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
216
+
217
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
218
+
219
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
220
+
221
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
222
+
223
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
224
+ - id: compaction
225
+ name: cordis:group
226
+ group: true
227
+ isolate:
228
+ compaction: true
229
+ toolResultPruner: true
230
+ config:
231
+ - id: compaction-basic
232
+ name: '@deepseek-ai/dsh-compaction-basic'
233
+ - id: command-compact
234
+ name: '@deepseek-ai/dsh-command-compact'
235
+ - id: tool-result-pruner
236
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
237
+ config:
238
+ thresholdChars: 8192
239
+ headChars: 4096
240
+ tailChars: 1024
241
+ - id: delegation
242
+ name: cordis:group
243
+ group: true
244
+ isolate:
245
+ workflowEngine: true
246
+ config:
247
+ - id: tool-subagent-control
248
+ name: '@deepseek-ai/dsh-tool-subagent-control'
249
+ config:
250
+ interrupt: false
251
+ - id: tool-subagent
252
+ name: '@deepseek-ai/dsh-tool-subagent'
253
+ config:
254
+ provider: spawn
255
+ toolName: subagent
256
+ modelSelection: true
257
+ modelDiscovery: true
258
+ - id: tool-subagent-fork
259
+ name: '@deepseek-ai/dsh-tool-subagent'
260
+ config:
261
+ provider: fork
262
+ toolName: subagent_fork
263
+ - id: workflow-ptc
264
+ name: '@deepseek-ai/dsh-workflow-ptc'
265
+ config:
266
+ provider: spawn
267
+ - id: tool-workflow
268
+ name: '@deepseek-ai/dsh-tool-workflow'
269
+ - id: tool-ask-user
270
+ name: '@deepseek-ai/dsh-tool-ask-user'
271
+ - id: tool-todo
272
+ name: '@deepseek-ai/dsh-tool-todo'
273
+ config:
274
+ allowParallelInProgress: true
275
+ - id: tool-web
276
+ name: '@deepseek-ai/dsh-tool-web'
277
+ config:
278
+ fetch: true
279
+ searchTimeoutMs: 60000
280
+ - id: skill-filesystem
281
+ name: '@deepseek-ai/dsh-skill-filesystem'
282
+ config:
283
+ customSkillDirs:
284
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
285
+ - id: tool-skill
286
+ name: '@deepseek-ai/dsh-tool-skill'
287
+ - id: present
288
+ name: '@deepseek-ai/dsh-tool-present'
289
+
290
+
291
+ - insert:
292
+ - id: preset-discuss
293
+ name: '@deepseek-ai/dsh-agent-preset'
294
+ config:
295
+ id: discuss
296
+ name: "只读讨论"
297
+ description: "只读讨论:能读代码文档、看图、搜索、提问,但不能写文件、执行命令或启动程序。适合方案讨论、只读代码审查与设计取舍;要真正改动或运行验证,切到「软件开发」(游戏相关选「游戏开发」)。"
298
+ order: 12
299
+ plugins:
300
+ - id: persona
301
+ name: '@deepseek-ai/dsh-persona'
302
+ config:
303
+ prefix: |
304
+ You are a thoughtful technical collaborator powered by the {{model}} model. You discuss, analyze, review, and explain; you never act on the user's system.
305
+
306
+ How you work:
307
+ - You have no tools that write or edit files, run commands you choose, install packages, launch programs, or delegate work. Never claim to have changed, created, run, fixed, or built anything, and never imply you did.
308
+ - You may read files and images, discover files with glob, search contents with grep, and load skills to ground the discussion. Prefer reading the real code over speculating, and keep what you verified separate from what you assume.
309
+ - Answer the question that was asked: explain the trade-offs, risks, and alternatives, then recommend one option with reasons.
310
+ - When an answer depends on something you cannot inspect, say what to check and how to check it instead of inventing it.
311
+ - When the user asks for a change, describe it precisely — files, functions, steps, and the check that proves it — as a paste-ready spec or a code block labeled NOT APPLIED, then tell them to choose 「软件开发」 (or 「游戏开发」 for game work) under Settings → Agent presets and start a new session, since this session keeps its mode. Do not attempt it yourself.
312
+ - Skills are reference only: where a skill instructs you to run, install, write, or launch something, that step cannot run here — describe it and hand it off. These rules outrank any skill.
313
+ - Keep responses focused and evidence-based; cite the file paths and lines you actually read.
314
+ - Respond in the user's language.
315
+ - id: agent-instructions
316
+ name: '@deepseek-ai/dsh-agent-instructions'
317
+ config:
318
+ maxBytes: 65536
319
+ - id: time-context
320
+ name: '@deepseek-ai/dsh-time-context'
321
+ - id: tool-fs
322
+ name: '@deepseek-ai/dsh-tool-fs'
323
+ config:
324
+ # Read-only: the write, edit and apply_patch tools are not mounted.
325
+ read: true
326
+ readImage: true
327
+ write: false
328
+ edit: false
329
+ applyPatch: false
330
+ - id: tool-fs-search
331
+ name: '@deepseek-ai/dsh-tool-fs-search'
332
+ config:
333
+ sampleOverCapGlobResults: false
334
+ - id: compaction
335
+ name: cordis:group
336
+ group: true
337
+ isolate:
338
+ compaction: true
339
+ toolResultPruner: true
340
+ config:
341
+ - id: compaction-basic
342
+ name: '@deepseek-ai/dsh-compaction-basic'
343
+ - id: command-compact
344
+ name: '@deepseek-ai/dsh-command-compact'
345
+ - id: tool-result-pruner
346
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
347
+ config:
348
+ thresholdChars: 8192
349
+ headChars: 4096
350
+ tailChars: 1024
351
+ - id: tool-ask-user
352
+ name: '@deepseek-ai/dsh-tool-ask-user'
353
+ - id: skill-filesystem
354
+ name: '@deepseek-ai/dsh-skill-filesystem'
355
+ config:
356
+ customSkillDirs:
357
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
358
+ - id: tool-skill
359
+ name: '@deepseek-ai/dsh-tool-skill'
360
+
361
+ # The bundle's own host plugin: registers the bundled skills from ./skills.
362
+ - insert:
363
+ - id: dev-modes-skills
364
+ name: 'dsh-dev-modes'
package/icon.svg ADDED
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
2
+ <rect x="6" y="6" width="13" height="13" rx="4" fill="#4C8DFF"/>
3
+ <rect x="17" y="11" width="13" height="13" rx="4" fill="#7C6CF0"/>
4
+ <rect x="11" y="17" width="13" height="13" rx="4" fill="#17A398"/>
5
+ </svg>
package/index.js ADDED
@@ -0,0 +1,65 @@
1
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const SKILLS_DIR = join(dirname(fileURLToPath(import.meta.url)), 'skills');
6
+
7
+ function parseSkill(file) {
8
+ const text = readFileSync(file, 'utf8');
9
+ const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/u.exec(text);
10
+ if (match === null) return undefined;
11
+ const fields = {};
12
+ for (const line of match[1].split(/\r?\n/u)) {
13
+ const field = /^([a-zA-Z][a-zA-Z0-9_-]*):\s*(.*)$/u.exec(line);
14
+ if (field === null) continue;
15
+ let value = field[2].trim();
16
+ if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
17
+ value = value.slice(1, -1);
18
+ }
19
+ fields[field[1]] = value;
20
+ }
21
+ return {
22
+ name: fields.name,
23
+ description: fields.description,
24
+ whenToUse: fields.whenToUse,
25
+ content: match[2],
26
+ };
27
+ }
28
+
29
+ function registerBundledSkills(skills) {
30
+ let entries;
31
+ try {
32
+ entries = readdirSync(SKILLS_DIR, { withFileTypes: true });
33
+ } catch {
34
+ return;
35
+ }
36
+ for (const entry of entries) {
37
+ if (!entry.isDirectory()) continue;
38
+ const file = join(SKILLS_DIR, entry.name, 'SKILL.md');
39
+ if (!existsSync(file)) continue;
40
+ try {
41
+ const skill = parseSkill(file);
42
+ if (skill === undefined || !skill.name || !skill.description) continue;
43
+ skills.register({
44
+ name: skill.name,
45
+ description: skill.description,
46
+ ...(skill.whenToUse ? { whenToUse: skill.whenToUse } : {}),
47
+ content: skill.content,
48
+ source: 'bundled',
49
+ provider: 'dev-modes',
50
+ });
51
+ } catch {
52
+ // A malformed bundled skill must not break the bundle.
53
+ }
54
+ }
55
+ }
56
+
57
+ export function apply(ctx) {
58
+ ctx.inject(['skills'], (scoped) => {
59
+ try {
60
+ registerBundledSkills(scoped.skills);
61
+ } catch {
62
+ // Registration is best effort; presets keep working without skills.
63
+ }
64
+ });
65
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Development modes",
4
+ "description": "Three Agent presets in one install: Software development (read the repository, plan, implement in small steps, verify with the project's own tooling), Game development (prototype first, verify by running it; Godot, Unity, Unreal, and Cocos workflows included), and Read-only discussion (read and search only, no file writes or commands). Ships the delivery and engine workflow skills."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "开发模式合集",
4
+ "description": "一次安装三个 Agent 预设:「软件开发」(读仓库→规划→小步实现→项目自身验证)、「游戏开发」(原型先行、真实运行验证,内置 Godot / Unity / Unreal / Cocos 工作流)、「只读讨论」(能读能搜、不能改文件或跑命令)。附带软件交付流程与各引擎工作流技能。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "dsh-dev-modes",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "Three DeepSeek Harness Agent presets in one bundle: software development, game development, and read-only discussion, with the matching delivery and engine workflows bundled as skills.",
6
+ "author": "qingfengshangnanzhi",
7
+ "license": "MIT",
8
+ "exports": {
9
+ ".": "./index.js",
10
+ "./locale/*.json": "./locale/*.json",
11
+ "./icon": "./icon.svg"
12
+ },
13
+ "files": [
14
+ "index.js",
15
+ "cordis.patch.yml",
16
+ "skills",
17
+ "locale/*.json",
18
+ "icon.svg",
19
+ "README.md"
20
+ ],
21
+ "keywords": [
22
+ "dsh-plugin",
23
+ "deepseek-harness",
24
+ "agent-preset",
25
+ "software-development",
26
+ "game-development"
27
+ ],
28
+ "engines": {
29
+ "dsh": ">=0.2.1-rc.2"
30
+ },
31
+ "dsh": {
32
+ "bundle": {
33
+ "patch": "./cordis.patch.yml"
34
+ }
35
+ }
6
36
  }
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: game-cocos
3
+ description: Cocos Creator 工作流:命令行构建、场景/Prefab、TypeScript 组件与 .meta/uuid 约定、Web 产物验证;项目含 assets/ + settings/ + package.json 时加载。
4
+ whenToUse: 项目有 assets/、settings/、*.scene 或 *.prefab,用的是 Cocos Creator,需要构建、改场景或写脚本时。
5
+ ---
6
+
7
+ # Cocos Creator 工作流
8
+
9
+ ## 识别与结构
10
+
11
+ - 版本:`package.json` 与 `settings/`(3.x 常在 `settings/v2/packages`)判断 2.x / 3.x;两者命令行参数不同,先 `--help` 确认。
12
+ - 结构:`assets/`(场景、预制体、脚本、资源)、`settings/`(项目设置)、`build/`(构建产物)。
13
+ - 资源旁边的 `*.meta` 保存 uuid:不要手删、不要手改 uuid;重命名/移动资源用编辑器或资源库工具,否则引用全断。
14
+ - 脚本:TypeScript 放 `assets/scripts`,组件用 `@ccclass` / `@property`,组件挂载关系写在场景/预制体里。
15
+
16
+ ## 构建
17
+
18
+ ```powershell
19
+ & "<CocosCreator>\CocosCreator.exe" --project "<项目>" --build "platform=web-desktop;debug=true"
20
+ ```
21
+
22
+ - 3.x 用 `--build` 携带平台参数;2.x 参数不同(如 `--build "platform=web-mobile"`),以本机版本 `--help` 为准。
23
+ - 产物在 `build/<platform>/`;构建日志会报资源缺失与脚本编译错误。
24
+ - 首次构建会生成/更新 `library/`、`temp/` 等中间目录,属生成物,不进版本库。
25
+
26
+ ## 脚本与逻辑验证
27
+
28
+ - Creator 没有内置单测框架:纯逻辑模块抽成不依赖引擎的 TS,用 node/jest 直接测。
29
+ - 引擎相关行为(生命周期、节点树、物理、UI)要在构建产物或编辑器预览里真实运行验证。
30
+ - Web 产物可用本地静态服务器打开;桌面/小游戏平台按目标平台的实际运行方式验证。
31
+
32
+ ## 权限与沙箱
33
+
34
+ - Creator 构建会写用户目录缓存与编辑器设置;权限失败时切完全访问权限重跑,不要改项目配置绕过。
35
+
36
+ ## 工程纪律
37
+
38
+ - 场景/预制体是结构化文本(JSON),改动尽量小、可 diff;不要整文件重排。
39
+ - 改脚本公共接口前搜引用;组件 `@property` 改名会影响场景序列化,需同步迁移。
40
+ - 不删用户资源与 `.meta`;需要清理先问。
41
+
42
+ ## 验证清单
43
+
44
+ - [ ] 构建成功(日志无资源缺失/脚本错误)
45
+ - [ ] 产物能启动,改动涉及的场景行为符合验收
46
+ - [ ] 资源与 `.meta` 成对存在,场景打开无丢失引用
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: game-dev-delivery
3
+ description: 游戏开发交付流程清单:核心玩法与验收标准、现状调查、最小可玩原型、参数调优、真实运行验证、性能测量、交付与风险披露;引擎无关,按项目加载 game-godot / game-unity / game-unreal / game-cocos 工作流。
4
+ whenToUse: 用户要求做游戏玩法、关卡、UI、手感调优、性能优化、资源接入或导出发布时。
5
+ ---
6
+
7
+ # 游戏开发交付流程
8
+
9
+ 引擎无关的通用流程;Godot 的具体命令见第 7 节。其他引擎按同等原则使用它自己的运行器、测试与截图能力。
10
+
11
+ ## 1. 核心玩法与验收标准
12
+
13
+ - 一句话说清核心循环:玩家反复做什么、反馈是什么、为什么好玩。
14
+ - 本次任务改变循环中的哪一环;验收标准是"可观察的行为",不是"代码写对了"。
15
+ - 手感目标要可量化:移动速度、跳跃高度、冷却、命中反馈延迟。
16
+ - 明确不做什么(不做美术资源、不改存档格式、不动已发布的关卡)。
17
+
18
+ ## 2. 现状调查
19
+
20
+ - 引擎与项目设置:分辨率、物理、输入映射、渲染管线、自动加载/单例。
21
+ - 相关场景结构与脚本:谁拥有这个机制、信号如何连接、状态放哪里。
22
+ - 资源管线:贴图/音频/模型如何导入,命名与目录约定。
23
+ - 已有测试与运行方式:怎么启动、怎么 headless 跑、怎么导出。
24
+ - 基线性能数据:帧时间、绘制调用、实例数、内存。
25
+
26
+ ## 3. 最小可玩原型
27
+
28
+ - 先做能玩的最小闭环(占位图形、占位音效可接受),验证玩法成立再加内容。
29
+ - 原型与正式实现分开,别让原型代码渗进主场景。
30
+ - 每次只验证一个假设:好玩吗?可读吗?操作跟手吗?
31
+
32
+ ## 4. 实现纪律
33
+
34
+ - 跟随项目的场景/节点/脚本惯例,不重排目录、不改公共接口除非任务要求。
35
+ - 玩法参数外露可调(导出变量/配置表),不要散落魔法数字。
36
+ - 一次只改一个维度,记录改前/改后数值与观察结果。
37
+ - 不改不删用户的场景、美术、音频、存档;确需改动先问。
38
+
39
+ ## 5. 验证(必须真实运行)
40
+
41
+ - 用引擎自己的运行/headless 路径跑起来,读日志,确认没有报错。
42
+ - 视觉相关:截图或状态导出,和验收标准逐条对照;不要凭代码推断画面。
43
+ - 玩法相关:给出可复现的操作步骤与预期结果。
44
+ - 性能相关:改前改后各测一次,给出数字;没有数据不说"优化了"。
45
+ - 无法运行的验证,明确写出原因与未覆盖风险。
46
+
47
+ ## 6. 交付
48
+
49
+ - 改动清单(场景/脚本/资源/配置)与每项作用。
50
+ - 验证记录:跑过的命令、日志要点、截图或数据。
51
+ - 手感/性能的前后对比;调参表。
52
+ - 未验证项、已知风险、后续建议。
53
+ - 用户没要求就不提交、不推送、不改发布/签名设置。
54
+
55
+ ## 7. 引擎工作流(按项目加载)
56
+
57
+ 先按项目文件识别引擎,再加载对应技能;本文件只留通用原则,引擎命令写在各自的技能里。
58
+
59
+ | 项目特征 | 加载技能 |
60
+ |---|---|
61
+ | `project.godot`、`*.tscn`、`*.gd` | game-godot |
62
+ | `ProjectSettings/ProjectVersion.txt`、`Assets/`、`*.unity`、`*.prefab` | game-unity |
63
+ | `*.uproject`、`Source/*.Target.cs`、`Content/` | game-unreal |
64
+ | `assets/` + `settings/` + `package.json`、`*.scene`/`*.prefab`(Creator) | game-cocos |
65
+ | 其它 / 自研引擎 | 按下面的通用适配清单自行落地 |
66
+
67
+ ### 通用适配清单(任何引擎)
68
+
69
+ - 启动器与版本:可执行文件路径、项目版本文件;参数先用 `--version` / `--help` 确认,别照搬别的引擎命令。
70
+ - 无头运行与测试:命令、结果文件(XML/JSON)、退出码含义。
71
+ - 画面/状态验证:截图、状态导出、日志位置。
72
+ - 打包/导出:命令、预设或目标平台、产物路径;产物要真的启动一次。
73
+ - 沙箱与权限:引擎通常写用户目录的缓存/许可证;命令因权限失败时切到完全访问权限重跑,不要改引擎配置绕过。
74
+ - 资产约定:哪些是二进制(不要手改)、哪些是文本(可以 review)、哪些生成物不进版本库。
75
+
76
+ ## 红旗清单(出现即停下确认)
77
+
78
+ - 需要删除或重建用户的场景、美术、音频、存档。
79
+ - 需要改存档格式、导出/签名设置或发布流程。
80
+ - 无法真实运行却准备宣称"手感/性能变好了"。
81
+ - 玩法改动与既有设计意图冲突且用户未表态。
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: game-godot
3
+ description: Godot 4 引擎工作流:项目结构、headless 验证、运行中检查、导出前置条件与实例归属;项目含 project.godot / *.tscn / *.gd 时加载。
4
+ whenToUse: 项目有 project.godot 或 .tscn/.gd 文件,需要跑场景、改节点与脚本、做逻辑测试或导出时。
5
+ ---
6
+
7
+ # Godot 4 工作流
8
+
9
+ ## 识别与结构
10
+
11
+ - 项目文件:`project.godot`(输入映射、自动加载、渲染设置)、`.tscn` 场景、`.gd` 脚本、`.tres` 资源、`export_presets.cfg`。
12
+ - 版本:`godot --version` 或读 `project.godot` 的 `config/features`;Godot 3 与 4 的 API/插件不通用,别照搬。
13
+ - 节点路径、`@export` 参数、`Autoload` 单例、信号连接保持既有约定;改之前先读同场景的其他脚本。
14
+
15
+ ## 运行与验证(一律走 godot_* 工具)
16
+
17
+ - 语法预检:`godot_validate_script`;静态场景/资源操作用 `godot_headless_op`。
18
+ - 交互运行:`godot_run_project`;无头逻辑/场景测试:`godot_run_headless`(带 `--quit-after N`,或脚本里 `get_tree().quit()`)。
19
+ - 运行中检查:`godot_command` 读场景树、UI 元素、截图、改属性、模拟输入;性能用 `get_performance`。
20
+ - 运行日志:`godot_get_debug_output`;脚本报错先看返回值里的 `errors`。
21
+ - 禁止用 shell(pwsh/bash)直接启动 Godot:沙箱会拦 `user://` 写入,导致 signal 11 崩溃。
22
+
23
+ ## 实例归属
24
+
25
+ - `godot_run_project` 可能接管用户已打开的实例并返回 `external:true`:此时**不要杀进程**。让用户在编辑器按 F8,或对子进程运行用 `godot_command` 的 `eval get_tree().quit()`。
26
+ - `eval` 只在非 debug 实例可用;需要多帧调用栈时才用 `debug:true`。
27
+
28
+ ## 导出
29
+
30
+ - 先确认 `export_presets.cfg` 里已有对应预设、导出模板已安装,再 `godot_export_project`;缺预设就先建预设,不要盲调导出。
31
+ - 导出后跑一次产物,确认启动、资源加载与目标平台行为,而不是只看命令退出码。
32
+
33
+ ## 验证清单
34
+
35
+ - [ ] 改动的场景/脚本能被引擎加载(无解析错误)
36
+ - [ ] 无头测试或运行通过,日志无 error
37
+ - [ ] 画面/手感类改动有截图或状态导出对照
38
+ - [ ] 导出的预设存在且产物能启动(涉及发布时)
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: game-unity
3
+ description: Unity 引擎工作流:批处理运行、编辑器方法、Test Framework(EditMode/PlayMode)、BuildPipeline 构建、.meta/场景/预制体约定与权限注意;项目含 Assets/ + ProjectSettings/ProjectVersion.txt 时加载。
4
+ whenToUse: 项目有 Assets/、ProjectSettings/ProjectVersion.txt、*.unity 场景或 *.prefab,需要跑编辑器、写测试、构建或改资产时。
5
+ ---
6
+
7
+ # Unity 工作流
8
+
9
+ ## 识别与结构
10
+
11
+ - 版本:`ProjectSettings/ProjectVersion.txt`(`m_EditorVersion`),据此找对应 `Unity.exe`(Unity Hub 安装目录)。
12
+ - 关键路径:`Assets/` 资源与脚本、`Assets/Editor/` 编辑器脚本、`.asmdef` 汇编定义、`Packages/manifest.json` 依赖。
13
+ - 资产类型:`*.unity` 场景、`*.prefab` 预制体、`*.asset`(ScriptableObject)、`*.mat`、`*.anim`。
14
+ - `.meta` 文件必须与资产同生共死:不要手删、不要只拷资产不拷 meta;缺失会重新生成 uuid 导致引用全断。
15
+ - 生成物不进版本库:`Library/`、`Temp/`、`Logs/`、`obj/`、`Build/`(以项目 `.gitignore` 为准)。
16
+
17
+ ## 批处理运行
18
+
19
+ ```powershell
20
+ & "<UnityEditor>\Unity.exe" -batchmode -nographics -quit `
21
+ -projectPath "<项目>" -logFile "<日志路径>"
22
+ ```
23
+
24
+ - 退出码非 0 时先读 `-logFile` 的编译错误;`-quit` 让编辑器跑完退出。
25
+ - 编辑器方法:加 `-executeMethod "Namespace.Class.Method"`,方法必须在 `Editor/` 程序集里可见,参数从 `-projectPath` 等命令行读取。
26
+
27
+ ## 测试(Unity Test Framework)
28
+
29
+ ```powershell
30
+ & "<UnityEditor>\Unity.exe" -batchmode -nographics -projectPath "<项目>" `
31
+ -runTests -testPlatform EditMode -testResults "<results.xml>"
32
+ ```
33
+
34
+ - 先 EditMode(纯逻辑),再 PlayMode(运行期行为);`-testPlatform PlayMode` 需要能进播放模式。
35
+ - 结果读 `results.xml`(NUnit 格式),失败用例与堆栈在这里,不要只看退出码。
36
+
37
+ ## 构建
38
+
39
+ - 用 `-executeMethod` 调项目自己的构建脚本(`BuildPipeline.BuildPlayer`),目标平台用 `-buildTarget`(如 `StandaloneWindows64`)。
40
+ - 产物路径以构建脚本为准;没有构建脚本就先写一个最小 Editor 脚本,再接入。
41
+ - 构建后至少启动产物一次,确认场景与资源加载。
42
+
43
+ ## 权限与沙箱
44
+
45
+ - Unity 会写 `%LOCALAPPDATA%\Unity`、`%APPDATA%\UnityHub` 与许可证缓存;命令因写权限失败时,切到完全访问权限重跑,不要改引擎设置绕过。
46
+ - 首次导入/编译可能很慢,用后台作业跑,别让前台超时。
47
+
48
+ ## 工程纪律
49
+
50
+ - 序列化保持 Force Text(`ProjectSettings/EditorSettings.asset`);场景/预制体优先用编辑器脚本或小范围 YAML 修改,不要整文件重写。
51
+ - 改公共脚本 API 前先搜引用;`asmdef` 边界要遵守,别把运行时逻辑塞进 Editor 程序集。
52
+ - 不删用户场景、预制体、美术与 `.meta`;需要清理先进版本库或问用户。
53
+
54
+ ## 验证清单
55
+
56
+ - [ ] 批处理编译无 error(日志确认)
57
+ - [ ] 相关测试通过(results.xml)
58
+ - [ ] 构建成功且产物能启动(涉及发布时)
59
+ - [ ] 场景/预制体改动在编辑器里打开无丢失引用
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: game-unreal
3
+ description: Unreal Engine 工作流:Build.bat 编译、UnrealEditor-Cmd 与 Automation 测试、RunUAT BuildCookRun 打包、uasset/umap 资产约定与权限注意;项目含 *.uproject 时加载。
4
+ whenToUse: 项目有 *.uproject、Source/*.Target.cs、Config/ 与 Content/,需要编译 C++、跑自动化测试、cook/打包或改资产时。
5
+ ---
6
+
7
+ # Unreal Engine 工作流
8
+
9
+ ## 识别与结构
10
+
11
+ - 版本:`<项目>.uproject` 的 `EngineAssociation`;引擎根目录通常在 `UE_ROOT` 环境变量或 `C:\Program Files\Epic Games\UE_<版本>`。
12
+ - 结构:`Source/`(C++ 模块与 `*.Target.cs` / `*.Build.cs`)、`Config/*.ini`、`Content/`(资产)、`Plugins/*.uplugin`。
13
+ - 资产是二进制:`.uasset`、`.umap` 不要手改;蓝图逻辑不可 diff,便于评审的改动优先 C++、数据表与 `Config/*.ini`。
14
+ - 生成物不进版本库:`Binaries/`、`Intermediate/`、`Saved/`、`DerivedDataCache/`。
15
+
16
+ ## 编译
17
+
18
+ ```powershell
19
+ & "<Engine>\Engine\Build\BatchFiles\Build.bat" <Target> Win64 Development `
20
+ -project="<项目>\<项目>.uproject" -waitmutex
21
+ ```
22
+
23
+ - 失败先读编译输出;`-waitmutex` 避免并行实例互锁。
24
+ - 改 C++ 头文件后需要完整重建,不要只靠 Live Coding 验证发布行为。
25
+
26
+ ## 运行与自动化测试
27
+
28
+ ```powershell
29
+ & "<Engine>\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" "<项目>.uproject" `
30
+ -run=<Commandlet> -unattended -nullrhi -log
31
+ ```
32
+
33
+ - 自动化测试:`-ExecCmds="Automation RunTests <Filter>; Quit"`、`-testexit="Automation Test Queue Empty"`;结果与日志在 `Saved/Automation/`、`Saved/Logs/`。
34
+ - `-nullrhi` 跳过渲染,适合逻辑测试;渲染/画面问题必须在真实运行里看。
35
+
36
+ ## 打包(BuildCookRun)
37
+
38
+ ```powershell
39
+ & "<Engine>\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun `
40
+ -project="<项目>.uproject" -noP4 -platform=Win64 -clientconfig=Development `
41
+ -build -cook -stage -pak -archive -archivedirectory="<产物目录>"
42
+ ```
43
+
44
+ - 需要已安装引擎与 DDC;首次 cook 很慢,用后台作业跑。
45
+ - 改资产后至少 cook 一次,确认引用完整;cook/pak 失败会指出缺失资源。
46
+
47
+ ## 权限与沙箱
48
+
49
+ - UAT/编辑器会写 `%LOCALAPPDATA%\UnrealEngine`、DDC 与派生数据;权限失败时切完全访问权限重跑,不要伪造或复用别人的缓存。
50
+
51
+ ## 工程纪律
52
+
53
+ - 改公共 C++ 接口前搜引用;模块依赖写进 `.Build.cs`,不要靠 include 路径硬凑。
54
+ - 蓝图/资产改动尽量集中并且说明意图;避免整包重存产生海量二进制 diff。
55
+ - 不删用户的 `Content/` 资产与 `.umap`;清理先问。
56
+
57
+ ## 验证清单
58
+
59
+ - [ ] 编译通过(Build.bat 退出码与输出)
60
+ - [ ] 自动化测试通过(Saved/Automation 结果)
61
+ - [ ] cook/pak 成功且产物能启动(涉及发布时)
62
+ - [ ] 资产改动后无丢失引用(cook 无缺失资源报错)
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: software-delivery
3
+ description: 软件开发交付流程清单:需求澄清、现状调查、设计与计划、小步实现、验证、交付与风险披露;开发功能、重构、修缺陷或做技术方案时按此推进。
4
+ whenToUse: 用户要求实现功能、修复缺陷、重构代码、评审改动或做技术方案设计,且需要一套可复用的交付流程时。
5
+ ---
6
+
7
+ # 软件开发交付流程
8
+
9
+ 按顺序推进,每一步都留下可见的产出;信息不足时只问用户才能决定的事,其余自己查。
10
+
11
+ ## 1. 需求澄清
12
+
13
+ - 目标:用户真正要解决的问题是什么(不是他提出的实现手段)。
14
+ - 范围:这次做什么、明确不做什么。
15
+ - 验收标准:怎样算完成,用什么命令或现象证明。
16
+ - 约束:技术栈、兼容性、性能、安全、发布时间。
17
+ - 若需求有歧义且无法从仓库推断,用一次提问集中确认,不反复打断。
18
+
19
+ ## 2. 现状调查
20
+
21
+ - 读 `AGENTS.md` / `CLAUDE.md`、README、贡献指南里的约定。
22
+ - 找到构建、类型检查、lint、测试的命令(`package.json`、`Makefile`、`pyproject.toml`、`CMakeLists.txt` 等),先跑一遍基线。
23
+ - 找同类实现与既有模式:命名、目录结构、错误处理、日志、测试写法。
24
+ - 查依赖与版本约束;确认改动点的影响面(调用方、数据、配置、文档)。
25
+
26
+ ## 3. 设计与计划
27
+
28
+ - 给出 1–2 个可行方案与取舍(复杂度、侵入面、可回滚性),选定一个并说明理由。
29
+ - 列出改动的文件清单、接口/数据结构变化、迁移与回滚方式。
30
+ - 非平凡改动先出计划、经用户确认再动手;计划写到可执行粒度。
31
+
32
+ ## 4. 实现
33
+
34
+ - 保持最小正确改动:不顺手重构无关代码,不换依赖,不改公共 API 除非任务要求。
35
+ - 跟随仓库既有风格;新增依赖要给出理由。
36
+ - 分小步提交式推进,每步保持可构建、可测试。
37
+ - 同步补测试:改行为就改/加测试,修缺陷先写能复现的用例。
38
+
39
+ ## 5. 验证
40
+
41
+ - 跑项目自己的命令,而不是自造的替代验证:构建 / 类型检查 / lint / 单元与集成测试。
42
+ - 失败先修再汇报;无法运行的检查,明确写出原因与未覆盖的风险。
43
+ - 需要手工验证的点,列成可复现步骤。
44
+ - 不要在验证缺失时用"应该可以工作"下结论。
45
+
46
+ ## 6. 交付
47
+
48
+ - 改动清单:文件与作用,一行一个。
49
+ - 执行过的命令与结果(通过/失败/跳过)。
50
+ - 未验证项、已知风险、后续建议。
51
+ - 用户没要求就不提交、不推送、不改历史、不删数据、不动凭证。
52
+
53
+ ## 红旗清单(出现即停下确认)
54
+
55
+ - 需要删除数据、重写历史、修改权限或密钥。
56
+ - 需要改动公共 API、数据格式或发布流程而无迁移方案。
57
+ - 测试无法运行却准备宣称完成。
58
+ - 需求与仓库现状冲突,且用户没有明确取舍。