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.
Files changed (211) hide show
  1. package/.claude/CLAUDE.md +6 -8
  2. package/.claude/agents/action-planning-agent.md +28 -45
  3. package/.claude/agents/cli-lite-planning-agent.md +93 -1
  4. package/.claude/agents/code-developer.md +144 -27
  5. package/.claude/commands/ccw-coordinator.md +175 -21
  6. package/.claude/commands/ccw-debug.md +832 -0
  7. package/.claude/commands/ccw.md +90 -9
  8. package/.claude/commands/cli/cli-init.md +1 -0
  9. package/.claude/commands/issue/convert-to-plan.md +718 -0
  10. package/.claude/commands/issue/from-brainstorm.md +382 -0
  11. package/.claude/commands/memory/tips.md +332 -0
  12. package/.claude/commands/workflow/analyze-with-file.md +804 -0
  13. package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
  14. package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
  15. package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
  16. package/.claude/commands/workflow/debug-with-file.md +7 -5
  17. package/.claude/commands/workflow/execute.md +6 -4
  18. package/.claude/commands/workflow/lite-plan.md +2 -2
  19. package/.claude/commands/workflow/plan-verify.md +162 -327
  20. package/.claude/commands/workflow/plan.md +162 -26
  21. package/.claude/commands/workflow/replan.md +78 -2
  22. package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
  23. package/.claude/commands/workflow/review-module-cycle.md +2 -2
  24. package/.claude/commands/workflow/review-session-cycle.md +2 -2
  25. package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
  26. package/.claude/commands/workflow/tools/context-gather.md +81 -118
  27. package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
  28. package/.claude/skills/ccw-help/command.json +4 -4
  29. package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
  30. package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
  31. package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
  32. package/.claude/skills/skill-generator/SKILL.md +277 -85
  33. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
  34. package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
  35. package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
  36. package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
  37. package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
  38. package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
  39. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
  40. package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
  41. package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
  42. package/.claude/skills/skill-generator/templates/script-template.md +368 -0
  43. package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
  44. package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
  45. package/.claude/skills/skill-tuning/SKILL.md +130 -266
  46. package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
  47. package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
  48. package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
  49. package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
  50. package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
  51. package/.claude/workflows/cli-tools-usage.md +1 -1
  52. package/.codex/AGENTS.md +1 -3
  53. package/.codex/prompts/analyze-with-file.md +607 -0
  54. package/.codex/prompts/brainstorm-to-cycle.md +455 -0
  55. package/.codex/prompts/brainstorm-with-file.md +933 -0
  56. package/.codex/prompts/debug-with-file.md +15 -20
  57. package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
  58. package/ccw/dist/commands/cli.d.ts.map +1 -1
  59. package/ccw/dist/commands/cli.js +29 -5
  60. package/ccw/dist/commands/cli.js.map +1 -1
  61. package/ccw/dist/commands/issue.d.ts +2 -0
  62. package/ccw/dist/commands/issue.d.ts.map +1 -1
  63. package/ccw/dist/commands/issue.js +62 -20
  64. package/ccw/dist/commands/issue.js.map +1 -1
  65. package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
  66. package/ccw/dist/config/litellm-api-config-manager.js +5 -3
  67. package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
  68. package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
  69. package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
  70. package/ccw/dist/config/litellm-provider-models.js +172 -0
  71. package/ccw/dist/config/litellm-provider-models.js.map +1 -0
  72. package/ccw/dist/config/provider-models.d.ts +25 -51
  73. package/ccw/dist/config/provider-models.d.ts.map +1 -1
  74. package/ccw/dist/config/provider-models.js +84 -149
  75. package/ccw/dist/config/provider-models.js.map +1 -1
  76. package/ccw/dist/config/storage-paths.d.ts.map +1 -1
  77. package/ccw/dist/config/storage-paths.js +23 -5
  78. package/ccw/dist/config/storage-paths.js.map +1 -1
  79. package/ccw/dist/core/auth/csrf-middleware.js +3 -3
  80. package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
  81. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
  82. package/ccw/dist/core/dashboard-generator.js +3 -1
  83. package/ccw/dist/core/dashboard-generator.js.map +1 -1
  84. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
  85. package/ccw/dist/core/routes/claude-routes.js +206 -14
  86. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  87. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  88. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  89. package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
  90. package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
  91. package/ccw/dist/core/routes/commands-routes.js +480 -0
  92. package/ccw/dist/core/routes/commands-routes.js.map +1 -0
  93. package/ccw/dist/core/routes/model-routes.d.ts +11 -0
  94. package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
  95. package/ccw/dist/core/routes/model-routes.js +112 -0
  96. package/ccw/dist/core/routes/model-routes.js.map +1 -0
  97. package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
  98. package/ccw/dist/core/routes/nav-status-routes.js +84 -1
  99. package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
  100. package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
  101. package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
  102. package/ccw/dist/core/routes/provider-routes.js +67 -0
  103. package/ccw/dist/core/routes/provider-routes.js.map +1 -0
  104. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
  105. package/ccw/dist/core/routes/skills-routes.js +219 -7
  106. package/ccw/dist/core/routes/skills-routes.js.map +1 -1
  107. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  108. package/ccw/dist/core/routes/system-routes.js +58 -6
  109. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  110. package/ccw/dist/core/server.d.ts.map +1 -1
  111. package/ccw/dist/core/server.js +13 -0
  112. package/ccw/dist/core/server.js.map +1 -1
  113. package/ccw/dist/mcp-server/index.js +2 -2
  114. package/ccw/dist/mcp-server/index.js.map +1 -1
  115. package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
  116. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  117. package/ccw/dist/tools/claude-cli-tools.js +146 -50
  118. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  119. package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
  120. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  121. package/ccw/dist/tools/cli-config-manager.js +3 -27
  122. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  123. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  124. package/ccw/dist/tools/cli-executor-core.js +7 -2
  125. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  126. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
  127. package/ccw/dist/tools/cli-history-store.d.ts +11 -0
  128. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  129. package/ccw/dist/tools/cli-history-store.js +82 -2
  130. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  131. package/ccw/dist/tools/command-registry.d.ts +7 -0
  132. package/ccw/dist/tools/command-registry.d.ts.map +1 -1
  133. package/ccw/dist/tools/command-registry.js +14 -1
  134. package/ccw/dist/tools/command-registry.js.map +1 -1
  135. package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
  136. package/ccw/dist/tools/generate-module-docs.js +11 -7
  137. package/ccw/dist/tools/generate-module-docs.js.map +1 -1
  138. package/ccw/dist/tools/litellm-executor.d.ts +1 -0
  139. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  140. package/ccw/dist/tools/litellm-executor.js +11 -9
  141. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  142. package/ccw/dist/types/skill-types.d.ts +97 -0
  143. package/ccw/dist/types/skill-types.d.ts.map +1 -0
  144. package/ccw/dist/types/skill-types.js +6 -0
  145. package/ccw/dist/types/skill-types.js.map +1 -0
  146. package/ccw/src/commands/cli.ts +36 -5
  147. package/ccw/src/commands/issue.ts +81 -26
  148. package/ccw/src/config/litellm-api-config-manager.ts +5 -3
  149. package/ccw/src/config/litellm-provider-models.ts +222 -0
  150. package/ccw/src/config/provider-models.ts +91 -190
  151. package/ccw/src/config/storage-paths.ts +20 -5
  152. package/ccw/src/core/auth/csrf-middleware.ts +3 -3
  153. package/ccw/src/core/dashboard-generator.ts +3 -1
  154. package/ccw/src/core/routes/claude-routes.ts +233 -15
  155. package/ccw/src/core/routes/cli-routes.ts +2 -3
  156. package/ccw/src/core/routes/commands-routes.ts +620 -0
  157. package/ccw/src/core/routes/nav-status-routes.ts +95 -1
  158. package/ccw/src/core/routes/provider-routes.ts +78 -0
  159. package/ccw/src/core/routes/skills-routes.ts +266 -45
  160. package/ccw/src/core/routes/system-routes.ts +102 -50
  161. package/ccw/src/core/server.ts +13 -0
  162. package/ccw/src/mcp-server/index.ts +2 -2
  163. package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
  164. package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
  165. package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
  166. package/ccw/src/templates/dashboard-js/i18n.js +116 -0
  167. package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
  168. package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
  169. package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
  170. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
  171. package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
  172. package/ccw/src/templates/dashboard.html +7 -0
  173. package/ccw/src/tools/claude-cli-tools.ts +170 -56
  174. package/ccw/src/tools/cli-config-manager.ts +2 -33
  175. package/ccw/src/tools/cli-executor-core.ts +8 -2
  176. package/ccw/src/tools/cli-history-store.ts +92 -2
  177. package/ccw/src/tools/command-registry.ts +16 -1
  178. package/ccw/src/tools/generate-module-docs.ts +11 -7
  179. package/ccw/src/tools/litellm-executor.ts +13 -9
  180. package/ccw/src/types/skill-types.ts +99 -0
  181. package/package.json +1 -1
  182. package/.claude/commands/enhance-prompt.md +0 -93
  183. package/.claude/commands/memory/code-map-memory.md +0 -687
  184. package/.claude/commands/memory/docs.md +0 -615
  185. package/.claude/commands/memory/load-skill-memory.md +0 -182
  186. package/.claude/commands/memory/skill-memory.md +0 -525
  187. package/.claude/commands/memory/swagger-docs.md +0 -773
  188. package/.claude/commands/memory/tech-research-rules.md +0 -310
  189. package/.claude/commands/memory/workflow-skill-memory.md +0 -517
  190. package/.claude/commands/task/breakdown.md +0 -208
  191. package/.claude/commands/task/create.md +0 -152
  192. package/.claude/commands/task/execute.md +0 -270
  193. package/.claude/commands/task/replan.md +0 -441
  194. package/.claude/commands/version.md +0 -254
  195. package/.claude/commands/workflow/action-plan-verify.md +0 -485
  196. package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
  197. package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
  198. package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
  199. package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
  200. package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
  201. package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
  202. package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
  203. package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
  204. package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
  205. package/.claude/commands/workflow/debug.md +0 -331
  206. package/.claude/commands/workflow/develop-with-file.md +0 -1044
  207. package/.claude/skills/ccw-loop/README.md +0 -303
  208. package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
  209. package/.claude/skills/skill-generator/templates/script-python.md +0 -198
  210. package/.codex/prompts/debug.md +0 -318
  211. package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
