@su-record/vibe 2.6.42 → 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/package.json +1 -1
- package/skills/core-capabilities/SKILL.md +164 -164
- package/skills/parallel-research/SKILL.md +80 -80
package/commands/vibe.analyze.md
CHANGED
|
@@ -1,373 +1,373 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze project or specific feature/module
|
|
3
|
-
argument-hint: "feature-name" or --code or --deps or --arch
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /vibe.analyze
|
|
7
|
-
|
|
8
|
-
Analyze project or specific feature/module.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
/vibe.analyze # Full project quality analysis
|
|
14
|
-
/vibe.analyze "login" # Login related code exploration + context collection
|
|
15
|
-
/vibe.analyze --code # Code quality analysis only
|
|
16
|
-
/vibe.analyze --deps # Dependency analysis only
|
|
17
|
-
/vibe.analyze --arch # Architecture analysis only
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Context Reset
|
|
21
|
-
|
|
22
|
-
**When this command runs, previous conversation is ignored.**
|
|
23
|
-
- Explore and analyze code from scratch like new session
|
|
24
|
-
- Base conversation only on newly collected information from this analysis
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
> **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
|
|
29
|
-
|
|
30
|
-
## Mode 1: Feature/Module Analysis (`/vibe.analyze "feature-name"`)
|
|
31
|
-
|
|
32
|
-
### Goal
|
|
33
|
-
|
|
34
|
-
**Explore all source code** related to user's requested feature/module and **analyze flow** to:
|
|
35
|
-
1. Understand current implementation status
|
|
36
|
-
2. Understand code structure and dependencies
|
|
37
|
-
3. Build context for immediate response to future development/modification requests
|
|
38
|
-
|
|
39
|
-
### Process
|
|
40
|
-
|
|
41
|
-
#### 1. Request Analysis
|
|
42
|
-
|
|
43
|
-
Extract key keywords from user request:
|
|
44
|
-
- Feature name (e.g., login, feed, payment)
|
|
45
|
-
- Action (e.g., create, read, update, delete)
|
|
46
|
-
- Scope (e.g., backend only, frontend only, full)
|
|
47
|
-
|
|
48
|
-
#### 2. Understand Project Structure
|
|
49
|
-
|
|
50
|
-
Read `CLAUDE.md`, `package.json`, `pyproject.toml`, etc. to identify tech stack:
|
|
51
|
-
|
|
52
|
-
**Backend:**
|
|
53
|
-
- FastAPI/Django: `app/api/`, `app/services/`, `app/models/`
|
|
54
|
-
- Express/NestJS: `src/controllers/`, `src/services/`, `src/models/`
|
|
55
|
-
|
|
56
|
-
**Frontend:**
|
|
57
|
-
- React/Next.js: `src/components/`, `src/pages/`, `src/hooks/`
|
|
58
|
-
- Flutter: `lib/screens/`, `lib/services/`, `lib/providers/`
|
|
59
|
-
|
|
60
|
-
#### 3. Explore Related Code (Parallel Sub-Agents)
|
|
61
|
-
|
|
62
|
-
**🚨 MANDATORY: 3개 이상의 Task를 병렬로 실행하세요. 순차 실행은 위반입니다.**
|
|
63
|
-
|
|
64
|
-
**병렬 탐색 패턴 (한 메시지에 모든 Task 호출):**
|
|
65
|
-
|
|
66
|
-
```text
|
|
67
|
-
# 3개 explorer 에이전트 병렬 실행 (single message, multiple tool calls)
|
|
68
|
-
Task(subagent_type="explorer-low", model="haiku",
|
|
69
|
-
prompt="Find all [FEATURE] related API endpoints in this project. List file paths, HTTP methods, routes, and auth requirements.")
|
|
70
|
-
|
|
71
|
-
Task(subagent_type="explorer-low", model="haiku",
|
|
72
|
-
prompt="Find all [FEATURE] related services, business logic, and utility functions. Map dependencies between them.")
|
|
73
|
-
|
|
74
|
-
Task(subagent_type="explorer-low", model="haiku",
|
|
75
|
-
prompt="Find all [FEATURE] related data models, schemas, and database queries. Document relationships and key fields.")
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**추가 탐색 (프로젝트 규모에 따라):**
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
# 대규모 프로젝트 (6+ 관련 파일) — 추가 2개 병렬 실행
|
|
82
|
-
Task(subagent_type="explorer-low", model="haiku",
|
|
83
|
-
prompt="Find all test files related to [FEATURE]. Identify tested vs untested paths.")
|
|
84
|
-
|
|
85
|
-
Task(subagent_type="explorer-low", model="haiku",
|
|
86
|
-
prompt="Analyze [FEATURE] configuration, environment variables, and external integrations.")
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**결과 종합:**
|
|
90
|
-
- 모든 Task 완료 후 결과를 종합하여 Flow Analysis (Step 4) 진행
|
|
91
|
-
- 탐색 결과 기반으로 관련 파일을 직접 Read하여 상세 분석
|
|
92
|
-
|
|
93
|
-
**Fallback (direct tools — 소규모 프로젝트):**
|
|
94
|
-
1. **Glob** to collect related file list
|
|
95
|
-
2. **Grep** to locate code by keyword
|
|
96
|
-
3. **Read** to analyze key files in detail
|
|
97
|
-
|
|
98
|
-
#### 4. Flow Analysis
|
|
99
|
-
|
|
100
|
-
**API Flow:**
|
|
101
|
-
- Endpoint URL and HTTP method
|
|
102
|
-
- Request/response schema
|
|
103
|
-
- Authentication/authorization requirements
|
|
104
|
-
|
|
105
|
-
**Business Logic:**
|
|
106
|
-
- Core methods and roles
|
|
107
|
-
- Validation rules
|
|
108
|
-
- External service integrations
|
|
109
|
-
|
|
110
|
-
**Data Flow:**
|
|
111
|
-
- Related tables/models
|
|
112
|
-
- Relationships (1:N, N:M)
|
|
113
|
-
- Key query patterns
|
|
114
|
-
|
|
115
|
-
#### 5. Output Analysis Results
|
|
116
|
-
|
|
117
|
-
```markdown
|
|
118
|
-
## [feature-name] Analysis Results
|
|
119
|
-
|
|
120
|
-
### Overview
|
|
121
|
-
- **Feature description**: [one-line summary]
|
|
122
|
-
- **Implementation status**: [Complete/In progress/Not implemented]
|
|
123
|
-
- **Related files**: N files
|
|
124
|
-
|
|
125
|
-
### Structure
|
|
126
|
-
|
|
127
|
-
#### API Endpoints
|
|
128
|
-
| Method | Path | Description | Auth |
|
|
129
|
-
|--------|------|-------------|------|
|
|
130
|
-
| POST | /api/v1/auth/login | Login | - |
|
|
131
|
-
|
|
132
|
-
#### Core Services
|
|
133
|
-
- `auth_service.py`: Authentication logic
|
|
134
|
-
- `login()`: Login processing
|
|
135
|
-
- `verify_token()`: Token verification
|
|
136
|
-
|
|
137
|
-
#### Data Models
|
|
138
|
-
- `User`: User table
|
|
139
|
-
- Key fields: id, email, password_hash
|
|
140
|
-
- Relationships: Session (1:N)
|
|
141
|
-
|
|
142
|
-
### Reference File List
|
|
143
|
-
- src/api/auth/router.py:L10-50
|
|
144
|
-
- src/services/auth_service.py:L1-100
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
#### 6. Complete & Next Action
|
|
148
|
-
|
|
149
|
-
After analysis:
|
|
150
|
-
1. Output analysis summary (include `⏱️ Started: {start_time}` and `⏱️ Completed: {getCurrentTime 결과}`)
|
|
151
|
-
2. **Ask user to choose workflow** when development is requested:
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
## Next Steps
|
|
155
|
-
|
|
156
|
-
Choose a workflow to proceed with development:
|
|
157
|
-
|
|
158
|
-
| Task Scope | Recommended Approach |
|
|
159
|
-
|----------|----------|
|
|
160
|
-
| Simple fix (1-2 files) | Plan Mode |
|
|
161
|
-
| Complex feature (3+ files, research/verification needed) | /vibe.spec |
|
|
162
|
-
|
|
163
|
-
1. `/vibe.spec "feature-name"` - VIBE workflow (parallel research + SPEC verification)
|
|
164
|
-
2. Plan Mode - Quick implementation (for simple tasks)
|
|
165
|
-
|
|
166
|
-
Which approach would you like to use?
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
3. Wait for user's choice before proceeding
|
|
170
|
-
4. If user chooses VIBE → wait for `/vibe.spec` command
|
|
171
|
-
5. If user chooses Plan Mode → proceed with EnterPlanMode
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Mode 2: Project Quality Analysis (--code/--deps/--arch)
|
|
176
|
-
|
|
177
|
-
### Analysis Scope
|
|
178
|
-
|
|
179
|
-
- **Default** (`/vibe.analyze`): Full analysis (code + dependencies + architecture)
|
|
180
|
-
- **--code**: Code quality analysis only
|
|
181
|
-
- **--deps**: Dependency analysis only
|
|
182
|
-
- **--arch**: Architecture analysis only
|
|
183
|
-
|
|
184
|
-
### Code Quality Analysis (--code)
|
|
185
|
-
|
|
186
|
-
- Complexity analysis (Cyclomatic Complexity)
|
|
187
|
-
- Code quality validation
|
|
188
|
-
- Coupling/cohesion check
|
|
189
|
-
|
|
190
|
-
### Dependency Analysis (--deps)
|
|
191
|
-
|
|
192
|
-
- Read `package.json` / `pyproject.toml` / `pubspec.yaml`
|
|
193
|
-
- Analyze version conflicts, security vulnerabilities, packages needing updates
|
|
194
|
-
|
|
195
|
-
### Architecture Analysis (--arch)
|
|
196
|
-
|
|
197
|
-
- Find core modules
|
|
198
|
-
- Identify module dependencies
|
|
199
|
-
- Detect circular dependencies, layer violations
|
|
200
|
-
|
|
201
|
-
### Analysis Report
|
|
202
|
-
|
|
203
|
-
`.claude/vibe/reports/analysis-{date}.md`:
|
|
204
|
-
|
|
205
|
-
```markdown
|
|
206
|
-
# Project Analysis Report
|
|
207
|
-
|
|
208
|
-
## Overview
|
|
209
|
-
- Analysis date: 2025-01-06 12:00
|
|
210
|
-
- Analysis scope: Full
|
|
211
|
-
|
|
212
|
-
## Code Quality (85/100)
|
|
213
|
-
- Average complexity: 8.2 (good)
|
|
214
|
-
- High complexity files: 3
|
|
215
|
-
|
|
216
|
-
## Dependencies (92/100)
|
|
217
|
-
- Total packages: 42
|
|
218
|
-
- Updates needed: 3
|
|
219
|
-
|
|
220
|
-
## Architecture (78/100)
|
|
221
|
-
- Circular dependencies: 2 found
|
|
222
|
-
- Layer violations: 1
|
|
223
|
-
|
|
224
|
-
## Improvement Suggestions
|
|
225
|
-
1. Refactor service.py
|
|
226
|
-
2. Apply lodash security patch
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## Core Tools (Semantic Analysis)
|
|
230
|
-
|
|
231
|
-
### Tool Invocation
|
|
232
|
-
|
|
233
|
-
All tools are called via:
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
node -e "import('
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Recommended Tools for Analysis
|
|
240
|
-
|
|
241
|
-
| Tool | Purpose | When to Use |
|
|
242
|
-
|------|---------|-------------|
|
|
243
|
-
| `findSymbol` | Find symbol definitions | Locate function/class implementations |
|
|
244
|
-
| `findReferences` | Find all references | Track usage patterns |
|
|
245
|
-
| `analyzeComplexity` | Complexity analysis | Measure code complexity metrics |
|
|
246
|
-
| `validateCodeQuality` | Quality validation | Check code quality standards |
|
|
247
|
-
| `saveMemory` | Save analysis results | Store analysis findings |
|
|
248
|
-
|
|
249
|
-
### Example Tool Usage in Analysis
|
|
250
|
-
|
|
251
|
-
**1. Find function definition:**
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
node -e "import('
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**2. Analyze complexity:**
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
node -e "import('
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
**3. Validate code quality:**
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
node -e "import('
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
**4. Save analysis results:**
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
node -e "import('
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Quality Gate (Mandatory)
|
|
278
|
-
|
|
279
|
-
### Analysis Quality Checklist
|
|
280
|
-
|
|
281
|
-
Before completing analysis, ALL items must be checked:
|
|
282
|
-
|
|
283
|
-
| Category | Check Item | Weight |
|
|
284
|
-
|----------|------------|--------|
|
|
285
|
-
| **Completeness** | All related files identified | 20% |
|
|
286
|
-
| **Completeness** | All API endpoints documented | 15% |
|
|
287
|
-
| **Completeness** | All data models mapped | 15% |
|
|
288
|
-
| **Accuracy** | File paths verified to exist | 10% |
|
|
289
|
-
| **Accuracy** | Line numbers accurate | 10% |
|
|
290
|
-
| **Depth** | Business logic explained | 10% |
|
|
291
|
-
| **Depth** | Dependencies mapped | 10% |
|
|
292
|
-
| **Actionability** | Next steps clearly defined | 10% |
|
|
293
|
-
|
|
294
|
-
### Analysis Score Calculation
|
|
295
|
-
|
|
296
|
-
```
|
|
297
|
-
Score = Σ(checked items × weight) / 100
|
|
298
|
-
|
|
299
|
-
Grades:
|
|
300
|
-
- 95-100: ✅ EXCELLENT - Comprehensive analysis
|
|
301
|
-
- 90-94: ⚠️ GOOD - Additional exploration recommended
|
|
302
|
-
- 80-89: ⚠️ FAIR - Needs more exploration
|
|
303
|
-
- 0-79: ❌ POOR - Incomplete, re-analyze
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Analysis Depth Levels
|
|
307
|
-
|
|
308
|
-
| Level | Scope | Output |
|
|
309
|
-
|-------|-------|--------|
|
|
310
|
-
| **L1: Surface** | File names, basic structure | File list only |
|
|
311
|
-
| **L2: Structure** | Functions, classes, imports | Structure map |
|
|
312
|
-
| **L3: Logic** | Business logic, data flow | Flow diagrams |
|
|
313
|
-
| **L4: Deep** | Edge cases, dependencies, risks | Full analysis |
|
|
314
|
-
|
|
315
|
-
**Minimum required: L3 for feature analysis, L2 for project overview**
|
|
316
|
-
|
|
317
|
-
### Analysis Output Requirements
|
|
318
|
-
|
|
319
|
-
Every analysis MUST include:
|
|
320
|
-
|
|
321
|
-
1. **Overview Section**
|
|
322
|
-
- Feature description (1 sentence)
|
|
323
|
-
- Implementation status (Complete/In progress/Not implemented)
|
|
324
|
-
- Related file count
|
|
325
|
-
|
|
326
|
-
2. **Structure Section**
|
|
327
|
-
- API endpoints table (Method, Path, Description, Auth)
|
|
328
|
-
- Core services list with key methods
|
|
329
|
-
- Data models with fields and relationships
|
|
330
|
-
|
|
331
|
-
3. **Reference File List**
|
|
332
|
-
- Absolute or relative paths
|
|
333
|
-
- Line number ranges for key sections
|
|
334
|
-
- Brief description per file
|
|
335
|
-
|
|
336
|
-
4. **Next Steps**
|
|
337
|
-
- Workflow choice prompt (Plan Mode vs VIBE)
|
|
338
|
-
- Specific action items if applicable
|
|
339
|
-
|
|
340
|
-
### Forbidden Incomplete Patterns
|
|
341
|
-
|
|
342
|
-
| Pattern | Issue | Required Fix |
|
|
343
|
-
|---------|-------|--------------|
|
|
344
|
-
| "and more..." | Incomplete list | List all items |
|
|
345
|
-
| "etc." | Vague scope | Be specific |
|
|
346
|
-
| "related files" without list | Missing details | Provide file paths |
|
|
347
|
-
| Missing line numbers | Hard to navigate | Add `:L10-50` format |
|
|
348
|
-
| No auth info on endpoints | Security gap | Always specify auth |
|
|
349
|
-
|
|
350
|
-
### Code Quality Analysis Thresholds
|
|
351
|
-
|
|
352
|
-
When running `--code` analysis:
|
|
353
|
-
|
|
354
|
-
| Metric | Good | Warning | Critical |
|
|
355
|
-
|--------|------|---------|----------|
|
|
356
|
-
| Avg Complexity | ≤10 | 11-15 | >15 |
|
|
357
|
-
| Max Function Length | ≤30 | 31-50 | >50 |
|
|
358
|
-
| High Complexity Files | 0 | 1-3 | >3 |
|
|
359
|
-
| Circular Dependencies | 0 | 1 | >1 |
|
|
360
|
-
|
|
361
|
-
### Dependency Analysis Thresholds
|
|
362
|
-
|
|
363
|
-
When running `--deps` analysis:
|
|
364
|
-
|
|
365
|
-
| Metric | Good | Warning | Critical |
|
|
366
|
-
|--------|------|---------|----------|
|
|
367
|
-
| Outdated Packages | 0-3 | 4-10 | >10 |
|
|
368
|
-
| Security Vulnerabilities | 0 | 1-2 (low) | Any high/critical |
|
|
369
|
-
| Major Version Behind | 0 | 1-2 | >2 |
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
ARGUMENTS: $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Analyze project or specific feature/module
|
|
3
|
+
argument-hint: "feature-name" or --code or --deps or --arch
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /vibe.analyze
|
|
7
|
+
|
|
8
|
+
Analyze project or specific feature/module.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/vibe.analyze # Full project quality analysis
|
|
14
|
+
/vibe.analyze "login" # Login related code exploration + context collection
|
|
15
|
+
/vibe.analyze --code # Code quality analysis only
|
|
16
|
+
/vibe.analyze --deps # Dependency analysis only
|
|
17
|
+
/vibe.analyze --arch # Architecture analysis only
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Context Reset
|
|
21
|
+
|
|
22
|
+
**When this command runs, previous conversation is ignored.**
|
|
23
|
+
- Explore and analyze code from scratch like new session
|
|
24
|
+
- Base conversation only on newly collected information from this analysis
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
> **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
|
|
29
|
+
|
|
30
|
+
## Mode 1: Feature/Module Analysis (`/vibe.analyze "feature-name"`)
|
|
31
|
+
|
|
32
|
+
### Goal
|
|
33
|
+
|
|
34
|
+
**Explore all source code** related to user's requested feature/module and **analyze flow** to:
|
|
35
|
+
1. Understand current implementation status
|
|
36
|
+
2. Understand code structure and dependencies
|
|
37
|
+
3. Build context for immediate response to future development/modification requests
|
|
38
|
+
|
|
39
|
+
### Process
|
|
40
|
+
|
|
41
|
+
#### 1. Request Analysis
|
|
42
|
+
|
|
43
|
+
Extract key keywords from user request:
|
|
44
|
+
- Feature name (e.g., login, feed, payment)
|
|
45
|
+
- Action (e.g., create, read, update, delete)
|
|
46
|
+
- Scope (e.g., backend only, frontend only, full)
|
|
47
|
+
|
|
48
|
+
#### 2. Understand Project Structure
|
|
49
|
+
|
|
50
|
+
Read `CLAUDE.md`, `package.json`, `pyproject.toml`, etc. to identify tech stack:
|
|
51
|
+
|
|
52
|
+
**Backend:**
|
|
53
|
+
- FastAPI/Django: `app/api/`, `app/services/`, `app/models/`
|
|
54
|
+
- Express/NestJS: `src/controllers/`, `src/services/`, `src/models/`
|
|
55
|
+
|
|
56
|
+
**Frontend:**
|
|
57
|
+
- React/Next.js: `src/components/`, `src/pages/`, `src/hooks/`
|
|
58
|
+
- Flutter: `lib/screens/`, `lib/services/`, `lib/providers/`
|
|
59
|
+
|
|
60
|
+
#### 3. Explore Related Code (Parallel Sub-Agents)
|
|
61
|
+
|
|
62
|
+
**🚨 MANDATORY: 3개 이상의 Task를 병렬로 실행하세요. 순차 실행은 위반입니다.**
|
|
63
|
+
|
|
64
|
+
**병렬 탐색 패턴 (한 메시지에 모든 Task 호출):**
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
# 3개 explorer 에이전트 병렬 실행 (single message, multiple tool calls)
|
|
68
|
+
Task(subagent_type="explorer-low", model="haiku",
|
|
69
|
+
prompt="Find all [FEATURE] related API endpoints in this project. List file paths, HTTP methods, routes, and auth requirements.")
|
|
70
|
+
|
|
71
|
+
Task(subagent_type="explorer-low", model="haiku",
|
|
72
|
+
prompt="Find all [FEATURE] related services, business logic, and utility functions. Map dependencies between them.")
|
|
73
|
+
|
|
74
|
+
Task(subagent_type="explorer-low", model="haiku",
|
|
75
|
+
prompt="Find all [FEATURE] related data models, schemas, and database queries. Document relationships and key fields.")
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**추가 탐색 (프로젝트 규모에 따라):**
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
# 대규모 프로젝트 (6+ 관련 파일) — 추가 2개 병렬 실행
|
|
82
|
+
Task(subagent_type="explorer-low", model="haiku",
|
|
83
|
+
prompt="Find all test files related to [FEATURE]. Identify tested vs untested paths.")
|
|
84
|
+
|
|
85
|
+
Task(subagent_type="explorer-low", model="haiku",
|
|
86
|
+
prompt="Analyze [FEATURE] configuration, environment variables, and external integrations.")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**결과 종합:**
|
|
90
|
+
- 모든 Task 완료 후 결과를 종합하여 Flow Analysis (Step 4) 진행
|
|
91
|
+
- 탐색 결과 기반으로 관련 파일을 직접 Read하여 상세 분석
|
|
92
|
+
|
|
93
|
+
**Fallback (direct tools — 소규모 프로젝트):**
|
|
94
|
+
1. **Glob** to collect related file list
|
|
95
|
+
2. **Grep** to locate code by keyword
|
|
96
|
+
3. **Read** to analyze key files in detail
|
|
97
|
+
|
|
98
|
+
#### 4. Flow Analysis
|
|
99
|
+
|
|
100
|
+
**API Flow:**
|
|
101
|
+
- Endpoint URL and HTTP method
|
|
102
|
+
- Request/response schema
|
|
103
|
+
- Authentication/authorization requirements
|
|
104
|
+
|
|
105
|
+
**Business Logic:**
|
|
106
|
+
- Core methods and roles
|
|
107
|
+
- Validation rules
|
|
108
|
+
- External service integrations
|
|
109
|
+
|
|
110
|
+
**Data Flow:**
|
|
111
|
+
- Related tables/models
|
|
112
|
+
- Relationships (1:N, N:M)
|
|
113
|
+
- Key query patterns
|
|
114
|
+
|
|
115
|
+
#### 5. Output Analysis Results
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
## [feature-name] Analysis Results
|
|
119
|
+
|
|
120
|
+
### Overview
|
|
121
|
+
- **Feature description**: [one-line summary]
|
|
122
|
+
- **Implementation status**: [Complete/In progress/Not implemented]
|
|
123
|
+
- **Related files**: N files
|
|
124
|
+
|
|
125
|
+
### Structure
|
|
126
|
+
|
|
127
|
+
#### API Endpoints
|
|
128
|
+
| Method | Path | Description | Auth |
|
|
129
|
+
|--------|------|-------------|------|
|
|
130
|
+
| POST | /api/v1/auth/login | Login | - |
|
|
131
|
+
|
|
132
|
+
#### Core Services
|
|
133
|
+
- `auth_service.py`: Authentication logic
|
|
134
|
+
- `login()`: Login processing
|
|
135
|
+
- `verify_token()`: Token verification
|
|
136
|
+
|
|
137
|
+
#### Data Models
|
|
138
|
+
- `User`: User table
|
|
139
|
+
- Key fields: id, email, password_hash
|
|
140
|
+
- Relationships: Session (1:N)
|
|
141
|
+
|
|
142
|
+
### Reference File List
|
|
143
|
+
- src/api/auth/router.py:L10-50
|
|
144
|
+
- src/services/auth_service.py:L1-100
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### 6. Complete & Next Action
|
|
148
|
+
|
|
149
|
+
After analysis:
|
|
150
|
+
1. Output analysis summary (include `⏱️ Started: {start_time}` and `⏱️ Completed: {getCurrentTime 결과}`)
|
|
151
|
+
2. **Ask user to choose workflow** when development is requested:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
## Next Steps
|
|
155
|
+
|
|
156
|
+
Choose a workflow to proceed with development:
|
|
157
|
+
|
|
158
|
+
| Task Scope | Recommended Approach |
|
|
159
|
+
|----------|----------|
|
|
160
|
+
| Simple fix (1-2 files) | Plan Mode |
|
|
161
|
+
| Complex feature (3+ files, research/verification needed) | /vibe.spec |
|
|
162
|
+
|
|
163
|
+
1. `/vibe.spec "feature-name"` - VIBE workflow (parallel research + SPEC verification)
|
|
164
|
+
2. Plan Mode - Quick implementation (for simple tasks)
|
|
165
|
+
|
|
166
|
+
Which approach would you like to use?
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
3. Wait for user's choice before proceeding
|
|
170
|
+
4. If user chooses VIBE → wait for `/vibe.spec` command
|
|
171
|
+
5. If user chooses Plan Mode → proceed with EnterPlanMode
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Mode 2: Project Quality Analysis (--code/--deps/--arch)
|
|
176
|
+
|
|
177
|
+
### Analysis Scope
|
|
178
|
+
|
|
179
|
+
- **Default** (`/vibe.analyze`): Full analysis (code + dependencies + architecture)
|
|
180
|
+
- **--code**: Code quality analysis only
|
|
181
|
+
- **--deps**: Dependency analysis only
|
|
182
|
+
- **--arch**: Architecture analysis only
|
|
183
|
+
|
|
184
|
+
### Code Quality Analysis (--code)
|
|
185
|
+
|
|
186
|
+
- Complexity analysis (Cyclomatic Complexity)
|
|
187
|
+
- Code quality validation
|
|
188
|
+
- Coupling/cohesion check
|
|
189
|
+
|
|
190
|
+
### Dependency Analysis (--deps)
|
|
191
|
+
|
|
192
|
+
- Read `package.json` / `pyproject.toml` / `pubspec.yaml`
|
|
193
|
+
- Analyze version conflicts, security vulnerabilities, packages needing updates
|
|
194
|
+
|
|
195
|
+
### Architecture Analysis (--arch)
|
|
196
|
+
|
|
197
|
+
- Find core modules
|
|
198
|
+
- Identify module dependencies
|
|
199
|
+
- Detect circular dependencies, layer violations
|
|
200
|
+
|
|
201
|
+
### Analysis Report
|
|
202
|
+
|
|
203
|
+
`.claude/vibe/reports/analysis-{date}.md`:
|
|
204
|
+
|
|
205
|
+
```markdown
|
|
206
|
+
# Project Analysis Report
|
|
207
|
+
|
|
208
|
+
## Overview
|
|
209
|
+
- Analysis date: 2025-01-06 12:00
|
|
210
|
+
- Analysis scope: Full
|
|
211
|
+
|
|
212
|
+
## Code Quality (85/100)
|
|
213
|
+
- Average complexity: 8.2 (good)
|
|
214
|
+
- High complexity files: 3
|
|
215
|
+
|
|
216
|
+
## Dependencies (92/100)
|
|
217
|
+
- Total packages: 42
|
|
218
|
+
- Updates needed: 3
|
|
219
|
+
|
|
220
|
+
## Architecture (78/100)
|
|
221
|
+
- Circular dependencies: 2 found
|
|
222
|
+
- Layer violations: 1
|
|
223
|
+
|
|
224
|
+
## Improvement Suggestions
|
|
225
|
+
1. Refactor service.py
|
|
226
|
+
2. Apply lodash security patch
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Core Tools (Semantic Analysis)
|
|
230
|
+
|
|
231
|
+
### Tool Invocation
|
|
232
|
+
|
|
233
|
+
All tools are called via:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
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)))"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Recommended Tools for Analysis
|
|
240
|
+
|
|
241
|
+
| Tool | Purpose | When to Use |
|
|
242
|
+
|------|---------|-------------|
|
|
243
|
+
| `findSymbol` | Find symbol definitions | Locate function/class implementations |
|
|
244
|
+
| `findReferences` | Find all references | Track usage patterns |
|
|
245
|
+
| `analyzeComplexity` | Complexity analysis | Measure code complexity metrics |
|
|
246
|
+
| `validateCodeQuality` | Quality validation | Check code quality standards |
|
|
247
|
+
| `saveMemory` | Save analysis results | Store analysis findings |
|
|
248
|
+
|
|
249
|
+
### Example Tool Usage in Analysis
|
|
250
|
+
|
|
251
|
+
**1. Find function definition:**
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.findSymbol({symbolName: 'login', searchPath: 'src/'}).then(r => console.log(r.content[0].text)))"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**2. Analyze complexity:**
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.analyzeComplexity({targetPath: 'src/services/', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**3. Validate code quality:**
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.validateCodeQuality({targetPath: 'src/', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**4. Save analysis results:**
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
node -e "import('{{CORE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'analysis-login-module', value: 'Found 5 related files, complexity avg 6.2', category: 'analysis', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Quality Gate (Mandatory)
|
|
278
|
+
|
|
279
|
+
### Analysis Quality Checklist
|
|
280
|
+
|
|
281
|
+
Before completing analysis, ALL items must be checked:
|
|
282
|
+
|
|
283
|
+
| Category | Check Item | Weight |
|
|
284
|
+
|----------|------------|--------|
|
|
285
|
+
| **Completeness** | All related files identified | 20% |
|
|
286
|
+
| **Completeness** | All API endpoints documented | 15% |
|
|
287
|
+
| **Completeness** | All data models mapped | 15% |
|
|
288
|
+
| **Accuracy** | File paths verified to exist | 10% |
|
|
289
|
+
| **Accuracy** | Line numbers accurate | 10% |
|
|
290
|
+
| **Depth** | Business logic explained | 10% |
|
|
291
|
+
| **Depth** | Dependencies mapped | 10% |
|
|
292
|
+
| **Actionability** | Next steps clearly defined | 10% |
|
|
293
|
+
|
|
294
|
+
### Analysis Score Calculation
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
Score = Σ(checked items × weight) / 100
|
|
298
|
+
|
|
299
|
+
Grades:
|
|
300
|
+
- 95-100: ✅ EXCELLENT - Comprehensive analysis
|
|
301
|
+
- 90-94: ⚠️ GOOD - Additional exploration recommended
|
|
302
|
+
- 80-89: ⚠️ FAIR - Needs more exploration
|
|
303
|
+
- 0-79: ❌ POOR - Incomplete, re-analyze
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Analysis Depth Levels
|
|
307
|
+
|
|
308
|
+
| Level | Scope | Output |
|
|
309
|
+
|-------|-------|--------|
|
|
310
|
+
| **L1: Surface** | File names, basic structure | File list only |
|
|
311
|
+
| **L2: Structure** | Functions, classes, imports | Structure map |
|
|
312
|
+
| **L3: Logic** | Business logic, data flow | Flow diagrams |
|
|
313
|
+
| **L4: Deep** | Edge cases, dependencies, risks | Full analysis |
|
|
314
|
+
|
|
315
|
+
**Minimum required: L3 for feature analysis, L2 for project overview**
|
|
316
|
+
|
|
317
|
+
### Analysis Output Requirements
|
|
318
|
+
|
|
319
|
+
Every analysis MUST include:
|
|
320
|
+
|
|
321
|
+
1. **Overview Section**
|
|
322
|
+
- Feature description (1 sentence)
|
|
323
|
+
- Implementation status (Complete/In progress/Not implemented)
|
|
324
|
+
- Related file count
|
|
325
|
+
|
|
326
|
+
2. **Structure Section**
|
|
327
|
+
- API endpoints table (Method, Path, Description, Auth)
|
|
328
|
+
- Core services list with key methods
|
|
329
|
+
- Data models with fields and relationships
|
|
330
|
+
|
|
331
|
+
3. **Reference File List**
|
|
332
|
+
- Absolute or relative paths
|
|
333
|
+
- Line number ranges for key sections
|
|
334
|
+
- Brief description per file
|
|
335
|
+
|
|
336
|
+
4. **Next Steps**
|
|
337
|
+
- Workflow choice prompt (Plan Mode vs VIBE)
|
|
338
|
+
- Specific action items if applicable
|
|
339
|
+
|
|
340
|
+
### Forbidden Incomplete Patterns
|
|
341
|
+
|
|
342
|
+
| Pattern | Issue | Required Fix |
|
|
343
|
+
|---------|-------|--------------|
|
|
344
|
+
| "and more..." | Incomplete list | List all items |
|
|
345
|
+
| "etc." | Vague scope | Be specific |
|
|
346
|
+
| "related files" without list | Missing details | Provide file paths |
|
|
347
|
+
| Missing line numbers | Hard to navigate | Add `:L10-50` format |
|
|
348
|
+
| No auth info on endpoints | Security gap | Always specify auth |
|
|
349
|
+
|
|
350
|
+
### Code Quality Analysis Thresholds
|
|
351
|
+
|
|
352
|
+
When running `--code` analysis:
|
|
353
|
+
|
|
354
|
+
| Metric | Good | Warning | Critical |
|
|
355
|
+
|--------|------|---------|----------|
|
|
356
|
+
| Avg Complexity | ≤10 | 11-15 | >15 |
|
|
357
|
+
| Max Function Length | ≤30 | 31-50 | >50 |
|
|
358
|
+
| High Complexity Files | 0 | 1-3 | >3 |
|
|
359
|
+
| Circular Dependencies | 0 | 1 | >1 |
|
|
360
|
+
|
|
361
|
+
### Dependency Analysis Thresholds
|
|
362
|
+
|
|
363
|
+
When running `--deps` analysis:
|
|
364
|
+
|
|
365
|
+
| Metric | Good | Warning | Critical |
|
|
366
|
+
|--------|------|---------|----------|
|
|
367
|
+
| Outdated Packages | 0-3 | 4-10 | >10 |
|
|
368
|
+
| Security Vulnerabilities | 0 | 1-2 (low) | Any high/critical |
|
|
369
|
+
| Major Version Behind | 0 | 1-2 | >2 |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
ARGUMENTS: $ARGUMENTS
|