@jmylchreest/aide-plugin 0.0.47 → 0.0.48

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.47",
3
+ "version": "0.0.48",
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",
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: autopilot
3
+ description: Full autonomous execution - keeps working until all tasks are verified complete
4
+ triggers:
5
+ - autopilot
6
+ - full auto
7
+ - autonomous
8
+ - keep going
9
+ - finish everything
10
+ - run until complete
11
+ ---
12
+
13
+ # Autopilot Mode
14
+
15
+ **Recommended model tier:** smart (opus) - this mode handles complex multi-step tasks
16
+
17
+ Full autonomous execution mode. The agent keeps working until all tasks in the todo list are verified complete. No stopping early, no partial results.
18
+
19
+ ## Activation
20
+
21
+ Type naturally:
22
+
23
+ ```
24
+ autopilot build me a web app
25
+ autopilot fix all failing tests
26
+ autopilot refactor the auth module
27
+ ```
28
+
29
+ Or explicitly set the mode:
30
+
31
+ ```bash
32
+ aide state set mode autopilot
33
+ ```
34
+
35
+ ## How It Works
36
+
37
+ When autopilot mode is active:
38
+
39
+ 1. The persistence hook intercepts stop signals
40
+ 2. If incomplete tasks exist in the todo list, the agent is re-prompted to continue
41
+ 3. The agent keeps working through its task list
42
+ 4. Auto-releases when ALL tasks are complete (terminal state)
43
+ 5. Safety cap: releases after 20 iterations even if tasks remain
44
+
45
+ ### Platform Behavior
46
+
47
+ | Platform | Mechanism |
48
+ | --------------- | ------------------------------------------------------------------ |
49
+ | **Claude Code** | Stop-blocking — prevents the AI from ending the conversation early |
50
+ | **OpenCode** | Re-prompting — `session.prompt()` is called on idle to keep going |
51
+
52
+ ### Task Tracking
53
+
54
+ Autopilot relies on the todo list to determine completeness:
55
+
56
+ - **Has incomplete tasks** → Block stop, continue working
57
+ - **All tasks complete** → Auto-release, allow stop
58
+ - **No tasks exist** → Generic reinforcement (verify your work)
59
+
60
+ ## When to Use
61
+
62
+ Autopilot mode is ideal for:
63
+
64
+ - **Multi-step implementations** — "autopilot implement the user dashboard"
65
+ - **Fixing all test failures** — "autopilot fix all failing tests"
66
+ - **Complete refactors** — "autopilot refactor all error handling to use Result types"
67
+ - **Migration tasks** — "autopilot migrate all components to the new API"
68
+ - **Build fixes** — "autopilot make the build pass"
69
+
70
+ ## When NOT to Use
71
+
72
+ Avoid autopilot for:
73
+
74
+ - **Exploratory tasks** — "investigate why X happens" (no clear completion criteria)
75
+ - **Design work** — Use the `design` skill instead (needs human input)
76
+ - **Tasks requiring human judgment** — Autopilot continues based on automated checks
77
+ - **Parallel work** — Use `swarm` mode instead for decomposed parallel stories
78
+
79
+ ## Combining with Skills
80
+
81
+ Autopilot works well with any skill:
82
+
83
+ ```
84
+ autopilot fix the build errors # autopilot + build-fix behavior
85
+ autopilot make all tests pass # autopilot + implement behavior
86
+ autopilot debug why login fails # autopilot + debug behavior
87
+ ```
88
+
89
+ ## Deactivation
90
+
91
+ To stop autopilot mode early:
92
+
93
+ ```bash
94
+ aide state set mode ""
95
+ ```
96
+
97
+ Or type "stop" — the keyword detector clears the active mode.
98
+
99
+ ## Instructions
100
+
101
+ When autopilot mode is activated:
102
+
103
+ 1. **Create a comprehensive todo list** — Break the task into specific, actionable items
104
+ 2. **Work through items sequentially** — Mark each as `in_progress` then `completed`
105
+ 3. **Verify each step** — Run tests, check builds, confirm behavior
106
+ 4. **Do not stop until all items are complete** — The persistence hook will block premature stops
107
+ 5. **If stuck on an item after 3 attempts**, record a blocker memory and move to the next item:
108
+ ```bash
109
+ ./.aide/bin/aide memory add --category=blocker --tags=project:<name>,session:<id>,source:discovered "Blocked on <task>: <reason>"
110
+ ```
111
+
112
+ **Binary location:** The aide binary is at `.aide/bin/aide`. If it's on your `$PATH`, you can use `aide` directly.
@@ -159,6 +159,14 @@ npm test
159
159
  | Root cause is in dependency | Check for updates, file issue, implement workaround |
160
160
  | Bug is in async code | Add proper await, check Promise chains |
161
161
 
162
+ **When abandoning an approach:** If you try a fix direction and abandon it (e.g., revert because it causes regressions), record it as an abandoned approach so future sessions don't repeat it:
163
+
164
+ ```bash
165
+ ./.aide/bin/aide memory add --category=abandoned \
166
+ --tags=reason:<why>,approach:<what>,project:<name>,session:<id>,source:discovered \
167
+ "ABANDONED: <what was tried>. REASON: <why>. ALTERNATIVE: <new direction>. CONTEXT: <details>"
168
+ ```
169
+
162
170
  ## MCP Tools