@@ -2,276 +2,174 @@
2
2
 
3
3
  Classification of skill execution issues with detection patterns and severity criteria.
4
4
 
5
- ## When to Use
6
-
7
- | Phase | Usage | Section |
8
- |-------|-------|---------|
9
- | All Diagnosis Actions | Issue classification | All sections |
10
- | action-propose-fixes | Strategy selection | Fix Mapping |
11
- | action-generate-report | Severity assessment | Severity Criteria |
5
+ ## Quick Reference
6
+
7
+ | Category | Priority | Detection | Fix Strategy |
8
+ |----------|----------|-----------|--------------|
9
+ | Authoring Violation | P0 | Intermediate files, state bloat, file relay | eliminate_intermediate, minimize_state |
10
+ | Data Flow Disruption | P1 | Scattered state, inconsistent formats | state_centralization, schema_enforcement |
11
+ | Agent Coordination | P2 | Fragile chains, no error handling | error_wrapping, result_validation |
12
+ | Context Explosion | P3 | Unbounded history, full content passing | sliding_window, path_reference |
13
+ | Long-tail Forgetting | P4 | Early constraint loss | constraint_injection, checkpoint_restore |
14
+ | Token Consumption | P5 | Verbose prompts, redundant I/O | prompt_compression, lazy_loading |
15
+ | Doc Redundancy | P6 | Repeated definitions | consolidate_to_ssot |
16
+ | Doc Conflict | P7 | Inconsistent definitions | reconcile_definitions |
12
17
 
