@jmylchreest/aide-plugin 0.0.38 → 0.0.40
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/package.json +1 -1
- package/skills/code-search/SKILL.md +41 -1
- package/skills/debug/SKILL.md +40 -20
- package/skills/forget/SKILL.md +224 -0
- package/skills/git/SKILL.md +10 -0
- package/skills/implement/SKILL.md +10 -1
- package/skills/memorise/SKILL.md +89 -11
- package/skills/patterns/SKILL.md +177 -0
- package/skills/perf/SKILL.md +56 -32
- package/skills/plan-swarm/SKILL.md +5 -0
- package/skills/ralph/SKILL.md +15 -8
- package/skills/review/SKILL.md +53 -18
- package/skills/swarm/SKILL.md +75 -24
- package/skills/test/SKILL.md +38 -22
- package/src/core/context-guard.ts +214 -0
- package/src/core/persistence-logic.ts +26 -4
- package/src/core/todo-checker.ts +53 -18
- package/src/core/types.ts +21 -0
- package/src/opencode/hooks.ts +5 -1
- package/src/opencode/index.ts +3 -3
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: patterns
|
|
3
|
+
description: Analyze codebase patterns, detect anti-patterns, and surface static analysis findings
|
|
4
|
+
triggers:
|
|
5
|
+
- find patterns
|
|
6
|
+
- anti-patterns
|
|
7
|
+
- code smells
|
|
8
|
+
- complexity
|
|
9
|
+
- duplicated code
|
|
10
|
+
- clones
|
|
11
|
+
- secrets
|
|
12
|
+
- coupling
|
|
13
|
+
- findings
|
|
14
|
+
- static analysis
|
|
15
|
+
- code health
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Pattern Analysis
|
|
19
|
+
|
|
20
|
+
**Recommended model tier:** balanced (sonnet) - this skill combines search with structured analysis
|
|
21
|
+
|
|
22
|
+
Analyze codebase patterns using static analysis findings. Surface complexity hotspots, code
|
|
23
|
+
duplication, coupling issues, and potential secrets. Use this skill to understand code health
|
|
24
|
+
and identify areas that need attention.
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
Findings must be generated first by running analyzers via the CLI:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Run all analyzers
|
|
32
|
+
./.aide/bin/aide findings run --path .
|
|
33
|
+
|
|
34
|
+
# Run specific analyzers
|
|
35
|
+
./.aide/bin/aide findings run --path . --analyzer complexity
|
|
36
|
+
./.aide/bin/aide findings run --path . --analyzer coupling
|
|
37
|
+
./.aide/bin/aide findings run --path . --analyzer secrets
|
|
38
|
+
./.aide/bin/aide findings run --path . --analyzer clones
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Binary location:** The aide binary is at `.aide/bin/aide`. If it's on your `$PATH`, you can use `aide` directly.
|
|
42
|
+
|
|
43
|
+
## Available Tools
|
|
44
|
+
|
|
45
|
+
### 1. Search Findings (`mcp__plugin_aide_aide__findings_search`)
|
|
46
|
+
|
|
47
|
+
Full-text search across all findings. Supports Bleve query syntax for advanced searches.
|
|
48
|
+
|
|
49
|
+
**Parameters:**
|
|
50
|
+
- `query` (required) — Search term or Bleve query
|
|
51
|
+
- `analyzer` (optional) — Filter to one analyzer: `complexity`, `coupling`, `secrets`, `clones`
|
|
52
|
+
- `severity` (optional) — Filter by severity: `info`, `warning`, `critical`
|
|
53
|
+
- `file` (optional) — Filter by file path substring
|
|
54
|
+
- `limit` (optional) — Max results (default 20)
|
|
55
|
+
|
|
56
|
+
**Example usage:**
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Search for: "high complexity"
|
|
60
|
+
-> findings_search query="complexity" severity="warning"
|
|
61
|
+
-> Returns: functions with high cyclomatic complexity, with file:line
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. List Findings (`mcp__plugin_aide_aide__findings_list`)
|
|
65
|
+
|
|
66
|
+
List findings with filters. Use when you want to browse rather than search.
|
|
67
|
+
|
|
68
|
+
**Parameters:**
|
|
69
|
+
- `analyzer` (optional) — Filter to one analyzer
|
|
70
|
+
- `severity` (optional) — Filter by severity
|
|
71
|
+
- `file` (optional) — Filter by file path substring
|
|
72
|
+
- `limit` (optional) — Max results (default 20)
|
|
73
|
+
- `offset` (optional) — Pagination offset
|
|
74
|
+
|
|
75
|
+
**Example usage:**
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
List all critical findings
|
|
79
|
+
-> findings_list severity="critical"
|
|
80
|
+
-> Returns: all critical-severity findings across all analyzers
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3. Findings Statistics (`mcp__plugin_aide_aide__findings_stats`)
|
|
84
|
+
|
|
85
|
+
Get aggregate counts by analyzer and severity. Use as a starting point to understand overall
|
|
86
|
+
code health before drilling into specifics.
|
|
87
|
+
|
|
88
|
+
**Example usage:**
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
How healthy is the codebase?
|
|
92
|
+
-> findings_stats
|
|
93
|
+
-> Returns: counts per analyzer, counts per severity, total findings
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Workflow
|
|
97
|
+
|
|
98
|
+
### Quick Health Check
|
|
99
|
+
|
|
100
|
+
1. **Get overview** — Use `findings_stats` to see counts by analyzer and severity
|
|
101
|
+
2. **Triage critical** — Use `findings_list severity="critical"` to review highest-priority items
|
|
102
|
+
3. **Drill into areas** — Use `findings_search` with file or query filters for specific concerns
|
|
103
|
+
|
|
104
|
+
### Complexity Analysis
|
|
105
|
+
|
|
106
|
+
1. Run `findings_search analyzer="complexity" severity="critical"` to find the most complex functions
|
|
107
|
+
2. Use `code_outline` on flagged files to understand structure
|
|
108
|
+
3. Use `Read` with offset/limit to examine the specific functions
|
|
109
|
+
4. Recommend decomposition strategies
|
|
110
|
+
|
|
111
|
+
### Duplication Analysis
|
|
112
|
+
|
|
113
|
+
1. Run `findings_list analyzer="clones"` to see detected code clones
|
|
114
|
+
2. Each finding includes the clone pair — both file locations and line ranges
|
|
115
|
+
3. Use `Read` to compare the duplicated sections
|
|
116
|
+
4. Recommend extraction into shared functions or modules
|
|
117
|
+
|
|
118
|
+
### Coupling Analysis
|
|
119
|
+
|
|
120
|
+
1. Run `findings_search analyzer="coupling"` to see import fan-out/fan-in issues
|
|
121
|
+
2. High fan-out means a file imports too many things (potential god module)
|
|
122
|
+
3. High fan-in means many files depend on one (fragile dependency)
|
|
123
|
+
4. Cycle findings indicate circular dependency chains
|
|
124
|
+
|
|
125
|
+
### Secret Detection
|
|
126
|
+
|
|
127
|
+
1. Run `findings_list analyzer="secrets" severity="critical"` for confirmed secrets
|
|
128
|
+
2. Run `findings_list analyzer="secrets"` for all potential secrets (including unverified)
|
|
129
|
+
3. Each finding includes the secret category (e.g., AWS, GitHub, generic API key)
|
|
130
|
+
4. Snippets are redacted for safety — use `Read` to examine context around the finding
|
|
131
|
+
|
|
132
|
+
## Anti-Pattern Identification
|
|
133
|
+
|
|
134
|
+
Beyond the automated analyzers, look for these patterns using findings as starting points:
|
|
135
|
+
|
|
136
|
+
| Finding | Likely Anti-Pattern | Action |
|
|
137
|
+
|---------|-------------------|--------|
|
|
138
|
+
| Complexity > 20 | God function | Decompose into smaller functions |
|
|
139
|
+
| Fan-out > 15 | Kitchen sink module | Split responsibilities |
|
|
140
|
+
| Fan-in > 20 | Fragile dependency | Consider interface/abstraction |
|
|
141
|
+
| Multiple clones | Copy-paste programming | Extract shared utility |
|
|
142
|
+
| Import cycle | Circular dependency | Restructure module boundaries |
|
|
143
|
+
|
|
144
|
+
## Output Format
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
## Code Health Report
|
|
148
|
+
|
|
149
|
+
### Overview
|
|
150
|
+
- Total findings: X (Y critical, Z warnings)
|
|
151
|
+
- Top concern: [area/file with most issues]
|
|
152
|
+
|
|
153
|
+
### Hotspots
|
|
154
|
+
1. **`file:line`** - [description] (severity)
|
|
155
|
+
- Impact: [why this matters]
|
|
156
|
+
- Recommendation: [what to do]
|
|
157
|
+
|
|
158
|
+
### Patterns Detected
|
|
159
|
+
- [List of anti-patterns found with evidence]
|
|
160
|
+
|
|
161
|
+
### Recommendations
|
|
162
|
+
1. [Prioritized action items]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Failure Handling
|
|
166
|
+
|
|
167
|
+
1. **No findings data** — Tell user to run analyzers first: `./.aide/bin/aide findings run --path .`
|
|
168
|
+
2. **Stale findings** — Findings reflect the state at last analyzer run; recommend re-running if code changed significantly
|
|
169
|
+
3. **False positives** — Secret detection may flag test fixtures or example configs; note when findings appear to be in test/example code
|
|
170
|
+
|
|
171
|
+
## Verification Criteria
|
|
172
|
+
|
|
173
|
+
- [ ] Checked `findings_stats` for overall picture
|
|
174
|
+
- [ ] Reviewed critical findings
|
|
175
|
+
- [ ] Cross-referenced findings with actual code (used `Read` or `code_outline`)
|
|
176
|
+
- [ ] Provided actionable recommendations with file:line references
|
|
177
|
+
- [ ] Noted any false positives or findings that need manual verification
|
package/skills/perf/SKILL.md
CHANGED
|
@@ -19,6 +19,7 @@ Systematic approach to identifying and fixing performance issues.
|
|
|
19
19
|
## Prerequisites
|
|
20
20
|
|
|
21
21
|
Before starting:
|
|
22
|
+
|
|
22
23
|
- Identify the specific operation or endpoint that is slow
|
|
23
24
|
- Understand what "fast enough" means (target latency, throughput)
|
|
24
25
|
- Ensure you can measure performance reproducibly
|
|
@@ -45,6 +46,7 @@ curl -w "@curl-format.txt" -o /dev/null -s "http://localhost:3000/api/endpoint"
|
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
**Record baseline metrics:**
|
|
49
|
+
|
|
48
50
|
- Execution time (p50, p95, p99 if available)
|
|
49
51
|
- Memory usage
|
|
50
52
|
- Number of operations per second
|
|
@@ -65,30 +67,42 @@ go tool pprof -http=:8080 cpu.prof
|
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
```
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
mcp__plugin_aide_aide__code_search query="map" kind="function"
|
|
70
|
+
# Get structural overview of suspect files (signatures + line ranges, not full content)
|
|
71
|
+
mcp__plugin_aide_aide__code_outline file="path/to/hotspot.ts"
|
|
71
72
|
|
|
72
|
-
# Find
|
|
73
|
-
|
|
73
|
+
# Find functions/classes in suspect area by name
|
|
74
|
+
mcp__plugin_aide_aide__code_search query="processData" kind="function"
|
|
74
75
|
|
|
75
|
-
# Find
|
|
76
|
-
|
|
76
|
+
# Find all callers of a hot function
|
|
77
|
+
mcp__plugin_aide_aide__code_references symbol="processData"
|
|
78
|
+
|
|
79
|
+
# Search for expensive patterns in code bodies (Grep is better here)
|
|
80
|
+
Grep for ".forEach(", ".map(", ".filter(" # Loop/iteration patterns
|
|
81
|
+
Grep for "SELECT", "find(", "query(" # Database queries
|
|
82
|
+
Grep for "fetch(", "axios", "http.Get" # Network calls
|
|
83
|
+
Grep for "setTimeout", "setInterval" # Timers
|
|
84
|
+
Grep for "JSON.parse", "JSON.stringify" # Serialization
|
|
77
85
|
```
|
|
78
86
|
|
|
87
|
+
Note: `code_search` finds function/class/type _definitions_ by name.
|
|
88
|
+
For patterns inside function bodies (loops, queries, call chains), use Grep.
|
|
89
|
+
|
|
90
|
+
After identifying hotspot functions via profiling and search, use `Read` with offset/limit to read
|
|
91
|
+
specific functions (use line numbers from `code_outline`).
|
|
92
|
+
|
|
79
93
|
### Step 3: Analyze Performance Patterns
|
|
80
94
|
|
|
81
95
|
Look for these common issues:
|
|
82
96
|
|
|
83
|
-
| Issue
|
|
84
|
-
|
|
85
|
-
| N+1 queries
|
|
86
|
-
| Repeated computation | Same calculation in loop
|
|
87
|
-
| Large allocations
|
|
88
|
-
| Blocking I/O
|
|
89
|
-
| Missing indexes
|
|
90
|
-
| Unnecessary work
|
|
91
|
-
| Serial execution
|
|
97
|
+
| Issue | Pattern | Solution |
|
|
98
|
+
| -------------------- | -------------------------- | --------------------- |
|
|
99
|
+
| N+1 queries | Loop containing DB call | Batch/eager load |
|
|
100
|
+
| Repeated computation | Same calculation in loop | Memoize/cache |
|
|
101
|
+
| Large allocations | Creating objects in loop | Reuse/pool objects |
|
|
102
|
+
| Blocking I/O | Sync file/network ops | Make async/concurrent |
|
|
103
|
+
| Missing indexes | Slow DB queries | Add database indexes |
|
|
104
|
+
| Unnecessary work | Processing unused data | Filter/skip early |
|
|
105
|
+
| Serial execution | Sequential independent ops | Parallelize |
|
|
92
106
|
|
|
93
107
|
### Step 4: Apply Optimizations
|
|
94
108
|
|
|
@@ -111,6 +125,7 @@ go test -bench=. -benchmem ./...
|
|
|
111
125
|
```
|
|
112
126
|
|
|
113
127
|
Compare:
|
|
128
|
+
|
|
114
129
|
- Did the metric improve?
|
|
115
130
|
- By how much (percentage)?
|
|
116
131
|
- Any negative side effects?
|
|
@@ -130,13 +145,13 @@ go test ./...
|
|
|
130
145
|
|
|
131
146
|
## Failure Handling
|
|
132
147
|
|
|
133
|
-
| Situation
|
|
134
|
-
|
|
135
|
-
| Cannot measure reliably
|
|
136
|
-
| Optimization made it slower
|
|
137
|
-
| Optimization broke tests
|
|
138
|
-
| Bottleneck is external
|
|
139
|
-
| Memory improved but CPU worse | Evaluate trade-off for use case
|
|
148
|
+
| Situation | Action |
|
|
149
|
+
| ----------------------------- | --------------------------------------------- |
|
|
150
|
+
| Cannot measure reliably | Increase sample size, reduce variance sources |
|
|
151
|
+
| Optimization made it slower | Revert, analyze why, profile more carefully |
|
|
152
|
+
| Optimization broke tests | Fix tests or revert if behavior changed |
|
|
153
|
+
| Bottleneck is external | Document, consider caching, async processing |
|
|
154
|
+
| Memory improved but CPU worse | Evaluate trade-off for use case |
|
|
140
155
|
|
|
141
156
|
## Common Optimizations
|
|
142
157
|
|
|
@@ -149,12 +164,12 @@ for (const user of users) {
|
|
|
149
164
|
}
|
|
150
165
|
|
|
151
166
|
// GOOD: Batch query
|
|
152
|
-
const userIds = users.map(u => u.id);
|
|
167
|
+
const userIds = users.map((u) => u.id);
|
|
153
168
|
const posts = await db.getPostsForUsers(userIds);
|
|
154
169
|
|
|
155
170
|
// BAD: Repeated work
|
|
156
|
-
const typeA = items.filter(x => x.type ===
|
|
157
|
-
const typeB = items.filter(x => x.type ===
|
|
171
|
+
const typeA = items.filter((x) => x.type === "a").map((x) => x.value);
|
|
172
|
+
const typeB = items.filter((x) => x.type === "b").map((x) => x.value);
|
|
158
173
|
|
|
159
174
|
// GOOD: Single pass
|
|
160
175
|
const grouped = { a: [], b: [] };
|
|
@@ -167,10 +182,7 @@ const result1 = await fetch(url1);
|
|
|
167
182
|
const result2 = await fetch(url2);
|
|
168
183
|
|
|
169
184
|
// GOOD: Parallel async
|
|
170
|
-
const [result1, result2] = await Promise.all([
|
|
171
|
-
fetch(url1),
|
|
172
|
-
fetch(url2)
|
|
173
|
-
]);
|
|
185
|
+
const [result1, result2] = await Promise.all([fetch(url1), fetch(url2)]);
|
|
174
186
|
```
|
|
175
187
|
|
|
176
188
|
### Go
|
|
@@ -225,13 +237,17 @@ SELECT * FROM posts WHERE user_id IN (?, ?, ?);
|
|
|
225
237
|
|
|
226
238
|
## MCP Tools
|
|
227
239
|
|
|
228
|
-
- `
|
|
229
|
-
- `
|
|
240
|
+
- `mcp__plugin_aide_aide__code_outline` - **Start here.** Get collapsed file skeleton to identify functions before reading
|
|
241
|
+
- `mcp__plugin_aide_aide__code_search` - Find function/class/type definitions by name
|
|
242
|
+
- `mcp__plugin_aide_aide__code_symbols` - List all symbol definitions in a file
|
|
243
|
+
- `mcp__plugin_aide_aide__code_references` - Find all callers of a hot function (exact name match)
|
|
230
244
|
- `mcp__plugin_aide_aide__memory_search` - Check past performance decisions
|
|
245
|
+
- **Grep** - Find code patterns in bodies: loops, queries, call chains, string literals
|
|
231
246
|
|
|
232
247
|
## Profiling Commands Reference
|
|
233
248
|
|
|
234
249
|
### Node.js
|
|
250
|
+
|
|
235
251
|
```bash
|
|
236
252
|
# CPU profiling
|
|
237
253
|
node --cpu-prof app.js
|
|
@@ -247,6 +263,7 @@ npx clinic flame -- node app.js
|
|
|
247
263
|
```
|
|
248
264
|
|
|
249
265
|
### Go
|
|
266
|
+
|
|
250
267
|
```bash
|
|
251
268
|
# CPU profiling
|
|
252
269
|
go test -cpuprofile=cpu.prof -bench=.
|
|
@@ -262,6 +279,7 @@ go tool trace trace.out
|
|
|
262
279
|
```
|
|
263
280
|
|
|
264
281
|
### Browser
|
|
282
|
+
|
|
265
283
|
- DevTools -> Performance -> Record
|
|
266
284
|
- DevTools -> Memory -> Heap snapshot
|
|
267
285
|
- Lighthouse for overall page performance
|
|
@@ -269,6 +287,7 @@ go tool trace trace.out
|
|
|
269
287
|
## Verification Criteria
|
|
270
288
|
|
|
271
289
|
Before completing:
|
|
290
|
+
|
|
272
291
|
- [ ] Baseline measurement recorded
|
|
273
292
|
- [ ] Improvement quantified (percentage)
|
|
274
293
|
- [ ] All tests still pass
|
|
@@ -281,25 +300,30 @@ Before completing:
|
|
|
281
300
|
## Performance Analysis: [Operation/Endpoint Name]
|
|
282
301
|
|
|
283
302
|
### Baseline
|
|
303
|
+
|
|
284
304
|
- Execution time: 450ms (p50), 680ms (p95)
|
|
285
305
|
- Memory: 125MB peak
|
|
286
306
|
- Database queries: 150
|
|
287
307
|
|
|
288
308
|
### Hotspots Identified
|
|
309
|
+
|
|
289
310
|
1. `db.getUsers()` - 300ms (67% of total)
|
|
290
311
|
2. `processData()` - 100ms (22% of total)
|
|
291
312
|
3. `formatOutput()` - 50ms (11% of total)
|
|
292
313
|
|
|
293
314
|
### Optimizations Applied
|
|
315
|
+
|
|
294
316
|
1. Batched user queries - 300ms -> 50ms
|
|
295
317
|
2. Memoized processData for repeated calls - 100ms -> 5ms
|
|
296
318
|
|
|
297
319
|
### Results
|
|
320
|
+
|
|
298
321
|
- Execution time: 450ms -> 105ms (77% faster)
|
|
299
322
|
- Memory: 125MB -> 80MB (36% reduction)
|
|
300
323
|
- Database queries: 150 -> 3 (98% reduction)
|
|
301
324
|
|
|
302
325
|
### Verification
|
|
326
|
+
|
|
303
327
|
- All tests: PASS
|
|
304
328
|
- Output correctness: VERIFIED
|
|
305
329
|
```
|
|
@@ -113,6 +113,11 @@ Output a structured story list. Each story must be:
|
|
|
113
113
|
|
|
114
114
|
4. **Instruct the user**: Run `/aide:swarm` to execute the plan
|
|
115
115
|
|
|
116
|
+
**Note on task materialization:** The plan is stored as a decision, not as tasks. The `/aide:swarm` skill reads the plan and materializes tasks at execution time:
|
|
117
|
+
|
|
118
|
+
- **Claude Code**: Each story agent creates native tasks (`TaskCreate`) with `blockedBy` dependency chaining for SDLC stages.
|
|
119
|
+
- **OpenCode**: The orchestrator creates aide tasks (`task_create` MCP tool) for all SDLC stages upfront, and story agents claim them.
|
|
120
|
+
|
|
116
121
|
## Output Format
|
|
117
122
|
|
|
118
123
|
The stored `swarm-plan` decision should be a JSON object:
|
package/skills/ralph/SKILL.md
CHANGED
|
@@ -34,6 +34,15 @@ You are now in **Ralph Wiggum mode** - an iterative development methodology that
|
|
|
34
34
|
|
|
35
35
|
All state is managed through aide. Use MCP tools for reads, CLI for writes:
|
|
36
36
|
|
|
37
|
+
### Task System Roles
|
|
38
|
+
|
|
39
|
+
| System | Role | How |
|
|
40
|
+
| --------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
41
|
+
| **aide tasks** (MCP or CLI) | Durable task backlog, claiming, persistence enforcement | `task_create`/`task_claim`/`task_complete` (MCP) or `aide task` (CLI) |
|
|
42
|
+
| **Native todowrite** | Personal progress tracking within current iteration | `todowrite` tool — tracks sub-steps of current task |
|
|
43
|
+
|
|
44
|
+
aide tasks are the source of truth for ralph — they survive session restarts and are checked by persistence hooks to block premature stopping. Use native `todowrite` for your own step-by-step checklist within each task iteration.
|
|
45
|
+
|
|
37
46
|
### Reads (MCP Tools)
|
|
38
47
|
|
|
39
48
|
| Tool | Purpose |
|
|
@@ -43,14 +52,18 @@ All state is managed through aide. Use MCP tools for reads, CLI for writes:
|
|
|
43
52
|
| `mcp__plugin_aide_aide__decision_get` | Get decisions |
|
|
44
53
|
| `mcp__plugin_aide_aide__decision_list` | List all decisions |
|
|
45
54
|
| `mcp__plugin_aide_aide__memory_search` | Search discoveries |
|
|
55
|
+
| `task_list` | List aide tasks |
|
|
56
|
+
| `task_get` | Get task by ID |
|
|
46
57
|
|
|
47
|
-
### Writes (CLI via Bash)
|
|
58
|
+
### Writes (CLI via Bash or MCP)
|
|
48
59
|
|
|
49
60
|
```bash
|
|
50
61
|
# Phase tracking
|
|
51
62
|
./.aide/bin/aide state set ralph:phase planning # or "building"
|
|
52
63
|
|
|
53
|
-
# Task management
|
|
64
|
+
# Task management — use aide tasks (persistent, claimable)
|
|
65
|
+
# Via MCP: task_create, task_claim, task_complete
|
|
66
|
+
# Via CLI: ./.aide/bin/aide task create/claim/complete
|
|
54
67
|
|
|
55
68
|
# Decisions
|
|
56
69
|
./.aide/bin/aide decision set <topic> "<decision>" --rationale="<why>"
|
|
@@ -168,12 +181,6 @@ Claim it:
|
|
|
168
181
|
./.aide/bin/aide task claim <task-id> --agent=ralph
|
|
169
182
|
```
|
|
170
183
|
|
|
171
|
-
Claim it:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
./.aide/bin/aide task claim <task-id> --agent=ralph
|
|
175
|
-
```
|
|
176
|
-
|
|
177
184
|
#### 3. Verify Gap Still Exists (Don't Assume!)
|
|
178
185
|
|
|
179
186
|
Before implementing, RE-VERIFY:
|
package/skills/review/SKILL.md
CHANGED
|
@@ -18,6 +18,7 @@ Comprehensive code review covering quality, security, and maintainability.
|
|
|
18
18
|
## Review Checklist
|
|
19
19
|
|
|
20
20
|
### Code Quality
|
|
21
|
+
|
|
21
22
|
- [ ] Clear naming (variables, functions, classes)
|
|
22
23
|
- [ ] Single responsibility (functions do one thing)
|
|
23
24
|
- [ ] DRY (no unnecessary duplication)
|
|
@@ -26,6 +27,7 @@ Comprehensive code review covering quality, security, and maintainability.
|
|
|
26
27
|
- [ ] Edge cases considered
|
|
27
28
|
|
|
28
29
|
### Security (OWASP Top 10)
|
|
30
|
+
|
|
29
31
|
- [ ] Input validation (no injection vulnerabilities)
|
|
30
32
|
- [ ] Authentication checks (routes protected)
|
|
31
33
|
- [ ] Authorization (proper access control)
|
|
@@ -36,6 +38,7 @@ Comprehensive code review covering quality, security, and maintainability.
|
|
|
36
38
|
- [ ] Secure dependencies (no known vulnerabilities)
|
|
37
39
|
|
|
38
40
|
### Maintainability
|
|
41
|
+
|
|
39
42
|
- [ ] Code is readable without comments
|
|
40
43
|
- [ ] Comments explain "why" not "what"
|
|
41
44
|
- [ ] Consistent with codebase patterns
|
|
@@ -43,29 +46,51 @@ Comprehensive code review covering quality, security, and maintainability.
|
|
|
43
46
|
- [ ] No dead code
|
|
44
47
|
|
|
45
48
|
### Performance
|
|
49
|
+
|
|
46
50
|
- [ ] No N+1 queries
|
|
47
51
|
- [ ] Appropriate caching
|
|
48
52
|
- [ ] No memory leaks
|
|
49
53
|
- [ ] Efficient algorithms
|
|
50
54
|
|
|
55
|
+
## Context-Efficient Reading
|
|
56
|
+
|
|
57
|
+
Prefer lightweight tools first, then read in detail where needed:
|
|
58
|
+
|
|
59
|
+
- **`code_outline`** -- Collapsed skeleton with signatures and line ranges. Great first step for unfamiliar files.
|
|
60
|
+
- **`code_symbols`** -- Quick symbol list when you only need names and kinds.
|
|
61
|
+
- **`code_search`** / **`code_references`** -- Find symbol definitions or callers across the codebase.
|
|
62
|
+
- **`Read` with offset/limit** -- Read specific functions using line numbers from the outline.
|
|
63
|
+
- **Grep** -- Find patterns in code content (loops, queries, string literals) that the index doesn't cover.
|
|
64
|
+
|
|
65
|
+
For reviews spanning many files, consider using **Task sub-agents** (`explore` type) which run in their
|
|
66
|
+
own context and return summaries.
|
|
67
|
+
|
|
51
68
|
## Review Process
|
|
52
69
|
|
|
53
|
-
1. **
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
1. **Outline changed files** - Use `code_outline` on each changed file to understand structure.
|
|
71
|
+
Identify areas of concern from signatures and line ranges.
|
|
72
|
+
2. **Read targeted sections** - Use `Read` with `offset`/`limit` to read only the specific
|
|
73
|
+
functions/sections that need detailed review (use line numbers from the outline).
|
|
74
|
+
3. **Search for context** - Use `code_search`, `code_references`, and **Grep**:
|
|
75
|
+
- `code_search` — Find related function/class/type _definitions_ by name
|
|
76
|
+
- `code_references` — Find all callers/usages of a modified symbol (exact name match)
|
|
77
|
+
- **Grep** — Find code _patterns_ in bodies (error handling, SQL queries, security-sensitive calls)
|
|
78
|
+
4. **Check integration** - How does it fit the larger system?
|
|
79
|
+
5. **Run static analysis** - Use lsp_diagnostics, ast_grep if available
|
|
80
|
+
6. **Document findings** - Use severity levels
|
|
61
81
|
|
|
62
82
|
## MCP Tools
|
|
63
83
|
|
|
64
84
|
Use these tools during review:
|
|
65
85
|
|
|
86
|
+
- `mcp__plugin_aide_aide__code_outline` - **Start here.** Get collapsed file skeleton with signatures and line ranges
|
|
66
87
|
- `mcp__plugin_aide_aide__code_search` - Find symbols related to changes (e.g., `code_search query="getUserById"`)
|
|
67
88
|
- `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file being reviewed
|
|
89
|
+
- `mcp__plugin_aide_aide__code_references` - Find all callers/usages of a modified symbol
|
|
68
90
|
- `mcp__plugin_aide_aide__memory_search` - Check for related past decisions or issues
|
|
91
|
+
- `mcp__plugin_aide_aide__findings_search` - Search static analysis findings (complexity, secrets, clones) related to changed code
|
|
92
|
+
- `mcp__plugin_aide_aide__findings_list` - List findings filtered by file, severity, or analyzer
|
|
93
|
+
- `mcp__plugin_aide_aide__findings_stats` - Overview of finding counts by analyzer and severity
|
|
69
94
|
|
|
70
95
|
## Output Format
|
|
71
96
|
|
|
@@ -73,28 +98,34 @@ Use these tools during review:
|
|
|
73
98
|
## Code Review: [Feature/PR Name]
|
|
74
99
|
|
|
75
100
|
### Summary
|
|
101
|
+
|
|
76
102
|
[1-2 sentence overview]
|
|
77
103
|
|
|
78
104
|
### Findings
|
|
79
105
|
|
|
80
106
|
#### 🔴 Critical (must fix)
|
|
107
|
+
|
|
81
108
|
- **[Issue]** `file:line`
|
|
82
109
|
- Problem: [description]
|
|
83
110
|
- Fix: [recommendation]
|
|
84
111
|
|
|
85
112
|
#### 🟡 Warning (should fix)
|
|
113
|
+
|
|
86
114
|
- **[Issue]** `file:line`
|
|
87
115
|
- Problem: [description]
|
|
88
116
|
- Fix: [recommendation]
|
|
89
117
|
|
|
90
118
|
#### 🔵 Suggestion (consider)
|
|
119
|
+
|
|
91
120
|
- **[Issue]** `file:line`
|
|
92
121
|
- Suggestion: [recommendation]
|
|
93
122
|
|
|
94
123
|
### Security Notes
|
|
124
|
+
|
|
95
125
|
- [Any security-specific observations]
|
|
96
126
|
|
|
97
127
|
### Verdict
|
|
128
|
+
|
|
98
129
|
[ ] ✅ Approve
|
|
99
130
|
[ ] ⚠️ Approve with comments
|
|
100
131
|
[ ] ❌ Request changes
|
|
@@ -102,11 +133,11 @@ Use these tools during review:
|
|
|
102
133
|
|
|
103
134
|
## Severity Guide
|
|
104
135
|
|
|
105
|
-
| Level
|
|
106
|
-
|
|
107
|
-
| Critical
|
|
108
|
-
| Warning
|
|
109
|
-
| Suggestion | Style, minor improvement, optional
|
|
136
|
+
| Level | Criteria |
|
|
137
|
+
| ---------- | ------------------------------------------------- |
|
|
138
|
+
| Critical | Security vulnerability, data loss risk, crash |
|
|
139
|
+
| Warning | Bug potential, maintainability issue, performance |
|
|
140
|
+
| Suggestion | Style, minor improvement, optional |
|
|
110
141
|
|
|
111
142
|
## Failure Handling
|
|
112
143
|
|
|
@@ -122,10 +153,12 @@ Use these tools during review:
|
|
|
122
153
|
## Review Status: Incomplete
|
|
123
154
|
|
|
124
155
|
### Blockers
|
|
156
|
+
|
|
125
157
|
- Could not access: `path/to/file.ts` (permission denied)
|
|
126
158
|
- Missing context: Need to understand `AuthService` implementation
|
|
127
159
|
|
|
128
160
|
### Partial Findings
|
|
161
|
+
|
|
129
162
|
[Include any findings from files that were reviewed]
|
|
130
163
|
```
|
|
131
164
|
|
|
@@ -133,14 +166,16 @@ Use these tools during review:
|
|
|
133
166
|
|
|
134
167
|
A complete code review must:
|
|
135
168
|
|
|
136
|
-
1. **
|
|
137
|
-
2. **
|
|
138
|
-
3. **
|
|
139
|
-
4. **
|
|
169
|
+
1. **Outline all changed files** - Use `code_outline` on every file in scope
|
|
170
|
+
2. **Read critical sections** - Use targeted `Read` with offset/limit on flagged areas
|
|
171
|
+
3. **Check for related code** - Use `code_search` and `code_references` to find callers/callees
|
|
172
|
+
4. **Verify test coverage** - Check if tests exist for critical paths
|
|
173
|
+
5. **Document all findings** - Even if no issues found, state that explicitly
|
|
140
174
|
|
|
141
175
|
### Checklist before submitting review:
|
|
142
176
|
|
|
143
|
-
- [ ] All files in diff/scope have been
|
|
177
|
+
- [ ] All files in diff/scope have been outlined
|
|
178
|
+
- [ ] Critical functions/sections read in detail (with offset/limit)
|
|
144
179
|
- [ ] Related symbols searched (callers, implementations)
|
|
145
180
|
- [ ] Security checklist evaluated
|
|
146
181
|
- [ ] Findings documented with file:line references
|