claude-code-workflow 6.3.49 → 6.3.51

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 (90) hide show
  1. package/.claude/commands/issue/new.md +1 -2
  2. package/.claude/commands/view.md +367 -0
  3. package/.claude/commands/workflow/unified-execute-with-file.md +807 -0
  4. package/.claude/skills/ccw-help/SKILL.md +72 -12
  5. package/.claude/skills/ccw-help/command.json +922 -520
  6. package/.claude/skills/ccw-help/index/all-agents.json +97 -0
  7. package/.claude/skills/ccw-help/index/all-commands.json +805 -0
  8. package/.claude/skills/ccw-help/index/by-category.json +833 -0
  9. package/.claude/skills/ccw-help/index/by-use-case.json +819 -0
  10. package/.claude/skills/ccw-help/index/command-relationships.json +160 -0
  11. package/.claude/skills/ccw-help/index/essential-commands.json +90 -0
  12. package/.claude/skills/ccw-help/scripts/auto-update.py +34 -0
  13. package/.claude/skills/skill-generator/SKILL.md +255 -208
  14. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +238 -228
  15. package/.claude/skills/skill-generator/phases/02-structure-generation.md +261 -262
  16. package/.claude/skills/skill-generator/phases/03-phase-generation.md +976 -969
  17. package/.claude/skills/skill-generator/phases/04-specs-templates.md +398 -398
  18. package/.claude/skills/skill-generator/phases/05-validation.md +417 -417
  19. package/.claude/skills/skill-generator/specs/cli-integration.md +131 -131
  20. package/.claude/skills/skill-generator/specs/execution-modes.md +399 -396
  21. package/.claude/skills/skill-generator/specs/reference-docs-spec.md +271 -0
  22. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -265
  23. package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -466
  24. package/.claude/skills/skill-generator/templates/autonomous-action.md +91 -88
  25. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +89 -89
  26. package/.claude/skills/skill-generator/templates/code-analysis-action.md +148 -149
  27. package/.claude/skills/skill-generator/templates/llm-action.md +367 -367
  28. package/.claude/skills/skill-generator/templates/script-template.md +79 -79
  29. package/.claude/skills/skill-generator/templates/sequential-phase.md +129 -129
  30. package/.claude/skills/skill-generator/templates/skill-md.md +134 -75
  31. package/.codex/prompts/UNIFIED_EXECUTE_COMPARISON.md +205 -0
  32. package/.codex/prompts/analyze-with-file.md +5 -2
  33. package/.codex/prompts/brainstorm-to-cycle.md +4 -3
  34. package/.codex/prompts/brainstorm-with-file.md +6 -2
  35. package/.codex/prompts/clean.md +7 -2
  36. package/.codex/prompts/compact.md +5 -3
  37. package/.codex/prompts/debug-with-file.md +6 -2
  38. package/.codex/prompts/execute.md +6 -2
  39. package/.codex/prompts/issue-execute.md +10 -2
  40. package/.codex/prompts/issue-new.md +390 -285
  41. package/.codex/prompts/lite-execute.md +8 -7
  42. package/.codex/prompts/lite-fix.md +6 -2
  43. package/.codex/prompts/lite-plan-a.md +6 -2
  44. package/.codex/prompts/lite-plan-b.md +6 -2
  45. package/.codex/prompts/lite-plan-c.md +6 -2
  46. package/.codex/prompts/unified-execute-with-file.md +722 -0
  47. package/.codex/skills/codex-issue-plan-execute/SKILL.md +239 -0
  48. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +173 -0
  49. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +220 -0
  50. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +86 -0
  51. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +165 -0
  52. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +170 -0
  53. package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +210 -0
  54. package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +136 -0
  55. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +136 -0
  56. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +135 -0
  57. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +107 -0
  58. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +122 -0
  59. package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +187 -0
  60. package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +231 -0
  61. package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +270 -0
  62. package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +268 -0
  63. package/ccw/dist/cli.d.ts.map +1 -1
  64. package/ccw/dist/cli.js +1 -0
  65. package/ccw/dist/cli.js.map +1 -1
  66. package/ccw/dist/commands/cli.d.ts +1 -0
  67. package/ccw/dist/commands/cli.d.ts.map +1 -1
  68. package/ccw/dist/commands/cli.js +74 -6
  69. package/ccw/dist/commands/cli.js.map +1 -1
  70. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  71. package/ccw/dist/core/routes/cli-routes.js +16 -1
  72. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  73. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
  74. package/ccw/dist/core/routes/help-routes.js +51 -1
  75. package/ccw/dist/core/routes/help-routes.js.map +1 -1
  76. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  77. package/ccw/dist/tools/cli-executor-core.js +5 -3
  78. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  79. package/ccw/dist/tools/cli-executor-utils.d.ts +1 -0
  80. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
  81. package/ccw/dist/tools/cli-executor-utils.js +3 -1
  82. package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
  83. package/ccw/src/cli.ts +1 -0
  84. package/ccw/src/commands/cli.ts +77 -6
  85. package/ccw/src/core/routes/cli-routes.ts +16 -1
  86. package/ccw/src/core/routes/help-routes.ts +60 -1
  87. package/ccw/src/templates/dashboard-js/views/help.js +423 -1
  88. package/ccw/src/tools/cli-executor-core.ts +6 -3
  89. package/ccw/src/tools/cli-executor-utils.ts +5 -2
  90. package/package.json +1 -1