13
18
  ---
14
19
 
15
- ## Problem Categories
16
-
17
- ### 0. Authoring Principles Violation (P0)
18
-
19
- **Definition**: 违反 skill 撰写首要准则(简洁高效、去除存储、上下文流转)。
20
+ ## 0. Authoring Principles Violation (P0)
20
21
 
21
- **Root Causes**:
22
- - 不必要的中间文件存储
23
- - State schema 过度膨胀
24
- - 文件中转代替上下文传递
25
- - 重复数据存储
22
+ **Definition**: Violates skill authoring principles (simplicity, no intermediate files, context passing).
26
23
 
27
24
  **Detection Patterns**:
28
25
 
29
- | Pattern ID | Regex/Check | Description |
30
- |------------|-------------|-------------|
31
- | APV-001 | `/Write\([^)]*temp-|intermediate-/` | 中间文件写入 |
32
- | APV-002 | `/Write\([^)]+\)[\s\S]{0,50}Read\([^)]+\)/` | 写后立即读(文件中转) |
33
- | APV-003 | State schema > 15 fields | State 字段过多 |
34
- | APV-004 | `/_history\s*[.=].*push|concat/` | 无限增长数组 |
35
- | APV-005 | `/debug_|_cache|_temp/` in state | 调试/缓存字段残留 |
36
- | APV-006 | Same data in multiple state fields | 重复存储 |
37
-
38
- **Impact Levels**:
39
- - **Critical**: 中间文件 > 5 个,严重违反原则
40
- - **High**: State 字段 > 20 个,或存在文件中转
41
- - **Medium**: 存在调试字段或轻微冗余
42
- - **Low**: 轻微的命名不规范
26
+ | Pattern ID | Check | Description |
27
+ |------------|-------|-------------|
28
+ | APV-001 | `/Write\([^)]*temp-\|intermediate-/` | Intermediate file writes |
29
+ | APV-002 | `/Write\([^)]+\)[\s\S]{0,50}Read\([^)]+\)/` | Write-then-read relay |
30
+ | APV-003 | State schema > 15 fields | Excessive state fields |
31
+ | APV-004 | `/_history\s*[.=].*push\|concat/` | Unbounded array growth |
32
+ | APV-005 | `/debug_\|_cache\|_temp/` in state | Debug/cache field residue |
33
+ | APV-006 | Same data in multiple fields | Duplicate storage |
43
34
 
