@jmylchreest/aide-plugin 0.0.24 → 0.0.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmylchreest/aide-plugin",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "aide plugin for OpenCode — multi-agent orchestration, memory, skills, and persistence",
5
5
  "type": "module",
6
6
  "main": "./src/opencode/index.ts",
@@ -14,6 +14,7 @@
14
14
  "src/core",
15
15
  "src/cli",
16
16
  "src/lib",
17
+ "skills",
17
18
  "bin",
18
19
  "README.md"
19
20
  ],
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: build-fix
3
+ description: Fix build, lint, and type errors
4
+ triggers:
5
+ - fix build
6
+ - fix the build
7
+ - build is broken
8
+ - lint errors
9
+ - type errors
10
+ - fix errors
11
+ ---
12
+
13
+ # Build Fix Mode
14
+
15
+ **Recommended model tier:** balanced (sonnet) - this skill performs straightforward operations
16
+
17
+ Rapidly fix all build, type, and lint errors with minimal changes.
18
+
19
+ ## Prerequisites
20
+
21
+ Before starting, ensure you have:
22
+ - Access to the project root directory
23
+ - Build tools installed (npm, tsc, etc.)
24
+
25
+ ## Workflow
26
+
27
+ ### Step 1: Capture All Errors
28
+
29
+ Run all checks and capture output:
30
+
31
+ ```bash
32
+ # Run in sequence, capture all output
33
+ npm run build 2>&1 | head -100
34
+ npm run lint 2>&1 | head -100
35
+ npx tsc --noEmit 2>&1 | head -100
36
+ ```
37
+
38
+ **If commands fail to run:**
39
+ - Check package.json for available scripts
40
+ - Try `npm install` if dependencies are missing
41
+ - Use `npm ci` for clean install if lock file exists
42
+
43
+ ### Step 2: Categorize Errors by Priority
44
+
45
+ Process errors in this order:
46
+
47
+ 1. **Type errors** (highest priority) - Fix TypeScript/type issues first
48
+ 2. **Build errors** - Compilation failures
49
+ 3. **Lint errors** - ESLint, Prettier, etc.
50
+ 4. **Warnings** - Address only if trivial
51
+
52
+ Group similar errors:
53
+ - Missing imports
54
+ - Type mismatches
55
+ - Unused variables
56
+ - Formatting issues
57
+
58
+ ### Step 3: Search for Context
59
+
60
+ Use MCP tools to find definitions and patterns:
61
+
62
+ ```
63
+ # Find type definitions
64
+ mcp__plugin_aide_aide__code_search query="InterfaceName" kind="interface"
65
+
66
+ # Find function signatures
67
+ mcp__plugin_aide_aide__code_search query="functionName" kind="function"
68
+
69
+ # Get symbols in a file
70
+ mcp__plugin_aide_aide__code_symbols file="path/to/file.ts"
71
+
72
+ # Check project conventions
73
+ mcp__plugin_aide_aide__decision_get topic="coding-style"
74
+ ```
75
+
76
+ ### Step 4: Apply Fixes Systematically
77
+
78
+ Fix in batches by category:
79
+
80
+ 1. **All missing imports together** - Add import statements
81
+ 2. **All type annotations together** - Add/fix type declarations
82
+ 3. **All unused variables together** - Remove or prefix with `_`
83
+
84
+ ### Step 5: Verify After Each Batch
85
+
86
+ ```bash
87
+ # Run full verification
88
+ npm run build && npm run lint && npx tsc --noEmit
89
+ ```
90
+
91
+ **Verification criteria:**
92
+ - Exit code 0 for all commands
93
+ - No error output
94
+ - Warnings are acceptable if not introduced by changes
95
+
96
+ ### Step 6: Final Verification
97
+
98
+ ```bash
99
+ # Run tests to ensure fixes didn't break functionality
100
+ npm test
101
+ ```
102
+
103
+ ## Failure Handling
104
+
105
+ | Failure | Action |
106
+ |---------|--------|
107
+ | `npm run build` fails to start | Run `npm install` first |
108
+ | Circular dependency error | Check import structure, may need refactoring |
109
+ | Type error in third-party lib | Check @types package version, update if needed |
110
+ | Cannot resolve module | Check tsconfig.json paths, baseUrl settings |
111
+ | ESLint config error | Check .eslintrc, ensure plugins installed |
112
+ | Fix introduces new errors | Revert and try alternative approach |
113
+
114
+ ## Rules
115
+
116
+ - **Minimal changes** - Fix only what's broken
117
+ - **No refactoring** - Don't improve "while you're there"
118
+ - **No new features** - Just fix errors
119
+ - **Match style** - Follow existing patterns exactly
120
+ - **One batch at a time** - Verify between batches
121
+
122
+ ## Common Fixes Reference
123
+
124
+ | Error | Fix |
125
+ |-------|-----|
126
+ | Cannot find module | Add import statement |
127
+ | Type 'X' not assignable | Add type annotation or use type assertion |
128
+ | 'X' is declared but never used | Remove or prefix with `_` |
129
+ | Missing return type | Add explicit return type |
130
+ | Unexpected any | Add proper type annotation |
131
+ | Property does not exist | Check interface, add property or fix typo |
132
+ | Argument of type X not assignable | Check function signature, cast if needed |
133
+
134
+ ## MCP Tools
135
+
136
+ - `mcp__plugin_aide_aide__code_search` - Find type definitions, function signatures
137
+ - `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file
138
+ - `mcp__plugin_aide_aide__decision_get` - Check project coding decisions
139
+
140
+ ## Output Format
141
+
142
+ Report all fixes made:
143
+
144
+ ```markdown
145
+ ## Build Fix Report
146
+
147
+ ### Errors Fixed
148
+
149
+ - `src/foo.ts:10` - Added missing import for `Bar`
150
+ - `src/foo.ts:25` - Fixed type: `string` -> `string | null`
151
+ - `src/bar.ts:5` - Removed unused variable `temp`
152
+
153
+ ### Verification
154
+
155
+ - Build: PASS
156
+ - Lint: PASS
157
+ - Types: PASS
158
+ - Tests: PASS
159
+
160
+ ### Notes
161
+ [Any observations or remaining warnings]
162
+ ```
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: code-search
3
+ description: Search code symbols, find function calls, and analyze codebase
4
+ triggers:
5
+ - find function
6
+ - where is
7
+ - who calls
8
+ - find class
9
+ - find method
10
+ - search code
11
+ - code search
12
+ - find symbol
13
+ - call sites
14
+ - references to
15
+ - what calls
16
+ - show me the
17
+ ---
18
+
19
+ # Code Search
20
+
21
+ **Recommended model tier:** balanced (sonnet) - this skill performs straightforward operations
22
+
23
+ Search for code symbols (functions, classes, methods, types) and find their call sites.
24
+
25
+ ## Available Tools
26
+
27
+ ### 1. Search Symbols (`mcp__plugin_aide_aide__code_search`)
28
+
29
+ Find functions, classes, methods, interfaces, and types by name or signature.
30
+
31
+ **Example usage:**
32
+ ```
33
+ Search for: "getUserById"
34
+ → Uses code_search tool
35
+ → Returns: function signatures, file locations, line numbers
36
+ ```
37
+
38
+ ### 2. Find References (`mcp__plugin_aide_aide__code_references`)
39
+
40
+ Find all places where a symbol is called/used.
41
+
42
+ **Example usage:**
43
+ ```
44
+ Who calls "getUserById"?
45
+ → Uses code_references tool
46
+ → Returns: all call sites with file:line and context
47
+ ```
48
+
49
+ ### 3. List File Symbols (`mcp__plugin_aide_aide__code_symbols`)
50
+
51
+ List all symbols defined in a specific file.
52
+
53
+ **Example usage:**
54
+ ```
55
+ What functions are in src/auth.ts?
56
+ → Uses code_symbols tool
57
+ → Returns: all functions, classes, types in that file
58
+ ```
59
+
60
+ ### 4. Check Index Status (`mcp__plugin_aide_aide__code_stats`)
61
+
62
+ Check if the codebase has been indexed.
63
+
64
+ **Example usage:**
65
+ ```
66
+ Is the code indexed?
67
+ → Uses code_stats tool
68
+ → Returns: file count, symbol count, reference count
69
+ ```
70
+
71
+ ## Workflow
72
+
73
+ 1. **First, check if codebase is indexed:**
74
+ - Use `code_stats` to verify indexing
75
+ - If not indexed, tell user to run: `aide code index`
76
+
77
+ 2. **Search for symbols:**
78
+ - Use `code_search` with the symbol name or pattern
79
+ - Filter by kind (function, method, class, interface, type)
80
+ - Filter by language (typescript, javascript, go, python)
81
+
82
+ 3. **Find call sites:**
83
+ - Use `code_references` to find where a symbol is used
84
+ - Shows all callers with context
85
+
86
+ 4. **Explore specific files:**
87
+ - Use `code_symbols` to list all definitions in a file
88
+
89
+ ## Example Session
90
+
91
+ **User:** "Where is the authentication function?"
92
+
93
+ **Assistant action:**
94
+ 1. Use `code_search` with query "auth" or "authenticate"
95
+ 2. Show matching functions with file locations
96
+
97
+ **User:** "Who calls authenticateUser?"
98
+
99
+ **Assistant action:**
100
+ 1. Use `code_references` with symbol "authenticateUser"
101
+ 2. Show all call sites grouped by file
102
+
103
+ ## Notes
104
+
105
+ - Code must be indexed first: `aide code index`
106
+ - Indexing is incremental - only changed files are re-parsed
107
+ - Supports: TypeScript, JavaScript, Go, Python, Rust, and more
108
+ - For file watching: `AIDE_CODE_WATCH=1 claude`
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: debug
3
+ description: Systematic debugging workflow for tracking down bugs and issues
4
+ triggers:
5
+ - "debug this"
6
+ - "debug mode"
7
+ - "fix this bug"
8
+ - "trace the bug"
9
+ - "find the bug"
10
+ ---
11
+
12
+ # Debug Mode
13
+
14
+ **Recommended model tier:** smart (opus) - this skill requires complex reasoning
15
+
16
+ Systematic approach to identifying and fixing bugs.
17
+
18
+ ## Prerequisites
19
+
20
+ Before starting:
21
+ - Get the exact error message or unexpected behavior description
22
+ - Identify the entry point or trigger for the bug
23
+ - Note any relevant environment details (Node version, OS, etc.)
24
+
25
+ ## Workflow
26
+
27
+ ### Step 1: Reproduce the Issue
28
+
29
+ **Goal:** Confirm the bug exists and understand its behavior.
30
+
31
+ ```bash
32
+ # Run the failing code/test
33
+ npm test -- --grep "failing test"
34
+ # OR
35
+ node path/to/script.js
36
+ ```
37
+
38
+ Document:
39
+ - Exact error message
40
+ - Steps to trigger
41
+ - Expected vs actual behavior
42
+ - Is it consistent or intermittent?
43
+
44
+ **If cannot reproduce:**
45
+ - Check environment differences
46
+ - Look for race conditions
47
+ - Check for cached state
48
+
49
+ ### Step 2: Locate the Relevant Code
50
+
51
+ Use tools to find code related to the error:
52
+
53
+ ```
54
+ # Search for function mentioned in stack trace
55
+ mcp__plugin_aide_aide__code_search query="functionName" kind="function"
56
+
57
+ # Get symbols in suspect file
58
+ mcp__plugin_aide_aide__code_symbols file="path/to/file.ts"
59
+
60
+ # Search for error message text in code
61
+ Grep for "error message text"
62
+ ```
63
+
64
+ ### Step 3: Trace the Execution Path
65
+
66
+ Follow the code flow from entry to error:
67
+
68
+ 1. Start at the entry point (route handler, event listener, etc.)
69
+ 2. Trace through each function call
70
+ 3. Use `mcp__plugin_aide_aide__code_references` to find callers
71
+ 4. Check type definitions with `mcp__plugin_aide_aide__code_search kind="interface"`
72
+
73
+ ### Step 4: Form Hypotheses
74
+
75
+ Based on the error type, consider these causes:
76
+
77
+ | Symptom | Likely Causes |
78
+ |---------|---------------|
79
+ | "undefined is not a function" | Variable is null/undefined, wrong import |
80
+ | "Cannot read property of undefined" | Missing null check, async timing issue |
81
+ | "Type error" | Type mismatch, wrong function signature |
82
+ | "Maximum call stack" | Infinite recursion, circular reference |
83
+ | "Network error" | Bad URL, CORS, timeout, server down |
84
+ | "State not updating" | Mutation instead of new object, missing dependency |
85
+
86
+ ### Step 5: Validate Hypotheses
87
+
88
+ Test each hypothesis systematically:
89
+
90
+ ```bash
91
+ # Add temporary logging
92
+ console.log('DEBUG: variable =', JSON.stringify(variable));
93
+
94
+ # Check with debugger
95
+ node --inspect-brk script.js
96
+
97
+ # Run specific test
98
+ npm test -- --grep "test name"
99
+ ```
100
+
101
+ **Validation checklist:**
102
+ - Check variable values at key points
103
+ - Verify assumptions about input data
104
+ - Test edge cases (null, empty, boundary values)
105
+ - Check async ordering
106
+
107
+ ### Step 6: Apply the Fix
108
+
109
+ **Rules:**
110
+ - Change only what's necessary to fix the bug
111
+ - Don't refactor unrelated code
112
+ - Match existing code patterns
113
+
114
+ **Common fixes:**
115
+ - Add null/undefined check
116
+ - Fix type annotation
117
+ - Correct async/await usage
118
+ - Fix variable scope
119
+ - Add missing initialization
120
+
121
+ ### Step 7: Verify the Fix
122
+
123
+ ```bash
124
+ # Run the originally failing test/scenario
125
+ npm test -- --grep "failing test"
126
+
127
+ # Run related tests
128
+ npm test -- --grep "related feature"
129
+
130
+ # Run full test suite to check for regressions
131
+ npm test
132
+ ```
133
+
134
+ **Verification criteria:**
135
+ - Original issue no longer occurs
136
+ - Related tests still pass
137
+ - No new errors introduced
138
+
139
+ ## Failure Handling
140
+
141
+ | Situation | Action |
142
+ |-----------|--------|
143
+ | Cannot reproduce | Check environment, add logging to narrow down |
144
+ | Multiple bugs intertwined | Fix one at a time, verify after each |
145
+ | Fix causes new failures | Revert, analyze dependencies, try different approach |
146
+ | Root cause is in dependency | Check for updates, file issue, implement workaround |
147
+ | Bug is in async code | Add proper await, check Promise chains |
148
+
149
+ ## MCP Tools
150
+
151
+ - `mcp__plugin_aide_aide__code_search` - Find functions, classes, types involved in the bug
152
+ - `mcp__plugin_aide_aide__code_symbols` - Understand file structure
153
+ - `mcp__plugin_aide_aide__code_references` - Find all callers of a function
154
+ - `mcp__plugin_aide_aide__memory_search` - Check for related past issues
155
+
156
+ ## Output Format
157
+
158
+ ```markdown
159
+ ## Debug Report: [Issue Title]
160
+
161
+ ### Problem
162
+ [What was happening vs what should happen]
163
+
164
+ ### Reproduction
165
+ [Steps to reproduce the issue]
166
+
167
+ ### Root Cause
168
+ [Identified cause with file:line reference]
169
+ [Why the bug occurred]
170
+
171
+ ### Fix Applied
172
+ [What was changed and why]
173
+
174
+ ### Verification
175
+ - Original issue: FIXED
176
+ - Related tests: PASS
177
+ - Full suite: PASS
178
+
179
+ ### Prevention
180
+ [Optional: How to prevent similar bugs]
181
+ ```
182
+
183
+ ## Tips
184
+
185
+ - Always get the full error message and stack trace first
186
+ - Don't guess - trace the code path methodically
187
+ - One fix at a time - don't bundle unrelated changes
188
+ - Remove temporary logging before committing
189
+ - Consider if the bug could occur elsewhere
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: decide
3
+ description: Formal decision-making interview for architectural choices
4
+ triggers:
5
+ - decide
6
+ - help me decide
7
+ - help me choose
8
+ - how should we
9
+ - what should we use
10
+ - which option
11
+ - trade-offs
12
+ - pros and cons
13
+ allowed-tools: Bash(aide decision set *)
14
+ ---
15
+
16
+ # Decision Mode
17
+
18
+ **Recommended model tier:** smart (opus) - this skill requires complex reasoning
19
+
20
+ Formal decision-making workflow for architectural and technical choices.
21
+
22
+ ## Purpose
23
+
24
+ When facing a significant technical decision, this workflow guides you through structured analysis to make an informed choice that will be recorded and respected by all future sessions and agents.
25
+
26
+ ## Workflow
27
+
28
+ ### Phase 1: IDENTIFY
29
+
30
+ Ask the user to clarify:
31
+ - What decision needs to be made?
32
+ - What is the context? (new system, migration, constraint?)
33
+ - What are the requirements? (scale, team, timeline?)
34
+ - Are there any hard constraints?
35
+
36
+ **Example questions:**
37
+ - "What technical decision do you need to make?"
38
+ - "What problem are you trying to solve?"
39
+ - "Are there any constraints I should know about?"
40
+
41
+ ### Phase 2: EXPLORE
42
+
43
+ Research and propose options:
44
+ - List 3-5 viable alternatives
45
+ - Include the obvious choices AND less common ones
46
+ - For each option, note what it's best suited for
47
+
48
+ **Output format:**
49
+ ```markdown
50
+ ## Options
51
+
52
+ 1. **[Option A]** - Brief description
53
+ - Best for: [use case]
54
+
55
+ 2. **[Option B]** - Brief description
56
+ - Best for: [use case]
57
+
58
+ 3. **[Option C]** - Brief description
59
+ - Best for: [use case]
60
+ ```
61
+
62
+ ### Phase 3: ANALYZE
63
+
64
+ For each option, evaluate:
65
+ - **Pros**: What are the benefits?
66
+ - **Cons**: What are the drawbacks?
67
+ - **Fit**: How well does it match the requirements?
68
+
69
+ **Output format:**
70
+ ```markdown
71
+ ## Analysis
72
+
73
+ | Option | Pros | Cons | Fit |
74
+ |--------|------|------|-----|
75
+ | Option A | Fast, simple | Limited scale | Good for MVP |
76
+ | Option B | Scalable | Complex setup | Good for growth |
77
+ | Option C | Flexible | Learning curve | Good if team knows it |
78
+ ```
79
+
80
+ Consider:
81
+ - Complexity (implementation, maintenance)
82
+ - Team familiarity
83
+ - Scalability
84
+ - Security implications
85
+ - Cost (time, money, resources)
86
+ - Reversibility (how hard to change later?)
87
+
88
+ ### Phase 4: RECOMMEND
89
+
90
+ Provide a clear recommendation with rationale:
91
+
92
+ ```markdown
93
+ ## Recommendation
94
+
95
+ I recommend **[Option]** because:
96
+ 1. [Primary reason tied to requirements]
97
+ 2. [Secondary benefit]
98
+ 3. [Risk mitigation]
99
+
100
+ This choice [addresses constraint X] while [enabling future Y].
101
+ ```
102
+
103
+ Ask for confirmation:
104
+ - "Does this recommendation align with your goals?"
105
+ - "Would you like to proceed with this decision?"
106
+ - "Any concerns before we record this?"
107
+
108
+ ### Phase 5: CONFIRM
109
+
110
+ Wait for explicit user approval before recording:
111
+ - User says "yes", "go ahead", "let's do it" → proceed to record
112
+ - User has concerns → address them, refine recommendation
113
+ - User wants different option → adjust and confirm
114
+
115
+ ### Phase 6: RECORD
116
+
117
+ Store the decision using the `aide decision set` CLI command via Bash:
118
+
119
+ ```bash
120
+ aide decision set "<topic-slug>" "<decision summary>" --rationale="<why this was chosen>"
121
+ ```
122
+
123
+ **Topic naming:**
124
+ - Use kebab-case: `auth-strategy`, `database-choice`, `api-design`
125
+ - Be specific: `user-auth-method` not just `auth`
126
+ - Include scope if relevant: `payments-queue-strategy`
127
+
128
+ **Verify** the decision was stored:
129
+ ```bash
130
+ aide decision get "<topic-slug>"
131
+ ```
132
+
133
+ ## Example Session
134
+
135
+ ```
136
+ User: help me decide how to handle background jobs
137
+
138
+ Claude: [IDENTIFY]
139
+ What kind of background jobs do you need to handle?
140
+ - Scheduled tasks (cron-like)?
141
+ - Async processing (triggered by events)?
142
+ - Long-running workers?
143
+
144
+ What's your current stack and scale expectations?
145
+
146
+ User: Async processing for email sending and webhook deliveries.
147
+ Stack is Node.js/TypeScript, expecting 10K jobs/day initially.
148
+
149
+ Claude: [EXPLORE]
150
+ ## Options
151
+
152
+ 1. **BullMQ (Redis)** - Production-ready Node.js queue
153
+ - Best for: Node.js apps needing reliability + Redis features
154
+
155
+ 2. **AWS SQS + Lambda** - Serverless queue
156
+ - Best for: AWS-native apps, variable load
157
+
158
+ 3. **Database-backed queue** - Simple polling
159
+ - Best for: Low volume, no new infrastructure
160
+
161
+ 4. **RabbitMQ** - Enterprise message broker
162
+ - Best for: Complex routing, multi-language
163
+
164
+ [ANALYZE]
165
+ | Option | Pros | Cons | Fit |
166
+ |--------|------|------|-----|
167
+ | BullMQ | Native TS, retries, dashboard | Needs Redis | Excellent |
168
+ | SQS+Lambda | Serverless, scales | Cold starts, AWS lock-in | Good |
169
+ | DB queue | Simple, no new infra | Polling overhead, scale limits | MVP only |
170
+ | RabbitMQ | Powerful routing | Overkill, operational burden | Over-engineered |
171
+
172
+ [RECOMMEND]
173
+ I recommend **BullMQ with Redis** because:
174
+ 1. Native TypeScript support matches your stack
175
+ 2. Built-in retries, delays, and rate limiting for email/webhooks
176
+ 3. Bull Board provides visibility without custom tooling
177
+ 4. 10K/day is well within comfortable range, scales to millions
178
+
179
+ Redis adds infrastructure but enables other features (caching, sessions).
180
+
181
+ Do you want to proceed with this decision?
182
+
183
+ User: yes, let's go with BullMQ
184
+
185
+ Claude: [RECORD]
186
+ [Calls aide decision set via Bash]
187
+
188
+ ```bash
189
+ aide decision set "background-jobs-queue" "Use BullMQ with Redis for background job processing (emails, webhooks)" --rationale="Native TypeScript support, built-in retries/delays/rate-limiting, Bull Board for visibility, 10K/day well within capacity. Rejected: SQS+Lambda (AWS lock-in, cold starts), DB queue (limited scale), RabbitMQ (over-engineered)"
190
+ ```
191
+
192
+ Decision recorded. Future sessions will follow this architectural choice.
193
+ ```
194
+
195
+ ## Integration
196
+
197
+ Decisions stored via `aide decision set` are:
198
+ 1. Persisted in the aide memory database
199
+ 2. Injected into future session contexts at startup
200
+ 3. Visible to swarm agents (they won't contradict decisions)
201
+ 4. Queryable via `aide decision get`, `aide decision list`, or the MCP tools `decision_get`/`decision_list`
202
+
203
+ ## When to Use This Skill
204
+
205
+ **Good candidates for formal decisions:**
206
+ - Authentication/authorization strategy
207
+ - Database technology choice
208
+ - API design patterns
209
+ - State management approach
210
+ - Testing strategy
211
+ - Deployment architecture
212
+ - Third-party service selection
213
+
214
+ **NOT needed for:**
215
+ - Minor implementation details
216
+ - Obvious choices with no trade-offs
217
+ - Temporary/experimental code
218
+ - Personal preferences (use memories instead)
219
+
220
+ ## Changing Decisions
221
+
222
+ Decisions can be superseded:
223
+ 1. Run `/aide:decide` again for the same topic
224
+ 2. New decision replaces old (history preserved)
225
+ 3. Use `mcp__plugin_aide_aide__decision_history` to see evolution