163
171
 
164
172
  - `mcp__plugin_aide_aide__code_outline` - **Start here.** Get collapsed file skeleton to understand structure before reading
@@ -207,3 +215,12 @@ npm test
207
215
  - One fix at a time - don't bundle unrelated changes
208
216
  - Remove temporary logging before committing
209
217
  - Consider if the bug could occur elsewhere
218
+
219
+ ## Memory Hygiene
220
+
221
+ When storing memories from this skill (abandoned approaches, blockers), always:
222
+
223
+ 1. **Include `source:` tag** — Use `source:discovered` for things you found, `source:inferred` for deductions
224
+ 2. **Include scope tags** — Add `project:<name>,session:<id>` (get project name from git remote or directory; session ID from `$AIDE_SESSION_ID` or `$CLAUDE_SESSION_ID`)
225
+ 3. **Verify codebase claims** before storing — If a memory references a file, function, or path, confirm it exists first. See the `memorise` skill for the full verification workflow.
226
+ 4. **Never use `scope:global`** unless storing a user preference
@@ -170,7 +170,7 @@ List specific, testable criteria for the TEST stage:
170
170
 
171
171
  1. List specific ambiguities
172
172
  2. State assumptions you're making
173
- 3. Record assumptions: `./.aide/bin/aide memory add --category=decision "Assumed X because Y"`
173
+ 3. Record assumptions: `./.aide/bin/aide memory add --category=decision --tags=project:<name>,session:${AIDE_SESSION_ID},source:inferred "Assumed X because Y"`
174
174
  4. Proceed with reasonable defaults
175
175
 
176
176
  ### Conflicting Patterns Found
@@ -198,6 +198,15 @@ Before completing design:
198
198
  - [ ] Files to modify are listed
199
199
  - [ ] Dependencies are identified
200
200
 
201
+ ## Memory Hygiene
202
+
203
+ When storing memories from this skill (assumptions, decisions, discoveries), always:
204
+
205
+ 1. **Include `source:` tag** — Use `source:inferred` for assumptions, `source:discovered` for findings during exploration
206
+ 2. **Include scope tags** — Add `project:<name>,session:<id>` (get project name from git remote or directory; session ID from `$AIDE_SESSION_ID` or `$CLAUDE_SESSION_ID`)
207
+ 3. **Verify codebase claims** before storing — If a memory references a file, function, or path, confirm it exists first. See the `memorise` skill for the full verification workflow.
208
+ 4. **Never use `scope:global`** unless storing a user preference
209
+
201
210
  ## Completion
202
211
 
203
212
  When design is complete:
@@ -92,8 +92,8 @@ If the memory is being superseded (not just deleted), add a new corrected memory
92
92
  # 1. Forget the old memory
93
93
  ./.aide/bin/aide memory tag <OLD_ID> --add=forget
94
94
 
95
- # 2. Add the corrected memory (NO forget tag)
96
- ./.aide/bin/aide memory add --category=<category> --tags=<relevant,tags> "<corrected content>"
95
+ # 2. Add the corrected memory (NO forget tag) — include scope + provenance tags
96
+ ./.aide/bin/aide memory add --category=<category> --tags=<relevant,tags>,project:<name>,session:${AIDE_SESSION_ID},source:discovered "<corrected content>"
97
97
  ```
98
98
 
99
99
  ### Step 5: Verify
@@ -184,7 +184,7 @@ To clear ALL memories (destructive, requires explicit user request):
184
184
  ./.aide/bin/aide memory tag <OLD_ID> --add=forget
185
185
 
186
186
  # 3. Add the corrected one
187
- ./.aide/bin/aide memory add --category=decision --tags=auth,sessions,project:myapp "Auth strategy changed from JWT to server-side sessions with Redis store"
187
+ ./.aide/bin/aide memory add --category=decision --tags=auth,sessions,project:myapp,session:${AIDE_SESSION_ID},source:discovered "Auth strategy changed from JWT to server-side sessions with Redis store"
188
188
  ```
189
189
 
190
190
  ### User says "recover that forgotten memory about testing"
@@ -211,6 +211,15 @@ If `aide memory tag` fails:
211
211
  ```
212
212
  3. **Database locked** - Another process may hold the lock. Wait and retry, or ensure the aide daemon is running (CLI routes through gRPC when daemon is active).
213
213
 
214
+ ## Memory Hygiene
215
+
216
+ When adding replacement memories (Step 4 above), always:
217
+
218
+ 1. **Include `source:` tag** — Use `source:discovered` for corrected facts, `source:user` if the user provided the correction
219
+ 2. **Include scope tags** — Add `project:<name>,session:<id>` (get project name from git remote or directory; session ID from `$AIDE_SESSION_ID` or `$CLAUDE_SESSION_ID`)
220
+ 3. **Verify codebase claims** before storing — If a replacement memory references a file, function, or path, confirm it exists first. See the `memorise` skill for the full verification workflow.
221
+ 4. **Never use `scope:global`** unless storing a user preference
222
+
214
223
  ## Verification
215
224
 
216
225
  After forgetting a memory, verify:
@@ -196,9 +196,15 @@ func (s *UserService) CreateUser(ctx context.Context, input CreateUserInput) (*U
196
196
  3. Check design decisions - is implementation matching spec?
197
197
  4. Record blocker:
198
198
  ```bash