44
- ---
35
+ **Impact**: Critical (>5 intermediate files), High (>20 state fields), Medium (debug fields), Low (naming issues)
45
36
 
46
- ### 1. Context Explosion (P2)
37
+ ---
47
38
 
48
- **Definition**: Excessive token accumulation causing prompt size to grow unbounded.
39
+ ## 1. Context Explosion (P3)
49
40
 
50
- **Root Causes**:
51
- - Unbounded conversation history
52
- - Full content passing instead of references
53
- - Missing summarization mechanisms
54
- - Agent returning full output instead of path+summary
41
+ **Definition**: Unbounded token accumulation causing prompt size growth.
55
42
 
56
43
  **Detection Patterns**:
57
44
 
58
- | Pattern ID | Regex/Check | Description |
59
- |------------|-------------|-------------|
45
+ | Pattern ID | Check | Description |
46
+ |------------|-------|-------------|
60
47
  | CTX-001 | `/history\s*[.=].*push\|concat/` | History array growth |
61
48
  | CTX-002 | `/JSON\.stringify\s*\(\s*state\s*\)/` | Full state serialization |
62
49
  | CTX-003 | `/Read\([^)]+\)\s*[\+,]/` | Multiple file content concatenation |
63
50
  | CTX-004 | `/return\s*\{[^}]*content:/` | Agent returning full content |
64
- | CTX-005 | File length > 5000 chars without summarize | Long prompt without compression |
51
+ | CTX-005 | File > 5000 chars without summarization | Long prompts |
65
52
 
