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
@@ -1,221 +0,0 @@
1
- ---
2
- name: ux-expert
3
- description: Generate or update ux-expert/analysis.md addressing guidance-specification discussion points for UX perspective
4
- argument-hint: "optional topic - uses existing framework if available"
5
- allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*)
6
- ---
7
-
8
- ## 🎯 **UX Expert Analysis Generator**
9
-
10
- ### Purpose
11
- **Specialized command for generating ux-expert/analysis.md** that addresses guidance-specification.md discussion points from user experience and interface design perspective. Creates or updates role-specific analysis with framework references.
12
-
13
- ### Core Function
14
- - **Framework-based Analysis**: Address each discussion point in guidance-specification.md
15
- - **UX Design Focus**: User interface, interaction patterns, and usability optimization
16
- - **Update Mechanism**: Create new or update existing analysis.md
17
- - **Agent Delegation**: Use conceptual-planning-agent for analysis generation
18
-
19
- ### Analysis Scope
20
- - **User Research**: User personas, behavioral analysis, and needs assessment
21
- - **Information Architecture**: Content structure, navigation hierarchy, and mental models
22
- - **User Journey Mapping**: User flows, task analysis, and interaction models
23
- - **Usability Strategy**: Accessibility planning, cognitive load reduction, and user testing frameworks
24
- - **Wireframing**: Low-fidelity layouts and structural prototypes (not visual design)
25
-
26
- ### Role Boundaries & Responsibilities
27
-
28
- #### **What This Role OWNS (Abstract User Experience & Research)**
29
- - **User Research & Personas**: Understanding target users, their goals, pain points, and behaviors
30
- - **Information Architecture**: Organizing content and defining navigation structures at a conceptual level
31
- - **User Journey Mapping**: Defining user flows, task sequences, and interaction models
32
- - **Wireframes & Low-Fidelity Prototypes**: Structural layouts showing information hierarchy (boxes and arrows, not colors/fonts)
33
- - **Usability Testing Strategy**: Planning user testing, A/B tests, and validation methods
34
- - **Accessibility Planning**: WCAG compliance strategy and inclusive design principles
35
-
36
- #### **What This Role DOES NOT Own (Defers to Other Roles)**
37
- - **Visual Design**: Colors, typography, spacing, visual style → Defers to **UI Designer**
38
- - **High-Fidelity Mockups**: Polished, pixel-perfect designs → Defers to **UI Designer**
39
- - **Component Implementation**: Design system components, CSS, animations → Defers to **UI Designer**
40
-
41
- #### **Handoff Points**
42
- - **TO UI Designer**: Provides wireframes, user flows, and information architecture that UI Designer will transform into high-fidelity visual designs
43
- - **FROM User Research**: May receive external research data to inform UX decisions
44
- - **TO Product Owner**: Provides user insights and validation results to inform feature prioritization
45
-
46
- ## ⚙️ **Execution Protocol**
47
-
48
- ### Phase 1: Session & Framework Detection
49
- ```bash
50
- # Check active session and framework
51
- CHECK: find .workflow/active/ -name "WFS-*" -type d
52
- IF active_session EXISTS:
53
- session_id = get_active_session()
54
- brainstorm_dir = .workflow/active/WFS-{session}/.brainstorming/
55
-
56
- CHECK: brainstorm_dir/guidance-specification.md
57
- IF EXISTS:
58
- framework_mode = true
59
- load_framework = true
60
- ELSE:
61
- IF topic_provided:
62
- framework_mode = false # Create analysis without framework
63
- ELSE:
64
- ERROR: "No framework found and no topic provided"
65
- ```
66
-
67
- ### Phase 2: Analysis Mode Detection
68
- ```bash
69
- # Determine execution mode
70
- IF framework_mode == true:
71
- mode = "framework_based_analysis"
72
- topic_ref = load_framework_topic()
73
- discussion_points = extract_framework_points()
74
- ELSE:
75
- mode = "standalone_analysis"
76
- topic_ref = provided_topic
77
- discussion_points = generate_basic_structure()
78
- ```
79
-
80
- ### Phase 3: Agent Execution with Flow Control
81
- **Framework-Based Analysis Generation**
82
-
83
- ```bash
84
- Task(conceptual-planning-agent): "
85
- [FLOW_CONTROL]
86
-
87
- Execute ux-expert analysis for existing topic framework
88
-
89
- ## Context Loading
90
- ASSIGNED_ROLE: ux-expert
91
- OUTPUT_LOCATION: .workflow/active/WFS-{session}/.brainstorming/ux-expert/
92
- ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"}
93
-
94
- ## Flow Control Steps
95
- 1. **load_topic_framework**
96
- - Action: Load structured topic discussion framework
97
- - Command: Read(.workflow/active/WFS-{session}/.brainstorming/guidance-specification.md)
98
- - Output: topic_framework_content
99
-
100
- 2. **load_role_template**
101
- - Action: Load ux-expert planning template
102
- - Command: bash($(cat ~/.claude/workflows/cli-templates/planning-roles/ux-expert.md))
103
- - Output: role_template_guidelines
104
-
105
- 3. **load_session_metadata**
106
- - Action: Load session metadata and existing context
107
- - Command: Read(.workflow/active/WFS-{session}/workflow-session.json)
108
- - Output: session_context
109
-
110
- ## Analysis Requirements
111
- **Framework Reference**: Address all discussion points in guidance-specification.md from user experience and interface design perspective
112
- **Role Focus**: UI design, interaction patterns, usability optimization, design systems
113
- **Structured Approach**: Create analysis.md addressing framework discussion points
114
- **Template Integration**: Apply role template guidelines within framework structure
115
-
116
- ## Expected Deliverables
117
- 1. **analysis.md**: Comprehensive UX design analysis addressing all framework discussion points
118
- 2. **Framework Reference**: Include @../guidance-specification.md reference in analysis
119
-
120
- ## Completion Criteria
121
- - Address each discussion point from guidance-specification.md with UX design expertise
122
- - Provide actionable interface design and usability optimization strategies
123
- - Include accessibility considerations and interaction pattern recommendations
124
- - Reference framework document using @ notation for integration
125
- "
126
- ```
127
-
128
- ## 📋 **TodoWrite Integration**
129
-
130
- ### Workflow Progress Tracking
131
- ```javascript
132
- TodoWrite({
133
- todos: [
134
- {
135
- content: "Detect active session and locate topic framework",
136
- status: "in_progress",
137
- activeForm: "Detecting session and framework"
138
- },
139
- {
140
- content: "Load guidance-specification.md and session metadata for context",
141
- status: "pending",
142
- activeForm: "Loading framework and session context"
143
- },
144
- {
145
- content: "Execute ux-expert analysis using conceptual-planning-agent with FLOW_CONTROL",
146
- status: "pending",
147
- activeForm: "Executing ux-expert framework analysis"
148
- },
149
- {
150
- content: "Generate analysis.md addressing all framework discussion points",
151
- status: "pending",
152
- activeForm: "Generating structured ux-expert analysis"
153
- },
154
- {
155
- content: "Update workflow-session.json with ux-expert completion status",
156
- status: "pending",
157
- activeForm: "Updating session metadata"
158
- }
159
- ]
160
- });
161
- ```
162
-
163
- ## 📊 **Output Structure**
164
-
165
- ### Framework-Based Analysis
166
- ```
167
- .workflow/active/WFS-{session}/.brainstorming/ux-expert/
168
- └── analysis.md # Structured analysis addressing guidance-specification.md discussion points
169
- ```
170
-
171
- ### Analysis Document Structure
172
- ```markdown
173
- # UX Expert Analysis: [Topic from Framework]
174
-
175
- ## Framework Reference
176
- **Topic Framework**: @../guidance-specification.md
177
- **Role Focus**: User Experience & Interface Design perspective
178
-
179
- ## Discussion Points Analysis
180
- [Address each point from guidance-specification.md with UX design expertise]
181
-
182
- ### Core Requirements (from framework)
183
- [User interface and interaction design requirements perspective]
184
-
185
- ### Technical Considerations (from framework)
186
- [Design system implementation and technical feasibility considerations]
187
-
188
- ### User Experience Factors (from framework)
189
- [Usability optimization, accessibility, and user-centered design analysis]
190
-
191
- ### Implementation Challenges (from framework)
192
- [Design implementation challenges and progressive enhancement strategies]
193
-
194
- ### Success Metrics (from framework)
195
- [UX metrics including usability testing, user satisfaction, and design KPIs]
196
-
197
- ## UX Expert Specific Recommendations
198
- [Role-specific interface design patterns and usability optimization strategies]
199
-
200
- ---
201
- *Generated by ux-expert analysis addressing structured framework*
202
- ```
203
-
204
- ## 🔄 **Session Integration**
205
-
206
- ### Completion Status Update
207
- ```json
208
- {
209
- "ux_expert": {
210
- "status": "completed",
211
- "framework_addressed": true,
212
- "output_location": ".workflow/active/WFS-{session}/.brainstorming/ux-expert/analysis.md",
213
- "framework_reference": "@../guidance-specification.md"
214
- }
215
- }
216
- ```
217
-
218
- ### Integration Points
219
- - **Framework Reference**: @../guidance-specification.md for structured discussion points
220
- - **Cross-Role Synthesis**: UX design insights available for synthesis-report.md integration
221
- - **Agent Autonomy**: Independent execution with framework guidance
@@ -1,331 +0,0 @@
1
- ---
2
- name: debug
3
- description: Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved
4
- argument-hint: "[-y|--yes] \"bug description or error message\""
5
- allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
6
- ---
7
-
8
- ## Auto Mode
9
-
10
- When `--yes` or `-y`: Auto-confirm all decisions (hypotheses, fixes, iteration), use recommended settings.
11
-
12
- # Workflow Debug Command (/workflow:debug)
13
-
14
- ## Overview
15
-
16
- Evidence-based interactive debugging command. Systematically identifies root causes through hypothesis-driven logging and iterative verification.
17
-
18
- **Core workflow**: Explore → Add Logging → Reproduce → Analyze Log → Fix → Verify
19
-
20
- ## Usage
21
-
22
- ```bash
23
- /workflow:debug <BUG_DESCRIPTION>
24
-
25
- # Arguments
26
- <bug-description> Bug description, error message, or stack trace (required)
27
- ```
28
-
29
- ## Execution Process
30
-
31
- ```
32
- Session Detection:
33
- ├─ Check if debug session exists for this bug
34
- ├─ EXISTS + debug.log has content → Analyze mode
35
- └─ NOT_FOUND or empty log → Explore mode
36
-
37
- Explore Mode:
38
- ├─ Locate error source in codebase
39
- ├─ Generate testable hypotheses (dynamic count)
40
- ├─ Add NDJSON logging instrumentation
41
- └─ Output: Hypothesis list + await user reproduction
42
-
43
- Analyze Mode:
44
- ├─ Parse debug.log, validate each hypothesis
45
- └─ Decision:
46
- ├─ Confirmed → Fix root cause
47
- ├─ Inconclusive → Add more logging, iterate
48
- └─ All rejected → Generate new hypotheses
49
-
50
- Fix & Cleanup:
51
- ├─ Apply fix based on confirmed hypothesis
52
- ├─ User verifies
53
- ├─ Remove debug instrumentation
54
- └─ If not fixed → Return to Analyze mode
55
- ```
56
-
57
- ## Implementation
58
-
59
- ### Session Setup & Mode Detection
60
-
61
- ```javascript
62
- const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
63
-
64
- const bugSlug = bug_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 30)
65
- const dateStr = getUtc8ISOString().substring(0, 10)
66
-
67
- const sessionId = `DBG-${bugSlug}-${dateStr}`
68
- const sessionFolder = `.workflow/.debug/${sessionId}`
69
- const debugLogPath = `${sessionFolder}/debug.log`
70
-
71
- // Auto-detect mode
72
- const sessionExists = fs.existsSync(sessionFolder)
73
- const logHasContent = sessionExists && fs.existsSync(debugLogPath) && fs.statSync(debugLogPath).size > 0
74
-
75
- const mode = logHasContent ? 'analyze' : 'explore'
76
-
77
- if (!sessionExists) {
78
- bash(`mkdir -p ${sessionFolder}`)
79
- }
80
- ```
81
-
82
- ---
83
-
84
- ### Explore Mode
85
-
86
- **Step 1.1: Locate Error Source**
87
-
88
- ```javascript
89
- // Extract keywords from bug description
90
- const keywords = extractErrorKeywords(bug_description)
91
- // e.g., ['Stack Length', '未找到', 'registered 0']
92
-
93
- // Search codebase for error locations
94
- for (const keyword of keywords) {
95
- Grep({ pattern: keyword, path: ".", output_mode: "content", "-C": 3 })
96
- }
97
-
98
- // Identify affected files and functions
99
- const affectedLocations = [...] // from search results
100
- ```
101
-
102
- **Step 1.2: Generate Hypotheses (Dynamic)**
103
-
104
- ```javascript
105
- // Hypothesis categories based on error pattern
106
- const HYPOTHESIS_PATTERNS = {
107
- "not found|missing|undefined|未找到": "data_mismatch",
108
- "0|empty|zero|registered 0": "logic_error",
109
- "timeout|connection|sync": "integration_issue",
110
- "type|format|parse": "type_mismatch"
111
- }
112
-
113
- // Generate hypotheses based on actual issue (NOT fixed count)
114
- function generateHypotheses(bugDescription, affectedLocations) {
115
- const hypotheses = []
116
-
117
- // Analyze bug and create targeted hypotheses
118
- // Each hypothesis has:
119
- // - id: H1, H2, ... (dynamic count)
120
- // - description: What might be wrong
121
- // - testable_condition: What to log
122
- // - logging_point: Where to add instrumentation
123
-
124
- return hypotheses // Could be 1, 3, 5, or more
125
- }
126
-
127
- const hypotheses = generateHypotheses(bug_description, affectedLocations)
128
- ```
129
-
130
- **Step 1.3: Add NDJSON Instrumentation**
131
-
132
- For each hypothesis, add logging at the relevant location:
133
-
134
- **Python template**:
135
- ```python
136
- # region debug [H{n}]
137
- try:
138
- import json, time
139
- _dbg = {
140
- "sid": "{sessionId}",
141
- "hid": "H{n}",
142
- "loc": "{file}:{line}",
143
- "msg": "{testable_condition}",
144
- "data": {
145
- # Capture relevant values here
146
- },
147
- "ts": int(time.time() * 1000)
148
- }
149
- with open(r"{debugLogPath}", "a", encoding="utf-8") as _f:
150
- _f.write(json.dumps(_dbg, ensure_ascii=False) + "\n")
151
- except: pass
152
- # endregion
153
- ```
154
-
155
- **JavaScript/TypeScript template**:
156
- ```javascript
157
- // region debug [H{n}]
158
- try {
159
- require('fs').appendFileSync("{debugLogPath}", JSON.stringify({
160
- sid: "{sessionId}",
161
- hid: "H{n}",
162
- loc: "{file}:{line}",
163
- msg: "{testable_condition}",
164
- data: { /* Capture relevant values */ },
165
- ts: Date.now()
166
- }) + "\n");
167
- } catch(_) {}
168
- // endregion
169
- ```
170
-
171
- **Output to user**:
172
- ```
173
- ## Hypotheses Generated
174
-
175
- Based on error "{bug_description}", generated {n} hypotheses:
176
-
177
- {hypotheses.map(h => `
178
- ### ${h.id}: ${h.description}
179
- - Logging at: ${h.logging_point}
180
- - Testing: ${h.testable_condition}
181
- `).join('')}
182
-
183
- **Debug log**: ${debugLogPath}
184
-
185
- **Next**: Run reproduction steps, then come back for analysis.
186
- ```
187
-
188
- ---
189
-
190
- ### Analyze Mode
191
-
192
- ```javascript
193
- // Parse NDJSON log
194
- const entries = Read(debugLogPath).split('\n')
195
- .filter(l => l.trim())
196
- .map(l => JSON.parse(l))
197
-
198
- // Group by hypothesis
199
- const byHypothesis = groupBy(entries, 'hid')
200
-
201
- // Validate each hypothesis
202
- for (const [hid, logs] of Object.entries(byHypothesis)) {
203
- const hypothesis = hypotheses.find(h => h.id === hid)
204
- const latestLog = logs[logs.length - 1]
205
-
206
- // Check if evidence confirms or rejects hypothesis
207
- const verdict = evaluateEvidence(hypothesis, latestLog.data)
208
- // Returns: 'confirmed' | 'rejected' | 'inconclusive'
209
- }
210
- ```
211
-
212
- **Output**:
213
- ```
214
- ## Evidence Analysis
215
-
216
- Analyzed ${entries.length} log entries.
217
-
218
- ${results.map(r => `
219
- ### ${r.id}: ${r.description}
220
- - **Status**: ${r.verdict}
221
- - **Evidence**: ${JSON.stringify(r.evidence)}
222
- - **Reason**: ${r.reason}
223
- `).join('')}
224
-
225
- ${confirmedHypothesis ? `
226
- ## Root Cause Identified
227
-
228
- **${confirmedHypothesis.id}**: ${confirmedHypothesis.description}
229
-
230
- Ready to fix.
231
- ` : `
232
- ## Need More Evidence
233
-
234
- Add more logging or refine hypotheses.
235
- `}
236
- ```
237
-
238
- ---
239
-
240
- ### Fix & Cleanup
241
-
242
- ```javascript
243
- // Apply fix based on confirmed hypothesis
244
- // ... Edit affected files
245
-
246
- // After user verifies fix works:
247
-
248
- // Remove debug instrumentation (search for region markers)
249
- const instrumentedFiles = Grep({
250
- pattern: "# region debug|// region debug",
251
- output_mode: "files_with_matches"
252
- })
253
-
254
- for (const file of instrumentedFiles) {
255
- // Remove content between region markers
256
- removeDebugRegions(file)
257
- }
258
-
259
- console.log(`
260
- ## Debug Complete
261
-
262
- - Root cause: ${confirmedHypothesis.description}
263
- - Fix applied to: ${modifiedFiles.join(', ')}
264
- - Debug instrumentation removed
265
- `)
266
- ```
267
-
268
- ---
269
-
270
- ## Debug Log Format (NDJSON)
271
-
272
- Each line is a JSON object:
273
-
274
- ```json
275
- {"sid":"DBG-xxx-2025-12-18","hid":"H1","loc":"file.py:func:42","msg":"Check dict keys","data":{"keys":["a","b"],"target":"c","found":false},"ts":1734567890123}
276
- ```
277
-
278
- | Field | Description |
279
- |-------|-------------|
280
- | `sid` | Session ID |
281
- | `hid` | Hypothesis ID (H1, H2, ...) |
282
- | `loc` | Code location |
283
- | `msg` | What's being tested |
284
- | `data` | Captured values |
285
- | `ts` | Timestamp (ms) |
286
-
287
- ## Session Folder
288
-
289
- ```
290
- .workflow/.debug/DBG-{slug}-{date}/
291
- ├── debug.log # NDJSON log (main artifact)
292
- └── resolution.md # Summary after fix (optional)
293
- ```
294
-
295
- ## Iteration Flow
296
-
297
- ```
298
- First Call (/workflow:debug "error"):
299
- ├─ No session exists → Explore mode
300
- ├─ Extract error keywords, search codebase
301
- ├─ Generate hypotheses, add logging
302
- └─ Await user reproduction
303
-
304
- After Reproduction (/workflow:debug "error"):
305
- ├─ Session exists + debug.log has content → Analyze mode
306
- ├─ Parse log, evaluate hypotheses
307
- └─ Decision:
308
- ├─ Confirmed → Fix → User verify
309
- │ ├─ Fixed → Cleanup → Done
310
- │ └─ Not fixed → Add logging → Iterate
311
- ├─ Inconclusive → Add logging → Iterate
312
- └─ All rejected → New hypotheses → Iterate
313
-
314
- Output:
315
- └─ .workflow/.debug/DBG-{slug}-{date}/debug.log
316
- ```
317
-
318
- ## Post-Completion Expansion
319
-
320
- 完成后询问用户是否扩展为issue(test/enhance/refactor/doc),选中项调用 `/issue:new "{summary} - {dimension}"`
321
-
322
- ---
323
-
324
- ## Error Handling
325
-
326
- | Situation | Action |
327
- |-----------|--------|
328
- | Empty debug.log | Verify reproduction triggered the code path |
329
- | All hypotheses rejected | Generate new hypotheses with broader scope |
330
- | Fix doesn't work | Iterate with more granular logging |
331
- | >5 iterations | Escalate to `/workflow:lite-fix` with evidence |