199
- ./.aide/bin/aide memory add --category=blocker "Cannot pass test X: <reason>"
199
+ ./.aide/bin/aide memory add --category=blocker --tags=project:<name>,session:<id>,source:discovered "Cannot pass test X: <reason>"
200
200
  ```
201
- 5. If stuck after 3 attempts, ask for help
201
+ 5. **If you abandon the approach**, record it so future sessions don't repeat it:
202
+ ```bash
203
+ ./.aide/bin/aide memory add --category=abandoned \
204
+ --tags=reason:<why>,approach:<what>,project:<name>,session:<id>,source:discovered \
205
+ "ABANDONED: <what was tried>. REASON: <why>. ALTERNATIVE: <new direction>. CONTEXT: <details>"
206
+ ```
207
+ 6. If stuck after 3 attempts, ask for help
202
208
 
203
209
  ### Build Fails
204
210
 
@@ -214,7 +220,7 @@ func (s *UserService) CreateUser(ctx context.Context, input CreateUserInput) (*U
214
220
  2. Don't refactor during implement stage
215
221
  3. Note concerns for future:
216
222
  ```bash
217
- ./.aide/bin/aide memory add --category=issue "Implementation of X could be improved: <how>"
223
+ ./.aide/bin/aide memory add --category=issue --tags=project:<name>,session:<id>,source:discovered "Implementation of X could be improved: <how>"
218
224
  ```
219
225
  4. Proceed - refactoring is a separate concern
220
226
 
@@ -243,6 +249,15 @@ go test -v ./pkg/feature/... && go build ./...
243
249
 
244
250
  Output: "Implementation complete. All tests passing. Ready for VERIFY stage."
245
251
 
252
+ ## Memory Hygiene
253
+
254
+ When storing memories from this skill (blockers, issues, abandoned approaches), always:
255
+
256
+ 1. **Include `source:` tag** — Use `source:discovered` for things you found, `source:inferred` for deductions
257
+ 2. **Include scope tags** — Add `project:<name>,session:<id>` (get project name from git remote or directory; session ID from `$AIDE_SESSION_ID` or `$CLAUDE_SESSION_ID`)
258
+ 3. **Verify codebase claims** before storing — If a memory references a file, function, or path, confirm it exists first. See the `memorise` skill for the full verification workflow.
259
+ 4. **Never use `scope:global`** unless storing a user preference
260
+
246
261
  ## Integration with SDLC Pipeline
247
262
 
248
263
  This skill is designed for the DEV stage:
@@ -38,6 +38,7 @@ Use the `./.aide/bin/aide memory add` CLI command via Bash:
38
38
  - `session` - Summary of a work session
39
39
  - `pattern` - A reusable approach or pattern identified
40
40
  - `gotcha` - A pitfall or issue to avoid in future
41
+ - `abandoned` - An approach that was tried and abandoned (see [Abandoned Approaches](#abandoned-approaches) below)
41
42
 
42
43
  ## When to Use
43
44
 
@@ -87,8 +88,8 @@ When the user invokes `/aide:memorise <something>`:
87
88
  2. **Verify factual claims before storing** (see [Verification Before Storage](#verification-before-storage-anti-poison) below)
88
89
  3. Determine the scope:
89
90
  - **User preference** (colour, style, etc.) → add `scope:global`
90
- - **Project-specific learning** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
91
- - **Session summary** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
91
+ - **Project-specific learning** → add `project:<project-name>,session:${AIDE_SESSION_ID}`
92
+ - **Session summary** → add `project:<project-name>,session:${AIDE_SESSION_ID}`
92
93
  4. Choose appropriate category and descriptive tags
93
94
  5. **Add provenance tags** (see [Provenance Tags](#provenance-tags) below)
94
95
  6. Format the content concisely but completely
@@ -215,7 +216,51 @@ Use scope tags to control when memories are injected:
215
216
  - **Project learnings** (API patterns, testing approach): Add `project:<name>,session:<id>`
216
217
  - **Session summaries**: Add `project:<name>,session:<id>` with `category=session`
217
218
 
218
- Get the project name from the git remote or directory name. Session ID is available as `$CLAUDE_SESSION_ID` (use first 8 chars).
219
+ Get the project name from the git remote or directory name. Session ID is available as `$AIDE_SESSION_ID` (set by aide hooks) or `$CLAUDE_SESSION_ID` (Claude Code native).
220
+
221
+ ## Abandoned Approaches
222
+
223
+ When an approach is tried and abandoned during implementation, debugging, or design, record it as an `abandoned` memory. This prevents future sessions from repeating the same failed approach.
224
+
225
+ ### When to Record
226
+
227
+ - You try an implementation approach and it fails or is rejected
228
+ - You explore a design direction and discover it won't work
229
+ - The user explicitly abandons a direction (e.g., "let's not do it that way")
230
+ - A dependency or library is evaluated and rejected
231
+
232
+ ### Content Template
233
+
234
+ Use this structured format:
235
+
236
+ ```
237
+ ABANDONED: <what was tried>
238
+ REASON: <why it was abandoned>
239
+ ALTERNATIVE: <what was done instead, or "none yet">
240
+ CONTEXT: <any useful context for future reference>
241
+ ```
242
+
243
+ ### Required Tags
244
+
245
+ | Tag | Purpose | Example |
246
+ | ------------------- | --------------------------------- | --------------------- |
247
+ | `reason:<why>` | Machine-searchable abandon reason | `reason:performance` |
248
+ | `approach:<what>` | What was tried | `approach:sqlite-fts` |
249
+ | `project:<name>` | Project scope | `project:aide` |
250
+ | `source:discovered` | Provenance (always discovered) | `source:discovered` |
251
+ | `session:<id>` | Session context | `session:abc12345` |
252
+
253
+ ### Example
254
+
255
+ ```bash
256
+ ./.aide/bin/aide memory add --category=abandoned \
257
+ --tags=reason:performance,approach:sqlite-fts,project:aide,session:abc12345,source:discovered \
258
+ "ABANDONED: Using SQLite FTS5 for memory search. REASON: go-sqlite3 requires CGO which breaks cross-compilation. ALTERNATIVE: Bleve full-text search (pure Go). CONTEXT: FTS5 was faster in benchmarks but CGO dependency was a non-starter for the release pipeline."
259
+ ```
260
+
261
+ ### Decision Interaction
262
+
263
+ If an abandoned approach contradicts or supersedes an existing Decision (check with `mcp__plugin_aide_aide__decision_list`), also update the decision to reflect the change. For example, if a decision said "use SQLite FTS" and you abandoned that approach, update the decision with the new direction.
219
264
 
220
265
  ## For Swarm/Multi-Agent
221
266
 
@@ -207,7 +207,7 @@ Use native Claude Code task tools to track your progress:
207
207
  **Shared state (MCP + CLI):**
208
208
  - Check decisions: \`mcp__plugin_aide_aide__decision_get\` (MCP read)
209
209
  - Record decisions: \`./.aide/bin/aide decision set <topic> "<decision>"\` (CLI write)
210
- - Share discoveries: \`./.aide/bin/aide memory add --category=discovery "<finding>"\` (CLI write)
210
+ - Share discoveries: \`./.aide/bin/aide memory add --category=discovery --tags=project:<name>,session:\${AIDE_SESSION_ID},source:discovered "<finding>"\` (CLI write)
211
211
 
212
212
  **Binary location:** The aide binary is at \`.aide/bin/aide\`. If it's on your \`$PATH\`, you can use \`aide\` directly.
213
213
 
@@ -366,7 +366,7 @@ activeForm: "Documenting [feature]"
366
366
 
367
367
  - Check existing decisions: `mcp__plugin_aide_aide__decision_get` (MCP read)
368
368
  - Record new decisions: `./.aide/bin/aide decision set <topic> "<decision>"` (CLI write)
369
- - Share discoveries: `./.aide/bin/aide memory add --category=discovery "<finding>"` (CLI write)
369
+ - Share discoveries: `./.aide/bin/aide memory add --category=discovery --tags=project:<name>,session:${AIDE_SESSION_ID},source:discovered "<finding>"` (CLI write)
370
370
 
371
371
  ## VERIFY Failure Handling
372
372
 
@@ -429,9 +429,20 @@ message_ack: message_id=42, agent_id="agent-auth"
429
429
  **Memory** (shared discoveries):
430
430
 
431
431
  ```bash