66
- **Impact Levels**:
67
- - **Critical**: Context exceeds model limit (128K tokens)
68
- - **High**: Context > 50K tokens per iteration
69
- - **Medium**: Context grows 10%+ per iteration
70
- - **Low**: Potential for growth but currently manageable
53
+ **Impact**: Critical (>128K tokens), High (>50K per iteration), Medium (10%+ growth), Low (manageable)
71
54
 
72
55
  ---
73
56
 
74
- ### 2. Long-tail Forgetting (P3)
57
+ ## 2. Long-tail Forgetting (P4)
75
58
 
76
- **Definition**: Loss of early instructions, constraints, or goals in long execution chains.
77
-
78
- **Root Causes**:
79
- - No explicit constraint propagation
80
- - Reliance on implicit context
81
- - Missing checkpoint/restore mechanisms
82
- - State schema without requirements field
59
+ **Definition**: Loss of early instructions/constraints in long chains.
83
60
 
84
61
  **Detection Patterns**:
85
62
 
86
- | Pattern ID | Regex/Check | Description |
87
- |------------|-------------|-------------|
88
- | MEM-001 | Later phases missing constraint reference | Constraint not carried forward |
63
+ | Pattern ID | Check | Description |
64
+ |------------|-------|-------------|
65
+ | MEM-001 | Later phases missing constraint reference | Constraint not forwarded |
89
66
  | MEM-002 | `/\[TASK\][^[]*(?!\[CONSTRAINTS\])/` | Task without constraints section |
90
67
  | MEM-003 | Key phases without checkpoint | Missing state preservation |
91
- | MEM-004 | State schema lacks `original_requirements` | No constraint persistence |
68
+ | MEM-004 | State lacks `original_requirements` | No constraint persistence |
92
69
  | MEM-005 | No verification phase | Output not checked against intent |
93
70
 
94
- **Impact Levels**:
95
- - **Critical**: Original goal completely lost
96
- - **High**: Key constraints ignored in output
97
- - **Medium**: Some requirements missing
98
- - **Low**: Minor goal drift
71
+ **Impact**: Critical (goal lost), High (constraints ignored), Medium (some missing), Low (minor drift)
99
72
 
100
73
  ---
101
74
 
102
- ### 3. Data Flow Disruption (P0)
103
-
104
- **Definition**: Inconsistent state management causing data loss or corruption.
75
+ ## 3. Data Flow Disruption (P1)
105
76
 
106
- **Root Causes**:
107
- - Multiple state storage locations
108
- - Inconsistent field naming
109
- - Missing schema validation
110
- - Format transformation without normalization
77
+ **Definition**: Inconsistent state management causing data loss/corruption.
111
78
 
112
79
  **Detection Patterns**:
113
80
 
114
- | Pattern ID | Regex/Check | Description |
115
- |------------|-------------|-------------|
81
+ | Pattern ID | Check | Description |
82
+ |------------|-------|-------------|
116
83
  | DF-001 | Multiple state file writes | Scattered state storage |
117
84
  | DF-002 | Same concept, different names | Field naming inconsistency |
118
85
  | DF-003 | JSON.parse without validation | Missing schema validation |
119
86
  | DF-004 | Files written but never read | Orphaned outputs |
120
87
  | DF-005 | Autonomous skill without state-schema | Undefined state structure |
121
88
 
122
- **Impact Levels**:
123
- - **Critical**: Data loss or corruption
124
- - **High**: State inconsistency between phases
125
- - **Medium**: Potential for inconsistency
126
- - **Low**: Minor naming inconsistencies
89
+ **Impact**: Critical (data loss), High (state inconsistency), Medium (potential inconsistency), Low (naming)
127
90
 
128
91
  ---
129
92
 
130
- ### 4. Agent Coordination Failure (P1)
93
+ ## 4. Agent Coordination Failure (P2)
131
94
 
132
95
  **Definition**: Fragile agent call patterns causing cascading failures.
