opencodekit 0.14.4 → 0.14.6
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/dist/index.js +7 -7
- package/dist/template/.opencode/.background-tasks.json +18 -0
- package/dist/template/.opencode/agent/ninja.md +351 -0
- package/dist/template/.opencode/command/analyze-project.md +187 -358
- package/dist/template/.opencode/command/implement.md +29 -30
- package/dist/template/.opencode/command/new-feature.md +10 -10
- package/dist/template/.opencode/command/plan.md +13 -15
- package/dist/template/.opencode/command/start.md +11 -12
- package/dist/template/.opencode/opencode.json +47 -1
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/env-ctx.ts +34 -0
- package/dist/template/.opencode/tool/background.ts +147 -99
- package/package.json +7 -7
|
@@ -1,466 +1,295 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Analyze project health,
|
|
3
|
-
argument-hint: "[--quick|--deep
|
|
4
|
-
agent:
|
|
5
|
-
subtask: true
|
|
2
|
+
description: Analyze project health, quality standards, and ready work
|
|
3
|
+
argument-hint: "[--quick|--deep]"
|
|
4
|
+
agent: build
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Analyze Project
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
Comprehensive project analysis with stack-specific best practices.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
## Arguments
|
|
12
|
+
|
|
13
|
+
$ARGUMENTS
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
---
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Phase 1: Environment Detection
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
# Git status
|
|
22
|
-
!`git status --short`
|
|
23
|
-
!`git branch --show-current`
|
|
24
|
-
!`git log --oneline -3`
|
|
19
|
+
Detect project type to determine analysis strategy:
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
!`bd list --status ready --limit 5`
|
|
21
|
+
```bash
|
|
22
|
+
# Check config files
|
|
23
|
+
ls -la package.json pyproject.toml Cargo.toml go.mod pom.xml build.gradle 2>/dev/null || true
|
|
30
24
|
|
|
31
|
-
#
|
|
32
|
-
|
|
25
|
+
# Check lock files for package manager
|
|
26
|
+
ls -la bun.lockb yarn.lock pnpm-lock.yaml package-lock.json 2>/dev/null || true
|
|
33
27
|
|
|
34
|
-
#
|
|
35
|
-
|
|
28
|
+
# Check for monorepo
|
|
29
|
+
ls -la pnpm-workspace.yaml lerna.json nx.json turbo.json 2>/dev/null || true
|
|
36
30
|
```
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
Read the main config file to detect framework:
|
|
39
33
|
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| Category | Status | Details |
|
|
44
|
-
| ---------------- | --------------------- | ------------------------------ |
|
|
45
|
-
| **Branch** | `main` | 3 commits ahead of origin |
|
|
46
|
-
| **Working Tree** | Clean / Dirty | X files modified |
|
|
47
|
-
| **Last Commit** | `abc123` | "feat: add auth" (2 hours ago) |
|
|
48
|
-
| **CI Status** | Pass / Fail / Running | Last run: 2h ago |
|
|
49
|
-
| **Open Tasks** | X beads | Y ready, Z blocked |
|
|
50
|
-
| **Dependencies** | X outdated | Y security issues |
|
|
34
|
+
```typescript
|
|
35
|
+
read({ filePath: "package.json" }); // or pyproject.toml, Cargo.toml, etc.
|
|
51
36
|
```
|
|
52
37
|
|
|
53
38
|
---
|
|
54
39
|
|
|
55
|
-
## Phase 2:
|
|
40
|
+
## Phase 2: Parallel Research & Discovery
|
|
56
41
|
|
|
57
|
-
|
|
42
|
+
Once stack is detected, launch parallel subagent tasks using the Task tool.
|
|
43
|
+
Run all three in parallel (single message with multiple Task calls):
|
|
58
44
|
|
|
45
|
+
```typescript
|
|
46
|
+
// Scout: Research best practices for detected stack
|
|
47
|
+
Task({
|
|
48
|
+
subagent_type: "scout",
|
|
49
|
+
description: "Best practices research",
|
|
50
|
+
prompt: `Research best practices for [DETECTED_STACK]:
|
|
51
|
+
- Code quality standards and linting rules
|
|
52
|
+
- Testing patterns and coverage expectations
|
|
53
|
+
- Project structure conventions
|
|
54
|
+
- Common anti-patterns to avoid
|
|
55
|
+
Return as actionable checklist with specific recommendations.`,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Scout: Framework-specific quality standards
|
|
59
|
+
Task({
|
|
60
|
+
subagent_type: "scout",
|
|
61
|
+
description: "Quality standards research",
|
|
62
|
+
prompt: `Research quality standards for [DETECTED_FRAMEWORK]:
|
|
63
|
+
- Recommended ESLint/Biome/Ruff rules
|
|
64
|
+
- Type safety requirements
|
|
65
|
+
- Performance best practices
|
|
66
|
+
- Security checklist
|
|
67
|
+
Return as comparison criteria checklist.`,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Explore: Analyze codebase architecture
|
|
71
|
+
Task({
|
|
72
|
+
subagent_type: "explore",
|
|
73
|
+
description: "Architecture analysis",
|
|
74
|
+
prompt: `Analyze this codebase architecture thoroughly:
|
|
75
|
+
- Directory structure pattern (feature-based, layer-based, etc.)
|
|
76
|
+
- Key modules and their responsibilities
|
|
77
|
+
- Entry points and data flow
|
|
78
|
+
- Test organization and coverage patterns
|
|
79
|
+
Return as detailed architecture summary with file paths.`,
|
|
80
|
+
});
|
|
59
81
|
```
|
|
60
|
-
# Package manager & framework
|
|
61
|
-
!`ls package.json pyproject.toml Cargo.toml go.mod pom.xml build.gradle`
|
|
62
82
|
|
|
63
|
-
|
|
64
|
-
# Read package.json # or equivalent
|
|
65
|
-
```
|
|
83
|
+
**Fallback:** If Task tool fails or network is unavailable, use local tools:
|
|
66
84
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
| --------------------- | ------------------------- | -------------------------------- |
|
|
71
|
-
| **Language** | File extensions, config | TypeScript, Python, Rust |
|
|
72
|
-
| **Framework** | package.json dependencies | Next.js 14, FastAPI, Axum |
|
|
73
|
-
| **Package Manager** | Lock file presence | npm, pnpm, yarn, bun |
|
|
74
|
-
| **Testing** | Test framework in deps | Jest, Vitest, pytest, cargo test |
|
|
75
|
-
| **Linting** | Config files | ESLint, Biome, Ruff |
|
|
76
|
-
| **Formatting** | Config files | Prettier, Biome, Black |
|
|
77
|
-
| **CI/CD** | Workflow files | GitHub Actions, GitLab CI |
|
|
78
|
-
| **Database** | Dependencies, .env | PostgreSQL, SQLite, MongoDB |
|
|
79
|
-
| **UI Framework** | Dependencies | React, Vue, Svelte |
|
|
80
|
-
| **Component Library** | components.json, deps | shadcn/ui, MUI, Chakra |
|
|
81
|
-
|
|
82
|
-
```markdown
|
|
83
|
-
## Tech Stack
|
|
84
|
-
|
|
85
|
-
| Category | Technology | Version |
|
|
86
|
-
| --------------- | ---------- | ------- |
|
|
87
|
-
| Language | TypeScript | 5.3.x |
|
|
88
|
-
| Runtime | Node.js | 20.x |
|
|
89
|
-
| Framework | Next.js | 14.2 |
|
|
90
|
-
| Package Manager | pnpm | 8.x |
|
|
91
|
-
| Testing | Vitest | 1.x |
|
|
92
|
-
| Linting | Biome | 1.x |
|
|
93
|
-
| UI | shadcn/ui | latest |
|
|
94
|
-
| Database | PostgreSQL | 16 |
|
|
95
|
-
```
|
|
85
|
+
- `repo-map` for architecture analysis
|
|
86
|
+
- `memory-search` for existing project knowledge
|
|
87
|
+
- Skip external research phases
|
|
96
88
|
|
|
97
89
|
---
|
|
98
90
|
|
|
99
|
-
## Phase 3: Health
|
|
100
|
-
|
|
101
|
-
### 3.1 Dependency Health
|
|
91
|
+
## Phase 3: Git & Version Control Health
|
|
102
92
|
|
|
103
93
|
```bash
|
|
104
|
-
#
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# Python
|
|
109
|
-
!`pip list --outdated`
|
|
110
|
-
!`pip-audit`
|
|
111
|
-
|
|
112
|
-
# Rust
|
|
113
|
-
!`cargo outdated`
|
|
114
|
-
cargo audit
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Dependency Dashboard:**
|
|
94
|
+
# Current state
|
|
95
|
+
git status --short
|
|
96
|
+
git branch --show-current
|
|
97
|
+
git log --oneline -5
|
|
118
98
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| Total dependencies | 45 | - | - |
|
|
122
|
-
| Outdated (major) | 3 | Warning | < 5 |
|
|
123
|
-
| Outdated (minor) | 8 | OK | < 20 |
|
|
124
|
-
| Security vulnerabilities | 0 | OK | 0 |
|
|
125
|
-
| High/Critical vulns | 0 | OK | 0 |
|
|
99
|
+
# Commits ahead/behind
|
|
100
|
+
git rev-list --left-right --count origin/main...HEAD 2>/dev/null || true
|
|
126
101
|
|
|
127
|
-
|
|
102
|
+
# Recent activity
|
|
103
|
+
git log -1 --format="%h %s (%cr by %an)"
|
|
128
104
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
npm test -- --coverage --json
|
|
132
|
-
|
|
133
|
-
# Python
|
|
134
|
-
pytest --cov --cov-report=json
|
|
135
|
-
|
|
136
|
-
# Check for coverage config (instructional - agent uses glob tool)
|
|
137
|
-
glob({ pattern: "**/jest.config.*" })
|
|
138
|
-
glob({ pattern: "**/vitest.config.*" })
|
|
139
|
-
glob({ pattern: "**/pytest.ini" })
|
|
140
|
-
glob({ pattern: "**/pyproject.toml" })
|
|
105
|
+
# Uncommitted changes
|
|
106
|
+
git diff --stat
|
|
141
107
|
```
|
|
142
108
|
|
|
143
|
-
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Phase 4: Code Quality Checks
|
|
144
112
|
|
|
145
|
-
|
|
146
|
-
| --------------- | ----- | ------- | --------- |
|
|
147
|
-
| Line coverage | 78% | Warning | > 80% |
|
|
148
|
-
| Branch coverage | 65% | Warning | > 70% |
|
|
149
|
-
| Uncovered files | 12 | - | - |
|
|
150
|
-
| Test count | 156 | - | - |
|
|
151
|
-
| Test pass rate | 100% | OK | 100% |
|
|
113
|
+
Run quality checks based on detected stack:
|
|
152
114
|
|
|
153
|
-
###
|
|
115
|
+
### For TypeScript/JavaScript:
|
|
154
116
|
|
|
155
117
|
```bash
|
|
156
|
-
#
|
|
157
|
-
|
|
118
|
+
# Type errors
|
|
119
|
+
npm run typecheck 2>/dev/null || npx tsc --noEmit 2>/dev/null || true
|
|
158
120
|
|
|
159
|
-
# Linting
|
|
160
|
-
|
|
121
|
+
# Linting
|
|
122
|
+
npm run lint 2>/dev/null || npx biome check . 2>/dev/null || npx eslint . 2>/dev/null || true
|
|
161
123
|
|
|
162
124
|
# TODO/FIXME count
|
|
163
|
-
|
|
125
|
+
grep -r "TODO\|FIXME\|HACK\|XXX" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l || echo "0"
|
|
164
126
|
```
|
|
165
127
|
|
|
166
|
-
|
|
128
|
+
### For Python:
|
|
167
129
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
| Lint errors | 5 | Warning | 0 |
|
|
172
|
-
| Lint warnings | 23 | OK | < 50 |
|
|
173
|
-
| TODO/FIXME | 15 | Info | < 30 |
|
|
174
|
-
| Console.log statements | 3 | Warning | 0 |
|
|
130
|
+
```bash
|
|
131
|
+
# Type checking
|
|
132
|
+
mypy . 2>/dev/null || true
|
|
175
133
|
|
|
176
|
-
|
|
134
|
+
# Linting
|
|
135
|
+
ruff check . 2>/dev/null || pylint **/*.py 2>/dev/null || true
|
|
177
136
|
|
|
137
|
+
# TODO count
|
|
138
|
+
grep -r "TODO\|FIXME" . --include="*.py" 2>/dev/null | wc -l || echo "0"
|
|
178
139
|
```
|
|
179
|
-
# Check for docs
|
|
180
|
-
!`ls README.md CHANGELOG.md CONTRIBUTING.md docs/ 2>/dev/null`
|
|
181
140
|
|
|
182
|
-
|
|
183
|
-
!`git log -1 --format="%cr" -- README.md`
|
|
141
|
+
### For Rust:
|
|
184
142
|
|
|
185
|
-
|
|
186
|
-
|
|
143
|
+
```bash
|
|
144
|
+
cargo check 2>/dev/null || true
|
|
145
|
+
cargo clippy 2>/dev/null || true
|
|
187
146
|
```
|
|
188
147
|
|
|
189
|
-
**Documentation Dashboard:**
|
|
190
|
-
|
|
191
|
-
| Document | Status | Last Updated |
|
|
192
|
-
| --------------- | ------- | ------------ |
|
|
193
|
-
| README.md | Present | 5 days ago |
|
|
194
|
-
| CHANGELOG.md | Present | 2 days ago |
|
|
195
|
-
| CONTRIBUTING.md | Missing | - |
|
|
196
|
-
| API docs | Present | 1 week ago |
|
|
197
|
-
| AGENTS.md | Present | 3 days ago |
|
|
198
|
-
|
|
199
148
|
---
|
|
200
149
|
|
|
201
|
-
## Phase
|
|
202
|
-
|
|
203
|
-
**For large codebases (>100KB of source):**
|
|
204
|
-
|
|
205
|
-
skill({ name: "gemini-large-context" })
|
|
206
|
-
|
|
207
|
-
### 4.1 Architecture Analysis
|
|
208
|
-
|
|
209
|
-
```typescript
|
|
210
|
-
gemini({ prompt: "@src/
|
|
211
|
-
Describe:
|
|
212
|
-
1. Overall architecture pattern (MVC, Clean, Hexagonal, etc.)
|
|
213
|
-
2. Key modules and their responsibilities
|
|
214
|
-
3. Data flow between components
|
|
215
|
-
4. External dependencies and integrations
|
|
216
|
-
5. Areas of high complexity" });
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### 4.2 Test Gap Analysis
|
|
220
|
-
|
|
221
|
-
```typescript
|
|
222
|
-
gemini({ prompt: "@src/ @tests/
|
|
223
|
-
Assess test coverage:
|
|
224
|
-
- Which modules have tests?
|
|
225
|
-
- Which are missing tests?
|
|
226
|
-
- Test quality (unit vs integration)
|
|
227
|
-
- Edge cases covered
|
|
228
|
-
- Critical paths without tests" });
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### 4.3 Code Smell Detection
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
gemini({ prompt: "@src/
|
|
235
|
-
Identify code smells:
|
|
236
|
-
- Duplicated code
|
|
237
|
-
- Long functions (>50 lines)
|
|
238
|
-
- Deep nesting (>4 levels)
|
|
239
|
-
- God objects/files
|
|
240
|
-
- Overly complex conditions" });
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### 4.4 Security Analysis (--security)
|
|
150
|
+
## Phase 5: Test Health
|
|
244
151
|
|
|
245
152
|
```bash
|
|
246
|
-
#
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
!`grep -r "secret" src/ --include="*.ts" || true`
|
|
254
|
-
|
|
255
|
-
# Deep analysis with Gemini
|
|
256
|
-
gemini -p "@src/ @api/
|
|
257
|
-
Security review:
|
|
258
|
-
- Input validation practices
|
|
259
|
-
- Authentication/authorization patterns
|
|
260
|
-
- SQL injection protections
|
|
261
|
-
- XSS prevention measures
|
|
262
|
-
- Secrets in code
|
|
263
|
-
- CORS configuration"
|
|
153
|
+
# Run tests with coverage if available
|
|
154
|
+
npm test -- --coverage 2>/dev/null || \
|
|
155
|
+
bun test --coverage 2>/dev/null || \
|
|
156
|
+
pytest --cov 2>/dev/null || \
|
|
157
|
+
cargo test 2>/dev/null || \
|
|
158
|
+
go test ./... 2>/dev/null || \
|
|
159
|
+
echo "No test runner detected"
|
|
264
160
|
```
|
|
265
161
|
|
|
266
|
-
**Security Dashboard:**
|
|
267
|
-
|
|
268
|
-
| Check | Status | Issues |
|
|
269
|
-
| ----------------- | ------- | ------------------------- |
|
|
270
|
-
| npm audit | Pass | 0 vulnerabilities |
|
|
271
|
-
| Hardcoded secrets | Warning | 2 potential matches |
|
|
272
|
-
| Auth patterns | OK | Using established library |
|
|
273
|
-
| Input validation | Warning | 5 unvalidated endpoints |
|
|
274
|
-
| CORS | OK | Properly configured |
|
|
275
|
-
|
|
276
162
|
---
|
|
277
163
|
|
|
278
|
-
## Phase
|
|
164
|
+
## Phase 6: Dependency & Security Health
|
|
279
165
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
!`bd list --status ready --limit 10`
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### Ready Work Table
|
|
287
|
-
|
|
288
|
-
| ID | Title | Type | Priority | Tags |
|
|
289
|
-
| ------ | ------------- | ------- | -------- | ----------- |
|
|
290
|
-
| bd-123 | Add user auth | feature | P1 | backend |
|
|
291
|
-
| bd-124 | Fix login bug | bug | P0 | urgent |
|
|
292
|
-
| bd-125 | Update deps | task | P2 | maintenance |
|
|
293
|
-
|
|
294
|
-
**Blocked Work:**
|
|
166
|
+
```bash
|
|
167
|
+
# Outdated dependencies
|
|
168
|
+
npm outdated 2>/dev/null || pnpm outdated 2>/dev/null || pip list --outdated 2>/dev/null || true
|
|
295
169
|
|
|
296
|
-
|
|
297
|
-
|
|
170
|
+
# Security audit
|
|
171
|
+
npm audit 2>/dev/null || pip-audit 2>/dev/null || cargo audit 2>/dev/null || true
|
|
298
172
|
```
|
|
299
173
|
|
|
300
|
-
| ID | Title | Blocked By | Action Needed |
|
|
301
|
-
| ------ | -------------- | ---------- | ------------------- |
|
|
302
|
-
| bd-130 | Deploy to prod | bd-124 | Fix login bug first |
|
|
303
|
-
|
|
304
174
|
---
|
|
305
175
|
|
|
306
|
-
## Phase
|
|
307
|
-
|
|
308
|
-
Calculate overall project health:
|
|
176
|
+
## Phase 7: CI/CD & Documentation Health
|
|
309
177
|
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
Penalties:
|
|
314
|
-
- Each high/critical vulnerability: -10 (max -30)
|
|
315
|
-
- Each major outdated dependency: -2 (max -10)
|
|
316
|
-
- Type errors present: -15
|
|
317
|
-
- Test coverage < 80%: -10
|
|
318
|
-
- Test coverage < 60%: -20
|
|
319
|
-
- CI failing: -20
|
|
320
|
-
- No README: -5
|
|
321
|
-
- No CHANGELOG: -3
|
|
322
|
-
- Lint errors > 0: -5
|
|
323
|
-
- TODO count > 50: -5
|
|
324
|
-
|
|
325
|
-
Score interpretation:
|
|
326
|
-
90-100: Excellent - Ship with confidence
|
|
327
|
-
75-89: Good - Minor issues to address
|
|
328
|
-
60-74: Fair - Technical debt accumulating
|
|
329
|
-
< 60: Poor - Significant attention needed
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
### Health Score Output
|
|
333
|
-
|
|
334
|
-
```markdown
|
|
335
|
-
## Project Health Score: 82/100 (Good)
|
|
336
|
-
|
|
337
|
-
### Score Breakdown
|
|
338
|
-
|
|
339
|
-
| Category | Score | Notes |
|
|
340
|
-
| ------------- | ----- | ------------------------ |
|
|
341
|
-
| Security | 20/20 | No vulnerabilities |
|
|
342
|
-
| Dependencies | 18/20 | 2 major outdated |
|
|
343
|
-
| Tests | 15/20 | 78% coverage (below 80%) |
|
|
344
|
-
| Code Quality | 15/20 | 5 lint errors |
|
|
345
|
-
| CI/CD | 10/10 | Passing |
|
|
346
|
-
| Documentation | 4/10 | Missing CONTRIBUTING.md |
|
|
178
|
+
```bash
|
|
179
|
+
# CI status (GitHub Actions)
|
|
180
|
+
gh run list --limit 3 2>/dev/null || true
|
|
347
181
|
|
|
348
|
-
|
|
182
|
+
# Documentation presence
|
|
183
|
+
ls -la README.md CHANGELOG.md CONTRIBUTING.md AGENTS.md docs/ 2>/dev/null || true
|
|
349
184
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
3. **Update 2 major deps** → `npm update`
|
|
353
|
-
4. **Add CONTRIBUTING.md** → Document contribution process
|
|
185
|
+
# README freshness
|
|
186
|
+
git log -1 --format="%cr" -- README.md 2>/dev/null || true
|
|
354
187
|
```
|
|
355
188
|
|
|
356
189
|
---
|
|
357
190
|
|
|
358
|
-
## Phase
|
|
359
|
-
|
|
360
|
-
Based on analysis, generate actionable recommendations:
|
|
361
|
-
|
|
362
|
-
### Immediate Actions
|
|
191
|
+
## Phase 8: Task/Work Health (if Beads configured)
|
|
363
192
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
### Create Beads for Issues
|
|
193
|
+
```bash
|
|
194
|
+
bd status 2>/dev/null || echo "Beads not configured"
|
|
195
|
+
bd ready 2>/dev/null || true
|
|
196
|
+
bd blocked 2>/dev/null || true
|
|
197
|
+
```
|
|
371
198
|
|
|
372
|
-
|
|
199
|
+
---
|
|
373
200
|
|
|
374
|
-
|
|
375
|
-
# For security vulnerabilities
|
|
376
|
-
bd create "[Security] Fix npm audit vulnerabilities" -t bug -p 1 # Keep as instructional
|
|
201
|
+
## Phase 9: Integrate Research Results
|
|
377
202
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
```
|
|
203
|
+
Task tool returns results directly - no collection needed.
|
|
204
|
+
Integrate findings from Phase 2 subagents into the report:
|
|
381
205
|
|
|
382
|
-
|
|
206
|
+
1. **Best practices checklist** → Compare against Phase 4 quality results
|
|
207
|
+
2. **Quality standards** → Use as criteria for Health Score calculation
|
|
208
|
+
3. **Architecture summary** → Include in report Architecture section
|
|
383
209
|
|
|
384
|
-
|
|
210
|
+
If subagents failed in Phase 2, use fallback data:
|
|
385
211
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
| Test coverage low | `/research test coverage strategies` |
|
|
390
|
-
| Security issues | `/fix security` |
|
|
391
|
-
| Outdated deps | `npm update` or `/research migration` |
|
|
392
|
-
| Architecture unclear | `/research architecture` |
|
|
393
|
-
| Design system issues | `/design-audit codebase` |
|
|
212
|
+
- Check `memory-read({ file: "project/architecture" })` for cached architecture
|
|
213
|
+
- Use `repo-map` output for structure analysis
|
|
214
|
+
- Skip best practices comparison (mark as "N/A - offline mode")
|
|
394
215
|
|
|
395
216
|
---
|
|
396
217
|
|
|
397
|
-
##
|
|
218
|
+
## Phase 10: Generate Report
|
|
398
219
|
|
|
399
|
-
|
|
220
|
+
Compile all findings into a comprehensive report:
|
|
400
221
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
- ~30 seconds
|
|
222
|
+
```markdown
|
|
223
|
+
# Project Analysis Report
|
|
404
224
|
|
|
405
|
-
|
|
225
|
+
**Generated:** [DATE]
|
|
226
|
+
**Stack:** [DETECTED_STACK]
|
|
227
|
+
**Framework:** [DETECTED_FRAMEWORK]
|
|
406
228
|
|
|
407
|
-
|
|
408
|
-
- Dependency/security scan
|
|
409
|
-
- Health score
|
|
410
|
-
- ~2-3 minutes
|
|
229
|
+
## Health Score: X/100
|
|
411
230
|
|
|
412
|
-
|
|
231
|
+
| Category | Score | Status | Notes |
|
|
232
|
+
| ------------- | ----- | ------- | ----------------- |
|
|
233
|
+
| Security | X/20 | OK/Warn | X vulnerabilities |
|
|
234
|
+
| Code Quality | X/20 | OK/Warn | X lint errors |
|
|
235
|
+
| Test Coverage | X/20 | OK/Warn | X% coverage |
|
|
236
|
+
| Dependencies | X/20 | OK/Warn | X outdated |
|
|
237
|
+
| Documentation | X/20 | OK/Warn | X missing |
|
|
413
238
|
|
|
414
|
-
|
|
415
|
-
- Architecture, test gaps, code smells
|
|
416
|
-
- ~10-15 minutes
|
|
239
|
+
## Current State vs Best Practices
|
|
417
240
|
|
|
418
|
-
|
|
241
|
+
Based on [FRAMEWORK] best practices research:
|
|
419
242
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
243
|
+
| Practice | Expected | Actual | Status |
|
|
244
|
+
| ------------------- | ----------- | -------- | ------ |
|
|
245
|
+
| Type Safety | Strict mode | ... | ✓/✗ |
|
|
246
|
+
| Test Coverage | >80% | X% | ✓/✗ |
|
|
247
|
+
| Linting | Zero errors | X errors | ✓/✗ |
|
|
248
|
+
| Dependency Security | No vulns | X vulns | ✓/✗ |
|
|
424
249
|
|
|
425
|
-
|
|
250
|
+
## Architecture Summary
|
|
426
251
|
|
|
427
|
-
|
|
252
|
+
[From explore agent]
|
|
428
253
|
|
|
429
|
-
|
|
430
|
-
# Quick status check
|
|
431
|
-
/analyze-project
|
|
254
|
+
## Priority Recommendations
|
|
432
255
|
|
|
433
|
-
|
|
434
|
-
|
|
256
|
+
1. **[HIGH]** [Action based on findings]
|
|
257
|
+
2. **[MEDIUM]** [Action based on findings]
|
|
258
|
+
3. **[LOW]** [Action based on findings]
|
|
435
259
|
|
|
436
|
-
|
|
437
|
-
/analyze-project --deep
|
|
260
|
+
## Ready Work
|
|
438
261
|
|
|
439
|
-
|
|
440
|
-
|
|
262
|
+
| ID | Title | Priority | Type |
|
|
263
|
+
| --- | ----- | -------- | ---- |
|
|
264
|
+
| ... | ... | ... | ... |
|
|
441
265
|
```
|
|
442
266
|
|
|
443
267
|
---
|
|
444
268
|
|
|
445
|
-
##
|
|
269
|
+
## Phase 11: Save to Memory
|
|
446
270
|
|
|
447
|
-
Save
|
|
448
|
-
|
|
449
|
-
Compare with previous analysis:
|
|
271
|
+
Save report for trend tracking:
|
|
450
272
|
|
|
451
273
|
```typescript
|
|
452
|
-
|
|
453
|
-
|
|
274
|
+
memory_update({
|
|
275
|
+
file: "project/analysis-[YYYY-MM-DD]",
|
|
276
|
+
content: "[GENERATED_REPORT]",
|
|
277
|
+
mode: "replace",
|
|
278
|
+
});
|
|
454
279
|
```
|
|
455
280
|
|
|
456
281
|
---
|
|
457
282
|
|
|
458
|
-
##
|
|
283
|
+
## Output Modes
|
|
284
|
+
|
|
285
|
+
### --quick (Default)
|
|
286
|
+
|
|
287
|
+
- Phase 1, 3, 8 only
|
|
288
|
+
- ~30 seconds
|
|
289
|
+
- Basic status dashboard
|
|
290
|
+
|
|
291
|
+
### --deep
|
|
459
292
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
| Review codebase | `/review-codebase` |
|
|
464
|
-
| Check design system | `/design-audit` |
|
|
465
|
-
| Security deep dive | `/research security best practices` |
|
|
466
|
-
| Dependency update | `/research migration to [package] vX` |
|
|
293
|
+
- All phases including subagent research
|
|
294
|
+
- ~3-5 minutes
|
|
295
|
+
- Full analysis with best practices comparison
|