432
- ./.aide/bin/aide memory add --category=discovery "User model needs email validation"
432
+ ./.aide/bin/aide memory add --category=discovery --tags=project:<name>,session:${AIDE_SESSION_ID},source:discovered "User model needs email validation"
433
433
  ```
434
434
 
435
+ ## Memory Hygiene
436
+
437
+ When any agent stores memories (discoveries, blockers, session summaries), always:
438
+
439
+ 1. **Include `source:` tag** — Use `source:discovered` for findings, `source:inferred` for deductions
440
+ 2. **Include scope tags** — Add `project:<name>,session:<id>` (get project name from git remote or directory; session ID from `$AIDE_SESSION_ID` or `$CLAUDE_SESSION_ID`)
441
+ 3. **Verify codebase claims** before storing — If a memory references a file, function, or path, confirm it exists first. See the `memorise` skill for the full verification workflow.
442
+ 4. **Never use `scope:global`** unless storing a user preference
443
+
444
+ This applies to all `memory add` commands in agent prompts, coordination examples, and the orchestrator memory section above.
445
+
435
446
  ## OpenCode Mode
436
447
 
437
448
  OpenCode has native `todowrite`/`todoread` for per-agent progress tracking, and a `task` tool for spawning subagents. However, OpenCode's todos are **session-private** — they are NOT shared across agents. For multi-agent coordination, use **aide tasks** (MCP tools) as the shared task system.
@@ -514,7 +525,7 @@ message_ack: message_id=42, agent_id="agent-auth"
514
525
  # Decisions and discoveries — shared knowledge
515
526
  mcp__plugin_aide_aide__decision_get with topic="auth-strategy"
516
527
  ./.aide/bin/aide decision set "auth-strategy" "JWT with refresh tokens"
517
- ./.aide/bin/aide memory add --category=discovery "User model needs email validation"
528
+ ./.aide/bin/aide memory add --category=discovery --tags=project:<name>,session:${AIDE_SESSION_ID},source:discovered "User model needs email validation"
518
529
  ```
519
530
 
520
531
  ## Completion (MANDATORY STEPS)
