claude-code-workflow 6.3.48 → 6.3.49
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/.claude/CLAUDE.md +6 -8
- package/.claude/agents/action-planning-agent.md +28 -45
- package/.claude/agents/cli-lite-planning-agent.md +93 -1
- package/.claude/agents/code-developer.md +144 -27
- package/.claude/commands/ccw-coordinator.md +175 -21
- package/.claude/commands/ccw-debug.md +832 -0
- package/.claude/commands/ccw.md +90 -9
- package/.claude/commands/cli/cli-init.md +1 -0
- package/.claude/commands/issue/convert-to-plan.md +718 -0
- package/.claude/commands/issue/from-brainstorm.md +382 -0
- package/.claude/commands/memory/tips.md +332 -0
- package/.claude/commands/workflow/analyze-with-file.md +804 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
- package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
- package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
- package/.claude/commands/workflow/debug-with-file.md +7 -5
- package/.claude/commands/workflow/execute.md +6 -4
- package/.claude/commands/workflow/lite-plan.md +2 -2
- package/.claude/commands/workflow/plan-verify.md +162 -327
- package/.claude/commands/workflow/plan.md +162 -26
- package/.claude/commands/workflow/replan.md +78 -2
- package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
- package/.claude/commands/workflow/review-module-cycle.md +2 -2
- package/.claude/commands/workflow/review-session-cycle.md +2 -2
- package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
- package/.claude/commands/workflow/tools/context-gather.md +81 -118
- package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
- package/.claude/skills/ccw-help/command.json +4 -4
- package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
- package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
- package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
- package/.claude/skills/skill-generator/SKILL.md +277 -85
- package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
- package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
- package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
- package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
- package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
- package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
- package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
- package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
- package/.claude/skills/skill-generator/templates/script-template.md +368 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
- package/.claude/skills/skill-tuning/SKILL.md +130 -266
- package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
- package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
- package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
- package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
- package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
- package/.claude/workflows/cli-tools-usage.md +1 -1
- package/.codex/AGENTS.md +1 -3
- package/.codex/prompts/analyze-with-file.md +607 -0
- package/.codex/prompts/brainstorm-to-cycle.md +455 -0
- package/.codex/prompts/brainstorm-with-file.md +933 -0
- package/.codex/prompts/debug-with-file.md +15 -20
- package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +29 -5
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +2 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +62 -20
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +5 -3
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
- package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
- package/ccw/dist/config/litellm-provider-models.js +172 -0
- package/ccw/dist/config/litellm-provider-models.js.map +1 -0
- package/ccw/dist/config/provider-models.d.ts +25 -51
- package/ccw/dist/config/provider-models.d.ts.map +1 -1
- package/ccw/dist/config/provider-models.js +84 -149
- package/ccw/dist/config/provider-models.js.map +1 -1
- package/ccw/dist/config/storage-paths.d.ts.map +1 -1
- package/ccw/dist/config/storage-paths.js +23 -5
- package/ccw/dist/config/storage-paths.js.map +1 -1
- package/ccw/dist/core/auth/csrf-middleware.js +3 -3
- package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
- package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
- package/ccw/dist/core/dashboard-generator.js +3 -1
- package/ccw/dist/core/dashboard-generator.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +206 -14
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
- package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/commands-routes.js +480 -0
- package/ccw/dist/core/routes/commands-routes.js.map +1 -0
- package/ccw/dist/core/routes/model-routes.d.ts +11 -0
- package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/model-routes.js +112 -0
- package/ccw/dist/core/routes/model-routes.js.map +1 -0
- package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/nav-status-routes.js +84 -1
- package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
- package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
- package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/provider-routes.js +67 -0
- package/ccw/dist/core/routes/provider-routes.js.map +1 -0
- package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/skills-routes.js +219 -7
- package/ccw/dist/core/routes/skills-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +58 -6
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +13 -0
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +2 -2
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +146 -50
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +3 -27
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +7 -2
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +11 -0
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +82 -2
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/command-registry.d.ts +7 -0
- package/ccw/dist/tools/command-registry.d.ts.map +1 -1
- package/ccw/dist/tools/command-registry.js +14 -1
- package/ccw/dist/tools/command-registry.js.map +1 -1
- package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
- package/ccw/dist/tools/generate-module-docs.js +11 -7
- package/ccw/dist/tools/generate-module-docs.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +1 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +11 -9
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/types/skill-types.d.ts +97 -0
- package/ccw/dist/types/skill-types.d.ts.map +1 -0
- package/ccw/dist/types/skill-types.js +6 -0
- package/ccw/dist/types/skill-types.js.map +1 -0
- package/ccw/src/commands/cli.ts +36 -5
- package/ccw/src/commands/issue.ts +81 -26
- package/ccw/src/config/litellm-api-config-manager.ts +5 -3
- package/ccw/src/config/litellm-provider-models.ts +222 -0
- package/ccw/src/config/provider-models.ts +91 -190
- package/ccw/src/config/storage-paths.ts +20 -5
- package/ccw/src/core/auth/csrf-middleware.ts +3 -3
- package/ccw/src/core/dashboard-generator.ts +3 -1
- package/ccw/src/core/routes/claude-routes.ts +233 -15
- package/ccw/src/core/routes/cli-routes.ts +2 -3
- package/ccw/src/core/routes/commands-routes.ts +620 -0
- package/ccw/src/core/routes/nav-status-routes.ts +95 -1
- package/ccw/src/core/routes/provider-routes.ts +78 -0
- package/ccw/src/core/routes/skills-routes.ts +266 -45
- package/ccw/src/core/routes/system-routes.ts +102 -50
- package/ccw/src/core/server.ts +13 -0
- package/ccw/src/mcp-server/index.ts +2 -2
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
- package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
- package/ccw/src/templates/dashboard-js/i18n.js +116 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
- package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
- package/ccw/src/templates/dashboard.html +7 -0
- package/ccw/src/tools/claude-cli-tools.ts +170 -56
- package/ccw/src/tools/cli-config-manager.ts +2 -33
- package/ccw/src/tools/cli-executor-core.ts +8 -2
- package/ccw/src/tools/cli-history-store.ts +92 -2
- package/ccw/src/tools/command-registry.ts +16 -1
- package/ccw/src/tools/generate-module-docs.ts +11 -7
- package/ccw/src/tools/litellm-executor.ts +13 -9
- package/ccw/src/types/skill-types.ts +99 -0
- package/package.json +1 -1
- package/.claude/commands/enhance-prompt.md +0 -93
- package/.claude/commands/memory/code-map-memory.md +0 -687
- package/.claude/commands/memory/docs.md +0 -615
- package/.claude/commands/memory/load-skill-memory.md +0 -182
- package/.claude/commands/memory/skill-memory.md +0 -525
- package/.claude/commands/memory/swagger-docs.md +0 -773
- package/.claude/commands/memory/tech-research-rules.md +0 -310
- package/.claude/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/commands/task/breakdown.md +0 -208
- package/.claude/commands/task/create.md +0 -152
- package/.claude/commands/task/execute.md +0 -270
- package/.claude/commands/task/replan.md +0 -441
- package/.claude/commands/version.md +0 -254
- package/.claude/commands/workflow/action-plan-verify.md +0 -485
- package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
- package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
- package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/commands/workflow/debug.md +0 -331
- package/.claude/commands/workflow/develop-with-file.md +0 -1044
- package/.claude/skills/ccw-loop/README.md +0 -303
- package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
- package/.claude/skills/skill-generator/templates/script-python.md +0 -198
- package/.codex/prompts/debug.md +0 -318
- package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
|
@@ -6,298 +6,162 @@ allowed-tools: Task, AskUserQuestion, Read, Write, Bash, Glob, Grep, mcp__ace-to
|
|
|
6
6
|
|
|
7
7
|
# Skill Tuning
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Autonomous diagnosis and optimization for skill execution issues.
|
|
10
10
|
|
|
11
|
-
## Architecture
|
|
11
|
+
## Architecture
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
|
|
15
|
-
│
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
│
|
|
21
|
-
│
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
│
|
|
26
|
-
│
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
│
|
|
36
|
-
│
|
|
37
|
-
|
|
38
|
-
│ │ • Phase 2: Spec 匹配 - 每个维度 → taxonomy + strategy │ │
|
|
39
|
-
│ │ • Phase 3: 覆盖度评估 - 以"有修复策略"为满足标准 │ │
|
|
40
|
-
│ │ • Phase 4: 歧义检测 - 识别多义性描述,必要时请求澄清 │ │
|
|
41
|
-
│ └───────────────────────────────────────────────────────────────────────┘ │
|
|
42
|
-
│ ↓ │
|
|
43
|
-
│ ┌──────────────────┐ │
|
|
44
|
-
│ │ Apply Fixes + │ │
|
|
45
|
-
│ │ Verify Results │ │
|
|
46
|
-
│ └──────────────────┘ │
|
|
47
|
-
│ │
|
|
48
|
-
│ ┌───────────────────────────────────────────────────────────────────────┐ │
|
|
49
|
-
│ │ Gemini CLI Integration │ │
|
|
50
|
-
│ │ 根据用户需求动态调用 gemini cli 进行深度分析: │ │
|
|
51
|
-
│ │ • 需求维度拆解 (requirement decomposition) │ │
|
|
52
|
-
│ │ • 复杂问题分析 (prompt engineering, architecture review) │ │
|
|
53
|
-
│ │ • 代码模式识别 (pattern matching, anti-pattern detection) │ │
|
|
54
|
-
│ │ • 修复策略生成 (fix generation, refactoring suggestions) │ │
|
|
55
|
-
│ └───────────────────────────────────────────────────────────────────────┘ │
|
|
56
|
-
│ │
|
|
57
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
14
|
+
┌─────────────────────────────────────────────────────┐
|
|
15
|
+
│ Phase 0: Read Specs (mandatory) │
|
|
16
|
+
│ → problem-taxonomy.md, tuning-strategies.md │
|
|
17
|
+
└─────────────────────────────────────────────────────┘
|
|
18
|
+
↓
|
|
19
|
+
┌─────────────────────────────────────────────────────┐
|
|
20
|
+
│ Orchestrator (state-driven) │
|
|
21
|
+
│ Read state → Select action → Execute → Update → ✓ │
|
|
22
|
+
└─────────────────────────────────────────────────────┘
|
|
23
|
+
↓ ↓
|
|
24
|
+
┌──────────────────────┐ ┌──────────────────┐
|
|
25
|
+
│ Diagnosis Phase │ │ Gemini CLI │
|
|
26
|
+
│ • Context │ │ Deep analysis │
|
|
27
|
+
│ • Memory │ │ (on-demand) │
|
|
28
|
+
│ • DataFlow │ │ │
|
|
29
|
+
│ • Agent │ │ Complex issues │
|
|
30
|
+
│ • Docs │ │ Architecture │
|
|
31
|
+
│ • Token Usage │ │ Performance │
|
|
32
|
+
└──────────────────────┘ └──────────────────┘
|
|
33
|
+
↓
|
|
34
|
+
┌───────────────────┐
|
|
35
|
+
│ Fix & Verify │
|
|
36
|
+
│ Apply → Re-test │
|
|
37
|
+
└───────────────────┘
|
|
58
38
|
```
|
|
59
39
|
|
|
60
|
-
##
|
|
40
|
+
## Core Issues Detected
|
|
61
41
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
| Priority | Problem | Root Cause | Solution Strategy |
|
|
67
|
-
|----------|---------|------------|-------------------|
|
|
68
|
-
| **P0** | Authoring Principles Violation | 中间文件存储, State膨胀, 文件中转 | eliminate_intermediate_files, minimize_state, context_passing |
|
|
42
|
+
| Priority | Problem | Root Cause | Fix Strategy |
|
|
43
|
+
|----------|---------|-----------|--------------|
|
|
44
|
+
| **P0** | Authoring Violation | Intermediate files, state bloat, file relay | eliminate_intermediate, minimize_state |
|
|
69
45
|
| **P1** | Data Flow Disruption | Scattered state, inconsistent formats | state_centralization, schema_enforcement |
|
|
70
|
-
| **P2** | Agent Coordination | Fragile
|
|
71
|
-
| **P3** | Context Explosion |
|
|
46
|
+
| **P2** | Agent Coordination | Fragile chains, no error handling | error_wrapping, result_validation |
|
|
47
|
+
| **P3** | Context Explosion | Unbounded history, full content passing | sliding_window, path_reference |
|
|
72
48
|
| **P4** | Long-tail Forgetting | Early constraint loss | constraint_injection, checkpoint_restore |
|
|
73
|
-
| **P5** | Token Consumption | Verbose prompts,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
49
|
+
| **P5** | Token Consumption | Verbose prompts, state bloat | prompt_compression, lazy_loading |
|
|
50
|
+
|
|
51
|
+
## Problem Categories (Detailed Specs)
|
|
52
|
+
|
|
53
|
+
See [specs/problem-taxonomy.md](specs/problem-taxonomy.md) for:
|
|
54
|
+
- Detection patterns (regex/checks)
|
|
55
|
+
- Severity calculations
|
|
56
|
+
- Impact assessments
|
|
57
|
+
|
|
58
|
+
## Tuning Strategies (Detailed Specs)
|
|
59
|
+
|
|
60
|
+
See [specs/tuning-strategies.md](specs/tuning-strategies.md) for:
|
|
61
|
+
- 10+ strategies per category
|
|
62
|
+
- Implementation patterns
|
|
63
|
+
- Verification methods
|
|
64
|
+
|
|
65
|
+
## Workflow
|
|
66
|
+
|
|
67
|
+
| Step | Action | Orchestrator Decision | Output |
|
|
68
|
+
|------|--------|----------------------|--------|
|
|
69
|
+
| 1 | `action-init` | status='pending' | Backup, session created |
|
|
70
|
+
| 2 | `action-analyze-requirements` | After init | Required dimensions + coverage |
|
|
71
|
+
| 3 | Diagnosis (6 types) | Focus areas | state.diagnosis.{type} |
|
|
72
|
+
| 4 | `action-gemini-analysis` | Critical issues OR user request | Deep findings |
|
|
73
|
+
| 5 | `action-generate-report` | All diagnosis complete | state.final_report |
|
|
74
|
+
| 6 | `action-propose-fixes` | Issues found | state.proposed_fixes[] |
|
|
75
|
+
| 7 | `action-apply-fix` | Pending fixes | Applied + verified |
|
|
76
|
+
| 8 | `action-complete` | Quality gates pass | session.status='completed' |
|
|
77
|
+
|
|
78
|
+
## Action Reference
|
|
79
|
+
|
|
80
|
+
| Category | Actions | Purpose |
|
|
81
|
+
|----------|---------|---------|
|
|
82
|
+
| **Setup** | action-init | Initialize backup, session state |
|
|
83
|
+
| **Analysis** | action-analyze-requirements | Decompose user request via Gemini CLI |
|
|
84
|
+
| **Diagnosis** | action-diagnose-{context,memory,dataflow,agent,docs,token_consumption} | Detect category-specific issues |
|
|
85
|
+
| **Deep Analysis** | action-gemini-analysis | Gemini CLI: complex/critical issues |
|
|
86
|
+
| **Reporting** | action-generate-report | Consolidate findings → final_report |
|
|
87
|
+
| **Fixing** | action-propose-fixes, action-apply-fix | Generate + apply fixes |
|
|
88
|
+
| **Verify** | action-verify | Re-run diagnosis, check gates |
|
|
89
|
+
| **Exit** | action-complete, action-abort | Finalize or rollback |
|
|
90
|
+
|
|
91
|
+
Full action details: [phases/actions/](phases/actions/)
|
|
92
|
+
|
|
93
|
+
## State Management
|
|
94
|
+
|
|
95
|
+
**Single source of truth**: `.workflow/.scratchpad/skill-tuning-{ts}/state.json`
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"status": "pending|running|completed|failed",
|
|
100
|
+
"target_skill": { "name": "...", "path": "..." },
|
|
101
|
+
"diagnosis": {
|
|
102
|
+
"context": {...},
|
|
103
|
+
"memory": {...},
|
|
104
|
+
"dataflow": {...},
|
|
105
|
+
"agent": {...},
|
|
106
|
+
"docs": {...},
|
|
107
|
+
"token_consumption": {...}
|
|
108
|
+
},
|
|
109
|
+
"issues": [{"id":"...", "severity":"...", "category":"...", "strategy":"..."}],
|
|
110
|
+
"proposed_fixes": [...],
|
|
111
|
+
"applied_fixes": [...],
|
|
112
|
+
"quality_gate": "pass|fail",
|
|
113
|
+
"final_report": "..."
|
|
114
|
+
}
|
|
122
115
|
```
|
|
123
116
|
|
|
124
|
-
|
|
117
|
+
See [phases/state-schema.md](phases/state-schema.md) for complete schema.
|
|
125
118
|
|
|
126
|
-
|
|
119
|
+
## Orchestrator Logic
|
|
127
120
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
MODE: analysis
|
|
133
|
-
CONTEXT: @**/*.md
|
|
134
|
-
EXPECTED: JSON with { root_causes: [], patterns_found: [], recommendations: [] }
|
|
135
|
-
RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Focus on execution flow
|
|
136
|
-
" --tool gemini --mode analysis
|
|
137
|
-
```
|
|
121
|
+
See [phases/orchestrator.md](phases/orchestrator.md) for:
|
|
122
|
+
- Decision logic (termination checks → action selection)
|
|
123
|
+
- State transitions
|
|
124
|
+
- Error recovery
|
|
138
125
|
|
|
139
|
-
|
|
126
|
+
## Key Principles
|
|
140
127
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
CONTEXT: @**/*.md
|
|
147
|
-
EXPECTED: Architecture assessment with improvement recommendations
|
|
148
|
-
RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Focus on modularity
|
|
149
|
-
" --tool gemini --mode analysis
|
|
150
|
-
```
|
|
128
|
+
1. **Problem-First**: Diagnosis before any fix
|
|
129
|
+
2. **Data-Driven**: Record traces, token counts, snapshots
|
|
130
|
+
3. **Iterative**: Multiple rounds until quality gates pass
|
|
131
|
+
4. **Reversible**: All changes with backup checkpoints
|
|
132
|
+
5. **Non-Invasive**: Minimal changes, maximum clarity
|
|
151
133
|
|
|
152
|
-
|
|
134
|
+
## Usage Examples
|
|
153
135
|
|
|
154
136
|
```bash
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
TASK: • Analyze issue context • Design fix approach • Generate implementation plan
|
|
158
|
-
MODE: analysis
|
|
159
|
-
CONTEXT: @**/*.md
|
|
160
|
-
EXPECTED: JSON with { strategy: string, changes: [], verification_steps: [] }
|
|
161
|
-
RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Minimal invasive changes
|
|
162
|
-
" --tool gemini --mode analysis
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Mandatory Prerequisites
|
|
168
|
-
|
|
169
|
-
> **CRITICAL**: Read these documents before executing any action.
|
|
137
|
+
# Basic skill diagnosis
|
|
138
|
+
/skill-tuning "Fix memory leaks in my skill"
|
|
170
139
|
|
|
171
|
-
|
|
140
|
+
# Deep analysis with Gemini
|
|
141
|
+
/skill-tuning "Architecture issues in async workflow"
|
|
172
142
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
| [specs/skill-authoring-principles.md](specs/skill-authoring-principles.md) | **首要准则:简洁高效、去除存储、上下文流转** | **P0** |
|
|
176
|
-
| [specs/problem-taxonomy.md](specs/problem-taxonomy.md) | Problem classification and detection patterns | **P0** |
|
|
177
|
-
| [specs/tuning-strategies.md](specs/tuning-strategies.md) | Fix strategies for each problem type | **P0** |
|
|
178
|
-
| [specs/dimension-mapping.md](specs/dimension-mapping.md) | Dimension to Spec mapping rules | **P0** |
|
|
179
|
-
| [specs/quality-gates.md](specs/quality-gates.md) | Quality thresholds and verification criteria | P1 |
|
|
143
|
+
# Focus on specific areas
|
|
144
|
+
/skill-tuning "Optimize token consumption and fix agent coordination"
|
|
180
145
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
| Document | Purpose |
|
|
184
|
-
|----------|---------|
|
|
185
|
-
| [templates/diagnosis-report.md](templates/diagnosis-report.md) | Diagnosis report structure |
|
|
186
|
-
| [templates/fix-proposal.md](templates/fix-proposal.md) | Fix proposal format |
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Execution Flow
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
194
|
-
│ Phase 0: Specification Study (强制前置 - 禁止跳过) │
|
|
195
|
-
│ → Read: specs/problem-taxonomy.md (问题分类) │
|
|
196
|
-
│ → Read: specs/tuning-strategies.md (调优策略) │
|
|
197
|
-
│ → Read: specs/dimension-mapping.md (维度映射规则) │
|
|
198
|
-
│ → Read: Target skill's SKILL.md and phases/*.md │
|
|
199
|
-
│ → Output: 内化规范,理解目标 skill 结构 │
|
|
200
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
201
|
-
│ action-init: Initialize Tuning Session │
|
|
202
|
-
│ → Create work directory: .workflow/.scratchpad/skill-tuning-{timestamp} │
|
|
203
|
-
│ → Initialize state.json with target skill info │
|
|
204
|
-
│ → Create backup of target skill files │
|
|
205
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
206
|
-
│ action-analyze-requirements: Requirement Analysis │
|
|
207
|
-
│ → Phase 1: 维度拆解 (Gemini CLI) - 单一描述 → 多个关注维度 │
|
|
208
|
-
│ → Phase 2: Spec 匹配 - 每个维度 → taxonomy + strategy │
|
|
209
|
-
│ → Phase 3: 覆盖度评估 - 以"有修复策略"为满足标准 │
|
|
210
|
-
│ → Phase 4: 歧义检测 - 识别多义性描述,必要时请求澄清 │
|
|
211
|
-
│ → Output: state.json (requirement_analysis field) │
|
|
212
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
213
|
-
│ action-diagnose-*: Diagnosis Actions (context/memory/dataflow/agent/docs/ │
|
|
214
|
-
│ token_consumption) │
|
|
215
|
-
│ → Execute pattern-based detection for each category │
|
|
216
|
-
│ → Output: state.json (diagnosis.{category} field) │
|
|
217
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
218
|
-
│ action-generate-report: Consolidated Report │
|
|
219
|
-
│ → Generate markdown summary from state.diagnosis │
|
|
220
|
-
│ → Prioritize issues by severity │
|
|
221
|
-
│ → Output: state.json (final_report field) │
|
|
222
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
223
|
-
│ action-propose-fixes: Fix Proposal Generation │
|
|
224
|
-
│ → Generate fix strategies for each issue │
|
|
225
|
-
│ → Create implementation plan │
|
|
226
|
-
│ → Output: state.json (proposed_fixes field) │
|
|
227
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
228
|
-
│ action-apply-fix: Apply Selected Fix │
|
|
229
|
-
│ → User selects fix to apply │
|
|
230
|
-
│ → Execute fix with backup │
|
|
231
|
-
│ → Update state with fix result │
|
|
232
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
233
|
-
│ action-verify: Verification │
|
|
234
|
-
│ → Re-run affected diagnosis │
|
|
235
|
-
│ → Check quality gates │
|
|
236
|
-
│ → Update iteration count │
|
|
237
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
238
|
-
│ action-complete: Finalization │
|
|
239
|
-
│ → Set status='completed' │
|
|
240
|
-
│ → Final report already in state.json (final_report field) │
|
|
241
|
-
│ → Output: state.json (final) │
|
|
242
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
146
|
+
# Custom issue
|
|
147
|
+
/skill-tuning "My skill produces inconsistent outputs"
|
|
243
148
|
```
|
|
244
149
|
|
|
245
|
-
##
|
|
246
|
-
|
|
247
|
-
```javascript
|
|
248
|
-
const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
|
|
249
|
-
const workDir = `.workflow/.scratchpad/skill-tuning-${timestamp}`;
|
|
250
|
-
|
|
251
|
-
// Simplified: Only backups dir needed, diagnosis results go into state.json
|
|
252
|
-
Bash(`mkdir -p "${workDir}/backups"`);
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
## Output Structure
|
|
256
|
-
|
|
257
|
-
```
|
|
258
|
-
.workflow/.scratchpad/skill-tuning-{timestamp}/
|
|
259
|
-
├── state.json # Single source of truth (all results consolidated)
|
|
260
|
-
│ ├── diagnosis.* # All diagnosis results embedded
|
|
261
|
-
│ ├── issues[] # Found issues
|
|
262
|
-
│ ├── proposed_fixes[] # Fix proposals
|
|
263
|
-
│ └── final_report # Markdown summary (on completion)
|
|
264
|
-
└── backups/
|
|
265
|
-
└── {skill-name}-backup/ # Original skill files backup
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
> **Token Optimization**: All outputs consolidated into state.json. No separate diagnosis files or report files.
|
|
269
|
-
|
|
270
|
-
## State Schema
|
|
271
|
-
|
|
272
|
-
详细状态结构定义请参阅 [phases/state-schema.md](phases/state-schema.md)。
|
|
150
|
+
## Output
|
|
273
151
|
|
|
274
|
-
|
|
275
|
-
- `
|
|
276
|
-
- `
|
|
277
|
-
- `
|
|
278
|
-
- `issues`: 发现的问题列表
|
|
279
|
-
- `proposed_fixes`: 建议的修复方案
|
|
152
|
+
After completion, review:
|
|
153
|
+
- `.workflow/.scratchpad/skill-tuning-{ts}/state.json` - Full state with final_report
|
|
154
|
+
- `state.final_report` - Markdown summary (in state.json)
|
|
155
|
+
- `state.applied_fixes` - List of applied fixes with verification results
|
|
280
156
|
|
|
281
157
|
## Reference Documents
|
|
282
158
|
|
|
283
159
|
| Document | Purpose |
|
|
284
160
|
|----------|---------|
|
|
285
|
-
| [
|
|
161
|
+
| [specs/problem-taxonomy.md](specs/problem-taxonomy.md) | Classification + detection patterns |
|
|
162
|
+
| [specs/tuning-strategies.md](specs/tuning-strategies.md) | Fix implementation guide |
|
|
163
|
+
| [specs/dimension-mapping.md](specs/dimension-mapping.md) | Dimension ↔ Spec mapping |
|
|
164
|
+
| [specs/quality-gates.md](specs/quality-gates.md) | Quality verification criteria |
|
|
165
|
+
| [phases/orchestrator.md](phases/orchestrator.md) | Workflow orchestration |
|
|
286
166
|
| [phases/state-schema.md](phases/state-schema.md) | State structure definition |
|
|
287
|
-
| [phases/actions/
|
|
288
|
-
| [phases/actions/action-analyze-requirements.md](phases/actions/action-analyze-requirements.md) | Requirement analysis (NEW) |
|
|
289
|
-
| [phases/actions/action-diagnose-context.md](phases/actions/action-diagnose-context.md) | Context explosion diagnosis |
|
|
290
|
-
| [phases/actions/action-diagnose-memory.md](phases/actions/action-diagnose-memory.md) | Long-tail forgetting diagnosis |
|
|
291
|
-
| [phases/actions/action-diagnose-dataflow.md](phases/actions/action-diagnose-dataflow.md) | Data flow diagnosis |
|
|
292
|
-
| [phases/actions/action-diagnose-agent.md](phases/actions/action-diagnose-agent.md) | Agent coordination diagnosis |
|
|
293
|
-
| [phases/actions/action-diagnose-docs.md](phases/actions/action-diagnose-docs.md) | Documentation structure diagnosis |
|
|
294
|
-
| [phases/actions/action-diagnose-token-consumption.md](phases/actions/action-diagnose-token-consumption.md) | Token consumption diagnosis |
|
|
295
|
-
| [phases/actions/action-generate-report.md](phases/actions/action-generate-report.md) | Report generation |
|
|
296
|
-
| [phases/actions/action-propose-fixes.md](phases/actions/action-propose-fixes.md) | Fix proposal |
|
|
297
|
-
| [phases/actions/action-apply-fix.md](phases/actions/action-apply-fix.md) | Fix application |
|
|
298
|
-
| [phases/actions/action-verify.md](phases/actions/action-verify.md) | Verification |
|
|
299
|
-
| [phases/actions/action-complete.md](phases/actions/action-complete.md) | Finalization |
|
|
300
|
-
| [specs/problem-taxonomy.md](specs/problem-taxonomy.md) | Problem classification |
|
|
301
|
-
| [specs/tuning-strategies.md](specs/tuning-strategies.md) | Fix strategies |
|
|
302
|
-
| [specs/dimension-mapping.md](specs/dimension-mapping.md) | Dimension to Spec mapping (NEW) |
|
|
303
|
-
| [specs/quality-gates.md](specs/quality-gates.md) | Quality criteria |
|
|
167
|
+
| [phases/actions/](phases/actions/) | Individual action implementations |
|