@jmylchreest/aide-plugin 0.0.39 → 0.0.42
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/assess-findings/SKILL.md +167 -0
- package/skills/code-search/SKILL.md +12 -0
- package/skills/git/SKILL.md +10 -0
- package/skills/memorise/SKILL.md +89 -11
- package/skills/patterns/SKILL.md +182 -0
- package/skills/plan-swarm/SKILL.md +5 -0
- package/skills/ralph/SKILL.md +15 -8
- package/skills/review/SKILL.md +3 -0
- package/skills/swarm/SKILL.md +75 -24
- package/src/cli/config.ts +4 -1
- package/src/core/aide-client.ts +15 -12
- package/src/core/mcp-sync.ts +19 -3
- package/src/core/partial-memory.ts +46 -55
- package/src/core/persistence-logic.ts +28 -4
- package/src/core/session-init.ts +10 -6
- package/src/core/session-summary-logic.ts +9 -2
- package/src/core/todo-checker.ts +53 -18
- package/src/core/tool-tracking.ts +3 -5
- package/src/core/types.ts +21 -0
- package/src/lib/aide-downloader.ts +0 -8
- package/src/lib/hook-utils.ts +47 -115
- package/src/lib/hud.ts +2 -2
- package/src/lib/skills-registry.ts +32 -4
- package/src/lib/worktree.ts +11 -37
- package/src/opencode/hooks.ts +27 -1
- package/src/lib/aide-memory.ts +0 -400
package/package.json
CHANGED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assess-findings
|
|
3
|
+
description: Triage static analysis findings, assess merit, and accept noise or irrelevant items
|
|
4
|
+
triggers:
|
|
5
|
+
- assess findings
|
|
6
|
+
- analyse findings
|
|
7
|
+
- analyze findings
|
|
8
|
+
- triage findings
|
|
9
|
+
- review findings
|
|
10
|
+
- accept findings
|
|
11
|
+
- dismiss findings
|
|
12
|
+
- clean up findings
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Assess Findings
|
|
16
|
+
|
|
17
|
+
**Recommended model tier:** balanced (sonnet) - this skill requires reading code and making judgement calls
|
|
18
|
+
|
|
19
|
+
Triage static analysis findings by reading the actual code, assessing whether each finding
|
|
20
|
+
is genuine or noise, and accepting (dismissing) irrelevant ones using `findings_accept`.
|
|
21
|
+
Accepted findings are hidden from future output by default.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
- Findings must already exist. If `findings_stats` returns zero counts, tell the user to run:
|
|
26
|
+
```bash
|
|
27
|
+
./.aide/bin/aide findings run --path .
|
|
28
|
+
```
|
|
29
|
+
- The `findings_accept` tool must be available (provided by the aide MCP server).
|
|
30
|
+
|
|
31
|
+
## Available Tools
|
|
32
|
+
|
|
33
|
+
### Read-only (shared with `patterns` skill)
|
|
34
|
+
|
|
35
|
+
| Tool | Purpose |
|
|
36
|
+
| ----------------- | ------------------------------------------------------- |
|
|
37
|
+
| `findings_stats` | Counts by analyzer and severity — start here |
|
|
38
|
+
| `findings_list` | Browse findings with filters (analyzer, severity, file) |
|
|
39
|
+
| `findings_search` | Full-text search across finding titles and details |
|
|
40
|
+
|
|
41
|
+
### Write (unique to this skill)
|
|
42
|
+
|
|
43
|
+
| Tool | Purpose |
|
|
44
|
+
| ----------------- | --------------------------------------------------- |
|
|
45
|
+
| `findings_accept` | Mark findings as accepted/dismissed by ID or filter |
|
|
46
|
+
|
|
47
|
+
### Code inspection
|
|
48
|
+
|
|
49
|
+
| Tool | Purpose |
|
|
50
|
+
| -------------- | --------------------------------------------------- |
|
|
51
|
+
| `code_outline` | Get collapsed file structure to understand context |
|
|
52
|
+
| `Read` | Read specific line ranges to evaluate finding merit |
|
|
53
|
+
|
|
54
|
+
## Workflow
|
|
55
|
+
|
|
56
|
+
### 1. Get the Landscape
|
|
57
|
+
|
|
58
|
+
Call `findings_stats` to understand the scope:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
findings_stats
|
|
62
|
+
-> Returns: counts per analyzer (complexity, coupling, secrets, clones) and severity
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If the user asked to focus on a specific analyzer or severity, note that and filter accordingly.
|
|
66
|
+
Otherwise, work through all findings systematically.
|
|
67
|
+
|
|
68
|
+
### 2. Prioritise Review Order
|
|
69
|
+
|
|
70
|
+
Work through findings in this order:
|
|
71
|
+
|
|
72
|
+
1. **Secrets** (critical first) — these need immediate attention; false positives are common in test fixtures
|
|
73
|
+
2. **Complexity** (critical, then warning) — assess whether high complexity is inherent or decomposable
|
|
74
|
+
3. **Clones** (all) — determine if duplication is extractable or structural boilerplate
|
|
75
|
+
4. **Coupling** (all) — assess whether high fan-in/fan-out is expected for the file's role
|
|
76
|
+
|
|
77
|
+
### 3. Assess Each Finding
|
|
78
|
+
|
|
79
|
+
For each finding or group of related findings:
|
|
80
|
+
|
|
81
|
+
1. **Read the finding details** — note the file, line range, and metric values
|
|
82
|
+
2. **Read the actual code** — use `code_outline` first, then `Read` with offset/limit on the flagged section
|
|
83
|
+
3. **Make a judgement call** using these criteria:
|
|
84
|
+
|
|
85
|
+
#### Accept (dismiss) when:
|
|
86
|
+
|
|
87
|
+
- **Complexity**: The function is inherently complex (CLI dispatch, protocol handling, state machines) and cannot be meaningfully decomposed without harming readability
|
|
88
|
+
- **Clones**: The duplication is structural boilerplate (e.g., CLI subcommand wiring, store method patterns) where extraction would require framework-level abstraction
|
|
89
|
+
- **Coupling**: High fan-in/fan-out is expected for the file's architectural role (e.g., a main entry point, a facade, a registry)
|
|
90
|
+
- **Secrets**: The flagged string is a test fixture, example config, documentation placeholder, or env var name (not an actual secret)
|
|
91
|
+
|
|
92
|
+
#### Keep (do NOT accept) when:
|
|
93
|
+
|
|
94
|
+
- The finding points to a genuine problem that should be fixed
|
|
95
|
+
- Complexity can be reduced by extracting helper functions
|
|
96
|
+
- Duplication can be resolved by creating a shared utility
|
|
97
|
+
- A coupling cycle exists that indicates poor module boundaries
|
|
98
|
+
- A string looks like it could be a real secret or credential
|
|
99
|
+
|
|
100
|
+
### 4. Accept Findings
|
|
101
|
+
|
|
102
|
+
Use `findings_accept` to dismiss noise. You can accept:
|
|
103
|
+
|
|
104
|
+
- **By IDs** — for individual findings after assessment:
|
|
105
|
+
```
|
|
106
|
+
findings_accept ids=["finding-id-1", "finding-id-2"]
|
|
107
|
+
```
|
|
108
|
+
- **By filter** — for bulk dismissal of an entire category:
|
|
109
|
+
```
|
|
110
|
+
findings_accept analyzer="clones" file="cmd/"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Always explain **why** each finding is being accepted before calling the tool.
|
|
114
|
+
|
|
115
|
+
### 5. Report Summary
|
|
116
|
+
|
|
117
|
+
After completing the triage, produce a summary:
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
## Findings Triage Summary
|
|
121
|
+
|
|
122
|
+
### Before
|
|
123
|
+
|
|
124
|
+
- Total: X findings (Y critical, Z warnings, W info)
|
|
125
|
+
|
|
126
|
+
### Accepted (Dismissed)
|
|
127
|
+
|
|
128
|
+
- N findings accepted as noise/irrelevant
|
|
129
|
+
- Complexity: X (inherent complexity in [files])
|
|
130
|
+
- Clones: Y (structural boilerplate in [area])
|
|
131
|
+
- Coupling: Z (expected for [role])
|
|
132
|
+
- Secrets: W (test fixtures / placeholders)
|
|
133
|
+
|
|
134
|
+
### Remaining (Genuine)
|
|
135
|
+
|
|
136
|
+
- M findings require attention
|
|
137
|
+
- [List each with file:line and brief description]
|
|
138
|
+
|
|
139
|
+
### Recommendations
|
|
140
|
+
|
|
141
|
+
1. [Prioritised action items for genuine findings]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Decision Criteria Reference
|
|
145
|
+
|
|
146
|
+
| Analyzer | Accept If | Keep If |
|
|
147
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
|
|
148
|
+
| complexity | Cyclomatic complexity is inherent to the problem domain; function handles unavoidable branching (CLI dispatch, protocol negotiation) | Function can be decomposed into smaller, testable units |
|
|
149
|
+
| clones | Duplication is cross-cutting boilerplate (CLI wiring, store CRUD patterns) | A shared utility or abstraction would reduce maintenance burden |
|
|
150
|
+
| coupling | File is an intentional integration point (main, facade, registry) | Circular dependencies or unexpected transitive coupling exists |
|
|
151
|
+
| secrets | Test fixture, documentation example, env var name, or placeholder | Looks like a real credential, API key, or connection string |
|
|
152
|
+
|
|
153
|
+
## Failure Handling
|
|
154
|
+
|
|
155
|
+
1. **No findings** — Tell user to run `./.aide/bin/aide findings run --path .` first
|
|
156
|
+
2. **`findings_accept` not available** — The aide MCP server may not expose this tool; tell the user to update aide
|
|
157
|
+
3. **Uncertain about a finding** — When in doubt, **keep it**. It's better to flag a false positive for human review than to dismiss a real issue
|
|
158
|
+
4. **Large number of findings** — Work in batches by analyzer. Accept obvious noise first, then do detailed code review for borderline cases
|
|
159
|
+
|
|
160
|
+
## Verification
|
|
161
|
+
|
|
162
|
+
- [ ] Called `findings_stats` for baseline counts
|
|
163
|
+
- [ ] Reviewed each finding category (secrets, complexity, clones, coupling)
|
|
164
|
+
- [ ] Read actual code for every finding before accepting
|
|
165
|
+
- [ ] Provided rationale for each acceptance
|
|
166
|
+
- [ ] Produced summary with before/after counts
|
|
167
|
+
- [ ] Remaining findings are genuinely actionable
|
|
@@ -86,6 +86,18 @@ Is the code indexed?
|
|
|
86
86
|
→ Returns: file count, symbol count, reference count
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
### 6. Search Findings (`mcp__plugin_aide_aide__findings_search`)
|
|
90
|
+
|
|
91
|
+
Search static analysis findings (complexity hotspots, secrets, code clones, coupling issues).
|
|
92
|
+
|
|
93
|
+
**Example usage:**
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Any complexity issues in src/auth?
|
|
97
|
+
→ Uses findings_search tool with query "auth" or file filter
|
|
98
|
+
→ Returns: findings with file, line, severity, description
|
|
99
|
+
```
|
|
100
|
+
|
|
89
101
|
## Workflow
|
|
90
102
|
|
|
91
103
|
1. **First, check if codebase is indexed:**
|
package/skills/git/SKILL.md
CHANGED
|
@@ -156,6 +156,16 @@ git worktree list | grep <worktree-path>
|
|
|
156
156
|
git branch -a | grep <branch-name>
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
## Change Context with Findings
|
|
160
|
+
|
|
161
|
+
When reviewing diffs or preparing commits, use findings tools to understand the quality context of changed code:
|
|
162
|
+
|
|
163
|
+
- `mcp__plugin_aide_aide__findings_search` — Search for known issues (complexity, secrets, clones) in changed files
|
|
164
|
+
- `mcp__plugin_aide_aide__findings_list` — List all findings for a specific file to understand its health
|
|
165
|
+
- `mcp__plugin_aide_aide__findings_stats` — Quick overview of finding counts across the project
|
|
166
|
+
|
|
167
|
+
This helps surface pre-existing issues in files you're touching, and can inform whether a commit should also address nearby problems.
|
|
168
|
+
|
|
159
169
|
## Parallel Work Pattern
|
|
160
170
|
|
|
161
171
|
For swarm mode or parallel features:
|
package/skills/memorise/SKILL.md
CHANGED
|
@@ -52,25 +52,31 @@ Use the `./.aide/bin/aide memory add` CLI command via Bash:
|
|
|
52
52
|
### Simple preference (global - injected at session start)
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
./.aide/bin/aide memory add --category=learning --tags=preferences,colour,scope:global "User's favourite colour is blue"
|
|
55
|
+
./.aide/bin/aide memory add --category=learning --tags=preferences,colour,scope:global,source:user "User's favourite colour is blue"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
### Technical learning (project-specific)
|
|
58
|
+
### Technical learning (project-specific, verified)
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
./.aide/bin/aide memory add --category=learning --tags=testing,vitest,project:myapp,session:abc12345 "Vitest requires .js extensions for ESM imports even for .ts files. Configure moduleResolution: NodeNext in tsconfig."
|
|
61
|
+
./.aide/bin/aide memory add --category=learning --tags=testing,vitest,project:myapp,session:abc12345,source:discovered,verified:true "Vitest requires .js extensions for ESM imports even for .ts files. Configure moduleResolution: NodeNext in tsconfig."
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
### Session summary
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
./.aide/bin/aide memory add --category=session --tags=auth,api,project:myapp,session:abc12345 "Implemented JWT auth with 15min access tokens, 7day refresh tokens in httpOnly cookies. Files: src/auth/jwt.ts, src/middleware/auth.ts, src/routes/auth.ts"
|
|
67
|
+
./.aide/bin/aide memory add --category=session --tags=auth,api,project:myapp,session:abc12345,source:discovered "Implemented JWT auth with 15min access tokens, 7day refresh tokens in httpOnly cookies. Files: src/auth/jwt.ts, src/middleware/auth.ts, src/routes/auth.ts"
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### Gotcha (global - applies everywhere)
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
./.aide/bin/aide memory add --category=gotcha --tags=hooks,claude-code,scope:global "Hooks must not write to stderr - Claude Code interprets any stderr as error. Debug logging must go to files only."
|
|
73
|
+
./.aide/bin/aide memory add --category=gotcha --tags=hooks,claude-code,scope:global,source:discovered,verified:true "Hooks must not write to stderr - Claude Code interprets any stderr as error. Debug logging must go to files only."
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Unverified external claim
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
./.aide/bin/aide memory add --category=learning --tags=api,stripe,project:myapp,source:user,verified:false "Stripe webhook signatures use HMAC-SHA256 with the whsec_ prefix."
|
|
74
80
|
```
|
|
75
81
|
|
|
76
82
|
## Instructions
|
|
@@ -78,18 +84,90 @@ Use the `./.aide/bin/aide memory add` CLI command via Bash:
|
|
|
78
84
|
When the user invokes `/aide:memorise <something>`:
|
|
79
85
|
|
|
80
86
|
1. Parse what they want to remember
|
|
81
|
-
2.
|
|
87
|
+
2. **Verify factual claims before storing** (see [Verification Before Storage](#verification-before-storage-anti-poison) below)
|
|
88
|
+
3. Determine the scope:
|
|
82
89
|
- **User preference** (colour, style, etc.) → add `scope:global`
|
|
83
90
|
- **Project-specific learning** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
|
|
84
91
|
- **Session summary** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
4. Choose appropriate category and descriptive tags
|
|
93
|
+
5. **Add provenance tags** (see [Provenance Tags](#provenance-tags) below)
|
|
94
|
+
6. Format the content concisely but completely
|
|
95
|
+
7. Call `./.aide/bin/aide memory add` via Bash to store it
|
|
96
|
+
8. **Verify success** - check exit code is 0 and output contains the memory ID
|
|
97
|
+
9. Confirm what was stored, including verification outcome
|
|
90
98
|
|
|
91
99
|
Keep content concise - aim for 1-3 sentences unless it's a complex session summary.
|
|
92
100
|
|
|
101
|
+
## Verification Before Storage (Anti-Poison)
|
|
102
|
+
|
|
103
|
+
Memories persist across sessions and influence future behaviour. Storing incorrect information is **worse than storing nothing** — it creates compounding errors. Before storing any memory, verify its claims.
|
|
104
|
+
|
|
105
|
+
### What to Verify
|
|
106
|
+
|
|
107
|
+
| Claim Type | Verification Method | Example |
|
|
108
|
+
| ------------------------- | ----------------------------------------------------- | ---------------------------------------------- |
|
|
109
|
+
| **File exists** | Use Glob or Read to confirm | "Config is in src/config.ts" |
|
|
110
|
+
| **Function/class exists** | Use Grep or code search | "Use `parseToken()` from auth.ts" |
|
|
111
|
+
| **Function signature** | Read the file, check the actual signature | "parseToken takes a string and returns Claims" |
|
|
112
|
+
| **API behaviour** | Check the implementation or tests | "The /users endpoint requires auth" |
|
|
113
|
+
| **Dependency/version** | Check package.json, go.mod, etc. | "Project uses Vitest v2" |
|
|
114
|
+
| **Build/test command** | Confirm the script exists in package.json or Makefile | "Run `npm run test:e2e` for integration tests" |
|
|
115
|
+
|
|
116
|
+
### What Does NOT Need Verification
|
|
117
|
+
|
|
118
|
+
- **User preferences** — The user is the authority ("I prefer tabs over spaces")
|
|
119
|
+
- **Session summaries** — Recap of what just happened in the current session
|
|
120
|
+
- **Opinions/decisions** — Architectural choices made by the user ("We chose Postgres")
|
|
121
|
+
- **External facts** — Things not checkable against the codebase ("React 19 uses...")
|
|
122
|
+
|
|
123
|
+
### Verification Workflow
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Is it a codebase claim (file, function, path, command, behaviour)?
|
|
127
|
+
├── No → Store directly with source:user or source:stated
|
|
128
|
+
└── Yes → Can you verify it right now?
|
|
129
|
+
├── Yes → Verify it
|
|
130
|
+
│ ├── Correct → Store with verified:true
|
|
131
|
+
│ └── Wrong → Inform user, do NOT store. Offer corrected version.
|
|
132
|
+
└── No (e.g., external service, runtime behaviour)
|
|
133
|
+
→ Store with verified:false, note unverified
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Verification Rules
|
|
137
|
+
|
|
138
|
+
1. **NEVER store a codebase claim without checking** — If the user says "the auth middleware is in src/middleware/auth.ts", confirm the file exists before memorising.
|
|
139
|
+
2. **If verification fails, do NOT store** — Tell the user what you found instead and offer to store the corrected version.
|
|
140
|
+
3. **If you cannot verify** (e.g., claim about runtime behaviour, external API), store it but tag with `verified:false`.
|
|
141
|
+
4. **Err on the side of not storing** — A missing memory is recoverable; a wrong memory causes future errors.
|
|
142
|
+
|
|
143
|
+
### Example: Verified vs Rejected
|
|
144
|
+
|
|
145
|
+
**User says:** "Remember that the database schema is defined in db/schema.sql"
|
|
146
|
+
|
|
147
|
+
**Verification steps:**
|
|
148
|
+
|
|
149
|
+
1. Check: does `db/schema.sql` exist? → Use Glob to search
|
|
150
|
+
2. If yes → Store with `verified:true`
|
|
151
|
+
3. If no → "I checked and `db/schema.sql` doesn't exist. I found `database/migrations/` instead. Would you like me to store that instead?"
|
|
152
|
+
|
|
153
|
+
## Provenance Tags
|
|
154
|
+
|
|
155
|
+
Always include provenance tags to track the origin and verification status of memories:
|
|
156
|
+
|
|
157
|
+
| Tag | Meaning | When to Use |
|
|
158
|
+
| ------------------- | ---------------------------------------- | ------------------------------------------------ |
|
|
159
|
+
| `source:user` | User explicitly stated this | User preferences, direct instructions |
|
|
160
|
+
| `source:discovered` | Agent discovered this by examining code | File paths, function signatures, patterns found |
|
|
161
|
+
| `source:inferred` | Agent inferred this from context | Behaviour deduced from code, not directly stated |
|
|
162
|
+
| `verified:true` | Codebase claim was checked and confirmed | After successful verification |
|
|
163
|
+
| `verified:false` | Claim could not be verified against code | External facts, runtime behaviour |
|
|
164
|
+
|
|
165
|
+
### Provenance Rules
|
|
166
|
+
|
|
167
|
+
- Every memory MUST have exactly one `source:` tag
|
|
168
|
+
- Codebase claims MUST have a `verified:` tag
|
|
169
|
+
- User preferences and opinions do NOT need `verified:` tags (user is authoritative)
|
|
170
|
+
|
|
93
171
|
## Failure Handling
|
|
94
172
|
|
|
95
173
|
If `./.aide/bin/aide memory add` fails:
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
- static analysis
|
|
14
|
+
- code health
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Pattern Analysis
|
|
18
|
+
|
|
19
|
+
**Recommended model tier:** balanced (sonnet) - this skill combines search with structured analysis
|
|
20
|
+
|
|
21
|
+
Analyze codebase patterns using static analysis findings. Surface complexity hotspots, code
|
|
22
|
+
duplication, coupling issues, and potential secrets. Use this skill to understand code health
|
|
23
|
+
and identify areas that need attention.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
Findings must be generated first by running analyzers via the CLI:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Run all analyzers
|
|
31
|
+
./.aide/bin/aide findings run --path .
|
|
32
|
+
|
|
33
|
+
# Run specific analyzers
|
|
34
|
+
./.aide/bin/aide findings run --path . --analyzer complexity
|
|
35
|
+
./.aide/bin/aide findings run --path . --analyzer coupling
|
|
36
|
+
./.aide/bin/aide findings run --path . --analyzer secrets
|
|
37
|
+
./.aide/bin/aide findings run --path . --analyzer clones
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Binary location:** The aide binary is at `.aide/bin/aide`. If it's on your `$PATH`, you can use `aide` directly.
|
|
41
|
+
|
|
42
|
+
## Available Tools
|
|
43
|
+
|
|
44
|
+
### 1. Search Findings (`mcp__plugin_aide_aide__findings_search`)
|
|
45
|
+
|
|
46
|
+
Full-text search across all findings. Supports Bleve query syntax for advanced searches.
|
|
47
|
+
|
|
48
|
+
**Parameters:**
|
|
49
|
+
|
|
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
|
+
|
|
70
|
+
- `analyzer` (optional) — Filter to one analyzer
|
|
71
|
+
- `severity` (optional) — Filter by severity
|
|
72
|
+
- `file` (optional) — Filter by file path substring
|
|
73
|
+
- `limit` (optional) — Max results (default 20)
|
|
74
|
+
- `offset` (optional) — Pagination offset
|
|
75
|
+
|
|
76
|
+
**Example usage:**
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
List all critical findings
|
|
80
|
+
-> findings_list severity="critical"
|
|
81
|
+
-> Returns: all critical-severity findings across all analyzers
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 3. Findings Statistics (`mcp__plugin_aide_aide__findings_stats`)
|
|
85
|
+
|
|
86
|
+
Get aggregate counts by analyzer and severity. Use as a starting point to understand overall
|
|
87
|
+
code health before drilling into specifics.
|
|
88
|
+
|
|
89
|
+
**Example usage:**
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
How healthy is the codebase?
|
|
93
|
+
-> findings_stats
|
|
94
|
+
-> Returns: counts per analyzer, counts per severity, total findings
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Workflow
|
|
98
|
+
|
|
99
|
+
### Quick Health Check
|
|
100
|
+
|
|
101
|
+
1. **Get overview** — Use `findings_stats` to see counts by analyzer and severity
|
|
102
|
+
2. **Triage critical** — Use `findings_list severity="critical"` to review highest-priority items
|
|
103
|
+
3. **Drill into areas** — Use `findings_search` with file or query filters for specific concerns
|
|
104
|
+
|
|
105
|
+
### Complexity Analysis
|
|
106
|
+
|
|
107
|
+
1. Run `findings_search analyzer="complexity" severity="critical"` to find the most complex functions
|
|
108
|
+
2. Use `code_outline` on flagged files to understand structure
|
|
109
|
+
3. Use `Read` with offset/limit to examine the specific functions
|
|
110
|
+
4. Recommend decomposition strategies
|
|
111
|
+
|
|
112
|
+
### Duplication Analysis
|
|
113
|
+
|
|
114
|
+
1. Run `findings_list analyzer="clones"` to see detected code clones
|
|
115
|
+
2. Each finding includes the clone pair — both file locations and line ranges
|
|
116
|
+
3. Use `Read` to compare the duplicated sections
|
|
117
|
+
4. Recommend extraction into shared functions or modules
|
|
118
|
+
|
|
119
|
+
### Coupling Analysis
|
|
120
|
+
|
|
121
|
+
1. Run `findings_search analyzer="coupling"` to see import fan-out/fan-in issues
|
|
122
|
+
2. High fan-out means a file imports too many things (potential god module)
|
|
123
|
+
3. High fan-in means many files depend on one (fragile dependency)
|
|
124
|
+
4. Cycle findings indicate circular dependency chains
|
|
125
|
+
|
|
126
|
+
### Secret Detection
|
|
127
|
+
|
|
128
|
+
1. Run `findings_list analyzer="secrets" severity="critical"` for confirmed secrets
|
|
129
|
+
2. Run `findings_list analyzer="secrets"` for all potential secrets (including unverified)
|
|
130
|
+
3. Each finding includes the secret category (e.g., AWS, GitHub, generic API key)
|
|
131
|
+
4. Snippets are redacted for safety — use `Read` to examine context around the finding
|
|
132
|
+
|
|
133
|
+
## Anti-Pattern Identification
|
|
134
|
+
|
|
135
|
+
Beyond the automated analyzers, look for these patterns using findings as starting points:
|
|
136
|
+
|
|
137
|
+
| Finding | Likely Anti-Pattern | Action |
|
|
138
|
+
| --------------- | ---------------------- | -------------------------------- |
|
|
139
|
+
| Complexity > 20 | God function | Decompose into smaller functions |
|
|
140
|
+
| Fan-out > 15 | Kitchen sink module | Split responsibilities |
|
|
141
|
+
| Fan-in > 20 | Fragile dependency | Consider interface/abstraction |
|
|
142
|
+
| Multiple clones | Copy-paste programming | Extract shared utility |
|
|
143
|
+
| Import cycle | Circular dependency | Restructure module boundaries |
|
|
144
|
+
|
|
145
|
+
## Output Format
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
## Code Health Report
|
|
149
|
+
|
|
150
|
+
### Overview
|
|
151
|
+
|
|
152
|
+
- Total findings: X (Y critical, Z warnings)
|
|
153
|
+
- Top concern: [area/file with most issues]
|
|
154
|
+
|
|
155
|
+
### Hotspots
|
|
156
|
+
|
|
157
|
+
1. **`file:line`** - [description] (severity)
|
|
158
|
+
- Impact: [why this matters]
|
|
159
|
+
- Recommendation: [what to do]
|
|
160
|
+
|
|
161
|
+
### Patterns Detected
|
|
162
|
+
|
|
163
|
+
- [List of anti-patterns found with evidence]
|
|
164
|
+
|
|
165
|
+
### Recommendations
|
|
166
|
+
|
|
167
|
+
1. [Prioritized action items]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Failure Handling
|
|
171
|
+
|
|
172
|
+
1. **No findings data** — Tell user to run analyzers first: `./.aide/bin/aide findings run --path .`
|
|
173
|
+
2. **Stale findings** — Findings reflect the state at last analyzer run; recommend re-running if code changed significantly
|
|
174
|
+
3. **False positives** — Secret detection may flag test fixtures or example configs; note when findings appear to be in test/example code
|
|
175
|
+
|
|
176
|
+
## Verification Criteria
|
|
177
|
+
|
|
178
|
+
- [ ] Checked `findings_stats` for overall picture
|
|
179
|
+
- [ ] Reviewed critical findings
|
|
180
|
+
- [ ] Cross-referenced findings with actual code (used `Read` or `code_outline`)
|
|
181
|
+
- [ ] Provided actionable recommendations with file:line references
|
|
182
|
+
- [ ] Noted any false positives or findings that need manual verification
|
|
@@ -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
|
@@ -88,6 +88,9 @@ Use these tools during review:
|
|
|
88
88
|
- `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file being reviewed
|
|
89
89
|
- `mcp__plugin_aide_aide__code_references` - Find all callers/usages of a modified symbol
|
|
90
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
|
|
91
94
|
|
|
92
95
|
## Output Format
|
|
93
96
|
|