133
96
 
134
- **Root Causes**:
135
- - Missing error handling in Task calls
136
- - No result validation
137
- - Inconsistent agent configurations
138
- - Deeply nested agent calls
139
-
140
97
  **Detection Patterns**:
141
98
 
142
- | Pattern ID | Regex/Check | Description |
143
- |------------|-------------|-------------|
99
+ | Pattern ID | Check | Description |
100
+ |------------|-------|-------------|
144
101
  | AGT-001 | Task without try-catch | Missing error handling |
145
102
  | AGT-002 | Result used without validation | No return value check |
146
- | AGT-003 | > 3 different agent types | Agent type proliferation |
103
+ | AGT-003 | >3 different agent types | Agent type proliferation |
147
104
  | AGT-004 | Nested Task in prompt | Agent calling agent |
148
105
  | AGT-005 | Task used but not in allowed-tools | Tool declaration mismatch |
149
106
  | AGT-006 | Multiple return formats | Inconsistent agent output |
150
107
 
151
- **Impact Levels**:
152
- - **Critical**: Workflow crash on agent failure
153
- - **High**: Unpredictable agent behavior
154
- - **Medium**: Occasional coordination issues
155
- - **Low**: Minor inconsistencies
108
+ **Impact**: Critical (crash on failure), High (unpredictable behavior), Medium (occasional issues), Low (minor)
156
109
 
157
110
  ---
158
111
 
159
- ### 5. Documentation Redundancy (P5)
112
+ ## 5. Documentation Redundancy (P6)
160
113
 
161
- **Definition**: 同一定义(如 State Schema、映射表、类型定义)在多个文件中重复出现,导致维护困难和不一致风险。
162
-
163
- **Root Causes**:
164
- - 缺乏单一真相来源 (SSOT)
165
- - 复制粘贴代替引用
166
- - 硬编码配置代替集中管理
114
+ **Definition**: Same definition (State Schema, mappings, types) repeated across files.
167
115
 
168
116
  **Detection Patterns**:
169
117
 
170
- | Pattern ID | Regex/Check | Description |
171
- |------------|-------------|-------------|
172
- | DOC-RED-001 | 跨文件语义比较 | 找到 State Schema 等核心概念的重复定义 |
173
- | DOC-RED-002 | 代码块 vs 规范表对比 | action 文件中硬编码与 spec 文档的重复 |
174
- | DOC-RED-003 | `/interface\s+(\w+)/` 同名扫描 | 多处定义的 interface/type |
118
+ | Pattern ID | Check | Description |
119
+ |------------|-------|-------------|
120
+ | DOC-RED-001 | Cross-file semantic comparison | State Schema duplication |
121
+ | DOC-RED-002 | Code block vs spec comparison | Hardcoded config duplication |
122
+ | DOC-RED-003 | `/interface\s+(\w+)/` same-name scan | Interface/type duplication |
175
123
 
176
- **Impact Levels**:
177
- - **High**: 核心定义(State Schema, 映射表)重复
178
- - **Medium**: 类型定义重复
179
- - **Low**: 示例代码重复
124
+ **Impact**: High (core definitions), Medium (type definitions), Low (example code)
180
125
 
181
126
  ---
182
127
 
183
- ### 6. Token Consumption (P6)
184
-
185
- **Definition**: Excessive token usage from verbose prompts, large state objects, or inefficient I/O patterns.
128
+ ## 6. Token Consumption (P5)
186
129
 
187
- **Root Causes**:
188
- - Long static prompts without compression
189
- - State schema with too many fields
190
- - Full content embedding instead of path references
191
- - Arrays growing unbounded without sliding windows
192
- - Write-then-read file relay patterns
130
+ **Definition**: Excessive token usage from verbose prompts, large state, inefficient I/O.
193
131
 
194
132
  **Detection Patterns**:
195
133
 
196
- | Pattern ID | Regex/Check | Description |
197
- |------------|-------------|-------------|
134
+ | Pattern ID | Check | Description |
135
+ |------------|-------|-------------|
198
136
  | TKN-001 | File size > 4KB | Verbose prompt files |