@@ -1,466 +1,466 @@
1
- # Skill Requirements Specification
2
-
3
- Skill 创建的需求收集规范。
4
-
5
- ---
6
-
7
- ## 必需信息
8
-
9
- ### 1. 基本信息
10
-
11
- | 字段 | 类型 | 必需 | 说明 |
12
- |------|------|------|------|
13
- | `skill_name` | string | | Skill 标识符(小写-连字符) |
14
- | `display_name` | string | | 显示名称 |
15
- | `description` | string | | 一句话描述 |
16
- | `triggers` | string[] | | 触发关键词列表 |
17
-
18
- ### 2. 执行模式
19
-
20
- | 字段 | 类型 | 必需 | 说明 |
21
- |------|------|------|------|
22
- | `execution_mode` | enum | | `sequential` \| `autonomous` \| `hybrid` |
23
- | `phase_count` | number | 条件 | Sequential 模式下的阶段数 |
24
- | `action_count` | number | 条件 | Autonomous 模式下的动作数 |
25
-
26
- ### 2.5 上下文策略 (P0 增强)
27
-
28
- | 字段 | 类型 | 必需 | 说明 |
29
- |------|------|------|------|
30
- | `context_strategy` | enum | | `file` \| `memory` |
31
-
32
- **策略对比**:
33
-
34
- | 策略 | 持久化 | 可调试 | 可恢复 | 适用场景 |
35
- |------|--------|--------|--------|----------|
36
- | `file` | | | | 复杂多阶段任务(推荐) |
37
- | `memory` | | | | 简单线性任务 |
38
-
39
- ### 2.6 LLM 集成配置 (P1 增强)
40
-
41
- | 字段 | 类型 | 必需 | 说明 |
42
- |------|------|------|------|
43
- | `llm_integration` | object | 可选 | LLM 调用配置 |
44
- | `llm_integration.enabled` | boolean | - | 是否启用 LLM 调用 |
45
- | `llm_integration.default_tool` | enum | - | `gemini` \| `qwen` \| `codex` |
46
- | `llm_integration.fallback_chain` | string[] | - | 失败时的备选工具链 |
47
-
48
- ### 3. 工具依赖
49
-
50
- | 字段 | 类型 | 必需 | 说明 |
51
- |------|------|------|------|
52
- | `allowed_tools` | string[] | | 允许使用的工具列表 |
53
- | `mcp_tools` | string[] | 可选 | 需要的 MCP 工具 |
54
-
55
- ### 4. 输出配置
56
-
57
- | 字段 | 类型 | 必需 | 说明 |
58
- |------|------|------|------|
59
- | `output_format` | enum | | `markdown` \| `html` \| `json` |
60
- | `output_location` | string | | 输出目录模式 |
61
-
62
- ---
63
-
64
- ## 配置文件结构
65
-
66
- ```typescript
67
- interface SkillConfig {
68
- // 基本信息
69
- skill_name: string; // "my-skill"
70
- display_name: string; // "My Skill"
71
- description: string; // "一句话描述"
72
- triggers: string[]; // ["keyword1", "keyword2"]
73
-
74
- // 执行模式
75
- execution_mode: 'sequential' | 'autonomous' | 'hybrid';
76
-
77
- // 上下文策略 (P0 增强)
78
- context_strategy: 'file' | 'memory'; // 默认: 'file'
79
-
80
- // LLM 集成配置 (P1 增强)
81
- llm_integration?: {
82
- enabled: boolean; // 是否启用 LLM 调用
83
- default_tool: 'gemini' | 'qwen' | 'codex';
84
- fallback_chain: string[]; // ['gemini', 'qwen', 'codex']
85
- mode: 'analysis' | 'write'; // 默认 mode
86
- };
87
-
88
- // Sequential 模式配置
89
- sequential_config?: {
90
- phases: Array<{
91
- id: string; // "01-init"
92
- name: string; // "Initialization"
93
- description: string; // "收集初始配置"
94
- input: string[]; // 输入依赖
95
- output: string; // 输出文件
96
- }>;
97
- };
98
-
99
- // Autonomous 模式配置
100
- autonomous_config?: {
101
- state_schema: {
102
- fields: Array<{
103
- name: string;
104
- type: string;
105
- description: string;
106
- }>;
107
- };
108
- actions: Array<{
109
- id: string; // "action-init"
110
- name: string; // "Initialize"
111
- description: string; // "初始化状态"
112
- preconditions: string[]; // 前置条件
113
- effects: string[]; // 执行效果
114
- }>;
115
- termination_conditions: string[];
116
- };
117
-
118
- // 工具依赖
119
- allowed_tools: string[]; // ["Task", "Read", "Write", ...]
120
- mcp_tools?: string[]; // ["mcp__chrome__*"]
121
-
122
- // 输出配置
123
- output: {
124
- format: 'markdown' | 'html' | 'json';
125
- location: string; // ".workflow/.scratchpad/{skill}-{timestamp}"
126
- filename_pattern: string; // "{name}-output.{ext}"
127
- };
128
-
129
- // 质量配置
130
- quality?: {
131
- dimensions: string[]; // ["completeness", "consistency", ...]
132
- pass_threshold: number; // 80
133
- };
134
-
135
- // 元数据
136
- created_at: string;
137
- version: string;
138
- }
139
- ```
140
-
141
- ---
142
-
143
- ## 需求收集问题
144
-
145
- ### Phase 1: 基本信息
146
-
147
- ```javascript
148
- AskUserQuestion({
149
- questions: [
150
- {
151
- question: "Skill 的名称是什么?(英文,小写-连字符格式)",
152
- header: "Skill 名称",
153
- multiSelect: false,
154
- options: [
155
- { label: "自动生成", description: "根据描述自动生成名称" },
156
- { label: "手动输入", description: "输入自定义名称" }
157
- ]
158
- },
159
- {
160
- question: "Skill 的主要用途是什么?",
161
- header: "用途类型",
162
- multiSelect: false,
163
- options: [
164
- { label: "文档生成", description: "生成 Markdown/HTML 文档" },
165
- { label: "代码分析", description: "分析代码结构、质量、安全" },
166
- { label: "交互管理", description: "管理 Issue、任务、工作流" },
167
- { label: "数据处理", description: "ETL、转换、报告生成" },
168
- { label: "自定义", description: "其他用途" }
169
- ]
170
- }
171
- ]
172
- });
173
- ```
174
-
175
- ### Phase 2: 执行模式
176
-
177
- ```javascript
178
- AskUserQuestion({
179
- questions: [
180
- {
181
- question: "选择执行模式:",
182
- header: "执行模式",
183
- multiSelect: false,
184
- options: [
185
- {
186
- label: "Sequential (顺序)",
187
- description: "阶段按固定顺序执行,适合流水线任务(推荐)"
188
- },
189
- {
190
- label: "Autonomous (自主)",
191
- description: "动态选择执行路径,适合交互式任务"
192
- },
193
- {
194
- label: "Hybrid (混合)",
195
- description: "初始化和收尾固定,中间交互灵活"
196
- }
197
- ]
198
- }
199
- ]
200
- });
201
- ```
202
-
203
- ### Phase 3: 阶段/动作定义
204
-
205
- #### Sequential 模式
206
-
207
- ```javascript
208
- AskUserQuestion({
209
- questions: [
210
- {
211
- question: "需要多少个执行阶段?",
212
- header: "阶段数量",
213
- multiSelect: false,
214
- options: [
215
- { label: "3 阶段", description: "简单: 收集处理输出" },
216
- { label: "5 阶段", description: "标准: 收集探索分析组装验证" },
217
- { label: "7 阶段", description: "完整: 包含并行处理和迭代优化" },
218
- { label: "自定义", description: "手动指定阶段" }
219
- ]
220
- }
221
- ]
222
- });
223
- ```
224
-
225
- #### Autonomous 模式
226
-
227
- ```javascript
228
- AskUserQuestion({
229
- questions: [
230
- {
231
- question: "核心动作有哪些?",
232
- header: "动作定义",
233
- multiSelect: true,
234
- options: [
235
- { label: "初始化 (init)", description: "设置初始状态" },
236
- { label: "列表 (list)", description: "显示当前项目" },
237
- { label: "创建 (create)", description: "创建新项目" },
238
- { label: "编辑 (edit)", description: "修改现有项目" },
239
- { label: "删除 (delete)", description: "删除项目" },
240
- { label: "完成 (complete)", description: "完成任务" }
241
- ]
242
- }
243
- ]
244
- });
245
- ```
246
-
247
- ### Phase 4: 上下文策略 (P0 增强)
248
-
249
- ```javascript
250
- AskUserQuestion({
251
- questions: [
252
- {
253
- question: "选择上下文管理策略:",
254
- header: "上下文策略",
255
- multiSelect: false,
256
- options: [
257
- {
258
- label: "文件策略 (file)",
259
- description: "持久化到 .scratchpad,支持调试和恢复(推荐)"
260
- },
261
- {
262
- label: "内存策略 (memory)",
263
- description: "仅在运行时保持,速度快但无法恢复"
264
- }
265
- ]
266
- }
267
- ]
268
- });
269
- ```
270
-
271
- ### Phase 5: LLM 集成 (P1 增强)
272
-
273
- ```javascript
274
- AskUserQuestion({
275
- questions: [
276
- {
277
- question: "是否需要 LLM 调用能力?",
278
- header: "LLM 集成",
279
- multiSelect: false,
280
- options: [
281
- {
282
- label: "启用 LLM 调用",
283
- description: "使用 gemini/qwen/codex 进行分析或生成"
284
- },
285
- {
286
- label: "不需要",
287
- description: "仅使用本地工具"
288
- }
289
- ]
290
- }
291
- ]
292
- });
293
-
294
- // 如果启用 LLM
295
- if (llmEnabled) {
296
- AskUserQuestion({
297
- questions: [
298
- {
299
- question: "选择默认 LLM 工具:",
300
- header: "LLM 工具",
301
- multiSelect: false,
302
- options: [
303
- { label: "Gemini", description: "大上下文,适合分析任务(推荐)" },
304
- { label: "Qwen", description: "代码生成能力强" },
305
- { label: "Codex", description: "自主执行能力强,适合实现任务" }
306
- ]
307
- }
308
- ]
309
- });
310
- }
311
- ```
312
-
313
- ### Phase 6: 工具依赖
314
-
315
- ```javascript
316
- AskUserQuestion({
317
- questions: [
318
- {
319
- question: "需要哪些工具?",
320
- header: "工具选择",
321
- multiSelect: true,
322
- options: [
323
- { label: "基础工具", description: "Task, Read, Write, Glob, Grep, Bash" },
324
- { label: "用户交互", description: "AskUserQuestion" },
325
- { label: "Chrome 截图", description: "mcp__chrome__*" },
326
- { label: "外部搜索", description: "mcp__exa__search" },
327
- { label: "CCW CLI 调用", description: "ccw cli (gemini/qwen/codex)" }
328
- ]
329
- }
330
- ]
331
- });
332
- ```
333
-
334
- ---
335
-
336
- ## 验证规则
337
-
338
- ### 名称验证
339
-
340
- ```javascript
341
- function validateSkillName(name) {
342
- const rules = [
343
- { test: /^[a-z][a-z0-9-]*$/, msg: "必须以小写字母开头,只包含小写字母、数字、连字符" },
344
- { test: /^.{3,30}$/, msg: "长度 3-30 字符" },
345
- { test: /^(?!.*--)/, msg: "不能有连续连字符" },
346
- { test: /[^-]$/, msg: "不能以连字符结尾" }
347
- ];
348
-
349
- for (const rule of rules) {
350
- if (!rule.test.test(name)) {
351
- return { valid: false, error: rule.msg };
352
- }
353
- }
354
- return { valid: true };
355
- }
356
- ```
357
-
358
- ### 配置验证
359
-
360
- ```javascript
361
- function validateSkillConfig(config) {
362
- const errors = [];
363
-
364
- // 必需字段
365
- if (!config.skill_name) errors.push("缺少 skill_name");
366
- if (!config.description) errors.push("缺少 description");
367
- if (!config.execution_mode) errors.push("缺少 execution_mode");
368
-
369
- // 模式特定验证
370
- if (config.execution_mode === 'sequential') {
371
- if (!config.sequential_config?.phases?.length) {
372
- errors.push("Sequential 模式需要定义 phases");
373
- }
374
- } else if (config.execution_mode === 'autonomous') {
375
- if (!config.autonomous_config?.actions?.length) {
376
- errors.push("Autonomous 模式需要定义 actions");
377
- }
378
- }
379
-
380
- return { valid: errors.length === 0, errors };
381
- }
382
- ```
383
-
384
- ---
385
-
386
- ## 示例配置
387
-
388
- ### Sequential 模式示例 (增强版)
389
-
390
- ```json
391
- {
392
- "skill_name": "api-docs-generator",
393
- "display_name": "API Docs Generator",
394
- "description": "Generate API documentation from source code",
395
- "triggers": ["generate api docs", "api documentation"],
396
- "execution_mode": "sequential",
397
- "context_strategy": "file",
398
- "llm_integration": {
399
- "enabled": true,
400
- "default_tool": "gemini",
401
- "fallback_chain": ["gemini", "qwen"],
402
- "mode": "analysis"
403
- },
404
- "sequential_config": {
405
- "phases": [
406
- {
407
- "id": "01-scan",
408
- "name": "Code Scanning",
409
- "output": "endpoints.json",
410
- "agent": { "type": "universal-executor", "run_in_background": false }
411
- },
412
- {
413
- "id": "02-analyze",
414
- "name": "LLM Analysis",
415
- "output": "analysis.json",
416
- "agent": { "type": "llm", "tool": "gemini", "mode": "analysis" }
417
- },
418
- {
419
- "id": "03-generate",
420
- "name": "Doc Generation",
421
- "output": "api-docs.md",
422
- "agent": { "type": "universal-executor", "run_in_background": false }
423
- }
424
- ]
425
- },
426
- "allowed_tools": ["Task", "Read", "Write", "Glob", "Grep", "Bash"],
427
- "output": {
428
- "format": "markdown",
429
- "location": ".workflow/.scratchpad/api-docs-{timestamp}",
430
- "filename_pattern": "{name}-api-docs.md"
431
- }
432
- }
433
- ```
434
-
435
- ### Autonomous 模式示例
436
-
437
- ```json
438
- {
439
- "skill_name": "task-manager",
440
- "display_name": "Task Manager",
441
- "description": "Interactive task management with CRUD operations",
442
- "triggers": ["manage tasks", "task list", "create task"],
443
- "execution_mode": "autonomous",
444
- "autonomous_config": {
445
- "state_schema": {
446
- "fields": [
447
- { "name": "tasks", "type": "Task[]", "description": "任务列表" },
448
- { "name": "current_view", "type": "string", "description": "当前视图" }
449
- ]
450
- },
451
- "actions": [
452
- { "id": "action-list", "name": "List Tasks", "preconditions": [], "effects": ["显示任务列表"] },
453
- { "id": "action-create", "name": "Create Task", "preconditions": [], "effects": ["添加新任务"] },
454
- { "id": "action-edit", "name": "Edit Task", "preconditions": ["task_selected"], "effects": ["更新任务"] },
455
- { "id": "action-delete", "name": "Delete Task", "preconditions": ["task_selected"], "effects": ["删除任务"] }
456
- ],
457
- "termination_conditions": ["user_exit", "error_limit"]
458
- },
459
- "allowed_tools": ["Task", "AskUserQuestion", "Read", "Write"],
460
- "output": {
461
- "format": "json",
462
- "location": ".workflow/.scratchpad/tasks",
463
- "filename_pattern": "tasks.json"
464
- }
465
- }
466
- ```
1
+ # Skill Requirements Specification
2
+
3
+ Requirements collection specification for new Skill creation.
4
+
5
+ ---
6
+
7
+ ## Required Information
8
+
9
+ ### 1. Basic Information
10
+
11
+ | Field | Type | Required | Description |
12
+ |-------|------|----------|-------------|
13
+ | `skill_name` | string | Yes | Skill identifier (lowercase with hyphens) |
14
+ | `display_name` | string | Yes | Display name |
15
+ | `description` | string | Yes | One-sentence description |
16
+ | `triggers` | string[] | Yes | List of trigger keywords |
17
+
18
+ ### 2. Execution Mode
19
+
20
+ | Field | Type | Required | Description |
21
+ |-------|------|----------|-------------|
22
+ | `execution_mode` | enum | Yes | `sequential` \| `autonomous` \| `hybrid` |
23
+ | `phase_count` | number | Conditional | Number of phases in Sequential mode |
24
+ | `action_count` | number | Conditional | Number of actions in Autonomous mode |
25
+
26
+ ### 2.5 Context Strategy (P0 Enhancement)
27
+
28
+ | Field | Type | Required | Description |
29
+ |-------|------|----------|-------------|
30
+ | `context_strategy` | enum | Yes | `file` \| `memory` |
31
+
32
+ **Strategy Comparison**:
33
+
34
+ | Strategy | Persistence | Debuggable | Recoverable | Applicable Scenarios |
35
+ |----------|-------------|-----------|------------|----------------------|
36
+ | `file` | Yes | Yes | Yes | Complex multi-phase tasks (recommended) |
37
+ | `memory` | No | No | No | Simple linear tasks |
38
+
39
+ ### 2.6 LLM Integration Configuration (P1 Enhancement)
40
+
41
+ | Field | Type | Required | Description |
42
+ |-------|------|----------|-------------|
43
+ | `llm_integration` | object | Optional | LLM invocation configuration |
44
+ | `llm_integration.enabled` | boolean | - | Enable LLM invocation |
45
+ | `llm_integration.default_tool` | enum | - | `gemini` \| `qwen` \| `codex` |
46
+ | `llm_integration.fallback_chain` | string[] | - | Fallback tool chain on failure |
47
+
48
+ ### 3. Tool Dependencies
49
+
50
+ | Field | Type | Required | Description |
51
+ |-------|------|----------|-------------|
52
+ | `allowed_tools` | string[] | Yes | List of allowed tools |
53
+ | `mcp_tools` | string[] | Optional | Required MCP tools |
54
+
55
+ ### 4. Output Configuration
56
+
57
+ | Field | Type | Required | Description |
58
+ |-------|------|----------|-------------|
59
+ | `output_format` | enum | Yes | `markdown` \| `html` \| `json` |
60
+ | `output_location` | string | Yes | Output directory pattern |
61
+
62
+ ---
63
+
64
+ ## Configuration File Structure
65
+
66
+ ```typescript
67
+ interface SkillConfig {
68
+ // Basic information
69
+ skill_name: string; // "my-skill"
70
+ display_name: string; // "My Skill"
71
+ description: string; // "One-sentence description"
72
+ triggers: string[]; // ["keyword1", "keyword2"]
73
+
74
+ // Execution mode
75
+ execution_mode: 'sequential' | 'autonomous' | 'hybrid';
76
+
77
+ // Context strategy (P0 Enhancement)
78
+ context_strategy: 'file' | 'memory'; // Default: 'file'
79
+
80
+ // LLM Integration Configuration (P1 Enhancement)
81
+ llm_integration?: {
82
+ enabled: boolean; // Enable LLM invocation
83
+ default_tool: 'gemini' | 'qwen' | 'codex';
84
+ fallback_chain: string[]; // ['gemini', 'qwen', 'codex']
85
+ mode: 'analysis' | 'write'; // Default mode
86
+ };
87
+
88
+ // Sequential mode configuration
89
+ sequential_config?: {
90
+ phases: Array<{
91
+ id: string; // "01-init"
92
+ name: string; // "Initialization"
93
+ description: string; // "Collect initial configuration"
94
+ input: string[]; // Input dependencies
95
+ output: string; // Output file
96
+ }>;
97
+ };
98
+
99
+ // Autonomous mode configuration
100
+ autonomous_config?: {
101
+ state_schema: {
102
+ fields: Array<{
103
+ name: string;
104
+ type: string;
105
+ description: string;
106
+ }>;
107
+ };
108
+ actions: Array<{
109
+ id: string; // "action-init"
110
+ name: string; // "Initialize"
111
+ description: string; // "Initialize state"
112
+ preconditions: string[]; // Preconditions
113
+ effects: string[]; // Execution effects
114
+ }>;
115
+ termination_conditions: string[];
116
+ };
117
+
118
+ // Tool dependencies
119
+ allowed_tools: string[]; // ["Task", "Read", "Write", ...]
120
+ mcp_tools?: string[]; // ["mcp__chrome__*"]
121
+
122
+ // Output configuration
123
+ output: {
124
+ format: 'markdown' | 'html' | 'json';
125
+ location: string; // ".workflow/.scratchpad/{skill}-{timestamp}"
126
+ filename_pattern: string; // "{name}-output.{ext}"
127
+ };
128
+
129
+ // Quality configuration
130
+ quality?: {
131
+ dimensions: string[]; // ["completeness", "consistency", ...]
132
+ pass_threshold: number; // 80
133
+ };
134
+
135
+ // Metadata
136
+ created_at: string;
137
+ version: string;
138
+ }
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Requirements Collection Questions
144
+
145
+ ### Phase 1: Basic Information
146
+
147
+ ```javascript
148
+ AskUserQuestion({
149
+ questions: [
150
+ {
151
+ question: "What is the Skill name? (English, lowercase with hyphens)",
152
+ header: "Skill Name",
153
+ multiSelect: false,
154
+ options: [
155
+ { label: "Auto-generate", description: "Auto-generate name from description" },
156
+ { label: "Manual input", description: "Enter custom name" }
157
+ ]
158
+ },
159
+ {
160
+ question: "What is the primary purpose of this Skill?",
161
+ header: "Purpose Type",
162
+ multiSelect: false,
163
+ options: [
164
+ { label: "Document Generation", description: "Generate Markdown/HTML documents" },
165
+ { label: "Code Analysis", description: "Analyze code structure, quality, security" },
166
+ { label: "Interactive Management", description: "Manage Issues, tasks, workflows" },
167
+ { label: "Data Processing", description: "ETL, transformation, report generation" },
168
+ { label: "Custom", description: "Other purposes" }
169
+ ]
170
+ }
171
+ ]
172
+ });
173
+ ```
174
+
175
+ ### Phase 2: Execution Mode
176
+
177
+ ```javascript
178
+ AskUserQuestion({
179
+ questions: [
180
+ {
181
+ question: "Select execution mode:",
182
+ header: "Execution Mode",
183
+ multiSelect: false,
184
+ options: [
185
+ {
186
+ label: "Sequential (Fixed Order)",
187
+ description: "Phases execute in fixed order, suitable for pipeline tasks (recommended)"
188
+ },
189
+ {
190
+ label: "Autonomous (Dynamic)",
191
+ description: "Dynamically select execution path, suitable for interactive tasks"
192
+ },
193
+ {
194
+ label: "Hybrid (Mixed)",
195
+ description: "Fixed initialization and finalization, flexible middle interaction"
196
+ }
197
+ ]
198
+ }
199
+ ]
200
+ });
201
+ ```
202
+
203
+ ### Phase 3: Phase/Action Definition
204
+
205
+ #### Sequential Mode
206
+
207
+ ```javascript
208
+ AskUserQuestion({
209
+ questions: [
210
+ {
211
+ question: "How many execution phases do you need?",
212
+ header: "Phase Count",
213
+ multiSelect: false,
214
+ options: [
215
+ { label: "3 phases", description: "Simple: CollectProcessOutput" },
216
+ { label: "5 phases", description: "Standard: CollectExploreAnalyzeAssembleValidate" },
217
+ { label: "7 phases", description: "Complete: Include parallel processing and iterative optimization" },
218
+ { label: "Custom", description: "Manually specify phases" }
219
+ ]
220
+ }
221
+ ]
222
+ });
223
+ ```
224
+
225
+ #### Autonomous Mode
226
+
227
+ ```javascript
228
+ AskUserQuestion({
229
+ questions: [
230
+ {
231
+ question: "What are the core actions?",
232
+ header: "Action Definition",
233
+ multiSelect: true,
234
+ options: [
235
+ { label: "Initialize (init)", description: "Set initial state" },
236
+ { label: "List (list)", description: "Display current items" },
237
+ { label: "Create (create)", description: "Create new item" },
238
+ { label: "Edit (edit)", description: "Modify existing item" },
239
+ { label: "Delete (delete)", description: "Delete item" },
240
+ { label: "Complete (complete)", description: "Complete task" }
241
+ ]
242
+ }
243
+ ]
244
+ });
245
+ ```
246
+
247
+ ### Phase 4: Context Strategy (P0 Enhancement)
248
+
249
+ ```javascript
250
+ AskUserQuestion({
251
+ questions: [
252
+ {
253
+ question: "Select context management strategy:",
254
+ header: "Context Strategy",
255
+ multiSelect: false,
256
+ options: [
257
+ {
258
+ label: "File Strategy (file)",
259
+ description: "Persist to .scratchpad, supports debugging and recovery (recommended)"
260
+ },
261
+ {
262
+ label: "Memory Strategy (memory)",
263
+ description: "Keep only at runtime, fast but no recovery"
264
+ }
265
+ ]
266
+ }
267
+ ]
268
+ });
269
+ ```
270
+
271
+ ### Phase 5: LLM Integration (P1 Enhancement)
272
+
273
+ ```javascript
274
+ AskUserQuestion({
275
+ questions: [
276
+ {
277
+ question: "Do you need LLM invocation capability?",
278
+ header: "LLM Integration",
279
+ multiSelect: false,
280
+ options: [
281
+ {
282
+ label: "Enable LLM Invocation",
283
+ description: "Use gemini/qwen/codex for analysis or generation"
284
+ },
285
+ {
286
+ label: "Not needed",
287
+ description: "Only use local tools"
288
+ }
289
+ ]
290
+ }
291
+ ]
292
+ });
293
+
294
+ // If LLM enabled
295
+ if (llmEnabled) {
296
+ AskUserQuestion({
297
+ questions: [
298
+ {
299
+ question: "Select default LLM tool:",
300
+ header: "LLM Tool",
301
+ multiSelect: false,
302
+ options: [
303
+ { label: "Gemini", description: "Large context, suitable for analysis tasks (recommended)" },
304
+ { label: "Qwen", description: "Strong code generation capability" },
305
+ { label: "Codex", description: "Strong autonomous execution, suitable for implementation tasks" }
306
+ ]
307
+ }
308
+ ]
309
+ });
310
+ }
311
+ ```
312
+
313
+ ### Phase 6: Tool Dependencies
314
+
315
+ ```javascript
316
+ AskUserQuestion({
317
+ questions: [
318
+ {
319
+ question: "What tools do you need?",
320
+ header: "Tool Selection",
321
+ multiSelect: true,
322
+ options: [
323
+ { label: "Basic tools", description: "Task, Read, Write, Glob, Grep, Bash" },
324
+ { label: "User interaction", description: "AskUserQuestion" },
325
+ { label: "Chrome screenshot", description: "mcp__chrome__*" },
326
+ { label: "External search", description: "mcp__exa__search" },
327
+ { label: "CCW CLI invocation", description: "ccw cli (gemini/qwen/codex)" }
328
+ ]
329
+ }
330
+ ]
331
+ });
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Validation Rules
337
+
338
+ ### Name Validation
339
+
340
+ ```javascript
341
+ function validateSkillName(name) {
342
+ const rules = [
343
+ { test: /^[a-z][a-z0-9-]*$/, msg: "Must start with lowercase letter, only contain lowercase letters, digits, hyphens" },
344
+ { test: /^.{3,30}$/, msg: "Length 3-30 characters" },
345
+ { test: /^(?!.*--)/, msg: "Cannot have consecutive hyphens" },
346
+ { test: /[^-]$/, msg: "Cannot end with hyphen" }
347
+ ];
348
+
349
+ for (const rule of rules) {
350
+ if (!rule.test.test(name)) {
351
+ return { valid: false, error: rule.msg };
352
+ }
353
+ }
354
+ return { valid: true };
355
+ }
356
+ ```
357
+
358
+ ### Configuration Validation
359
+
360
+ ```javascript
361
+ function validateSkillConfig(config) {
362
+ const errors = [];
363
+
364
+ // Required fields
365
+ if (!config.skill_name) errors.push("Missing skill_name");
366
+ if (!config.description) errors.push("Missing description");
367
+ if (!config.execution_mode) errors.push("Missing execution_mode");
368
+
369
+ // Mode-specific validation
370
+ if (config.execution_mode === 'sequential') {
371
+ if (!config.sequential_config?.phases?.length) {
372
+ errors.push("Sequential mode requires phases definition");
373
+ }
374
+ } else if (config.execution_mode === 'autonomous') {
375
+ if (!config.autonomous_config?.actions?.length) {
376
+ errors.push("Autonomous mode requires actions definition");
377
+ }
378
+ }
379
+
380
+ return { valid: errors.length === 0, errors };
381
+ }
382
+ ```
383
+
384
+ ---
385
+
386
+ ## Example Configurations
387
+
388
+ ### Sequential Mode Example (Enhanced)
389
+
390
+ ```json
391
+ {
392
+ "skill_name": "api-docs-generator",
393
+ "display_name": "API Docs Generator",
394
+ "description": "Generate API documentation from source code",
395
+ "triggers": ["generate api docs", "api documentation"],
396
+ "execution_mode": "sequential",
397
+ "context_strategy": "file",
398
+ "llm_integration": {
399
+ "enabled": true,
400
+ "default_tool": "gemini",
401
+ "fallback_chain": ["gemini", "qwen"],
402
+ "mode": "analysis"
403
+ },
404
+ "sequential_config": {
405
+ "phases": [
406
+ {
407
+ "id": "01-scan",
408
+ "name": "Code Scanning",
409
+ "output": "endpoints.json",
410
+ "agent": { "type": "universal-executor", "run_in_background": false }
411
+ },
412
+ {
413
+ "id": "02-analyze",
414
+ "name": "LLM Analysis",
415
+ "output": "analysis.json",
416
+ "agent": { "type": "llm", "tool": "gemini", "mode": "analysis" }
417
+ },
418
+ {
419
+ "id": "03-generate",
420
+ "name": "Doc Generation",
421
+ "output": "api-docs.md",
422
+ "agent": { "type": "universal-executor", "run_in_background": false }
423
+ }
424
+ ]
425
+ },
426
+ "allowed_tools": ["Task", "Read", "Write", "Glob", "Grep", "Bash"],
427
+ "output": {
428
+ "format": "markdown",
429
+ "location": ".workflow/.scratchpad/api-docs-{timestamp}",
430
+ "filename_pattern": "{name}-api-docs.md"
431
+ }
432
+ }
433
+ ```
434
+
435
+ ### Autonomous Mode Example
436
+
437
+ ```json
438
+ {
439
+ "skill_name": "task-manager",
440
+ "display_name": "Task Manager",
441
+ "description": "Interactive task management with CRUD operations",
442
+ "triggers": ["manage tasks", "task list", "create task"],
443
+ "execution_mode": "autonomous",
444
+ "autonomous_config": {
445
+ "state_schema": {
446
+ "fields": [
447
+ { "name": "tasks", "type": "Task[]", "description": "Task list" },
448
+ { "name": "current_view", "type": "string", "description": "Current view" }
449
+ ]
450
+ },
451
+ "actions": [
452
+ { "id": "action-list", "name": "List Tasks", "preconditions": [], "effects": ["Display task list"] },
453
+ { "id": "action-create", "name": "Create Task", "preconditions": [], "effects": ["Add new task"] },
454
+ { "id": "action-edit", "name": "Edit Task", "preconditions": ["task_selected"], "effects": ["Update task"] },
455
+ { "id": "action-delete", "name": "Delete Task", "preconditions": ["task_selected"], "effects": ["Delete task"] }
456
+ ],
457
+ "termination_conditions": ["user_exit", "error_limit"]
458
+ },
459
+ "allowed_tools": ["Task", "AskUserQuestion", "Read", "Write"],
460
+ "output": {
461
+ "format": "json",
462
+ "location": ".workflow/.scratchpad/tasks",
463
+ "filename_pattern": "tasks.json"
464
+ }
465
+ }
466
+ ```