@su-record/vibe 2.0.0 → 2.0.2
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/agents/explorer.md +48 -48
- package/.claude/agents/implementer.md +53 -53
- package/.claude/agents/searcher.md +54 -54
- package/.claude/agents/simplifier.md +119 -119
- package/.claude/agents/tester.md +49 -49
- package/.claude/commands/vibe.analyze.md +239 -239
- package/.claude/commands/vibe.continue.md +88 -88
- package/.claude/commands/vibe.diagram.md +178 -178
- package/.claude/commands/vibe.reason.md +306 -306
- package/.claude/commands/vibe.run.md +760 -760
- package/.claude/commands/vibe.spec.md +339 -339
- package/.claude/commands/vibe.tool.md +153 -153
- package/.claude/commands/vibe.ui.md +137 -137
- package/.claude/commands/vibe.verify.md +238 -238
- package/.claude/settings.json +152 -152
- package/.claude/settings.local.json +4 -57
- package/.vibe/config.json +9 -0
- package/.vibe/constitution.md +184 -184
- package/.vibe/rules/core/communication-guide.md +104 -104
- package/.vibe/rules/core/development-philosophy.md +52 -52
- package/.vibe/rules/core/quick-start.md +120 -120
- package/.vibe/rules/quality/bdd-contract-testing.md +388 -388
- package/.vibe/rules/quality/checklist.md +276 -276
- package/.vibe/rules/quality/testing-strategy.md +437 -437
- package/.vibe/rules/standards/anti-patterns.md +369 -369
- package/.vibe/rules/standards/code-structure.md +291 -291
- package/.vibe/rules/standards/complexity-metrics.md +312 -312
- package/.vibe/rules/standards/naming-conventions.md +198 -198
- package/.vibe/rules/tools/mcp-hi-ai-guide.md +665 -665
- package/.vibe/rules/tools/mcp-workflow.md +51 -51
- package/.vibe/setup.sh +31 -31
- package/CLAUDE.md +122 -122
- package/LICENSE +21 -21
- package/README.md +568 -568
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +391 -406
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/MemoryManager.js +92 -92
- package/dist/lib/PythonParser.js +108 -108
- package/dist/lib/gemini-mcp.js +15 -15
- package/dist/lib/gemini-oauth.d.ts.map +1 -1
- package/dist/lib/gemini-oauth.js +41 -38
- package/dist/lib/gemini-oauth.js.map +1 -1
- package/dist/lib/gpt-mcp.js +17 -17
- package/dist/lib/gpt-oauth.d.ts.map +1 -1
- package/dist/lib/gpt-oauth.js +50 -45
- package/dist/lib/gpt-oauth.js.map +1 -1
- package/dist/tools/analytics/getUsageAnalytics.js +12 -12
- package/dist/tools/memory/createMemoryTimeline.js +10 -10
- package/dist/tools/memory/getMemoryGraph.js +12 -12
- package/dist/tools/memory/getSessionContext.js +9 -9
- package/dist/tools/memory/linkMemories.js +14 -14
- package/dist/tools/memory/listMemories.js +4 -4
- package/dist/tools/memory/recallMemory.js +4 -4
- package/dist/tools/memory/saveMemory.js +4 -4
- package/dist/tools/memory/searchMemoriesAdvanced.js +22 -22
- package/dist/tools/planning/generatePrd.js +46 -46
- package/dist/tools/prompt/enhancePromptGemini.js +160 -160
- package/dist/tools/reasoning/applyReasoningFramework.js +56 -56
- package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
- package/package.json +67 -67
- package/templates/constitution-template.md +184 -184
- package/templates/contract-backend-template.md +517 -517
- package/templates/contract-frontend-template.md +594 -594
- package/templates/feature-template.md +96 -96
- package/templates/hooks-template.json +103 -103
- package/templates/spec-template.md +199 -199
- package/dist/lib/vibe-mcp.d.ts.map +0 -1
- package/dist/lib/vibe-mcp.js.map +0 -1
|
@@ -1,306 +1,306 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Apply systematic reasoning framework to complex problems
|
|
3
|
-
argument-hint: "problem description"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /vibe.reason
|
|
7
|
-
|
|
8
|
-
Apply 9-step reasoning framework to complex problems (Reasoning Agent).
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
/vibe.reason "problem description"
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Description
|
|
17
|
-
|
|
18
|
-
Use systematic 9-step reasoning framework to logically analyze complex problems and derive optimal solutions.
|
|
19
|
-
|
|
20
|
-
## When to Use
|
|
21
|
-
|
|
22
|
-
Use in situations like:
|
|
23
|
-
|
|
24
|
-
1. **Complex bug debugging**
|
|
25
|
-
- Root cause unclear
|
|
26
|
-
- Need to systematically verify multiple hypotheses
|
|
27
|
-
|
|
28
|
-
2. **Architecture design decisions**
|
|
29
|
-
- Need to choose optimal option among several
|
|
30
|
-
- Need to comprehensively evaluate constraints and risks
|
|
31
|
-
|
|
32
|
-
3. **Performance optimization**
|
|
33
|
-
- Bottleneck may be in multiple places
|
|
34
|
-
- Need step-by-step optimization strategy
|
|
35
|
-
|
|
36
|
-
4. **Refactoring planning**
|
|
37
|
-
- Need to systematically analyze legacy code complexity
|
|
38
|
-
- Need gradual refactoring strategy
|
|
39
|
-
|
|
40
|
-
5. **Requirements analysis**
|
|
41
|
-
- Need to reconcile conflicting requirements
|
|
42
|
-
- Need to discover missing requirements
|
|
43
|
-
|
|
44
|
-
## Process
|
|
45
|
-
|
|
46
|
-
### 1. Logical Dependencies and Constraints
|
|
47
|
-
- Check policies, rules, prerequisites
|
|
48
|
-
- Optimize task order (identify dependencies)
|
|
49
|
-
- Apply user constraints first
|
|
50
|
-
|
|
51
|
-
### 2. Risk Assessment
|
|
52
|
-
- Analyze action consequences
|
|
53
|
-
- Check rollback possibility
|
|
54
|
-
- Review compatibility, security, performance risks
|
|
55
|
-
|
|
56
|
-
### 3. Inductive Reasoning and Hypothesis Exploration
|
|
57
|
-
- Generate hypotheses about root cause
|
|
58
|
-
- Prioritize by likelihood
|
|
59
|
-
- Present verification method for each hypothesis
|
|
60
|
-
|
|
61
|
-
### 4. Result Evaluation and Adaptability
|
|
62
|
-
- Modify plan based on observations
|
|
63
|
-
- Generate new hypothesis when disproved
|
|
64
|
-
- Determine backtracking need
|
|
65
|
-
|
|
66
|
-
### 5. Information Availability
|
|
67
|
-
- Identify all available tools
|
|
68
|
-
- Reference relevant policy/rule documents
|
|
69
|
-
- Restore previous context
|
|
70
|
-
- Distinguish items needing user confirmation
|
|
71
|
-
|
|
72
|
-
### 6. Precision and Evidence
|
|
73
|
-
- Cite exact source when referencing policies
|
|
74
|
-
- Include filename:line when referencing code
|
|
75
|
-
- Provide exact metric numbers
|
|
76
|
-
|
|
77
|
-
### 7. Completeness
|
|
78
|
-
- Integrate all requirements, options, preferences
|
|
79
|
-
- Avoid premature conclusions
|
|
80
|
-
- Explore multiple alternatives
|
|
81
|
-
|
|
82
|
-
### 8. Persistence and Patience
|
|
83
|
-
- Intelligently retry temporary errors
|
|
84
|
-
- Solve problems through strategy changes
|
|
85
|
-
- Continue until all reasoning steps complete
|
|
86
|
-
|
|
87
|
-
### 9. Response Suppression
|
|
88
|
-
- Act only after reasoning complete
|
|
89
|
-
- Document reasoning process for complex decisions
|
|
90
|
-
- Ensure safety through step-by-step execution
|
|
91
|
-
|
|
92
|
-
## MCP Tools Integration
|
|
93
|
-
|
|
94
|
-
This command automatically uses these MCP tools:
|
|
95
|
-
|
|
96
|
-
- **apply_reasoning_framework**: Apply 9-step reasoning framework
|
|
97
|
-
- **create_thinking_chain**: Create sequential thinking chain
|
|
98
|
-
- **analyze_problem**: Analyze problem root cause
|
|
99
|
-
- **step_by_step_analysis**: Detailed step-by-step analysis
|
|
100
|
-
- **recall_memory**: Restore previous context
|
|
101
|
-
- **find_symbol / find_references**: Identify code dependencies
|
|
102
|
-
|
|
103
|
-
## Output Format
|
|
104
|
-
|
|
105
|
-
```markdown
|
|
106
|
-
# Reasoning Framework Analysis
|
|
107
|
-
|
|
108
|
-
**Problem**: [problem description]
|
|
109
|
-
**Context**: [relevant information]
|
|
110
|
-
**Steps Applied**: 9/9
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 1. Logical Dependencies and Constraints
|
|
115
|
-
|
|
116
|
-
**Key Questions**:
|
|
117
|
-
- What policies or required rules apply?
|
|
118
|
-
- Should task order be rearranged?
|
|
119
|
-
- Required prerequisites or information?
|
|
120
|
-
- Explicit user constraints?
|
|
121
|
-
|
|
122
|
-
**Constraint Analysis**:
|
|
123
|
-
[analysis content]
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## 2. Risk Assessment
|
|
128
|
-
|
|
129
|
-
...
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Summary
|
|
134
|
-
|
|
135
|
-
[Overall reasoning results summary and recommendations]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Examples
|
|
139
|
-
|
|
140
|
-
### Example 1: Complex Bug Debugging
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
User: /vibe.reason "After user login, profile page intermittently returns 500 error. Log shows 'TypeError: Cannot read property id of undefined'"
|
|
144
|
-
|
|
145
|
-
AI: Analyzing this problem with 9-step reasoning framework.
|
|
146
|
-
|
|
147
|
-
# Reasoning Framework Analysis
|
|
148
|
-
|
|
149
|
-
**Problem**: Intermittent 500 error on profile page after login (TypeError: Cannot read property 'id' of undefined)
|
|
150
|
-
**Context**: Intermittent occurrence, happens after successful login
|
|
151
|
-
**Steps Applied**: 9/9
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## 1. Logical Dependencies and Constraints
|
|
156
|
-
|
|
157
|
-
**Constraint Analysis**:
|
|
158
|
-
- Policy/Rules: Need to check auth/authz system policies
|
|
159
|
-
- Task Order: Verify login → session creation → profile fetch order
|
|
160
|
-
- Prerequisites: Need to identify error reproduction conditions
|
|
161
|
-
- User Constraints: Production environment limits debugging tools
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## 2. Risk Assessment
|
|
166
|
-
|
|
167
|
-
**Risk Assessment**:
|
|
168
|
-
- Task type: Debugging (medium risk - logging low risk, DB changes high risk)
|
|
169
|
-
- Rollback possibility: Adding logs easy to rollback
|
|
170
|
-
- Compatibility risk: Session structure changes affect existing users
|
|
171
|
-
- Security risk: Excessive logging may expose sensitive info
|
|
172
|
-
- Performance risk: Additional logging minimal impact
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
177
|
-
|
|
178
|
-
**Hypothesis Generation**:
|
|
179
|
-
1. **Hypothesis 1: Incomplete session data** (Likelihood: High)
|
|
180
|
-
- Evidence: Intermittent = timing issue or data consistency problem
|
|
181
|
-
- Verification: Add logging to session save logic, check Redis connection
|
|
182
|
-
|
|
183
|
-
2. **Hypothesis 2: Async processing order issue** (Likelihood: Medium)
|
|
184
|
-
- Evidence: undefined = accessing data before load
|
|
185
|
-
- Verification: Check Promise chain in profile API, check for missing await
|
|
186
|
-
|
|
187
|
-
3. **Hypothesis 3: DB query returns null** (Likelihood: Low)
|
|
188
|
-
- Evidence: User info fetch fails only under certain conditions
|
|
189
|
-
- Verification: Check profile query logs, review foreign key constraints
|
|
190
|
-
|
|
191
|
-
**Priority**: Verify in order of likelihood, don't completely rule out low probability
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
[Additional steps 4-9 analysis...]
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
## Summary
|
|
200
|
-
|
|
201
|
-
Analyzed profile page 500 error after login through 9-step reasoning framework.
|
|
202
|
-
|
|
203
|
-
**Key Findings**:
|
|
204
|
-
- Most likely cause: Incomplete session data (Redis connection issue or session save timing)
|
|
205
|
-
- Verification priority: 1) Add session save logic logging → 2) Review async processing → 3) Check DB queries
|
|
206
|
-
|
|
207
|
-
**Recommended Actions**:
|
|
208
|
-
1. Immediate: Add detailed logging to session save/fetch (low risk)
|
|
209
|
-
2. Short-term: Code review async processing (Promise, await check)
|
|
210
|
-
3. Medium-term: Strengthen session store monitoring (Redis connection, memory)
|
|
211
|
-
|
|
212
|
-
**Next Steps**:
|
|
213
|
-
Check `profile_controller.ts` → Add try-catch and logging to session processing logic → Identify reproduction conditions
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Example 2: Architecture Design Decision
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
User: /vibe.reason "Want to add real-time notification feature. Should I use WebSocket, SSE, or Long Polling?"
|
|
220
|
-
|
|
221
|
-
AI: [Systematically analyze constraints, risks, pros/cons of each option through 9-step framework, recommend optimal choice for project situation]
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## Integration with Other Commands
|
|
225
|
-
|
|
226
|
-
### With /vibe.spec
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
# 1. Collect requirements
|
|
230
|
-
/vibe.spec "real-time notifications"
|
|
231
|
-
|
|
232
|
-
# 2. When technical decision needed
|
|
233
|
-
/vibe.reason "Choosing WebSocket vs SSE vs Long Polling for real-time notifications"
|
|
234
|
-
|
|
235
|
-
# 3. Update SPEC document and create plan
|
|
236
|
-
/vibe.plan "real-time notifications"
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### With /vibe.analyze
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
# 1. Discover issue through code analysis
|
|
243
|
-
/vibe.analyze --code
|
|
244
|
-
|
|
245
|
-
# 2. Analyze discovered issue with reasoning framework
|
|
246
|
-
/vibe.reason "Refactoring strategy to reduce users_service.py Cyclomatic Complexity from 15 to under 10"
|
|
247
|
-
|
|
248
|
-
# 3. Execute refactoring
|
|
249
|
-
/vibe.run "Task: Refactor users_service.py"
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Agent Configuration
|
|
253
|
-
|
|
254
|
-
This command uses `~/.claude/agents/reasoning-agent.md`.
|
|
255
|
-
|
|
256
|
-
**Agent Role**:
|
|
257
|
-
- Systematic reasoning and problem-solving expert
|
|
258
|
-
- Logically analyze complex problems
|
|
259
|
-
- Derive optimal solutions considering all relevant factors
|
|
260
|
-
|
|
261
|
-
**Agent Features**:
|
|
262
|
-
- Apply 9-step reasoning framework
|
|
263
|
-
- Hypothesis-based approach
|
|
264
|
-
- Risk assessment and mitigation strategies
|
|
265
|
-
- Precise evidence and source citation
|
|
266
|
-
|
|
267
|
-
## Best Practices
|
|
268
|
-
|
|
269
|
-
1. **Describe problem specifically**
|
|
270
|
-
- ❌ "There's a bug"
|
|
271
|
-
- ✅ "After login, profile page intermittently returns 500 error. Error log: TypeError: Cannot read property 'id' of undefined"
|
|
272
|
-
|
|
273
|
-
2. **Include context**
|
|
274
|
-
- Occurrence conditions (always? intermittent? specific conditions only?)
|
|
275
|
-
- Relevant tech stack
|
|
276
|
-
- Solutions already tried
|
|
277
|
-
|
|
278
|
-
3. **Save reasoning results to memory**
|
|
279
|
-
- For complex problems, save reasoning results with `save_memory`
|
|
280
|
-
- Reference later with `recall_memory`
|
|
281
|
-
|
|
282
|
-
4. **Verify step by step**
|
|
283
|
-
- Verify hypotheses suggested by reasoning framework in order
|
|
284
|
-
- Feedback each verification result to agent
|
|
285
|
-
|
|
286
|
-
5. **Combine with other commands**
|
|
287
|
-
- `/vibe.analyze` to understand situation → `/vibe.reason` to analyze solution → `/vibe.run` to execute
|
|
288
|
-
|
|
289
|
-
## Notes
|
|
290
|
-
|
|
291
|
-
- This command is specialized for complex problems. For simple tasks, direct requests are more efficient.
|
|
292
|
-
- Reasoning process may take time; allow sufficient time.
|
|
293
|
-
- Reasoning results are recommendations; final decision is user's.
|
|
294
|
-
- Automatically uses MCP tools, so hi-ai server must be connected.
|
|
295
|
-
|
|
296
|
-
## Related
|
|
297
|
-
|
|
298
|
-
- [Reasoning Agent Guide](~/.claude/agents/reasoning-agent.md)
|
|
299
|
-
- [MCP hi-ai Guide](~/.claude/skills/tools/mcp-hi-ai-guide.md)
|
|
300
|
-
- [/vibe.analyze](vibe.analyze.md)
|
|
301
|
-
- [/vibe.spec](vibe.spec.md)
|
|
302
|
-
- [/vibe.plan](vibe.plan.md)
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
ARGUMENTS: $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Apply systematic reasoning framework to complex problems
|
|
3
|
+
argument-hint: "problem description"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /vibe.reason
|
|
7
|
+
|
|
8
|
+
Apply 9-step reasoning framework to complex problems (Reasoning Agent).
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/vibe.reason "problem description"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
|
|
18
|
+
Use systematic 9-step reasoning framework to logically analyze complex problems and derive optimal solutions.
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Use in situations like:
|
|
23
|
+
|
|
24
|
+
1. **Complex bug debugging**
|
|
25
|
+
- Root cause unclear
|
|
26
|
+
- Need to systematically verify multiple hypotheses
|
|
27
|
+
|
|
28
|
+
2. **Architecture design decisions**
|
|
29
|
+
- Need to choose optimal option among several
|
|
30
|
+
- Need to comprehensively evaluate constraints and risks
|
|
31
|
+
|
|
32
|
+
3. **Performance optimization**
|
|
33
|
+
- Bottleneck may be in multiple places
|
|
34
|
+
- Need step-by-step optimization strategy
|
|
35
|
+
|
|
36
|
+
4. **Refactoring planning**
|
|
37
|
+
- Need to systematically analyze legacy code complexity
|
|
38
|
+
- Need gradual refactoring strategy
|
|
39
|
+
|
|
40
|
+
5. **Requirements analysis**
|
|
41
|
+
- Need to reconcile conflicting requirements
|
|
42
|
+
- Need to discover missing requirements
|
|
43
|
+
|
|
44
|
+
## Process
|
|
45
|
+
|
|
46
|
+
### 1. Logical Dependencies and Constraints
|
|
47
|
+
- Check policies, rules, prerequisites
|
|
48
|
+
- Optimize task order (identify dependencies)
|
|
49
|
+
- Apply user constraints first
|
|
50
|
+
|
|
51
|
+
### 2. Risk Assessment
|
|
52
|
+
- Analyze action consequences
|
|
53
|
+
- Check rollback possibility
|
|
54
|
+
- Review compatibility, security, performance risks
|
|
55
|
+
|
|
56
|
+
### 3. Inductive Reasoning and Hypothesis Exploration
|
|
57
|
+
- Generate hypotheses about root cause
|
|
58
|
+
- Prioritize by likelihood
|
|
59
|
+
- Present verification method for each hypothesis
|
|
60
|
+
|
|
61
|
+
### 4. Result Evaluation and Adaptability
|
|
62
|
+
- Modify plan based on observations
|
|
63
|
+
- Generate new hypothesis when disproved
|
|
64
|
+
- Determine backtracking need
|
|
65
|
+
|
|
66
|
+
### 5. Information Availability
|
|
67
|
+
- Identify all available tools
|
|
68
|
+
- Reference relevant policy/rule documents
|
|
69
|
+
- Restore previous context
|
|
70
|
+
- Distinguish items needing user confirmation
|
|
71
|
+
|
|
72
|
+
### 6. Precision and Evidence
|
|
73
|
+
- Cite exact source when referencing policies
|
|
74
|
+
- Include filename:line when referencing code
|
|
75
|
+
- Provide exact metric numbers
|
|
76
|
+
|
|
77
|
+
### 7. Completeness
|
|
78
|
+
- Integrate all requirements, options, preferences
|
|
79
|
+
- Avoid premature conclusions
|
|
80
|
+
- Explore multiple alternatives
|
|
81
|
+
|
|
82
|
+
### 8. Persistence and Patience
|
|
83
|
+
- Intelligently retry temporary errors
|
|
84
|
+
- Solve problems through strategy changes
|
|
85
|
+
- Continue until all reasoning steps complete
|
|
86
|
+
|
|
87
|
+
### 9. Response Suppression
|
|
88
|
+
- Act only after reasoning complete
|
|
89
|
+
- Document reasoning process for complex decisions
|
|
90
|
+
- Ensure safety through step-by-step execution
|
|
91
|
+
|
|
92
|
+
## MCP Tools Integration
|
|
93
|
+
|
|
94
|
+
This command automatically uses these MCP tools:
|
|
95
|
+
|
|
96
|
+
- **apply_reasoning_framework**: Apply 9-step reasoning framework
|
|
97
|
+
- **create_thinking_chain**: Create sequential thinking chain
|
|
98
|
+
- **analyze_problem**: Analyze problem root cause
|
|
99
|
+
- **step_by_step_analysis**: Detailed step-by-step analysis
|
|
100
|
+
- **recall_memory**: Restore previous context
|
|
101
|
+
- **find_symbol / find_references**: Identify code dependencies
|
|
102
|
+
|
|
103
|
+
## Output Format
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
# Reasoning Framework Analysis
|
|
107
|
+
|
|
108
|
+
**Problem**: [problem description]
|
|
109
|
+
**Context**: [relevant information]
|
|
110
|
+
**Steps Applied**: 9/9
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 1. Logical Dependencies and Constraints
|
|
115
|
+
|
|
116
|
+
**Key Questions**:
|
|
117
|
+
- What policies or required rules apply?
|
|
118
|
+
- Should task order be rearranged?
|
|
119
|
+
- Required prerequisites or information?
|
|
120
|
+
- Explicit user constraints?
|
|
121
|
+
|
|
122
|
+
**Constraint Analysis**:
|
|
123
|
+
[analysis content]
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 2. Risk Assessment
|
|
128
|
+
|
|
129
|
+
...
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Summary
|
|
134
|
+
|
|
135
|
+
[Overall reasoning results summary and recommendations]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
### Example 1: Complex Bug Debugging
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
User: /vibe.reason "After user login, profile page intermittently returns 500 error. Log shows 'TypeError: Cannot read property id of undefined'"
|
|
144
|
+
|
|
145
|
+
AI: Analyzing this problem with 9-step reasoning framework.
|
|
146
|
+
|
|
147
|
+
# Reasoning Framework Analysis
|
|
148
|
+
|
|
149
|
+
**Problem**: Intermittent 500 error on profile page after login (TypeError: Cannot read property 'id' of undefined)
|
|
150
|
+
**Context**: Intermittent occurrence, happens after successful login
|
|
151
|
+
**Steps Applied**: 9/9
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 1. Logical Dependencies and Constraints
|
|
156
|
+
|
|
157
|
+
**Constraint Analysis**:
|
|
158
|
+
- Policy/Rules: Need to check auth/authz system policies
|
|
159
|
+
- Task Order: Verify login → session creation → profile fetch order
|
|
160
|
+
- Prerequisites: Need to identify error reproduction conditions
|
|
161
|
+
- User Constraints: Production environment limits debugging tools
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 2. Risk Assessment
|
|
166
|
+
|
|
167
|
+
**Risk Assessment**:
|
|
168
|
+
- Task type: Debugging (medium risk - logging low risk, DB changes high risk)
|
|
169
|
+
- Rollback possibility: Adding logs easy to rollback
|
|
170
|
+
- Compatibility risk: Session structure changes affect existing users
|
|
171
|
+
- Security risk: Excessive logging may expose sensitive info
|
|
172
|
+
- Performance risk: Additional logging minimal impact
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
177
|
+
|
|
178
|
+
**Hypothesis Generation**:
|
|
179
|
+
1. **Hypothesis 1: Incomplete session data** (Likelihood: High)
|
|
180
|
+
- Evidence: Intermittent = timing issue or data consistency problem
|
|
181
|
+
- Verification: Add logging to session save logic, check Redis connection
|
|
182
|
+
|
|
183
|
+
2. **Hypothesis 2: Async processing order issue** (Likelihood: Medium)
|
|
184
|
+
- Evidence: undefined = accessing data before load
|
|
185
|
+
- Verification: Check Promise chain in profile API, check for missing await
|
|
186
|
+
|
|
187
|
+
3. **Hypothesis 3: DB query returns null** (Likelihood: Low)
|
|
188
|
+
- Evidence: User info fetch fails only under certain conditions
|
|
189
|
+
- Verification: Check profile query logs, review foreign key constraints
|
|
190
|
+
|
|
191
|
+
**Priority**: Verify in order of likelihood, don't completely rule out low probability
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
[Additional steps 4-9 analysis...]
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Summary
|
|
200
|
+
|
|
201
|
+
Analyzed profile page 500 error after login through 9-step reasoning framework.
|
|
202
|
+
|
|
203
|
+
**Key Findings**:
|
|
204
|
+
- Most likely cause: Incomplete session data (Redis connection issue or session save timing)
|
|
205
|
+
- Verification priority: 1) Add session save logic logging → 2) Review async processing → 3) Check DB queries
|
|
206
|
+
|
|
207
|
+
**Recommended Actions**:
|
|
208
|
+
1. Immediate: Add detailed logging to session save/fetch (low risk)
|
|
209
|
+
2. Short-term: Code review async processing (Promise, await check)
|
|
210
|
+
3. Medium-term: Strengthen session store monitoring (Redis connection, memory)
|
|
211
|
+
|
|
212
|
+
**Next Steps**:
|
|
213
|
+
Check `profile_controller.ts` → Add try-catch and logging to session processing logic → Identify reproduction conditions
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Example 2: Architecture Design Decision
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
User: /vibe.reason "Want to add real-time notification feature. Should I use WebSocket, SSE, or Long Polling?"
|
|
220
|
+
|
|
221
|
+
AI: [Systematically analyze constraints, risks, pros/cons of each option through 9-step framework, recommend optimal choice for project situation]
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Integration with Other Commands
|
|
225
|
+
|
|
226
|
+
### With /vibe.spec
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
# 1. Collect requirements
|
|
230
|
+
/vibe.spec "real-time notifications"
|
|
231
|
+
|
|
232
|
+
# 2. When technical decision needed
|
|
233
|
+
/vibe.reason "Choosing WebSocket vs SSE vs Long Polling for real-time notifications"
|
|
234
|
+
|
|
235
|
+
# 3. Update SPEC document and create plan
|
|
236
|
+
/vibe.plan "real-time notifications"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### With /vibe.analyze
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
# 1. Discover issue through code analysis
|
|
243
|
+
/vibe.analyze --code
|
|
244
|
+
|
|
245
|
+
# 2. Analyze discovered issue with reasoning framework
|
|
246
|
+
/vibe.reason "Refactoring strategy to reduce users_service.py Cyclomatic Complexity from 15 to under 10"
|
|
247
|
+
|
|
248
|
+
# 3. Execute refactoring
|
|
249
|
+
/vibe.run "Task: Refactor users_service.py"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Agent Configuration
|
|
253
|
+
|
|
254
|
+
This command uses `~/.claude/agents/reasoning-agent.md`.
|
|
255
|
+
|
|
256
|
+
**Agent Role**:
|
|
257
|
+
- Systematic reasoning and problem-solving expert
|
|
258
|
+
- Logically analyze complex problems
|
|
259
|
+
- Derive optimal solutions considering all relevant factors
|
|
260
|
+
|
|
261
|
+
**Agent Features**:
|
|
262
|
+
- Apply 9-step reasoning framework
|
|
263
|
+
- Hypothesis-based approach
|
|
264
|
+
- Risk assessment and mitigation strategies
|
|
265
|
+
- Precise evidence and source citation
|
|
266
|
+
|
|
267
|
+
## Best Practices
|
|
268
|
+
|
|
269
|
+
1. **Describe problem specifically**
|
|
270
|
+
- ❌ "There's a bug"
|
|
271
|
+
- ✅ "After login, profile page intermittently returns 500 error. Error log: TypeError: Cannot read property 'id' of undefined"
|
|
272
|
+
|
|
273
|
+
2. **Include context**
|
|
274
|
+
- Occurrence conditions (always? intermittent? specific conditions only?)
|
|
275
|
+
- Relevant tech stack
|
|
276
|
+
- Solutions already tried
|
|
277
|
+
|
|
278
|
+
3. **Save reasoning results to memory**
|
|
279
|
+
- For complex problems, save reasoning results with `save_memory`
|
|
280
|
+
- Reference later with `recall_memory`
|
|
281
|
+
|
|
282
|
+
4. **Verify step by step**
|
|
283
|
+
- Verify hypotheses suggested by reasoning framework in order
|
|
284
|
+
- Feedback each verification result to agent
|
|
285
|
+
|
|
286
|
+
5. **Combine with other commands**
|
|
287
|
+
- `/vibe.analyze` to understand situation → `/vibe.reason` to analyze solution → `/vibe.run` to execute
|
|
288
|
+
|
|
289
|
+
## Notes
|
|
290
|
+
|
|
291
|
+
- This command is specialized for complex problems. For simple tasks, direct requests are more efficient.
|
|
292
|
+
- Reasoning process may take time; allow sufficient time.
|
|
293
|
+
- Reasoning results are recommendations; final decision is user's.
|
|
294
|
+
- Automatically uses MCP tools, so hi-ai server must be connected.
|
|
295
|
+
|
|
296
|
+
## Related
|
|
297
|
+
|
|
298
|
+
- [Reasoning Agent Guide](~/.claude/agents/reasoning-agent.md)
|
|
299
|
+
- [MCP hi-ai Guide](~/.claude/skills/tools/mcp-hi-ai-guide.md)
|
|
300
|
+
- [/vibe.analyze](vibe.analyze.md)
|
|
301
|
+
- [/vibe.spec](vibe.spec.md)
|
|
302
|
+
- [/vibe.plan](vibe.plan.md)
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
ARGUMENTS: $ARGUMENTS
|