@@ -574,7 +585,7 @@ Only after successful merge, record the swarm session (see Orchestrator Memory b
574
585
  After swarm completes, record the session using the CLI:
575
586
 
576
587
  ```bash
577
- ./.aide/bin/aide memory add --category=session --tags=swarm,sdlc,session:${CLAUDE_SESSION_ID:0:8} "## Swarm: [Brief Description]
588
+ ./.aide/bin/aide memory add --category=session --tags=swarm,sdlc,project:<name>,session:${AIDE_SESSION_ID},source:discovered "## Swarm: [Brief Description]
578
589
 
579
590
  ### Stories Completed
580
591
  - Story A: [outcome]
@@ -105,7 +105,7 @@ export function buildPartialTags(
105
105
  ): string[] {
106
106
  const tags = [
107
107
  "partial",
108
- `session:${sessionId.slice(0, 12)}`,
108
+ `session:${sessionId}`,
109
109
  `tool:${info.toolName.toLowerCase()}`,
110
110
  ];
111
111
  if (info.filePath) {
@@ -173,7 +173,7 @@ function querySessionPartials<T>(
173
173
  label: string,
174
174
  ): T[] {
175
175
  try {
176
- const sessionTag = `session:${sessionId.slice(0, 12)}`;
176
+ const sessionTag = `session:${sessionId}`;
177
177
 
178
178
  const output = execFileSync(
179
179
  binary,
@@ -464,7 +464,6 @@ export function buildWelcomeContext(
464
464
  lines.push("");
465
465
  lines.push("- **autopilot**: Full autonomous execution");
466
466
  lines.push("- **eco**: Token-efficient mode");
467
- lines.push("- **ralph**: Persistence until verified complete");
468
467
  lines.push("- **swarm**: Parallel agents with shared memory");
469
468
  lines.push("- **plan**: Planning interview workflow");
470
469
  lines.push("");
@@ -224,7 +224,7 @@ export function storeSessionSummary(
224
224
  summary: string,
225
225
  ): boolean {
226
226
  try {
227
- const tags = `session-summary,session:${sessionId.slice(0, 12)}`;
227
+ const tags = `session-summary,session:${sessionId}`;
228
228
 
229
229
  execFileSync(
230
230
  binary,
@@ -81,7 +81,6 @@ export function buildReminder(mode: string | null): string | null {
81
81
  if (!mode) return null;
82
82
 
83
83
  const reminders: Record<string, string> = {
84
- ralph: `[aide:ralph] Persistence active. Verify work is complete before stopping.`,
85
84
  autopilot: `[aide:autopilot] Autonomous mode. Continue until all tasks verified.`,
86
85
  eco: `[aide:eco] Token-efficient mode. Minimize context, use fast models.`,
87
86
  swarm: `[aide:swarm] Swarm active. Use aide-memory for coordination.`,
package/src/core/types.ts CHANGED
@@ -144,7 +144,7 @@ export interface ToolUseInfo {
144
144
  // Persistence
145
145
  // =============================================================================
146
146
 
147
- export const PERSISTENCE_MODES = ["ralph", "autopilot"] as const;
147
+ export const PERSISTENCE_MODES = ["autopilot"] as const;
148
148
  export type PersistenceMode = (typeof PERSISTENCE_MODES)[number];
149
149
  export const MAX_PERSISTENCE_ITERATIONS = 20;
150
150
 
package/src/lib/hud.ts CHANGED
@@ -84,7 +84,6 @@ const DEFAULT_HUD_CONFIG: HudConfig = {
84
84
  const ICONS = {
85
85
  mode: {
86
86
  autopilot: "🚀",
87
- ralph: "🔄",
88
87
  eco: "💚",
89
88
  swarm: "🐝",
90
89
  plan: "📋",
@@ -509,7 +509,7 @@ async function handleSessionIdle(
509
509
  ): Promise<void> {
510
510
  const sessionId = extractSessionId(event);
511
511
 
512
- // Check persistence: if ralph/autopilot mode is active, re-prompt the session
512
+ // Check persistence: if autopilot mode is active, re-prompt the session
513
513
  if (state.binary) {
514
514
  try {
515
515
  const persistResult = checkPersistence(
@@ -875,7 +875,7 @@ function createCompactionHandler(
875
875
 
876
876
  if (summary) {
877
877
  // Tag as partial so the session-end summary supersedes it
878
- const tags = `partial,session-summary,session:${input.sessionID.slice(0, 8)}`;
878
+ const tags = `partial,session-summary,session:${input.sessionID}`;
879
879
  execFileSync(
880
880
  state.binary,
881
881
  ["memory", "add", "--category=session", `--tags=${tags}`, summary],
@@ -1,515 +0,0 @@
1
- ---
2
- name: ralph
3
- description: Ralph Wiggum methodology - iterative implementation with test-driven backpressure
4
- triggers:
5
- - ralph
6
- - persist
7
- - persistence
8
- - don't stop
9
- - dont stop
10
- - until done
11
- - must complete
12
- - relentless
13
- - ralph wiggum
14
- ---
15
-
16
- # Ralph Mode (Ralph Wiggum Methodology)
17
-
18
- **Recommended model tier:** smart (opus) - this skill requires complex reasoning
19
-
20
- You are now in **Ralph Wiggum mode** - an iterative development methodology that uses test-driven backpressure and aide-based state persistence.
21
-
22
- ## Core Principles
23
-
24
- 1. **Planning vs Building**: Separate phases with distinct behaviors
25
- 2. **Backpressure via Tests**: Cannot proceed until tests pass
26
- 3. **Task Atomicity**: One task per iteration
27
- 4. **Don't Assume**: Verify gaps exist before implementing
28
- 5. **aide-Based Persistence**: Tasks, state, and decisions stored in aide (not files)
29
- 6. **Swarm Compatible**: Multiple agents can work in parallel
30
-
31
- ---
32
-
33
- ## State Management
34
-
35
- All state is managed through aide. Use MCP tools for reads, CLI for writes:
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
-
46
- ### Reads (MCP Tools)
47
-
48
- | Tool | Purpose |
49
- | -------------------------------------- | -------------------- |
50
- | `mcp__plugin_aide_aide__state_get` | Get phase, objective |
51
- | `mcp__plugin_aide_aide__state_list` | List all state |
52
- | `mcp__plugin_aide_aide__decision_get` | Get decisions |
53
- | `mcp__plugin_aide_aide__decision_list` | List all decisions |
54
- | `mcp__plugin_aide_aide__memory_search` | Search discoveries |
55
- | `task_list` | List aide tasks |
56
- | `task_get` | Get task by ID |
57
-
58
- ### Writes (CLI via Bash or MCP)
59
-
60
- ```bash
61
- # Phase tracking
62
- ./.aide/bin/aide state set ralph:phase planning # or "building"
63
-
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
67
-
68
- # Decisions
69
- ./.aide/bin/aide decision set <topic> "<decision>" --rationale="<why>"
70
-
71
- # Gap analysis / discoveries
72
- ./.aide/bin/aide memory add --category=discovery --tags=ralph "Gap found: <description>"
73
- ```
74
-
75
- **Binary location:** The aide binary is at `.aide/bin/aide`. If it's on your `$PATH`, you can use `aide` directly.
76
-
77
- ---
78
-
79
- ## Phase 1: Planning Mode
80
-
81
- When starting a new task or when `./.aide/bin/aide state get ralph:phase` is empty/planning:
82
-
83
- ### Step 1: Set Phase
84
-
85
- ```bash
86
- ./.aide/bin/aide state set ralph:phase planning
87
- ./.aide/bin/aide state set ralph:objective "<what we're building>"
88
- ```
89
-
90
- ### Step 2: Gap Analysis (Don't Assume!)
91
-
92
- **CRITICAL**: Before assuming anything needs implementation, SEARCH THE CODE:
93
-
94
- ```bash
95
- # Search for existing implementations
96
- rg "functionName\|ClassName\|feature" --type ts
97
-
98
- # Check existing tests
99
- rg "describe.*feature\|it.*should" --type ts
100
- ```
101
-
102
- Record findings:
103
-
104
- ```bash
105
- ./.aide/bin/aide memory add --category=discovery --tags=ralph,gap-analysis "Searched for X: <results>"
106
- ```
107
-
108
- Only after confirming gaps exist, proceed to task creation.
109
-
110
- ### Step 3: Create Tasks
111
-
112
- Create atomic, testable tasks:
113
-
114
- ```bash
115
- ./.aide/bin/aide task create "Implement user model" --tags=ralph,task-1
116
- ./.aide/bin/aide task create "Add validation to user model" --tags=ralph,task-2
117
- ./.aide/bin/aide task create "Write user model tests" --tags=ralph,task-3
118
- ```
119
-
120
- Each task should be:
121
-
122
- - Small enough to complete in one iteration
123
- - Independently testable
124
- - Clearly defined acceptance criteria
125
-
126
- ### Step 4: Record Key Decisions
127
-
128
- ```bash
129
- ./.aide/bin/aide decision set ralph:test-framework "vitest" --rationale="Already configured in project"
130
- ./.aide/bin/aide decision set ralph:approach "<approach>" --rationale="<why>"
131
- ```
132
-
133
- ### Step 5: Exit Planning
134
-
135
- ```bash
136
- ./.aide/bin/aide state set ralph:phase building
137
- ```
138
-
139
- Report the plan:
140
-
141
- - List tasks: `./.aide/bin/aide task list`
142
- - List decisions: `./.aide/bin/aide decision list`
143
-
144
- **DO NOT implement during planning phase.**
145
-
146
- ---
147
-
148
- ## Phase 2: Building Mode
149
-
150
- When `./.aide/bin/aide state get ralph:phase` returns "building":
151
-
152
- ### Iteration Loop
153
-
154
- Each iteration follows this exact sequence:
155
-
156
- #### 1. Load Context
157
-
158
- ```bash
159
- # Check current phase and objective
160
- ./.aide/bin/aide state get ralph:phase
161
- ./.aide/bin/aide state get ralph:objective
162
-
163
- # List tasks to find next one
164
- ./.aide/bin/aide task list
165
-
166
- # Check existing decisions
167
- ./.aide/bin/aide decision list
168
- ```
169
-
170
- #### 2. Select Next Task
171
-
172
- Find the first pending task:
173
-
174
- ```bash
175
- ./.aide/bin/aide task list # Look for [pending] status
176
- ```
177
-
178
- Claim it:
179
-
180
- ```bash
181
- ./.aide/bin/aide task claim <task-id> --agent=ralph
182
- ```
183
-
184
- #### 3. Verify Gap Still Exists (Don't Assume!)
185
-
186
- Before implementing, RE-VERIFY:
187
-
188
- ```bash
189
- # Search again - someone may have implemented it
190
- rg "featureName" --type ts
191
- ```
192
-
193
- If gap no longer exists:
194
-
195
- ```bash
196
- ./.aide/bin/aide task complete <task-id>
197
- # Proceed to next task
198
- ```
199
-
200
- #### 4. Write Tests First
201
-
202
- Create or update test file with failing tests:
203
-
204
- ```bash
205
- # Run tests - they MUST fail initially
206
- npm test -- path/to/test.test.ts
207
- ```
208
-
209
- If tests pass without implementation, the gap analysis was wrong - complete the task and move on.
210
-
211
- #### 5. Implement Solution
212
-
213
- Write minimal code to make tests pass.
214
-
215
- #### 6. Backpressure Checkpoint (REQUIRED)
216
-
217
- **You CANNOT proceed until this passes:**
218
-
219
- ```bash
220
- npm test -- path/to/test.test.ts
221
- ```
222
-
223
- **BLOCKING RULE**: If tests fail, you MUST:
224
-
225
- 1. Analyze the failure
226
- 2. Fix the issue
227
- 3. Re-run tests
228
- 4. Repeat until passing
229
-
230
- **DO NOT skip failing tests. DO NOT proceed with failing tests.**
231
-
232
- #### 7. Complete Task
233
-
234
- ```bash
235
- ./.aide/bin/aide task complete <task-id>
236
- ```
237
-
238
- #### 8. Atomic Commit
239
-
240
- ```bash
241
- git add -A
242
- git commit -m "feat: <task description> - tests passing"
243
- ```
244
-
245
- #### 9. Check Completion
246
-
247
- ```bash
248
- ./.aide/bin/aide task list
249
- ```
250
-
251
- If more pending tasks: continue to next iteration (step 2)
252
- If all complete: run full verification
253
-
254
- ---
255
-
256
- ## Failure Handling
257
-
258
- ### Test Failures
259
-
260
- When tests fail during backpressure checkpoint:
261
-
262
- 1. **DO NOT** proceed to next task
263
- 2. **DO NOT** skip the failing test
264
- 3. **DO** analyze the error message
265
- 4. **DO** fix and re-run until passing
266
-
267
- Record blockers:
268
-
269
- ```bash
270
- ./.aide/bin/aide memory add --category=blocker --tags=ralph "Test failure: <description>"
271
- ```
272
-
273
- ### Stuck Conditions
274
-
275
- If blocked for more than 3 attempts:
276
-
277
- ```bash
278
- ./.aide/bin/aide memory add --category=blocker --tags=ralph,needs-help "Stuck on: <description>"
279
- ```
280
-
281
- Then ask user for guidance. **DO NOT** proceed without resolution.
282
-
283
- ---
284
-
285
- ## Full Verification Protocol
286
-
287
- Before claiming completion, ALL must pass:
288
-
289
- ```bash
290
- # 1. All tasks complete
291
- ./.aide/bin/aide task list # Should show all [done]
292
-
293
- # 2. All tests
294
- npm test
295
-
296
- # 3. Build
297
- npm run build
298
-
299
- # 4. Lint
300
- npm run lint
301
- ```
302
-
303
- Only proceed to completion when ALL verification passes.
304
-
305
- ---
306
-
307
- ## Completion
308
-
309
- When all tasks complete and verification passes:
310
-
311
- ### Update State
312
-
313
- ```bash
314
- ./.aide/bin/aide state set ralph:phase complete
315
- ./.aide/bin/aide state set ralph:result "success"
316
- ```
317
-
318
- ### Record Session
319
-
320
- ```bash
321
- ./.aide/bin/aide memory add --category=session --tags=ralph,implementation "
322
- ## <Feature Name> Complete
323
-
324
- Implemented using Ralph Wiggum methodology.
325
-
326
- ### Tasks Completed
327
- - Task 1: <description>
328
- - Task 2: <description>
329
-
330
- ### Verification
331
- - Tests: passing
332
- - Build: passing
333
- - Lint: clean
334
-
335
- ### Key Decisions
336
- - <decision>: <rationale>
337
- "
338
- ```
339
-
340
- ---
341
-
342
- ## Anti-Patterns (AVOID)
343
-
344
- - "I've made good progress, let me summarize..." (KEEP WORKING)
345
- - "The main work is done, you can finish..." (VERIFY FIRST)
346
- - "I'll skip this failing test for now..." (FIX IT NOW)
347
- - "I assume this needs to be implemented..." (SEARCH FIRST)
348
- - "I'll implement everything then test..." (TEST EACH TASK)
349
- - Proceeding with red tests (NEVER)
350
- - Implementing during planning phase (SEPARATE PHASES)
351
- - Large commits with multiple tasks (ONE TASK PER COMMIT)
352
-
353
- ---
354
-
355
- ## Commands
356
-
357
- - `ralph` or `ralph plan` - Start planning phase
358
- - `ralph build` - Start building phase (requires tasks exist)
359
- - `ralph status` - Show current state via aide
360
- - `cancel` or `stop ralph` - Exit ralph mode
361
-
362
- ---
363
-
364
- ## Quick Reference
365
-
366
- ```
367
- PLANNING PHASE:
368
- 1. ./.aide/bin/aide state set ralph:phase planning
369
- 2. Search code (don't assume!)
370
- 3. ./.aide/bin/aide memory add findings
371
- 4. ./.aide/bin/aide task create (atomic tasks)
372
- 5. ./.aide/bin/aide decision set (key decisions)
373
- 6. ./.aide/bin/aide state set ralph:phase building
374
-
375
- BUILDING PHASE (per task):
376
- 1. ./.aide/bin/aide task list (find next)
377
- 2. ./.aide/bin/aide task claim <id>
378
- 3. Re-verify gap exists
379
- 4. Write failing tests
380
- 5. Implement
381
- 6. BACKPRESSURE: Tests MUST pass
382
- 7. ./.aide/bin/aide task complete <id>
383
- 8. Atomic commit
384
- 9. Repeat or verify completion
385
- ```
386
-
387
- ---
388
-
389
- ## Swarm Compatibility
390
-
391
- This skill is **swarm-compatible**. Multiple ralph agents can:
392
-
393
- - Work on different tasks in parallel
394
- - Share discoveries via `./.aide/bin/aide memory`
395
- - Check decisions via `./.aide/bin/aide decision get`
396
- - Claim tasks atomically via `./.aide/bin/aide task claim`
397
-
398
- No file conflicts because all state is in aide's database.
399
-
400
- ---
401
-
402
- ## Phase 3: Final QA (Swarm Mode)
403
-
404
- **MANDATORY** when ralph runs with swarm (multiple agents). After all tasks show `[done]`:
405
-
406
- ### Step 1: Spawn QA Agent
407
-
408
- The orchestrator spawns a **single** QA subagent:
409
-
410
- ```
411
- Spawn a final QA agent with instructions:
412
- "You are the QA agent for a ralph swarm session. Your job is NOT to trust the task list.
413
- Instead, independently verify the implementation against the original objective."
414
- ```
415
-
416
- ### Step 2: QA Agent Workflow
417
-
418
- The QA agent must:
419
-
420
- #### a) Load the Objective (not the task list)
421
-
422
- ```bash
423
- ./.aide/bin/aide state get ralph:objective
424
- ```
425
-
426
- #### b) Independent Verification
427
-
428
- **Ignore the task list.** Instead, verify from first principles:
429
-
430
- 1. **Read the code** - Does it implement the objective?
431
- 2. **Check for gaps** - Are there missing pieces the tasks didn't cover?
432
- 3. **Run full test suite** - Not just individual task tests
433
- ```bash
434
- npm test
435
- npm run build
436
- npm run lint
437
- ```
438
- 4. **Integration check** - Does it work as a whole?
439
-
440
- #### c) Find & Fix Gaps
441
-
442
- If gaps are found:
443
-
444
- ```bash
445
- # Record the gap
446
- ./.aide/bin/aide memory add --category=discovery --tags=ralph,qa "QA found gap: <description>"
447
-
448
- # Create fix task
449
- ./.aide/bin/aide task create "QA fix: <description>" --tags=ralph,qa-fix
450
-
451
- # Implement the fix (follow standard backpressure rules)
452
- # ...
453
-
454
- # Mark complete
455
- ./.aide/bin/aide task complete <id>
456
- ```
457
-
458
- #### d) Final Sign-off
459
-
460
- Only when QA agent confirms:
461
-
462
- - All tests passing
463
- - Build clean
464
- - Lint clean
465
- - Objective fully met (not just tasks)
466
-
467
- ```bash
468
- ./.aide/bin/aide state set ralph:qa "passed"
469
- ./.aide/bin/aide state set ralph:phase complete
470
- ```
471
-
472
- ### Step 3: QA Failure Handling
473
-
474
- If QA finds unfixable issues:
475
-
476
- ```bash
477
- ./.aide/bin/aide state set ralph:qa "failed"
478
- ./.aide/bin/aide memory add --category=blocker --tags=ralph,qa "QA failed: <reason>"
479
- ```
480
-
481
- Report to user with specific failures. **DO NOT** mark complete.
482
-
483
- ---
484
-
485
- ## Swarm + Ralph Workflow Summary
486
-
487
- ```
488
- ORCHESTRATOR SWARM AGENTS QA AGENT
489
- │ │ │
490
- ├─► Planning phase │ │
491
- │ (create tasks) │ │
492
- │ │ │
493
- ├─► Spawn N agents ────────────►│ │
494
- │ ├─► Claim tasks │
495
- │ ├─► Implement │
496
- │ ├─► Backpressure tests │
497
- │ ├─► Complete & commit │
498
- │ │ │
499
- │◄── All tasks [done] ──────────┤ │
500
- │ │ │
501
- ├─► Merge worktrees │ │
502
- │ (worktree-resolve) │ │
503
- │ │ │
504
- ├─► Spawn QA agent ─────────────┼───────────────────────►│
505
- │ │ ├─► Ignore task list
506
- │ │ ├─► Verify objective
507
- │ │ ├─► Fix gaps
508
- │ │ ├─► Full test suite
509
- │ │ │
510
- │◄── QA passed ─────────────────┼────────────────────────┤
511
- │ │ │
512
- └─► Mark complete │ │
513
- ```
514
-
515
- The QA phase ensures swarm work is **truly complete**, not just task-list complete.