199
137
  | TKN-002 | State fields > 15 | Excessive state schema |
200
138
  | TKN-003 | `/Read\([^)]+\)\s*[\+,]/` | Full content passing |
201
139
  | TKN-004 | `/.push\|concat(?!.*\.slice)/` | Unbounded array growth |
202
140
  | TKN-005 | `/Write\([^)]+\)[\s\S]{0,100}Read\([^)]+\)/` | Write-then-read pattern |
203
141
 
204
- **Impact Levels**:
205
- - **High**: Multiple TKN-003/TKN-004 issues causing significant token waste
206
- - **Medium**: Several verbose files or state bloat
207
- - **Low**: Minor optimization opportunities
142
+ **Impact**: High (multiple TKN-003/004), Medium (verbose files), Low (minor optimization)
208
143
 
209
144
  ---
210
145
 
211
- ### 7. Documentation Conflict (P7)
146
+ ## 7. Documentation Conflict (P7)
212
147
 
213
- **Definition**: 同一概念在不同文件中定义不一致,导致行为不可预测和文档误导。
214
-
215
- **Root Causes**:
216
- - 定义更新后未同步其他位置
217
- - 实现与文档漂移
218
- - 缺乏一致性校验
148
+ **Definition**: Same concept defined inconsistently across files.
219
149
 
220
150
  **Detection Patterns**:
221
151
 
222
- | Pattern ID | Regex/Check | Description |
223
- |------------|-------------|-------------|
224
- | DOC-CON-001 | 键值一致性校验 | 同一键(如优先级)在不同文件中值不同 |
225
- | DOC-CON-002 | 实现 vs 文档对比 | 硬编码配置与文档对应项不一致 |
152
+ | Pattern ID | Check | Description |
153
+ |------------|-------|-------------|
154
+ | DOC-CON-001 | Key-value consistency check | Same key, different values |
155
+ | DOC-CON-002 | Implementation vs docs comparison | Hardcoded vs documented mismatch |
226
156
 
227
- **Impact Levels**:
228
- - **Critical**: 优先级/类别定义冲突
229
- - **High**: 策略映射不一致
230
- - **Medium**: 示例与实际不符
157
+ **Impact**: Critical (priority/category conflicts), High (strategy mapping inconsistency), Medium (example mismatch)
231
158
 
232
159
  ---
233
160
 
234
- ## Severity Criteria
235
-
236
- ### Global Severity Matrix
237
-
238
- | Severity | Definition | Action Required |
239
- |----------|------------|-----------------|
240
- | **Critical** | Blocks execution or causes data loss | Immediate fix required |
241
- | **High** | Significantly impacts reliability | Should fix before deployment |
242
- | **Medium** | Affects quality or maintainability | Fix in next iteration |
243
- | **Low** | Minor improvement opportunity | Optional fix |
244
-
245
- ### Severity Calculation
161
+ ## Severity Calculation
246
162
 
