doukui 0.0.0-stage → 0.3.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 (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +42 -0
  3. package/README.md +147 -2
  4. package/bin/commands/build.js +178 -0
  5. package/bin/commands/config.js +88 -0
  6. package/bin/commands/help.js +83 -0
  7. package/bin/commands/init.js +194 -0
  8. package/bin/commands/install.js +202 -0
  9. package/bin/commands/interactive.js +352 -0
  10. package/bin/commands/list.js +108 -0
  11. package/bin/commands/loop-server.js +357 -0
  12. package/bin/commands/loop.js +1398 -0
  13. package/bin/commands/migrate.js +120 -0
  14. package/bin/commands/setup-global.js +81 -0
  15. package/bin/commands/status.js +140 -0
  16. package/bin/commands/team-cleanup.js +190 -0
  17. package/bin/commands/validate-config.js +35 -0
  18. package/bin/commands/validate.js +21 -0
  19. package/bin/commands/version.js +22 -0
  20. package/bin/context.js +143 -0
  21. package/bin/doukui.js +216 -0
  22. package/package.json +47 -4
  23. package/plugins/contracts/capabilities.js +268 -0
  24. package/plugins/contracts/checkresult-schema.json +75 -0
  25. package/plugins/contracts/config-schema.json +179 -0
  26. package/plugins/contracts/plugin-interface.js +262 -0
  27. package/plugins/contracts/plugin-schema.json +104 -0
  28. package/plugins/core/hook-session-start/index.js +281 -0
  29. package/plugins/core/hook-session-start/plugin.json +7 -0
  30. package/plugins/core/hook-skill-gate/index.js +661 -0
  31. package/plugins/core/hook-skill-gate/plugin.json +12 -0
  32. package/plugins/core/provider-loop-engine/index.js +1397 -0
  33. package/plugins/core/provider-loop-engine/plugin.json +15 -0
  34. package/plugins/core/provider-memory-store/index.js +510 -0
  35. package/plugins/core/provider-memory-store/plugin.json +9 -0
  36. package/plugins/core/provider-role-registry/index.js +376 -0
  37. package/plugins/core/provider-role-registry/plugin.json +9 -0
  38. package/plugins/core/provider-state-store/index.js +244 -0
  39. package/plugins/core/provider-state-store/plugin.json +9 -0
  40. package/plugins/core/provider-watchdog/assets/daemon-config.template.json +32 -0
  41. package/plugins/core/provider-watchdog/assets/lib/watchdog-multi-window.js +676 -0
  42. package/plugins/core/provider-watchdog/assets/watchdog.js +754 -0
  43. package/plugins/core/provider-watchdog/index.js +151 -0
  44. package/plugins/core/provider-watchdog/plugin.json +13 -0
  45. package/plugins/core/skill-agent-dispatcher/cleanup-reference.md +214 -0
  46. package/plugins/core/skill-agent-dispatcher/daemon-helpers-reference.md +249 -0
  47. package/plugins/core/skill-agent-dispatcher/plugin.json +13 -0
  48. package/plugins/core/skill-agent-dispatcher/roles-reference.md +253 -0
  49. package/plugins/core/skill-agent-dispatcher/skill.md +1291 -0
  50. package/plugins/core/skill-agentic-loop/plugin.json +20 -0
  51. package/plugins/core/skill-agentic-loop/skill.md +572 -0
  52. package/plugins/core/skill-batch-task-creator/plugin.json +15 -0
  53. package/plugins/core/skill-batch-task-creator/skill.md +620 -0
  54. package/plugins/core/skill-checklist/plugin.json +10 -0
  55. package/plugins/core/skill-checklist/skill.md +171 -0
  56. package/plugins/core/skill-completion-report/plugin.json +10 -0
  57. package/plugins/core/skill-completion-report/skill.md +331 -0
  58. package/plugins/core/skill-doukui-plan/plugin.json +15 -0
  59. package/plugins/core/skill-doukui-plan/skill.md +233 -0
  60. package/plugins/core/skill-doukui-sync/plugin.json +10 -0
  61. package/plugins/core/skill-doukui-sync/skill.md +76 -0
  62. package/plugins/core/skill-experience-logger/plugin.json +10 -0
  63. package/plugins/core/skill-experience-logger/skill.md +235 -0
  64. package/plugins/core/skill-human-checkpoint/plugin.json +10 -0
  65. package/plugins/core/skill-human-checkpoint/skill.md +194 -0
  66. package/plugins/core/skill-progress-tracker/plugin.json +10 -0
  67. package/plugins/core/skill-progress-tracker/skill.md +228 -0
  68. package/plugins/core/skill-role-manager/plugin.json +10 -0
  69. package/plugins/core/skill-role-manager/skill.md +252 -0
  70. package/plugins/core/skill-split-work-package/plugin.json +15 -0
  71. package/plugins/core/skill-split-work-package/skill.md +441 -0
  72. package/plugins/core/skill-task-archive/plugin.json +10 -0
  73. package/plugins/core/skill-task-archive/skill.md +116 -0
  74. package/plugins/core/skill-task-creator/plugin.json +15 -0
  75. package/plugins/core/skill-task-creator/skill.md +886 -0
  76. package/plugins/core/skill-team-cleanup/plugin.json +10 -0
  77. package/plugins/core/skill-team-cleanup/skill.md +266 -0
  78. package/plugins/core/skill-watchdog-manager/plugin.json +10 -0
  79. package/plugins/core/skill-watchdog-manager/skill.md +143 -0
  80. package/plugins/core/skill-workflow-orchestrator/plugin.json +13 -0
  81. package/plugins/core/skill-workflow-orchestrator/skill.md +273 -0
  82. package/plugins/core/validator-doc-sync/index.js +248 -0
  83. package/plugins/core/validator-doc-sync/plugin.json +12 -0
  84. package/plugins/core/validator-work-package/index.js +300 -0
  85. package/plugins/core/validator-work-package/plugin.json +12 -0
  86. package/plugins/plugin-registry.json +186 -0
  87. package/plugins/runtime/agent-def-generator.js +150 -0
  88. package/plugins/runtime/audit-logger.js +311 -0
  89. package/plugins/runtime/build-cli.js +89 -0
  90. package/plugins/runtime/checkresult-validator.js +131 -0
  91. package/plugins/runtime/claude-md-injector.js +159 -0
  92. package/plugins/runtime/cleanup-utils.js +293 -0
  93. package/plugins/runtime/config-manager.js +317 -0
  94. package/plugins/runtime/config-validator.js +320 -0
  95. package/plugins/runtime/context-window.js +81 -0
  96. package/plugins/runtime/event-bus.js +207 -0
  97. package/plugins/runtime/executor-claude.js +828 -0
  98. package/plugins/runtime/executor-default.js +448 -0
  99. package/plugins/runtime/executor-local.js +178 -0
  100. package/plugins/runtime/executor-sdk.js +390 -0
  101. package/plugins/runtime/harness-build.js +1037 -0
  102. package/plugins/runtime/hook-dispatcher.js +315 -0
  103. package/plugins/runtime/logger.js +192 -0
  104. package/plugins/runtime/loop-actuator.js +292 -0
  105. package/plugins/runtime/loop-coordinator.js +347 -0
  106. package/plugins/runtime/loop-defaults.js +29 -0
  107. package/plugins/runtime/loop-dispatch-batch.js +247 -0
  108. package/plugins/runtime/loop-executor.js +120 -0
  109. package/plugins/runtime/loop-report.js +327 -0
  110. package/plugins/runtime/loop-server-core.js +750 -0
  111. package/plugins/runtime/loop-snapshot.js +581 -0
  112. package/plugins/runtime/loop-trace.js +242 -0
  113. package/plugins/runtime/loop-worktree.js +404 -0
  114. package/plugins/runtime/manifest-resolver.js +457 -0
  115. package/plugins/runtime/multi-window-coordinator.js +560 -0
  116. package/plugins/runtime/objective-verifier.js +136 -0
  117. package/plugins/runtime/plan-reader.js +763 -0
  118. package/plugins/runtime/plugin-loader.js +798 -0
  119. package/plugins/runtime/plugin-trust.js +182 -0
  120. package/plugins/runtime/plugin-validator.js +491 -0
  121. package/plugins/runtime/provider-failover.js +114 -0
  122. package/plugins/runtime/provider-resolver.js +342 -0
  123. package/plugins/runtime/reflection-evaluator.js +540 -0
  124. package/plugins/runtime/resolve-plugin-path.js +297 -0
  125. package/plugins/runtime/safe-path.js +119 -0
  126. package/plugins/runtime/sandbox-context.js +235 -0
  127. package/plugins/runtime/sandbox-manager.js +609 -0
  128. package/plugins/runtime/sandbox-worker.js +215 -0
  129. package/plugins/runtime/settings-merger.js +172 -0
  130. package/plugins/runtime/state-store.js +527 -0
  131. package/plugins/runtime/team-cleanup.js +497 -0
  132. package/plugins/runtime/text-tokenize.js +25 -0
  133. package/plugins/runtime/validator-pipeline.js +475 -0
  134. package/plugins/runtime/yaml-parser.js +692 -0
  135. package/templates/harness-config.yaml +388 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "skill-split-work-package",
3
+ "version": "1.0.0",
4
+ "type": "skill",
5
+ "description": "工作包拆分 Skill - 将任务拆分为结构化工作包(仅定义不实现),支持子任务分解和依赖关系管理",
6
+ "triggers": ["拆分工作包", "创建工作包", "split-work-package", "split work package", "create work package"],
7
+ "dependencies": ["provider:state-store", "provider:role-registry"],
8
+ "provides": ["skill:split-work-package"],
9
+ "metadata": {
10
+ "gatedByCode": true
11
+ },
12
+ "config": {
13
+ "plan_mode_required": true
14
+ }
15
+ }
@@ -0,0 +1,441 @@
1
+ ---
2
+ name: skill-split-work-package
3
+ description: "工作包拆分 Skill - 将任务拆分为结构化工作包(仅定义不实现),支持子任务分解和依赖关系管理"
4
+ ---
5
+
6
+ <SUBAGENT-STOP>
7
+ If you were dispatched as a subagent to execute a specific task, skip this skill.
8
+ </SUBAGENT-STOP>
9
+
10
+ <STOP>
11
+ ╔══════════════════════════════════════════════════════════════════════════════╗
12
+ ║ 🛑 MANDATORY STOP POINT - 文档优先模式 ║
13
+ ║ ║
14
+ ║ Plan 确认后,自动执行以下步骤: ║
15
+ ║ Step 7: 写入 docs/wp/WP-XXX.md ║
16
+ ║ Step 8: 更新 task.md ║
17
+ ║ Step 9: 输出简洁报告 → 🛑 停止 ║
18
+ ║ ║
19
+ ║ ⚠️ 这是自动流程,不需要用户再次确认 ║
20
+ ║ ⚠️ bypassPermission 不影响此流程 ║
21
+ ╚══════════════════════════════════════════════════════════════════════════════╝
22
+ </STOP>
23
+
24
+ <HARD-GATE>
25
+ ╔══════════════════════════════════════════════════════════════════════════════╗
26
+ ║ 📝 文档优先模式 - Plan 确认后自动执行 ║
27
+ ║ ║
28
+ ║ Plan 确认后,你必须**立即**执行以下步骤: ║
29
+ ║ ║
30
+ ║ Step 7: 写入 docs/wp/WP-XXX.md(完整工作包文档) ║
31
+ ║ Step 8: 更新 task.md(追加概览表行) ║
32
+ ║ Step 9: 输出简洁报告 → 🛑 停止 ║
33
+ ║ ║
34
+ ║ ⚠️ 这是自动流程,不需要用户再次确认 ║
35
+ ║ ⚠️ bypassPermission 不影响此流程 ║
36
+ ║ ║
37
+ ║ DO NOT: ║
38
+ ║ ❌ Write any code files (.gd, .js, etc.) ║
39
+ ║ ❌ Modify any scene files (.tscn) except documentation ║
40
+ ║ ❌ Call human-checkpoint(Plan 确认已是人介入点) ║
41
+ ╚══════════════════════════════════════════════════════════════════════════════╝
42
+ </HARD-GATE>
43
+
44
+ # Split Work Package (工作包拆分器)
45
+
46
+ 将任务拆分成结构化工作包 - **仅创建定义,不实现代码**。
47
+
48
+ ## 核心原则
49
+
50
+ ```
51
+ ┌─────────────────────────────────────────────────────────────────┐
52
+ │ "拆分工作包" ≠ "执行工作包" │
53
+ │ │
54
+ │ 用户说 "拆分工作包" = 只写文档,不写代码 │
55
+ │ 用户说 "执行" = 开始写代码实现 │
56
+ │ │
57
+ │ 这是两个完全独立的阶段,中间必须有人工确认! │
58
+ └─────────────────────────────────────────────────────────────────┘
59
+ ```
60
+
61
+ ## When to Use
62
+
63
+ - 用户说 "拆分工作包" / "创建工作包"
64
+ - 需要将大任务分解成可执行子任务
65
+
66
+ ---
67
+
68
+ ## 🎯 快速模式 vs 深度模式
69
+
70
+ 根据用户提示词自动选择模式:
71
+
72
+ | 用户提示词特征 | 模式 | Plan 阶段行为 |
73
+ |----------------|------|---------------|
74
+ | 包含"只写文档"、"不要执行"、"不具体执行"、"不要直接执行" | **快速模式** | 只定义任务,不分析代码 |
75
+ | 无上述关键词 | **深度模式** | 可自由分析代码、评估复杂度 |
76
+
77
+ ### 快速模式(用户明确说"不要执行"时)
78
+
79
+ 在 Plan 模式中,你只能:
80
+ - ✅ 确定工作包编号
81
+ - ✅ 写任务标题和目标(1-2句话)
82
+ - ✅ 写子任务列表(可选)
83
+ - ✅ 写验收标准(可选)
84
+
85
+ 在 Plan 模式中,你**禁止**:
86
+ - ❌ 读取代码文件分析实现
87
+ - ❌ 检查代码是否存在
88
+ - ❌ 运行任何代码审计
89
+ - ❌ 做任何"执行阶段"才该做的工作
90
+
91
+ **规则**: 快速模式下,Plan 阶段只定义"做什么",不分析"怎么做"或"是否已做"
92
+
93
+ ### 深度模式(默认)
94
+
95
+ Plan 阶段可以自由进行:
96
+ - ✅ 读取代码分析依赖
97
+ - ✅ 评估任务复杂度
98
+ - ✅ 检查现有实现
99
+ - ✅ 设计拆分方案
100
+
101
+ ---
102
+
103
+ ## Forbidden Thoughts
104
+
105
+ | Thought | Reality |
106
+ |---------|---------|
107
+ | "拆分后可以直接开始执行" | ❌ 拆分≠执行,必须等待 |
108
+ | "Plan 确认后可以继续执行" | ❌ Plan 确认只允许文档更新,然后必须停止 |
109
+ | "工作包太简单,不需要验证" | ❌ 任何工作包都必须验证 |
110
+ | "用户想让我立即执行" | ❌ 不要假设,必须确认 |
111
+ | "用户选择了 bypassPermission" | ❌ bypassPermission 不影响停止点 |
112
+ | "用户清除了上下文" | ❌ 清除上下文 ≠ 授权执行代码 |
113
+ | "Plan 已经确认了" | ❌ Plan 确认只允许文档更新,然后必须停止 |
114
+ | "用户选了 bypass,可以跳过文档更新" | ❌ bypass 只跳过权限确认,不跳过文档更新步骤 |
115
+ | "调用 ExitPlanMode 工具" | ❌ 不要调用 ExitPlanMode,让用户在 Plan 界面确认即可 |
116
+
117
+ ---
118
+
119
+ ## 上下文窗口管理
120
+
121
+ 仅在深度模式下生效。快速模式不读取文件,无需分块。
122
+
123
+ ### 预读估算协议
124
+
125
+ 1. 查看文件顶部的 `<!-- CONTEXT-CONFIG -->` 获取限制参数
126
+ 2. 先用 Glob 发现文件,用 Bash `wc -l` 估算行数
127
+ 3. 估算公式: 每行代码 ≈ 10 tokens,每行文本 ≈ 5 tokens
128
+ 4. 可用预算 = max_tokens - safety_margin
129
+
130
+ ### 读取策略决策树
131
+
132
+ | 文件估算行数 | 策略 |
133
+ |-------------|------|
134
+ | ≤ thresholds.small (200行) | 直接用 Read 工具读取整个文件 |
135
+ | thresholds.small ~ thresholds.medium (200-800行) | 分块读取: Read(offset, limit=chunk_lines) |
136
+ | > thresholds.medium (800行) | Grep 扫描关键模式 → 定位行范围 → Read 目标段 |
137
+ | 多文件合计超预算 | 排序优先级 → 读高优 → 低优用 Grep |
138
+
139
+ ### 分块读取协议
140
+
141
+ 1. **首块**(1 ~ chunk_lines): 建立"结构地图"(类/函数/节标题位置)
142
+ 2. **后续块**: 根据结构地图判断是否包含相关内容
143
+ 3. **提前终止**: 已获得足够信息时停止读取,不读完整文件
144
+ 4. **跨块引用**: 记录依赖但不回读
145
+
146
+ ### 语义边界规则(优先级从高到低)
147
+
148
+ 1. 函数/方法边界 - 不在函数体中间断开
149
+ 2. 类边界 - 不在类定义中间断开
150
+ 3. Markdown 节标题 - 在 `##`/`###` 处断开
151
+ 4. 代码块边界 - 在 `{ }` 之间断开
152
+ 5. 行边界 - 最后手段
153
+
154
+ ### 部分分析的合并
155
+
156
+ 置信度标注:
157
+ - **[HIGH]** 基于完整直接读取
158
+ - **[MEDIUM]** 基于部分读取 + 结构推断
159
+ - **[LOW]** 仅基于 Grep 结果
160
+
161
+ 在 Plan 中包含"上下文缺口"子节:
162
+ ```
163
+ ## 上下文缺口
164
+ | 文件 | 未读部分 | 影响 | 建议 |
165
+ |------|----------|------|------|
166
+ ```
167
+
168
+ ### 工作包拆分专属规则
169
+
170
+ 1. **范围优先**: 先用 Glob 映射完整文件范围
171
+ 2. **依赖扫描**: 用 Grep 扫描跨文件依赖(import/require)而非全文读取
172
+ 3. **定向读取**: 只 Read 需要直接修改的主文件
173
+ 4. **接口提取**: 依赖文件用 Grep 提取接口签名
174
+ 5. **粗粒度偏好**: 分析不完整时,偏向更大粒度的拆分,避免基于不完整信息的细粒度拆分
175
+ 6. **重分析标记**: 在工作包中标记"需要实现阶段重新分析"的文件
176
+
177
+ ---
178
+
179
+ ## Two-Phase Architecture
180
+
181
+ ### Phase 1: CREATE WORK PACKAGE (本 Skill 的职责)
182
+
183
+ **触发**: 用户说 "拆分工作包"
184
+
185
+ **允许的操作**:
186
+ - ✅ 读取项目文件(分析依赖)
187
+ - ✅ 写入 `docs/wp/WP-XXX.md`
188
+ - ✅ 更新 `task.md`
189
+
190
+ **禁止的操作**:
191
+ - ❌ 创建/修改任何 `.gd` 文件
192
+ - ❌ 创建/修改任何 `.tscn` 场景文件
193
+ - ❌ 创建/修改任何资源文件 `.tres`
194
+ - ❌ 执行任何代码实现
195
+ - ❌ 调用 human-checkpoint(Plan 确认已是人介入点)
196
+
197
+ **结束标志**: 输出完成报告 → 🛑 停止
198
+
199
+ ### Phase 2: IMPLEMENT WORK PACKAGE (需要用户明确触发)
200
+
201
+ **触发**: 用户明确说 "执行" / "开始"
202
+
203
+ **允许的操作**:
204
+ - ✅ 所有代码实现操作
205
+ - ✅ 创建/修改场景文件
206
+ - ✅ 写测试代码
207
+
208
+ **如何进入**: 只有当用户在 Phase 1 完成后,**在新的一轮对话中**明确说 "执行" 时才能进入
209
+
210
+ ---
211
+
212
+ ## Flow Diagram
213
+
214
+ ```dot
215
+ digraph split_wp_v4 {
216
+ rankdir=TB;
217
+ node [shape=box];
218
+
219
+ "用户说'拆分工作包'" [shape=ellipse, style=filled, fillcolor=lightblue];
220
+ "进入 Plan 模式" [shape=box, style=filled, fillcolor=yellow];
221
+ "分析任务需求" [shape=box];
222
+ "拆分子任务" [shape=box];
223
+ "生成工作包结构" [shape=box];
224
+ "分配 WP ID" [shape=box];
225
+ "写入 plan.md" [shape=box];
226
+ "用户审核 Plan" [shape=diamond, style=filled, fillcolor=lightyellow];
227
+
228
+ subgraph cluster_phase1 {
229
+ label="文档优先模式:Plan 确认后自动执行";
230
+ style=dashed;
231
+ color=blue;
232
+
233
+ "写入 WP-XXX.md" [shape=box];
234
+ "更新 task.md" [shape=box];
235
+ "输出完成报告" [shape=box];
236
+ "🛑 停止" [shape=box, style=filled, fillcolor=red];
237
+ }
238
+
239
+ "用户说'拆分工作包'" -> "进入 Plan 模式";
240
+ "进入 Plan 模式" -> "分析任务需求";
241
+ "分析任务需求" -> "拆分子任务";
242
+ "拆分子任务" -> "生成工作包结构";
243
+ "生成工作包结构" -> "分配 WP ID";
244
+ "分配 WP ID" -> "写入 plan.md";
245
+ "写入 plan.md" -> "用户审核 Plan";
246
+ "用户审核 Plan" -> "写入 WP-XXX.md" [label="确认"];
247
+ "用户审核 Plan" -> "修改计划" [label="修改", style=dashed];
248
+
249
+ "写入 WP-XXX.md" -> "更新 task.md";
250
+ "更新 task.md" -> "输出完成报告";
251
+ "输出完成报告" -> "🛑 停止";
252
+ }
253
+ ```
254
+
255
+ ---
256
+
257
+ ## Execution Steps
258
+
259
+ ### Step 0: 进入 Plan 模式(必须首先执行)
260
+
261
+ **⚠️ 立即调用 `EnterPlanMode` 工具进入 Plan 模式!**
262
+
263
+ 不要跳过这一步。不要直接开始分析。必须先进入 Plan 模式。
264
+
265
+ ### Phase 1: Plan Mode 阶段
266
+
267
+ 在 Plan 模式中完成以下工作:
268
+
269
+ 1. **识别任务** - 确定用户指定的任务
270
+ 2. **分析范围** - 理解技术要求、依赖关系、涉及文件
271
+ 3. **生成工作包结构** - 创建唯一 ID、预估AI时间、测试用例
272
+ 4. **写入 plan.md** - 将完整计划写入 `.claude/plan.md`
273
+ 5. **等待用户确认** - 在 Plan 界面等待用户审核确认
274
+
275
+ **⚠️ Plan 完成后,等待用户在 Plan 界面确认,然后自动进入文档输出阶段。不要调用 ExitPlanMode 工具!**
276
+
277
+ ### Phase 2: 文档输出阶段(Plan 确认后,自动执行)
278
+
279
+ <POST-PLAN-MANDATORY>
280
+ ╔══════════════════════════════════════════════════════════════════════════════╗
281
+ ║ 📝 文档优先模式 - Plan 确认后自动执行 ║
282
+ ║ ║
283
+ ║ Plan 确认后,你必须**立即**执行以下步骤: ║
284
+ ║ ║
285
+ ║ Step 1: 识别任务范围 ║
286
+ ║ Step 2: 分析依赖关系 ║
287
+ ║ Step 3: 生成工作包结构 ║
288
+ ║ Step 4: 写入 docs/wp/WP-XXX.md ║
289
+ ║ Step 5: 更新 task.md ║
290
+ ║ Step 6: 输出简洁报告 → 🛑 停止 ║
291
+ ║ ║
292
+ ║ ⚠️ 这是自动流程,不需要用户再次确认 ║
293
+ ║ ⚠️ bypassPermission 不影响此流程 ║
294
+ ╚══════════════════════════════════════════════════════════════════════════════╝
295
+ </POST-PLAN-MANDATORY>
296
+
297
+ **⚠️ 此阶段只允许更新文档!**
298
+
299
+ 1. **识别任务** - 确定用户指定的任务
300
+ 2. **分析范围** - 理解技术要求、依赖关系、涉及文件
301
+ 3. **生成工作包** - 创建唯一 ID、预估AI时间、测试用例
302
+ 4. **写入工作包文档** - 创建 `docs/wp/WP-XXX.md`
303
+ 5. **同步 task.md** - 在工作包概览表添加新行
304
+ 6. **输出简洁报告** - 向用户报告新增的 WP ID,然后 **🛑 停止**
305
+
306
+ ---
307
+
308
+ ## Completion Report Format
309
+
310
+ ```markdown
311
+ ✅ 工作包创建完成
312
+
313
+ 📦 **工作包**: WP-XXX - 工作包名称
314
+ 📊 **优先级**: P0/P1/P2
315
+ ⏱️ **预估AI时间**: Xmin
316
+ 📋 **子任务数**: X 个
317
+ 🧪 **测试用例**: X 个
318
+
319
+ 📁 **已更新文档**:
320
+ - docs/wp/WP-XXX.md
321
+ - task.md
322
+
323
+ 🛑 **任务创建完成,等待您的下一步指示**
324
+ ```
325
+
326
+ **输出报告后,直接 🛑 停止**
327
+
328
+ ---
329
+
330
+ ## 🛑 MANDATORY STOP BEHAVIOR
331
+
332
+ **文档优先模式:Plan 确认后自动写文档,然后停止。**
333
+
334
+ ```
335
+ ╔══════════════════════════════════════════════════════════════════╗
336
+ ║ 📝 文档优先模式 ║
337
+ ║ ║
338
+ ║ Plan 确认后: ║
339
+ ║ ✅ 自动写入 docs/wp/WP-XXX.md ║
340
+ ║ ✅ 自动更新 task.md ║
341
+ ║ ✅ 输出简洁报告 ║
342
+ ║ ✅ 🛑 停止等待用户下一步指示 ║
343
+ ║ ║
344
+ ║ DO NOT (绝对禁止): ║
345
+ ║ ❌ 调用 human-checkpoint(Plan 确认已是人介入点) ║
346
+ ║ ❌ 自动开始代码实现 ║
347
+ ║ ❌ 开始写任何代码文件 ║
348
+ ╚══════════════════════════════════════════════════════════════════╝
349
+ ```
350
+
351
+ ---
352
+
353
+ ## Work Package ID Rules
354
+
355
+ | 规则 | 示例 |
356
+ |------|------|
357
+ | 工作包 ID | `WP-NNN` (数字编号,无位数限制) |
358
+ | 顺序递增 | WP-1 → WP-2 → WP-3 |
359
+ | 子任务 ID | `模块前缀-序号` (如 GAZE-1, SHOP-2) |
360
+
361
+ ---
362
+
363
+ ## Work Package Template
364
+
365
+ ```markdown
366
+ ## WP-XXX: 工作包名称 (优先级) 📋
367
+
368
+ ### 状态
369
+ - **代码状态**: 📋 待开始
370
+ - **测试状态**: 📋 待开始
371
+ - **依赖**: 无 / WP-XXX
372
+
373
+ ### 任务列表
374
+ | 任务ID | 任务名称 | 预估 | 测试数 | 状态 |
375
+ |--------|----------|------|--------|------|
376
+ | XXX-1 | 任务描述 | Xmin | X | 📋 待开始 |
377
+
378
+ ### XXX-1: 任务名称
379
+
380
+ #### 实现内容
381
+ - [ ] 具体实现项1
382
+ - [ ] 具体实现项2
383
+
384
+ #### 涉及文件
385
+ ```
386
+ scripts/path/to/file.gd
387
+ ```
388
+
389
+ #### 验收标准
390
+ - [ ] XXX-1-A1: 验收项1
391
+
392
+ > **WP-S5 verify 优先**:能被命令验证的验收项必须加 `[verify: command]` 标记
393
+ > (如 `- [ ] 单测全绿 [verify: npm test]`)——框架实跑命令客观判定(零 LLM
394
+ > 自由判断,更可靠且省 token);只有无法命令化的项(如「文档表述清晰」)才
395
+ > 留给 LLM 自由判断。
396
+
397
+ #### 测试用例
398
+ | 测试ID | 测试内容 | 预期结果 |
399
+ |--------|----------|----------|
400
+ | XXX-1-T1 | 测试描述 | 预期结果 |
401
+ ```
402
+
403
+ ---
404
+
405
+ ## 文件路径约定
406
+
407
+ | 文件类型 | 允许在本 Skill 中修改 |
408
+ |----------|----------------------|
409
+ | `docs/wp/WP-XXX.md` | ✅ 允许 |
410
+ | `task.md` | ✅ 允许 |
411
+ | `scripts/**/*.gd` | ❌ 禁止 |
412
+ | `scenes/**/*.tscn` | ❌ 禁止 |
413
+ | 其他任何代码文件 | ❌ 禁止 |
414
+
415
+ ---
416
+
417
+ ## Split Principles
418
+
419
+ | 原则 | 说明 |
420
+ |------|------|
421
+ | 单一聚焦 | 每个工作包聚焦单一模块/功能 |
422
+ | 粒度控制 | 子任务 5-30 分钟(AI执行) |
423
+ | 测试覆盖 | 每个子任务至少 3 个测试用例 |
424
+ | 依赖标注 | 明确标注前置依赖 |
425
+
426
+ ---
427
+
428
+ ## Priority Definition
429
+
430
+ | 优先级 | 含义 |
431
+ |--------|------|
432
+ | P0 | 阻塞性问题,必须立即处理 |
433
+ | P1 | 重要功能,当前迭代需要 |
434
+ | P2 | 优化改进,可延后处理 |
435
+
436
+ ---
437
+
438
+ ## Related Skills
439
+
440
+ - **task-creator**: 单任务创建(推荐使用)
441
+ - **batch-task-creator**: 批量任务创建
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "skill-task-archive",
3
+ "version": "1.0.0",
4
+ "type": "skill",
5
+ "description": "Archive completed work packages from task.md to docs/archive/, keeping only pending items. Use when user says '任务归档' or 'archive tasks'.",
6
+ "triggers": ["任务归档", "task archive", "archive tasks", "归档"],
7
+ "dependencies": [],
8
+ "provides": ["skill:task-archive"],
9
+ "config": {}
10
+ }
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: skill-task-archive
3
+ description: "Archive completed work packages from task.md to docs/archive/, keeping only pending items. Use when user says '任务归档' or 'archive tasks'."
4
+ ---
5
+
6
+ # Task Archive (任务归档)
7
+
8
+ 将 task.md 中已完成和非待执行的工作包/活动归档到独立文档,保持 task.md 精简。
9
+
10
+ ## When to Use
11
+
12
+ - 用户说 "任务归档" / "归档"
13
+ - 用户说 "task archive" / "archive tasks"
14
+ - task.md 文件过长(单行过长 / 行数膨胀)需要清理时
15
+
16
+ ---
17
+
18
+ ## task.md 结构识别
19
+
20
+ task.md 节结构(按出现顺序,缺失的节跳过):
21
+
22
+ - `# Task Overview` 标题 + `## 📊 快速概览`(含 **进度** 行 + **最近更新** 行 + 规划文档/预算)
23
+ - `## 📦 归档索引`(表格:日期 / 文件 / 摘要)
24
+ - `## 📝 最近活动`(表格:日期 / 活动描述,按时间倒序)
25
+ - `## 📋 待办工作包`(**历史结构,当前可能不存在**:WP 表格,含 ✅完成 / 🔄进行中 / 📋待执行 行)
26
+
27
+ > 结构演进:早期 task.md 含 `📋 待办工作包` 表格;当前版本改用 `📝 最近活动` 表 + `📊 快速概览` 进度行承载 WP 完成记录(单行进度串可极长)。本 skill 兼容两种结构。
28
+
29
+ ---
30
+
31
+ ## 核心流程
32
+
33
+ ### Step 1: 分析 task.md
34
+
35
+ 读取项目根 `task.md`,识别**可归档**与**必须保留**:
36
+
37
+ **可归档**:
38
+ - `📋 待办工作包` 表格中状态为 `✅ 完成` 的行(若该表存在)
39
+ - `📝 最近活动` 表格中**超过保留窗口**的旧活动行(默认保留最近 5 条,更旧的归档)
40
+ - `📊 快速概览` 的 **进度** 行中已完成 WP 的冗长详细描述(归档原貌,task.md 保留摘要)
41
+ - "历史工作包" / "实施阶段" / "依赖图" 等纯历史参考章节(若存在)
42
+
43
+ **必须保留**:
44
+ - `# Task Overview` 标题 + `📊 快速概览` 节(进度行可摘要化但节结构保留)
45
+ - `📦 归档索引` 表(只追加新行,不删旧行)
46
+ - `📝 最近活动` 表的最近 5 条(含表头/分隔行)
47
+ - `📋 待办工作包` 表中状态**不是** `✅ 完成` 的行(🔄进行中 / 📋待执行 **绝对不归档**)
48
+ - 综合发展规划文档引用链接
49
+
50
+ ### Step 2: 生成归档文档
51
+
52
+ 1. 当前日期 `YYYY-MM-DD`
53
+ 2. 创建 `docs/archive/task-archive-YYYY-MM-DD.md`(目录不存在则先建)
54
+ 3. 写入归档内容,保留原貌:
55
+
56
+ ```markdown
57
+ # Task Archive — YYYY-MM-DD
58
+
59
+ > 自动归档生成,源文件:task.md
60
+ > 归档范围:<说明本次归档了哪些节/条目>
61
+
62
+ ## 📊 快速概览 — 进度行(归档原貌)
63
+
64
+ <原进度行全文>
65
+
66
+ ## 📝 最近活动 — 旧条目(归档原貌)
67
+
68
+ | 日期 | 活动描述 |
69
+ |------|----------|
70
+ <被归档的旧活动行,原样>
71
+
72
+ ## 已归档工作包(若存在待办工作包表)
73
+
74
+ <按原格式保留 ✅ 完成 WP 详情>
75
+ ```
76
+
77
+ ### Step 3: 更新 task.md
78
+
79
+ 1. `📊 快速概览` 进度行:若过长,替换为摘要(如 `N/N (100%) | 路线图完成 ✅(WP-XXX~YYY,详情见归档)`),详细原貌已进 Step 2 归档文件
80
+ 2. `📝 最近活动` 表:删除超过保留窗口的旧活动行,保留最近 5 条(含表头/分隔行)
81
+ 3. `📋 待办工作包` 表(若存在):删除所有 `✅ 完成` 行;变空则保留表头并标注"无待办工作包"
82
+ 4. 在 `📦 归档索引` 表的**首行数据位置**(最新日期在前)插入新行:
83
+ `| YYYY-MM-DD | [task-archive-YYYY-MM-DD.md](docs/archive/task-archive-YYYY-MM-DD.md) | <X 个 WP / Y 条旧活动> 归档 |`
84
+
85
+ ### Step 4: 验证
86
+
87
+ ```bash
88
+ ls docs/archive/task-archive-YYYY-MM-DD.md # 归档文件存在
89
+ grep "📦 归档索引" task.md # 归档索引节在
90
+ grep "📝 最近活动" task.md # 最近活动节在
91
+ # task.md 行数 / 最长行字符数 较归档前明显下降
92
+ ```
93
+
94
+ > 若 task.md 含 `📋 待办工作包` 表,额外 `grep "📋 待办工作包" task.md`;当前结构无此表则跳过该检查(grep 返回非 0 不代表失败)。
95
+
96
+ ---
97
+
98
+ ## 注意事项
99
+
100
+ - **task.md 是 git tracked 工作包索引**(CLAUDE.md / `.gitignore` 明确:不得 `git rm` / 忽略)。归档是**移动详细内容**到 `docs/archive/`,task.md 保留精简骨架——绝非删除 task.md。
101
+ - **`docs/archive/` 必须进 git**:`.gitignore` 已含 `!docs/archive/` 例外(覆盖 `docs/*` 忽略规则),归档文件入 git 保留可追溯性。若该例外缺失,归档前先在 `.gitignore` 的 `docs/*` 段补 `!docs/archive/`。
102
+ - 归档累积:已有归档索引表只追加新行,不重建 / 不删旧行。
103
+ - 非完成态行(🔄进行中 / 📋待执行)绝对不归档。
104
+ - 单次归档聚焦一个日期;跨日历史分别归档。
105
+
106
+ ## 输出报告格式
107
+
108
+ ```markdown
109
+ ✅ 归档完成
110
+
111
+ 📦 归档文件: docs/archive/task-archive-YYYY-MM-DD.md
112
+ 📊 归档条目: X 个已完成 WP + Y 条旧活动 + Z 个历史章节
113
+ 📋 task.md 剩余: W 行(最长行 K 字符)
114
+
115
+ 🛑 归档完成,等待您的下一步指示
116
+ ```
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "skill-task-creator",
3
+ "version": "1.0.0",
4
+ "type": "skill",
5
+ "description": "任务创建 Skill - 创建工作包定义(仅定义不实现),包含复杂度评估、智能拆分模式和 Plan 模式流程",
6
+ "triggers": ["创建任务", "新建任务", "添加任务", "task-creator", "create task", "new task", "add task"],
7
+ "dependencies": ["provider:state-store"],
8
+ "provides": ["skill:task-creator"],
9
+ "metadata": {
10
+ "gatedByCode": true
11
+ },
12
+ "config": {
13
+ "plan_mode_required": true
14
+ }
15
+ }