@su-record/vibe 2.6.41 → 2.6.43
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/.env +1 -1
- package/commands/vibe.analyze.md +373 -373
- package/commands/vibe.reason.md +333 -333
- package/commands/vibe.review.md +555 -555
- package/commands/vibe.run.md +1922 -1922
- package/commands/vibe.spec.md +1195 -1195
- package/commands/vibe.trace.md +209 -209
- package/commands/vibe.verify.md +414 -414
- package/dist/cli/postinstall/inline-skills.js +1 -1
- package/dist/cli/postinstall/inline-skills.js.map +1 -1
- package/dist/cli/setup/GlobalInstaller.d.ts +7 -0
- package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -1
- package/dist/cli/setup/GlobalInstaller.js +45 -0
- package/dist/cli/setup/GlobalInstaller.js.map +1 -1
- package/dist/infra/lib/SkillRepository.d.ts.map +1 -1
- package/dist/infra/lib/SkillRepository.js +5 -4
- package/dist/infra/lib/SkillRepository.js.map +1 -1
- package/dist/infra/lib/gpt/constants.d.ts +1 -1
- package/dist/infra/lib/gpt/constants.d.ts.map +1 -1
- package/dist/infra/lib/gpt/constants.js +1 -1
- package/dist/infra/lib/gpt/constants.js.map +1 -1
- package/package.json +2 -2
- package/skills/core-capabilities/SKILL.md +164 -164
- package/skills/parallel-research/SKILL.md +80 -80
package/commands/vibe.reason.md
CHANGED
|
@@ -1,333 +1,333 @@
|
|
|
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.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
/vibe.reason "problem description"
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
> **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
|
|
17
|
-
|
|
18
|
-
## When to Use
|
|
19
|
-
|
|
20
|
-
1. **Complex bug debugging** - Root cause unclear, need systematic hypothesis verification
|
|
21
|
-
2. **Architecture design decisions** - Choose optimal option among several
|
|
22
|
-
3. **Performance optimization** - Bottleneck may be in multiple places
|
|
23
|
-
4. **Refactoring planning** - Systematically analyze legacy code complexity
|
|
24
|
-
5. **Requirements analysis** - Reconcile conflicting requirements
|
|
25
|
-
|
|
26
|
-
## 9-Step Reasoning Framework
|
|
27
|
-
|
|
28
|
-
### 1. Logical Dependencies and Constraints
|
|
29
|
-
- Check policies, rules, prerequisites
|
|
30
|
-
- Optimize task order (identify dependencies)
|
|
31
|
-
- Apply user constraints first
|
|
32
|
-
|
|
33
|
-
### 2. Risk Assessment
|
|
34
|
-
- Analyze action consequences
|
|
35
|
-
- Check rollback possibility
|
|
36
|
-
- Review compatibility, security, performance risks
|
|
37
|
-
|
|
38
|
-
### 3. Inductive Reasoning and Hypothesis Exploration
|
|
39
|
-
- Generate hypotheses about root cause
|
|
40
|
-
- Prioritize by likelihood
|
|
41
|
-
- Present verification method for each hypothesis
|
|
42
|
-
|
|
43
|
-
### 4. Result Evaluation and Adaptability
|
|
44
|
-
- Modify plan based on observations
|
|
45
|
-
- Generate new hypothesis when disproved
|
|
46
|
-
- Determine backtracking need
|
|
47
|
-
|
|
48
|
-
### 5. Information Availability
|
|
49
|
-
- Identify all available tools
|
|
50
|
-
- Reference relevant policy/rule documents
|
|
51
|
-
- Restore previous context
|
|
52
|
-
- Distinguish items needing user confirmation
|
|
53
|
-
|
|
54
|
-
### 6. Precision and Evidence
|
|
55
|
-
- Cite exact source when referencing policies
|
|
56
|
-
- Include filename:line when referencing code
|
|
57
|
-
- Provide exact metric numbers
|
|
58
|
-
|
|
59
|
-
### 7. Completeness
|
|
60
|
-
- Integrate all requirements, options, preferences
|
|
61
|
-
- Avoid premature conclusions
|
|
62
|
-
- Explore multiple alternatives
|
|
63
|
-
|
|
64
|
-
### 8. Persistence and Patience
|
|
65
|
-
- Intelligently retry temporary errors
|
|
66
|
-
- Solve problems through strategy changes
|
|
67
|
-
- Continue until all reasoning steps complete
|
|
68
|
-
|
|
69
|
-
### 9. Response Suppression
|
|
70
|
-
- Act only after reasoning complete
|
|
71
|
-
- Document reasoning process for complex decisions
|
|
72
|
-
- Ensure safety through step-by-step execution
|
|
73
|
-
|
|
74
|
-
## Output Format
|
|
75
|
-
|
|
76
|
-
```markdown
|
|
77
|
-
# Reasoning Framework Analysis
|
|
78
|
-
|
|
79
|
-
**Problem**: [problem description]
|
|
80
|
-
**Context**: [relevant information]
|
|
81
|
-
**Steps Applied**: 9/9
|
|
82
|
-
**⏱️ Started**: {start_time}
|
|
83
|
-
**⏱️ Completed**: {getCurrentTime 결과}
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## 1. Logical Dependencies and Constraints
|
|
88
|
-
|
|
89
|
-
**Constraint Analysis**:
|
|
90
|
-
[analysis content]
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## 2. Risk Assessment
|
|
95
|
-
|
|
96
|
-
**Risk Assessment**:
|
|
97
|
-
- Task type: [risk level]
|
|
98
|
-
- Rollback possibility: [assessment]
|
|
99
|
-
- Compatibility/Security/Performance risks
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
104
|
-
|
|
105
|
-
**Hypothesis Generation**:
|
|
106
|
-
1. **Hypothesis 1**: [description] (Likelihood: High/Medium/Low)
|
|
107
|
-
- Evidence: [supporting evidence]
|
|
108
|
-
- Verification: [how to verify]
|
|
109
|
-
|
|
110
|
-
2. **Hypothesis 2**: ...
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
[Steps 4-9...]
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Summary
|
|
119
|
-
|
|
120
|
-
[Overall reasoning results summary and recommendations]
|
|
121
|
-
|
|
122
|
-
**Recommended Actions**:
|
|
123
|
-
1. Immediate: [low risk action]
|
|
124
|
-
2. Short-term: [medium priority]
|
|
125
|
-
3. Medium-term: [long-term fix]
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Example
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
User: /vibe.reason "After user login, profile page intermittently returns 500 error"
|
|
132
|
-
|
|
133
|
-
AI: Analyzing with 9-step reasoning framework...
|
|
134
|
-
|
|
135
|
-
# Reasoning Framework Analysis
|
|
136
|
-
|
|
137
|
-
**Problem**: Intermittent 500 error on profile page after login
|
|
138
|
-
**Context**: Intermittent occurrence, happens after successful login
|
|
139
|
-
|
|
140
|
-
## 1. Logical Dependencies and Constraints
|
|
141
|
-
|
|
142
|
-
**Constraint Analysis**:
|
|
143
|
-
- Policy/Rules: Need to check auth/authz system policies
|
|
144
|
-
- Task Order: Verify login -> session creation -> profile fetch order
|
|
145
|
-
- Prerequisites: Need to identify error reproduction conditions
|
|
146
|
-
|
|
147
|
-
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
148
|
-
|
|
149
|
-
**Hypothesis Generation**:
|
|
150
|
-
1. **Hypothesis 1: Incomplete session data** (Likelihood: High)
|
|
151
|
-
- Evidence: Intermittent = timing issue or data consistency problem
|
|
152
|
-
- Verification: Add logging to session save logic
|
|
153
|
-
|
|
154
|
-
2. **Hypothesis 2: Async processing order issue** (Likelihood: Medium)
|
|
155
|
-
- Evidence: undefined = accessing data before load
|
|
156
|
-
- Verification: Check Promise chain, missing await
|
|
157
|
-
|
|
158
|
-
## Summary
|
|
159
|
-
|
|
160
|
-
**Key Findings**:
|
|
161
|
-
- Most likely cause: Incomplete session data
|
|
162
|
-
- Verification priority: 1) Session logging -> 2) Async review -> 3) DB check
|
|
163
|
-
|
|
164
|
-
**Recommended Actions**:
|
|
165
|
-
1. Immediate: Add detailed logging to session save/fetch
|
|
166
|
-
2. Short-term: Code review async processing
|
|
167
|
-
3. Medium-term: Strengthen session store monitoring
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Best Practices
|
|
171
|
-
|
|
172
|
-
1. **Describe problem specifically**
|
|
173
|
-
- Bad: "There's a bug"
|
|
174
|
-
- Good: "After login, profile page intermittently returns 500 error"
|
|
175
|
-
|
|
176
|
-
2. **Include context**
|
|
177
|
-
- Occurrence conditions (always? intermittent?)
|
|
178
|
-
- Relevant tech stack
|
|
179
|
-
- Solutions already tried
|
|
180
|
-
|
|
181
|
-
3. **Verify step by step**
|
|
182
|
-
- Verify hypotheses in order of likelihood
|
|
183
|
-
- Feedback each verification result
|
|
184
|
-
|
|
185
|
-
## Core Tools (Reasoning Support)
|
|
186
|
-
|
|
187
|
-
### Tool Invocation
|
|
188
|
-
|
|
189
|
-
All tools are called via:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
node -e "import('
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Recommended Tools for Reasoning
|
|
196
|
-
|
|
197
|
-
| Tool | Purpose | When to Use |
|
|
198
|
-
|------|---------|-------------|
|
|
199
|
-
| `findSymbol` | Find symbol definitions | Locate potential problem areas |
|
|
200
|
-
| `findReferences` | Find all references | Trace data/control flow |
|
|
201
|
-
| `analyzeComplexity` | Complexity analysis | Identify high-risk complex code |
|
|
202
|
-
| `saveMemory` | Save reasoning progress | Store hypothesis verification results |
|
|
203
|
-
| `recallMemory` | Recall saved memory | Retrieve previous reasoning context |
|
|
204
|
-
|
|
205
|
-
### Example Tool Usage in Reasoning
|
|
206
|
-
|
|
207
|
-
**1. Find potential problem source:**
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
node -e "import('
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
**2. Trace references to understand flow:**
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
node -e "import('
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
**3. Save hypothesis verification result:**
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
node -e "import('
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## Quality Gate (Mandatory)
|
|
228
|
-
|
|
229
|
-
### Reasoning Quality Checklist
|
|
230
|
-
|
|
231
|
-
Before completing reasoning analysis, ALL steps must be verified:
|
|
232
|
-
|
|
233
|
-
| Step | Check Item | Weight |
|
|
234
|
-
|------|------------|--------|
|
|
235
|
-
| **Step 1** | Logical dependencies and constraints identified | 10% |
|
|
236
|
-
| **Step 2** | Risk assessment completed with rollback plan | 10% |
|
|
237
|
-
| **Step 3** | At least 3 hypotheses generated with likelihood | 15% |
|
|
238
|
-
| **Step 4** | Verification method defined for each hypothesis | 10% |
|
|
239
|
-
| **Step 5** | All available tools and resources listed | 10% |
|
|
240
|
-
| **Step 6** | Evidence cited with exact sources | 15% |
|
|
241
|
-
| **Step 7** | All alternatives explored | 10% |
|
|
242
|
-
| **Step 8** | Error handling strategy defined | 10% |
|
|
243
|
-
| **Step 9** | Action plan documented before execution | 10% |
|
|
244
|
-
|
|
245
|
-
### Reasoning Score Calculation
|
|
246
|
-
|
|
247
|
-
```
|
|
248
|
-
Score = (completed_steps / 9) × 100
|
|
249
|
-
|
|
250
|
-
Grades:
|
|
251
|
-
- 9/9 (100%): ✅ THOROUGH - Ready to act
|
|
252
|
-
- 7-8/9 (78-89%): ⚠️ ADEQUATE - Minor gaps
|
|
253
|
-
- 5-6/9 (56-67%): ❌ INCOMPLETE - More analysis needed
|
|
254
|
-
- <5/9 (<56%): ❌ INSUFFICIENT - Start over
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Hypothesis Quality Standards
|
|
258
|
-
|
|
259
|
-
Each hypothesis MUST include:
|
|
260
|
-
|
|
261
|
-
| Component | Requirement | Example |
|
|
262
|
-
|-----------|-------------|---------|
|
|
263
|
-
| **Description** | Clear, testable statement | "Session data is incomplete due to race condition" |
|
|
264
|
-
| **Likelihood** | High/Medium/Low with justification | "High - intermittent = timing issue" |
|
|
265
|
-
| **Evidence** | Supporting observations | "Error only on concurrent logins" |
|
|
266
|
-
| **Verification** | Specific test method | "Add logging to session.save()" |
|
|
267
|
-
| **Disproof criteria** | What would rule it out | "Logs show complete data every time" |
|
|
268
|
-
|
|
269
|
-
### Minimum Hypothesis Count
|
|
270
|
-
|
|
271
|
-
| Problem Complexity | Minimum Hypotheses |
|
|
272
|
-
|--------------------|-------------------|
|
|
273
|
-
| Simple (single component) | 2 |
|
|
274
|
-
| Medium (cross-component) | 3 |
|
|
275
|
-
| Complex (system-wide) | 5 |
|
|
276
|
-
|
|
277
|
-
### Evidence Standards
|
|
278
|
-
|
|
279
|
-
All claims MUST include:
|
|
280
|
-
|
|
281
|
-
| Evidence Type | Required Format |
|
|
282
|
-
|---------------|-----------------|
|
|
283
|
-
| Code reference | `filename.ts:L42` |
|
|
284
|
-
| Log/metric | Exact value with timestamp |
|
|
285
|
-
| Documentation | Document name + section |
|
|
286
|
-
| Prior knowledge | Memory key or conversation reference |
|
|
287
|
-
|
|
288
|
-
### Risk Assessment Matrix
|
|
289
|
-
|
|
290
|
-
| Risk Level | Rollback Required | Approval Required |
|
|
291
|
-
|------------|-------------------|-------------------|
|
|
292
|
-
| **Low** | Optional | No |
|
|
293
|
-
| **Medium** | Yes, automated | No |
|
|
294
|
-
| **High** | Yes, tested | User confirmation |
|
|
295
|
-
| **Critical** | Yes, verified | User + backup plan |
|
|
296
|
-
|
|
297
|
-
### Forbidden Reasoning Patterns
|
|
298
|
-
|
|
299
|
-
| Pattern | Issue | Required Fix |
|
|
300
|
-
|---------|-------|--------------|
|
|
301
|
-
| "Probably X" without evidence | Unsubstantiated claim | Add supporting evidence |
|
|
302
|
-
| Single hypothesis | Tunnel vision | Generate alternatives |
|
|
303
|
-
| Skipping risk assessment | Dangerous changes | Always assess risk |
|
|
304
|
-
| "I think" without verification | Assumption | Verify before claiming |
|
|
305
|
-
| Acting before reasoning complete | Premature action | Complete all 9 steps |
|
|
306
|
-
|
|
307
|
-
### Reasoning Output Requirements
|
|
308
|
-
|
|
309
|
-
Every reasoning analysis MUST include:
|
|
310
|
-
|
|
311
|
-
1. **Problem Statement**
|
|
312
|
-
- Clear description
|
|
313
|
-
- Context and constraints
|
|
314
|
-
- Steps applied count (X/9)
|
|
315
|
-
|
|
316
|
-
2. **Hypothesis Table**
|
|
317
|
-
- Ranked by likelihood
|
|
318
|
-
- All 5 components per hypothesis
|
|
319
|
-
- Verification status
|
|
320
|
-
|
|
321
|
-
3. **Risk Assessment**
|
|
322
|
-
- Risk level classification
|
|
323
|
-
- Rollback possibility
|
|
324
|
-
- Approval requirements
|
|
325
|
-
|
|
326
|
-
4. **Recommended Actions**
|
|
327
|
-
- Immediate (low risk, high confidence)
|
|
328
|
-
- Short-term (medium priority)
|
|
329
|
-
- Long-term (systemic fix)
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
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.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/vibe.reason "problem description"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
1. **Complex bug debugging** - Root cause unclear, need systematic hypothesis verification
|
|
21
|
+
2. **Architecture design decisions** - Choose optimal option among several
|
|
22
|
+
3. **Performance optimization** - Bottleneck may be in multiple places
|
|
23
|
+
4. **Refactoring planning** - Systematically analyze legacy code complexity
|
|
24
|
+
5. **Requirements analysis** - Reconcile conflicting requirements
|
|
25
|
+
|
|
26
|
+
## 9-Step Reasoning Framework
|
|
27
|
+
|
|
28
|
+
### 1. Logical Dependencies and Constraints
|
|
29
|
+
- Check policies, rules, prerequisites
|
|
30
|
+
- Optimize task order (identify dependencies)
|
|
31
|
+
- Apply user constraints first
|
|
32
|
+
|
|
33
|
+
### 2. Risk Assessment
|
|
34
|
+
- Analyze action consequences
|
|
35
|
+
- Check rollback possibility
|
|
36
|
+
- Review compatibility, security, performance risks
|
|
37
|
+
|
|
38
|
+
### 3. Inductive Reasoning and Hypothesis Exploration
|
|
39
|
+
- Generate hypotheses about root cause
|
|
40
|
+
- Prioritize by likelihood
|
|
41
|
+
- Present verification method for each hypothesis
|
|
42
|
+
|
|
43
|
+
### 4. Result Evaluation and Adaptability
|
|
44
|
+
- Modify plan based on observations
|
|
45
|
+
- Generate new hypothesis when disproved
|
|
46
|
+
- Determine backtracking need
|
|
47
|
+
|
|
48
|
+
### 5. Information Availability
|
|
49
|
+
- Identify all available tools
|
|
50
|
+
- Reference relevant policy/rule documents
|
|
51
|
+
- Restore previous context
|
|
52
|
+
- Distinguish items needing user confirmation
|
|
53
|
+
|
|
54
|
+
### 6. Precision and Evidence
|
|
55
|
+
- Cite exact source when referencing policies
|
|
56
|
+
- Include filename:line when referencing code
|
|
57
|
+
- Provide exact metric numbers
|
|
58
|
+
|
|
59
|
+
### 7. Completeness
|
|
60
|
+
- Integrate all requirements, options, preferences
|
|
61
|
+
- Avoid premature conclusions
|
|
62
|
+
- Explore multiple alternatives
|
|
63
|
+
|
|
64
|
+
### 8. Persistence and Patience
|
|
65
|
+
- Intelligently retry temporary errors
|
|
66
|
+
- Solve problems through strategy changes
|
|
67
|
+
- Continue until all reasoning steps complete
|
|
68
|
+
|
|
69
|
+
### 9. Response Suppression
|
|
70
|
+
- Act only after reasoning complete
|
|
71
|
+
- Document reasoning process for complex decisions
|
|
72
|
+
- Ensure safety through step-by-step execution
|
|
73
|
+
|
|
74
|
+
## Output Format
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
# Reasoning Framework Analysis
|
|
78
|
+
|
|
79
|
+
**Problem**: [problem description]
|
|
80
|
+
**Context**: [relevant information]
|
|
81
|
+
**Steps Applied**: 9/9
|
|
82
|
+
**⏱️ Started**: {start_time}
|
|
83
|
+
**⏱️ Completed**: {getCurrentTime 결과}
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 1. Logical Dependencies and Constraints
|
|
88
|
+
|
|
89
|
+
**Constraint Analysis**:
|
|
90
|
+
[analysis content]
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 2. Risk Assessment
|
|
95
|
+
|
|
96
|
+
**Risk Assessment**:
|
|
97
|
+
- Task type: [risk level]
|
|
98
|
+
- Rollback possibility: [assessment]
|
|
99
|
+
- Compatibility/Security/Performance risks
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
104
|
+
|
|
105
|
+
**Hypothesis Generation**:
|
|
106
|
+
1. **Hypothesis 1**: [description] (Likelihood: High/Medium/Low)
|
|
107
|
+
- Evidence: [supporting evidence]
|
|
108
|
+
- Verification: [how to verify]
|
|
109
|
+
|
|
110
|
+
2. **Hypothesis 2**: ...
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
[Steps 4-9...]
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Summary
|
|
119
|
+
|
|
120
|
+
[Overall reasoning results summary and recommendations]
|
|
121
|
+
|
|
122
|
+
**Recommended Actions**:
|
|
123
|
+
1. Immediate: [low risk action]
|
|
124
|
+
2. Short-term: [medium priority]
|
|
125
|
+
3. Medium-term: [long-term fix]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Example
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
User: /vibe.reason "After user login, profile page intermittently returns 500 error"
|
|
132
|
+
|
|
133
|
+
AI: Analyzing with 9-step reasoning framework...
|
|
134
|
+
|
|
135
|
+
# Reasoning Framework Analysis
|
|
136
|
+
|
|
137
|
+
**Problem**: Intermittent 500 error on profile page after login
|
|
138
|
+
**Context**: Intermittent occurrence, happens after successful login
|
|
139
|
+
|
|
140
|
+
## 1. Logical Dependencies and Constraints
|
|
141
|
+
|
|
142
|
+
**Constraint Analysis**:
|
|
143
|
+
- Policy/Rules: Need to check auth/authz system policies
|
|
144
|
+
- Task Order: Verify login -> session creation -> profile fetch order
|
|
145
|
+
- Prerequisites: Need to identify error reproduction conditions
|
|
146
|
+
|
|
147
|
+
## 3. Inductive Reasoning and Hypothesis Exploration
|
|
148
|
+
|
|
149
|
+
**Hypothesis Generation**:
|
|
150
|
+
1. **Hypothesis 1: Incomplete session data** (Likelihood: High)
|
|
151
|
+
- Evidence: Intermittent = timing issue or data consistency problem
|
|
152
|
+
- Verification: Add logging to session save logic
|
|
153
|
+
|
|
154
|
+
2. **Hypothesis 2: Async processing order issue** (Likelihood: Medium)
|
|
155
|
+
- Evidence: undefined = accessing data before load
|
|
156
|
+
- Verification: Check Promise chain, missing await
|
|
157
|
+
|
|
158
|
+
## Summary
|
|
159
|
+
|
|
160
|
+
**Key Findings**:
|
|
161
|
+
- Most likely cause: Incomplete session data
|
|
162
|
+
- Verification priority: 1) Session logging -> 2) Async review -> 3) DB check
|
|
163
|
+
|
|
164
|
+
**Recommended Actions**:
|
|
165
|
+
1. Immediate: Add detailed logging to session save/fetch
|
|
166
|
+
2. Short-term: Code review async processing
|
|
167
|
+
3. Medium-term: Strengthen session store monitoring
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Best Practices
|
|
171
|
+
|
|
172
|
+
1. **Describe problem specifically**
|
|
173
|
+
- Bad: "There's a bug"
|
|
174
|
+
- Good: "After login, profile page intermittently returns 500 error"
|
|
175
|
+
|
|
176
|
+
2. **Include context**
|
|
177
|
+
- Occurrence conditions (always? intermittent?)
|
|
178
|
+
- Relevant tech stack
|
|
179
|
+
- Solutions already tried
|
|
180
|
+
|
|
181
|
+
3. **Verify step by step**
|
|
182
|
+
- Verify hypotheses in order of likelihood
|
|
183
|
+
- Feedback each verification result
|
|
184
|
+
|
|
185
|
+
## Core Tools (Reasoning Support)
|
|
186
|
+
|
|
187
|
+
### Tool Invocation
|
|
188
|
+
|
|
189
|
+
All tools are called via:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Recommended Tools for Reasoning
|
|
196
|
+
|
|
197
|
+
| Tool | Purpose | When to Use |
|
|
198
|
+
|------|---------|-------------|
|
|
199
|
+
| `findSymbol` | Find symbol definitions | Locate potential problem areas |
|
|
200
|
+
| `findReferences` | Find all references | Trace data/control flow |
|
|
201
|
+
| `analyzeComplexity` | Complexity analysis | Identify high-risk complex code |
|
|
202
|
+
| `saveMemory` | Save reasoning progress | Store hypothesis verification results |
|
|
203
|
+
| `recallMemory` | Recall saved memory | Retrieve previous reasoning context |
|
|
204
|
+
|
|
205
|
+
### Example Tool Usage in Reasoning
|
|
206
|
+
|
|
207
|
+
**1. Find potential problem source:**
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.findSymbol({symbolName: 'getProfile', searchPath: 'src/'}).then(r => console.log(r.content[0].text)))"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**2. Trace references to understand flow:**
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.findReferences({symbolName: 'sessionData', searchPath: 'src/'}).then(r => console.log(r.content[0].text)))"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**3. Save hypothesis verification result:**
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'hypothesis-1-result', value: 'Session save timing issue confirmed - race condition in auth middleware', category: 'reasoning', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Quality Gate (Mandatory)
|
|
228
|
+
|
|
229
|
+
### Reasoning Quality Checklist
|
|
230
|
+
|
|
231
|
+
Before completing reasoning analysis, ALL steps must be verified:
|
|
232
|
+
|
|
233
|
+
| Step | Check Item | Weight |
|
|
234
|
+
|------|------------|--------|
|
|
235
|
+
| **Step 1** | Logical dependencies and constraints identified | 10% |
|
|
236
|
+
| **Step 2** | Risk assessment completed with rollback plan | 10% |
|
|
237
|
+
| **Step 3** | At least 3 hypotheses generated with likelihood | 15% |
|
|
238
|
+
| **Step 4** | Verification method defined for each hypothesis | 10% |
|
|
239
|
+
| **Step 5** | All available tools and resources listed | 10% |
|
|
240
|
+
| **Step 6** | Evidence cited with exact sources | 15% |
|
|
241
|
+
| **Step 7** | All alternatives explored | 10% |
|
|
242
|
+
| **Step 8** | Error handling strategy defined | 10% |
|
|
243
|
+
| **Step 9** | Action plan documented before execution | 10% |
|
|
244
|
+
|
|
245
|
+
### Reasoning Score Calculation
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Score = (completed_steps / 9) × 100
|
|
249
|
+
|
|
250
|
+
Grades:
|
|
251
|
+
- 9/9 (100%): ✅ THOROUGH - Ready to act
|
|
252
|
+
- 7-8/9 (78-89%): ⚠️ ADEQUATE - Minor gaps
|
|
253
|
+
- 5-6/9 (56-67%): ❌ INCOMPLETE - More analysis needed
|
|
254
|
+
- <5/9 (<56%): ❌ INSUFFICIENT - Start over
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Hypothesis Quality Standards
|
|
258
|
+
|
|
259
|
+
Each hypothesis MUST include:
|
|
260
|
+
|
|
261
|
+
| Component | Requirement | Example |
|
|
262
|
+
|-----------|-------------|---------|
|
|
263
|
+
| **Description** | Clear, testable statement | "Session data is incomplete due to race condition" |
|
|
264
|
+
| **Likelihood** | High/Medium/Low with justification | "High - intermittent = timing issue" |
|
|
265
|
+
| **Evidence** | Supporting observations | "Error only on concurrent logins" |
|
|
266
|
+
| **Verification** | Specific test method | "Add logging to session.save()" |
|
|
267
|
+
| **Disproof criteria** | What would rule it out | "Logs show complete data every time" |
|
|
268
|
+
|
|
269
|
+
### Minimum Hypothesis Count
|
|
270
|
+
|
|
271
|
+
| Problem Complexity | Minimum Hypotheses |
|
|
272
|
+
|--------------------|-------------------|
|
|
273
|
+
| Simple (single component) | 2 |
|
|
274
|
+
| Medium (cross-component) | 3 |
|
|
275
|
+
| Complex (system-wide) | 5 |
|
|
276
|
+
|
|
277
|
+
### Evidence Standards
|
|
278
|
+
|
|
279
|
+
All claims MUST include:
|
|
280
|
+
|
|
281
|
+
| Evidence Type | Required Format |
|
|
282
|
+
|---------------|-----------------|
|
|
283
|
+
| Code reference | `filename.ts:L42` |
|
|
284
|
+
| Log/metric | Exact value with timestamp |
|
|
285
|
+
| Documentation | Document name + section |
|
|
286
|
+
| Prior knowledge | Memory key or conversation reference |
|
|
287
|
+
|
|
288
|
+
### Risk Assessment Matrix
|
|
289
|
+
|
|
290
|
+
| Risk Level | Rollback Required | Approval Required |
|
|
291
|
+
|------------|-------------------|-------------------|
|
|
292
|
+
| **Low** | Optional | No |
|
|
293
|
+
| **Medium** | Yes, automated | No |
|
|
294
|
+
| **High** | Yes, tested | User confirmation |
|
|
295
|
+
| **Critical** | Yes, verified | User + backup plan |
|
|
296
|
+
|
|
297
|
+
### Forbidden Reasoning Patterns
|
|
298
|
+
|
|
299
|
+
| Pattern | Issue | Required Fix |
|
|
300
|
+
|---------|-------|--------------|
|
|
301
|
+
| "Probably X" without evidence | Unsubstantiated claim | Add supporting evidence |
|
|
302
|
+
| Single hypothesis | Tunnel vision | Generate alternatives |
|
|
303
|
+
| Skipping risk assessment | Dangerous changes | Always assess risk |
|
|
304
|
+
| "I think" without verification | Assumption | Verify before claiming |
|
|
305
|
+
| Acting before reasoning complete | Premature action | Complete all 9 steps |
|
|
306
|
+
|
|
307
|
+
### Reasoning Output Requirements
|
|
308
|
+
|
|
309
|
+
Every reasoning analysis MUST include:
|
|
310
|
+
|
|
311
|
+
1. **Problem Statement**
|
|
312
|
+
- Clear description
|
|
313
|
+
- Context and constraints
|
|
314
|
+
- Steps applied count (X/9)
|
|
315
|
+
|
|
316
|
+
2. **Hypothesis Table**
|
|
317
|
+
- Ranked by likelihood
|
|
318
|
+
- All 5 components per hypothesis
|
|
319
|
+
- Verification status
|
|
320
|
+
|
|
321
|
+
3. **Risk Assessment**
|
|
322
|
+
- Risk level classification
|
|
323
|
+
- Rollback possibility
|
|
324
|
+
- Approval requirements
|
|
325
|
+
|
|
326
|
+
4. **Recommended Actions**
|
|
327
|
+
- Immediate (low risk, high confidence)
|
|
328
|
+
- Short-term (medium priority)
|
|
329
|
+
- Long-term (systemic fix)
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
ARGUMENTS: $ARGUMENTS
|