247
163
  ```javascript
248
- function calculateIssueSeverity(issue) {
249
- const weights = {
250
- impact_on_execution: 40, // Does it block workflow?
251
- data_integrity_risk: 30, // Can it cause data loss?
252
- frequency: 20, // How often does it occur?
253
- complexity_to_fix: 10 // How hard to fix?
254
- };
255
-
164
+ function calculateSeverity(issue) {
165
+ const weights = { execution: 40, data_integrity: 30, frequency: 20, complexity: 10 };
256
166
  let score = 0;
257
167
 
258
- // Impact on execution
259
- if (issue.blocks_execution) score += weights.impact_on_execution;
260
- else if (issue.degrades_execution) score += weights.impact_on_execution * 0.5;
261
-
262
- // Data integrity
263
- if (issue.causes_data_loss) score += weights.data_integrity_risk;
264
- else if (issue.causes_inconsistency) score += weights.data_integrity_risk * 0.5;
265
-
266
- // Frequency
168
+ if (issue.blocks_execution) score += weights.execution;
169
+ if (issue.causes_data_loss) score += weights.data_integrity;
267
170
  if (issue.occurs_every_run) score += weights.frequency;
268
- else if (issue.occurs_sometimes) score += weights.frequency * 0.5;
171
+ if (issue.fix_complexity === 'low') score += weights.complexity;
269
172
 
270
- // Complexity (inverse - easier to fix = higher priority)
271
- if (issue.fix_complexity === 'low') score += weights.complexity_to_fix;
272
- else if (issue.fix_complexity === 'medium') score += weights.complexity_to_fix * 0.5;
273
-
274
- // Map score to severity
275
173
  if (score >= 70) return 'critical';
276
174
  if (score >= 50) return 'high';
277
175
  if (score >= 30) return 'medium';
@@ -283,36 +181,30 @@ function calculateIssueSeverity(issue) {
283
181
 
284
182
  ## Fix Mapping
285
183
 
286
- | Problem Type | Recommended Strategies | Priority Order |
287
- |--------------|----------------------|----------------|
288
- | **Authoring Principles Violation** | eliminate_intermediate_files, minimize_state, context_passing | 1, 2, 3 |
289
- | Context Explosion | sliding_window, path_reference, context_summarization | 1, 2, 3 |
290
- | Long-tail Forgetting | constraint_injection, state_constraints_field, checkpoint | 1, 2, 3 |
291
- | Data Flow Disruption | state_centralization, schema_enforcement, field_normalization | 1, 2, 3 |
292
- | Agent Coordination | error_wrapping, result_validation, flatten_nesting | 1, 2, 3 |
293
- | **Token Consumption** | prompt_compression, lazy_loading, output_minimization, state_field_reduction | 1, 2, 3, 4 |
294
- | **Documentation Redundancy** | consolidate_to_ssot, centralize_mapping_config | 1, 2 |
295
- | **Documentation Conflict** | reconcile_conflicting_definitions | 1 |
184
+ | Problem | Strategies (priority order) |
185
+ |---------|---------------------------|
186
+ | Authoring Violation | eliminate_intermediate_files, minimize_state, context_passing |
187
+ | Context Explosion | sliding_window, path_reference, context_summarization |
188
+ | Long-tail Forgetting | constraint_injection, state_constraints_field, checkpoint |
189
+ | Data Flow Disruption | state_centralization, schema_enforcement, field_normalization |
190
+ | Agent Coordination | error_wrapping, result_validation, flatten_nesting |
191
+ | Token Consumption | prompt_compression, lazy_loading, output_minimization, state_field_reduction |
192
+ | Doc Redundancy | consolidate_to_ssot, centralize_mapping_config |
193
+ | Doc Conflict | reconcile_conflicting_definitions |
296
194
 
297
195
  ---
298
196
 
299
197
  ## Cross-Category Dependencies
300
198
 
301
- Some issues may trigger others:
302
-
303
199
  ```
304
- Context Explosion ──→ Long-tail Forgetting
305
- (Large context causes important info to be pushed out)
200
+ Context Explosion Long-tail Forgetting
201
+ (Large context pushes important info out)
306
202
 
307
- Data Flow Disruption ──→ Agent Coordination Failure
308
- (Inconsistent data causes agents to fail)
203
+ Data Flow Disruption Agent Coordination Failure
204
+ (Inconsistent data causes agent failures)
309
205
 
310
- Agent Coordination Failure ──→ Context Explosion
311
- (Failed retries add to context)
206
+ Agent Coordination Failure Context Explosion
207
+ (Failed retries add to context)
312
208
  ```
313
209
 
314
- When fixing, address in this order:
315
- 1. **P0 Data Flow** - Foundation for other fixes
316
- 2. **P1 Agent Coordination** - Stability
317
- 3. **P2 Context Explosion** - Efficiency
318
- 4. **P3 Long-tail Forgetting** - Quality
210
+ **Fix Order**: P1 Data Flow → P2 Agent → P3 Context → P4 Memory