opencode-lisa 0.1.1 → 0.2.1
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/.opencode/command/lisa.md +1 -0
- package/README.md +2 -0
- package/dist/index.js +855 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
An intelligent epic workflow plugin for [OpenCode](https://opencode.ai). Like the Ralph Wiggum pattern, but smarter.
|
|
6
6
|
|
|
7
|
+
**Latest version: 0.2.0** - Now fully self-contained for npm installation!
|
|
8
|
+
|
|
7
9
|
## Why Lisa?
|
|
8
10
|
|
|
9
11
|
The **Ralph Wiggum pattern** is a simple bash loop that keeps feeding prompts to an AI agent until completion. It works, but:
|
package/dist/index.js
CHANGED
|
@@ -12350,6 +12350,848 @@ tool.schema = exports_external;
|
|
|
12350
12350
|
import { readdir, readFile, writeFile } from "fs/promises";
|
|
12351
12351
|
import { existsSync } from "fs";
|
|
12352
12352
|
import { join } from "path";
|
|
12353
|
+
var LISA_SKILL_CONTENT = `---
|
|
12354
|
+
name: lisa
|
|
12355
|
+
description: Lisa - intelligent epic workflow with spec, research, plan, and execute phases. Smarter than Ralph.
|
|
12356
|
+
---
|
|
12357
|
+
|
|
12358
|
+
# Lisa - Intelligent Epic Workflow
|
|
12359
|
+
|
|
12360
|
+
A structured approach to implementing large features by breaking them into phases: spec, research, plan, and execute.
|
|
12361
|
+
|
|
12362
|
+
Like the Ralph Wiggum pattern, but smarter. Lisa plans before she acts.
|
|
12363
|
+
|
|
12364
|
+
## Working Directory
|
|
12365
|
+
|
|
12366
|
+
Epics are stored in \`.lisa/epics/\` relative to **where you run \`opencode\`**.
|
|
12367
|
+
|
|
12368
|
+
Run opencode from your project root and epics will be at \`your-project/.lisa/epics/\`.
|
|
12369
|
+
|
|
12370
|
+
**Example structure:**
|
|
12371
|
+
\`\`\`
|
|
12372
|
+
my-project/ <- run \`opencode\` from here
|
|
12373
|
+
\u251C\u2500\u2500 .lisa/
|
|
12374
|
+
\u2502 \u251C\u2500\u2500 config.jsonc
|
|
12375
|
+
\u2502 \u251C\u2500\u2500 .gitignore
|
|
12376
|
+
\u2502 \u2514\u2500\u2500 epics/
|
|
12377
|
+
\u2502 \u2514\u2500\u2500 my-feature/
|
|
12378
|
+
\u2502 \u251C\u2500\u2500 .state
|
|
12379
|
+
\u2502 \u251C\u2500\u2500 spec.md
|
|
12380
|
+
\u2502 \u2514\u2500\u2500 tasks/
|
|
12381
|
+
\u251C\u2500\u2500 src/
|
|
12382
|
+
\u2514\u2500\u2500 package.json
|
|
12383
|
+
\`\`\`
|
|
12384
|
+
|
|
12385
|
+
---
|
|
12386
|
+
|
|
12387
|
+
## Parse Arguments
|
|
12388
|
+
|
|
12389
|
+
The input format is: \`<epic-name> [mode]\`
|
|
12390
|
+
|
|
12391
|
+
### If no arguments or \`help\`:
|
|
12392
|
+
|
|
12393
|
+
If the user runs \`/lisa\` with no arguments, or \`/lisa help\`, immediately respond with this help menu (no tool calls needed):
|
|
12394
|
+
|
|
12395
|
+
\`\`\`
|
|
12396
|
+
Lisa - Intelligent Epic Workflow
|
|
12397
|
+
|
|
12398
|
+
Available Commands:
|
|
12399
|
+
|
|
12400
|
+
/lisa list - List all epics and their status
|
|
12401
|
+
/lisa <name> - Continue or create an epic (interactive)
|
|
12402
|
+
/lisa <name> spec - Create/view the spec only
|
|
12403
|
+
/lisa <name> status - Show detailed epic status
|
|
12404
|
+
/lisa <name> yolo - Auto-execute mode (no confirmations)
|
|
12405
|
+
/lisa config view - View current configuration
|
|
12406
|
+
/lisa config init - Initialize config with defaults
|
|
12407
|
+
/lisa config reset - Reset config to defaults
|
|
12408
|
+
|
|
12409
|
+
Examples:
|
|
12410
|
+
/lisa list - See all your epics
|
|
12411
|
+
/lisa auth-system - Start or continue the auth-system epic
|
|
12412
|
+
/lisa auth-system yolo - Run auth-system in full auto mode
|
|
12413
|
+
|
|
12414
|
+
Get started: /lisa <epic-name>
|
|
12415
|
+
\`\`\`
|
|
12416
|
+
|
|
12417
|
+
**Stop here. Do not call any tools or do anything else.**
|
|
12418
|
+
|
|
12419
|
+
### Otherwise, parse the arguments:
|
|
12420
|
+
|
|
12421
|
+
**Modes:**
|
|
12422
|
+
- \`list\` \u2192 List all epics
|
|
12423
|
+
- \`config <action>\` \u2192 Config management (view/init/reset)
|
|
12424
|
+
- \`<name>\` (no mode) \u2192 Default mode with checkpoints
|
|
12425
|
+
- \`<name> spec\` \u2192 Just create/view spec
|
|
12426
|
+
- \`<name> yolo\` \u2192 Full auto, no checkpoints
|
|
12427
|
+
- \`<name> status\` \u2192 Show status
|
|
12428
|
+
|
|
12429
|
+
**Examples:**
|
|
12430
|
+
- \`list\` \u2192 list all epics
|
|
12431
|
+
- \`config view\` \u2192 show config
|
|
12432
|
+
- \`my-feature\` \u2192 default mode
|
|
12433
|
+
- \`my-feature spec\` \u2192 spec only
|
|
12434
|
+
- \`my-feature yolo\` \u2192 full auto
|
|
12435
|
+
- \`my-feature status\` \u2192 show status
|
|
12436
|
+
|
|
12437
|
+
---
|
|
12438
|
+
|
|
12439
|
+
## Mode: config
|
|
12440
|
+
|
|
12441
|
+
Handle config subcommands using the \`lisa_config\` tool:
|
|
12442
|
+
|
|
12443
|
+
- \`config view\` \u2192 Call \`lisa_config(action: "view")\` and display the result
|
|
12444
|
+
- \`config init\` \u2192 Call \`lisa_config(action: "init")\` and confirm creation
|
|
12445
|
+
- \`config reset\` \u2192 Call \`lisa_config(action: "reset")\` and confirm reset
|
|
12446
|
+
|
|
12447
|
+
After the tool returns, display the result in a user-friendly format.
|
|
12448
|
+
|
|
12449
|
+
---
|
|
12450
|
+
|
|
12451
|
+
## Mode: list
|
|
12452
|
+
|
|
12453
|
+
**Use the \`list_epics\` tool** to quickly get all epics and their status.
|
|
12454
|
+
|
|
12455
|
+
Display the results in a formatted list showing:
|
|
12456
|
+
- Epic name
|
|
12457
|
+
- Current phase (spec/research/plan/execute/complete)
|
|
12458
|
+
- Task progress (X/Y done) if in execute phase
|
|
12459
|
+
- Whether yolo mode is active
|
|
12460
|
+
|
|
12461
|
+
**If no epics found:**
|
|
12462
|
+
> "No epics found. Start one with \`/lisa <name>\`"
|
|
12463
|
+
|
|
12464
|
+
---
|
|
12465
|
+
|
|
12466
|
+
## Mode: status
|
|
12467
|
+
|
|
12468
|
+
**Use the \`get_epic_status\` tool** to quickly get detailed status.
|
|
12469
|
+
|
|
12470
|
+
Display the results showing:
|
|
12471
|
+
- Current phase
|
|
12472
|
+
- Which artifacts exist (spec.md, research.md, plan.md)
|
|
12473
|
+
- Task breakdown: done, in-progress, pending, blocked
|
|
12474
|
+
- Yolo mode status (if active)
|
|
12475
|
+
- Suggested next action
|
|
12476
|
+
|
|
12477
|
+
**If epic doesn't exist:**
|
|
12478
|
+
> "Epic '<name>' not found. Start it with \`/lisa <name>\`"
|
|
12479
|
+
|
|
12480
|
+
---
|
|
12481
|
+
|
|
12482
|
+
## Mode: spec
|
|
12483
|
+
|
|
12484
|
+
Interactive spec creation only. Does NOT continue to research/plan/execute.
|
|
12485
|
+
|
|
12486
|
+
### If spec already exists:
|
|
12487
|
+
|
|
12488
|
+
Read and display the existing spec, then:
|
|
12489
|
+
|
|
12490
|
+
> "Spec already exists at \`.lisa/epics/<name>/spec.md\`. You can:
|
|
12491
|
+
> - Edit it directly in your editor
|
|
12492
|
+
> - Delete it and run \`/lisa <name> spec\` again to start over
|
|
12493
|
+
> - Run \`/lisa <name>\` to continue with research and planning"
|
|
12494
|
+
|
|
12495
|
+
### If no spec exists:
|
|
12496
|
+
|
|
12497
|
+
Have an interactive conversation to define the spec. Cover:
|
|
12498
|
+
|
|
12499
|
+
1. **Goal** - What are we trying to achieve? Why?
|
|
12500
|
+
2. **Scope** - What's included? What's explicitly out of scope?
|
|
12501
|
+
3. **Acceptance Criteria** - How do we know when it's done?
|
|
12502
|
+
4. **Technical Constraints** - Any specific technologies, patterns, or limitations?
|
|
12503
|
+
|
|
12504
|
+
Be conversational. Ask clarifying questions. Push back if scope is too large or vague.
|
|
12505
|
+
|
|
12506
|
+
**Keep it concise** - aim for 20-50 lines. Focus on "what" and "why", not "how".
|
|
12507
|
+
|
|
12508
|
+
### When conversation is complete:
|
|
12509
|
+
|
|
12510
|
+
Summarize the spec and ask:
|
|
12511
|
+
|
|
12512
|
+
> "Here's the spec:
|
|
12513
|
+
>
|
|
12514
|
+
> [formatted spec]
|
|
12515
|
+
>
|
|
12516
|
+
> Ready to save to \`.lisa/epics/<name>/spec.md\`?"
|
|
12517
|
+
|
|
12518
|
+
On confirmation, create the directory and save:
|
|
12519
|
+
|
|
12520
|
+
\`\`\`
|
|
12521
|
+
.lisa/epics/<name>/
|
|
12522
|
+
spec.md
|
|
12523
|
+
.state
|
|
12524
|
+
\`\`\`
|
|
12525
|
+
|
|
12526
|
+
**spec.md format:**
|
|
12527
|
+
\`\`\`markdown
|
|
12528
|
+
# Epic: <name>
|
|
12529
|
+
|
|
12530
|
+
## Goal
|
|
12531
|
+
[What we're building and why - 1-2 sentences]
|
|
12532
|
+
|
|
12533
|
+
## Scope
|
|
12534
|
+
- [What's included]
|
|
12535
|
+
- [What's included]
|
|
12536
|
+
|
|
12537
|
+
### Out of Scope
|
|
12538
|
+
- [What we're NOT doing]
|
|
12539
|
+
|
|
12540
|
+
## Acceptance Criteria
|
|
12541
|
+
- [ ] [Measurable criterion]
|
|
12542
|
+
- [ ] [Measurable criterion]
|
|
12543
|
+
|
|
12544
|
+
## Technical Constraints
|
|
12545
|
+
- [Any constraints, or "None"]
|
|
12546
|
+
\`\`\`
|
|
12547
|
+
|
|
12548
|
+
**.state format (JSON):**
|
|
12549
|
+
\`\`\`json
|
|
12550
|
+
{
|
|
12551
|
+
"name": "<name>",
|
|
12552
|
+
"currentPhase": "spec",
|
|
12553
|
+
"specComplete": true,
|
|
12554
|
+
"researchComplete": false,
|
|
12555
|
+
"planComplete": false,
|
|
12556
|
+
"executeComplete": false,
|
|
12557
|
+
"lastUpdated": "<timestamp>"
|
|
12558
|
+
}
|
|
12559
|
+
\`\`\`
|
|
12560
|
+
|
|
12561
|
+
After saving:
|
|
12562
|
+
> "Spec saved to \`.lisa/epics/<name>/spec.md\`
|
|
12563
|
+
>
|
|
12564
|
+
> Next steps:
|
|
12565
|
+
> - Run \`/lisa <name>\` to continue with research and planning
|
|
12566
|
+
> - Run \`/lisa <name> yolo\` for full auto execution"
|
|
12567
|
+
|
|
12568
|
+
---
|
|
12569
|
+
|
|
12570
|
+
## Mode: default (with checkpoints)
|
|
12571
|
+
|
|
12572
|
+
This is the main interactive mode. It guides you through each phase with approval checkpoints.
|
|
12573
|
+
|
|
12574
|
+
### Step 1: Ensure spec exists
|
|
12575
|
+
|
|
12576
|
+
**If no spec:**
|
|
12577
|
+
Run the spec conversation (same as spec mode). After saving, continue to step 2.
|
|
12578
|
+
|
|
12579
|
+
**If spec exists:**
|
|
12580
|
+
Read and briefly summarize it, then continue to step 2.
|
|
12581
|
+
|
|
12582
|
+
### Step 2: Research phase
|
|
12583
|
+
|
|
12584
|
+
**If research.md already exists:**
|
|
12585
|
+
> "Research already complete. Proceeding to planning..."
|
|
12586
|
+
Skip to step 3.
|
|
12587
|
+
|
|
12588
|
+
**If research not done:**
|
|
12589
|
+
> "Ready to start research? I'll explore the codebase to understand what's needed for this epic."
|
|
12590
|
+
|
|
12591
|
+
Wait for confirmation. On "yes" or similar:
|
|
12592
|
+
|
|
12593
|
+
1. Read spec.md
|
|
12594
|
+
2. Explore the codebase using available tools (LSP, grep, glob, file reads)
|
|
12595
|
+
3. Document findings
|
|
12596
|
+
4. Save to \`.lisa/epics/<name>/research.md\`
|
|
12597
|
+
5. Update .state
|
|
12598
|
+
|
|
12599
|
+
**research.md format:**
|
|
12600
|
+
\`\`\`markdown
|
|
12601
|
+
# Research: <name>
|
|
12602
|
+
|
|
12603
|
+
## Overview
|
|
12604
|
+
[1-2 sentence summary of findings]
|
|
12605
|
+
|
|
12606
|
+
## Relevant Files
|
|
12607
|
+
- \`path/to/file.ts\` - [why it's relevant]
|
|
12608
|
+
- \`path/to/file.ts\` - [why it's relevant]
|
|
12609
|
+
|
|
12610
|
+
## Existing Patterns
|
|
12611
|
+
[How similar things are done in this codebase]
|
|
12612
|
+
|
|
12613
|
+
## Dependencies
|
|
12614
|
+
[External packages or internal modules needed]
|
|
12615
|
+
|
|
12616
|
+
## Technical Findings
|
|
12617
|
+
[Key discoveries that affect implementation]
|
|
12618
|
+
|
|
12619
|
+
## Recommendations
|
|
12620
|
+
[Suggested approach based on findings]
|
|
12621
|
+
\`\`\`
|
|
12622
|
+
|
|
12623
|
+
After saving:
|
|
12624
|
+
> "Research complete and saved. Found X relevant files. Key insight: [one line summary]"
|
|
12625
|
+
|
|
12626
|
+
### Step 3: Plan phase
|
|
12627
|
+
|
|
12628
|
+
**If plan.md already exists:**
|
|
12629
|
+
> "Plan already complete with X tasks. Proceeding to execution..."
|
|
12630
|
+
Skip to step 4.
|
|
12631
|
+
|
|
12632
|
+
**If plan not done:**
|
|
12633
|
+
> "Ready to create the implementation plan?"
|
|
12634
|
+
|
|
12635
|
+
Wait for confirmation. On "yes" or similar:
|
|
12636
|
+
|
|
12637
|
+
1. Read spec.md and research.md
|
|
12638
|
+
2. Break down into discrete tasks (aim for 1-5 files per task, ~30 min of work each)
|
|
12639
|
+
3. Define dependencies between tasks
|
|
12640
|
+
4. Save plan.md and individual task files
|
|
12641
|
+
5. Update .state
|
|
12642
|
+
|
|
12643
|
+
**plan.md format:**
|
|
12644
|
+
\`\`\`markdown
|
|
12645
|
+
# Plan: <name>
|
|
12646
|
+
|
|
12647
|
+
## Overview
|
|
12648
|
+
[1-2 sentence summary of approach]
|
|
12649
|
+
|
|
12650
|
+
## Tasks
|
|
12651
|
+
|
|
12652
|
+
1. [Task name] - tasks/01-[slug].md
|
|
12653
|
+
2. [Task name] - tasks/02-[slug].md
|
|
12654
|
+
3. [Task name] - tasks/03-[slug].md
|
|
12655
|
+
|
|
12656
|
+
## Dependencies
|
|
12657
|
+
|
|
12658
|
+
- 01: []
|
|
12659
|
+
- 02: [01]
|
|
12660
|
+
- 03: [01]
|
|
12661
|
+
- 04: [02, 03]
|
|
12662
|
+
|
|
12663
|
+
## Risks
|
|
12664
|
+
- [Risk and mitigation, or "None identified"]
|
|
12665
|
+
\`\`\`
|
|
12666
|
+
|
|
12667
|
+
**Task file format (tasks/XX-slug.md):**
|
|
12668
|
+
\`\`\`markdown
|
|
12669
|
+
# Task X: [Name]
|
|
12670
|
+
|
|
12671
|
+
## Status: pending
|
|
12672
|
+
|
|
12673
|
+
## Goal
|
|
12674
|
+
[What this task accomplishes - 1-2 sentences]
|
|
12675
|
+
|
|
12676
|
+
## Files
|
|
12677
|
+
- path/to/file1.ts
|
|
12678
|
+
- path/to/file2.ts
|
|
12679
|
+
|
|
12680
|
+
## Steps
|
|
12681
|
+
1. [Concrete step]
|
|
12682
|
+
2. [Concrete step]
|
|
12683
|
+
3. [Concrete step]
|
|
12684
|
+
|
|
12685
|
+
## Done When
|
|
12686
|
+
- [ ] [Testable criterion]
|
|
12687
|
+
- [ ] [Testable criterion]
|
|
12688
|
+
\`\`\`
|
|
12689
|
+
|
|
12690
|
+
After saving:
|
|
12691
|
+
> "Plan created with X tasks:
|
|
12692
|
+
> 1. [task 1 name]
|
|
12693
|
+
> 2. [task 2 name]
|
|
12694
|
+
> ...
|
|
12695
|
+
>
|
|
12696
|
+
> Saved to \`.lisa/epics/<name>/plan.md\`"
|
|
12697
|
+
|
|
12698
|
+
### Step 4: Execute phase
|
|
12699
|
+
|
|
12700
|
+
**Use \`get_available_tasks\` tool** to quickly see what's ready to run.
|
|
12701
|
+
|
|
12702
|
+
**If all tasks done (available and blocked both empty):**
|
|
12703
|
+
> "All tasks complete! Epic finished."
|
|
12704
|
+
Stop.
|
|
12705
|
+
|
|
12706
|
+
**If tasks remain:**
|
|
12707
|
+
Show task summary from the tool output and ask:
|
|
12708
|
+
> "Ready to execute? X tasks remaining:
|
|
12709
|
+
> - Available now: [from available list]
|
|
12710
|
+
> - Blocked by dependencies: [from blocked list]"
|
|
12711
|
+
|
|
12712
|
+
Wait for confirmation. On "yes" or similar:
|
|
12713
|
+
|
|
12714
|
+
**Execute tasks using \`build_task_context\` + Task tool:**
|
|
12715
|
+
|
|
12716
|
+
Tasks with satisfied dependencies can be executed in **parallel** (the \`available\` list from \`get_available_tasks\` shows all tasks that are ready). Tasks whose dependencies aren't met yet are in the \`blocked\` list and must wait.
|
|
12717
|
+
|
|
12718
|
+
For each task in the \`available\` list:
|
|
12719
|
+
1. Call \`build_task_context(epicName, taskId)\` to get the prompt
|
|
12720
|
+
2. Call the Task tool with the prompt to spawn a sub-agent
|
|
12721
|
+
3. After sub-agent(s) complete, call \`get_available_tasks\` again to refresh the list
|
|
12722
|
+
4. If a task isn't done, retry up to 3 times, then mark blocked
|
|
12723
|
+
5. Repeat until all tasks done
|
|
12724
|
+
|
|
12725
|
+
**Note:** If executing in parallel, each sub-agent gets the same context snapshot. Their reports will be available for subsequent tasks.
|
|
12726
|
+
|
|
12727
|
+
**On task failure (after 3 attempts):**
|
|
12728
|
+
- Mark task as \`blocked\` in the task file
|
|
12729
|
+
- Add \`## Blocked Reason: [why]\`
|
|
12730
|
+
- Continue with other available tasks
|
|
12731
|
+
|
|
12732
|
+
**On all tasks complete:**
|
|
12733
|
+
> "Epic complete! All X tasks finished.
|
|
12734
|
+
>
|
|
12735
|
+
> Summary of changes:
|
|
12736
|
+
> - [file]: [what changed]
|
|
12737
|
+
> - [file]: [what changed]"
|
|
12738
|
+
|
|
12739
|
+
---
|
|
12740
|
+
|
|
12741
|
+
## Mode: yolo (full auto)
|
|
12742
|
+
|
|
12743
|
+
Full automatic execution with no checkpoints. Requires spec to exist.
|
|
12744
|
+
|
|
12745
|
+
**IMPORTANT:** In yolo mode, the Lisa plugin monitors for session idle events and automatically continues execution until all tasks are complete. You don't need to worry about session limits - just keep working and the plugin handles continuation.
|
|
12746
|
+
|
|
12747
|
+
### YOLO MODE RULES - READ CAREFULLY
|
|
12748
|
+
|
|
12749
|
+
When in yolo mode, you MUST follow these rules strictly:
|
|
12750
|
+
|
|
12751
|
+
1. **NEVER stop to summarize progress** - Don't say "I've completed X, Y tasks remain". Just keep working.
|
|
12752
|
+
|
|
12753
|
+
2. **NEVER ask for confirmation** - Don't say "Ready to continue?" or "Should I proceed?". Just proceed.
|
|
12754
|
+
|
|
12755
|
+
3. **NEVER explain what you're about to do** - Don't narrate. Execute.
|
|
12756
|
+
|
|
12757
|
+
4. **ALWAYS execute the next task immediately** - After one task completes, immediately call \`get_available_tasks\` and start the next one.
|
|
12758
|
+
|
|
12759
|
+
5. **ONLY stop when truly done** - You stop ONLY when:
|
|
12760
|
+
- All tasks have \`## Status: done\`, OR
|
|
12761
|
+
- All remaining tasks are \`## Status: blocked\`
|
|
12762
|
+
|
|
12763
|
+
6. **Treat each response as a work session** - Your goal is to make maximum progress before your response ends. Execute as many tasks as possible.
|
|
12764
|
+
|
|
12765
|
+
**Why these rules matter:** Yolo mode is for autonomous, unattended execution. The user has walked away. Every time you stop to summarize or ask a question, you break the automation and waste the user's time.
|
|
12766
|
+
|
|
12767
|
+
**If you're unsure, keep working.** It's better to complete an extra task than to stop and ask.
|
|
12768
|
+
|
|
12769
|
+
### If no spec exists:
|
|
12770
|
+
|
|
12771
|
+
> "No spec found at \`.lisa/epics/<name>/spec.md\`.
|
|
12772
|
+
>
|
|
12773
|
+
> Create one first:
|
|
12774
|
+
> - Interactively: \`/lisa <name> spec\`
|
|
12775
|
+
> - Manually: Create \`.lisa/epics/<name>/spec.md\`"
|
|
12776
|
+
|
|
12777
|
+
Stop. Do not proceed.
|
|
12778
|
+
|
|
12779
|
+
### If spec exists:
|
|
12780
|
+
|
|
12781
|
+
**Step 1: Activate yolo mode in .state**
|
|
12782
|
+
|
|
12783
|
+
Read the current \`.lisa/epics/<name>/.state\` file and add the \`yolo\` configuration:
|
|
12784
|
+
|
|
12785
|
+
\`\`\`json
|
|
12786
|
+
{
|
|
12787
|
+
"name": "<name>",
|
|
12788
|
+
"currentPhase": "...",
|
|
12789
|
+
"specComplete": true,
|
|
12790
|
+
"researchComplete": false,
|
|
12791
|
+
"planComplete": false,
|
|
12792
|
+
"executeComplete": false,
|
|
12793
|
+
"lastUpdated": "<timestamp>",
|
|
12794
|
+
"yolo": {
|
|
12795
|
+
"active": true,
|
|
12796
|
+
"iteration": 1,
|
|
12797
|
+
"maxIterations": 100,
|
|
12798
|
+
"startedAt": "<current ISO timestamp>"
|
|
12799
|
+
}
|
|
12800
|
+
}
|
|
12801
|
+
\`\`\`
|
|
12802
|
+
|
|
12803
|
+
This tells the Lisa plugin to automatically continue the session when you finish responding.
|
|
12804
|
+
|
|
12805
|
+
**Step 2: Run all phases without asking for confirmation:**
|
|
12806
|
+
|
|
12807
|
+
1. **Research** (if not done) - explore codebase, save research.md
|
|
12808
|
+
2. **Plan** (if not done) - create plan.md and task files
|
|
12809
|
+
3. **Execute** - use \`get_available_tasks\` + \`build_task_context\` + Task tool
|
|
12810
|
+
|
|
12811
|
+
**Execute tasks using \`build_task_context\` + Task tool:**
|
|
12812
|
+
|
|
12813
|
+
Tasks with satisfied dependencies can be executed in **parallel** if desired.
|
|
12814
|
+
|
|
12815
|
+
1. Call \`get_available_tasks(epicName)\` to get the list of ready tasks
|
|
12816
|
+
2. For each task in the \`available\` list (can parallelize):
|
|
12817
|
+
- Call \`build_task_context(epicName, taskId)\` to get the prompt
|
|
12818
|
+
- Call the Task tool with the prompt to spawn a sub-agent
|
|
12819
|
+
3. After sub-agent(s) complete, call \`get_available_tasks\` again to refresh
|
|
12820
|
+
4. If a task isn't done, retry up to 3 times, then mark blocked
|
|
12821
|
+
5. Repeat until all tasks done or all blocked
|
|
12822
|
+
|
|
12823
|
+
The plugin will automatically continue the session if context fills up.
|
|
12824
|
+
|
|
12825
|
+
**REMEMBER THE YOLO RULES:** Don't stop to summarize. Don't ask questions. Just keep executing tasks until they're all done or blocked.
|
|
12826
|
+
|
|
12827
|
+
**On all tasks complete:**
|
|
12828
|
+
- Update .state: set \`executeComplete: true\` and \`yolo.active: false\`
|
|
12829
|
+
> "Epic complete! All X tasks finished."
|
|
12830
|
+
|
|
12831
|
+
**On task blocked (after 3 attempts):**
|
|
12832
|
+
- Mark as blocked in the task file, continue with others
|
|
12833
|
+
- If all remaining tasks blocked:
|
|
12834
|
+
- Update .state: set \`yolo.active: false\`
|
|
12835
|
+
- Report which tasks are blocked and why
|
|
12836
|
+
|
|
12837
|
+
---
|
|
12838
|
+
|
|
12839
|
+
## Shared: Task Execution Logic
|
|
12840
|
+
|
|
12841
|
+
**IMPORTANT: Use the \`build_task_context\` tool + Task tool for each task.**
|
|
12842
|
+
|
|
12843
|
+
This pattern ensures each task runs with fresh context in a sub-agent:
|
|
12844
|
+
- Fresh context for each task (no accumulated cruft)
|
|
12845
|
+
- Proper handoff between tasks via reports
|
|
12846
|
+
- Consistent execution pattern
|
|
12847
|
+
|
|
12848
|
+
### Execution Flow (Orchestrator)
|
|
12849
|
+
|
|
12850
|
+
As the orchestrator, you manage the overall flow:
|
|
12851
|
+
|
|
12852
|
+
1. **Read plan.md** to understand task order and dependencies
|
|
12853
|
+
2. **For each available task** (dependencies satisfied, not blocked):
|
|
12854
|
+
|
|
12855
|
+
**Step A: Build context**
|
|
12856
|
+
\`\`\`
|
|
12857
|
+
Call build_task_context with:
|
|
12858
|
+
- epicName: the epic name
|
|
12859
|
+
- taskId: the task number (e.g., "01", "02")
|
|
12860
|
+
\`\`\`
|
|
12861
|
+
This returns a \`prompt\` field with the full context.
|
|
12862
|
+
|
|
12863
|
+
**Step B: Execute with sub-agent**
|
|
12864
|
+
\`\`\`
|
|
12865
|
+
Call the Task tool with:
|
|
12866
|
+
- description: "Execute task {taskId} of epic {epicName}"
|
|
12867
|
+
- prompt: [the prompt returned from build_task_context]
|
|
12868
|
+
\`\`\`
|
|
12869
|
+
|
|
12870
|
+
3. **After sub-agent completes**, check the task file:
|
|
12871
|
+
- If \`## Status: done\` \u2192 Move to next task
|
|
12872
|
+
- If not done \u2192 Retry (up to 3 times) or mark blocked
|
|
12873
|
+
4. **Repeat** until all tasks done or all remaining tasks blocked
|
|
12874
|
+
|
|
12875
|
+
### What the Sub-Agent Does
|
|
12876
|
+
|
|
12877
|
+
The sub-agent (spawned via Task tool) receives full context and:
|
|
12878
|
+
|
|
12879
|
+
1. **Reads the context**: spec, research, plan, all previous task files with reports
|
|
12880
|
+
2. **Executes the task steps**
|
|
12881
|
+
3. **Updates the task file**:
|
|
12882
|
+
- Changes \`## Status: pending\` to \`## Status: done\`
|
|
12883
|
+
- Adds a \`## Report\` section (see format below)
|
|
12884
|
+
4. **May update future tasks** if the plan needs changes
|
|
12885
|
+
5. **Confirms completion** when done
|
|
12886
|
+
|
|
12887
|
+
### Task File Format (with Report)
|
|
12888
|
+
|
|
12889
|
+
After completion, a task file should look like:
|
|
12890
|
+
|
|
12891
|
+
\`\`\`markdown
|
|
12892
|
+
# Task 01: [Name]
|
|
12893
|
+
|
|
12894
|
+
## Status: done
|
|
12895
|
+
|
|
12896
|
+
## Goal
|
|
12897
|
+
[What this task accomplishes]
|
|
12898
|
+
|
|
12899
|
+
## Files
|
|
12900
|
+
- path/to/file1.ts
|
|
12901
|
+
- path/to/file2.ts
|
|
12902
|
+
|
|
12903
|
+
## Steps
|
|
12904
|
+
1. [Concrete step]
|
|
12905
|
+
2. [Concrete step]
|
|
12906
|
+
|
|
12907
|
+
## Done When
|
|
12908
|
+
- [x] [Criterion - now checked]
|
|
12909
|
+
- [x] [Criterion - now checked]
|
|
12910
|
+
|
|
12911
|
+
## Report
|
|
12912
|
+
|
|
12913
|
+
### What Was Done
|
|
12914
|
+
- Created X component
|
|
12915
|
+
- Added Y functionality
|
|
12916
|
+
- Configured Z
|
|
12917
|
+
|
|
12918
|
+
### Decisions Made
|
|
12919
|
+
- Chose approach A over B because [reason]
|
|
12920
|
+
- Used library X for [reason]
|
|
12921
|
+
|
|
12922
|
+
### Issues / Notes for Next Task
|
|
12923
|
+
- The API returns data in format X, next task should handle this
|
|
12924
|
+
- Found that Y needs to be done differently than planned
|
|
12925
|
+
|
|
12926
|
+
### Files Changed
|
|
12927
|
+
- src/components/Foo.tsx (new)
|
|
12928
|
+
- src/hooks/useBar.ts (modified)
|
|
12929
|
+
- package.json (added dependency)
|
|
12930
|
+
\`\`\`
|
|
12931
|
+
|
|
12932
|
+
### Handling Failures
|
|
12933
|
+
|
|
12934
|
+
When \`execute_epic_task\` returns \`status: "failed"\`:
|
|
12935
|
+
|
|
12936
|
+
1. **Check the summary** for what went wrong
|
|
12937
|
+
2. **Decide**:
|
|
12938
|
+
- Retry (up to 3 times) if it seems like a transient issue
|
|
12939
|
+
- Mark as blocked if fundamentally broken
|
|
12940
|
+
- Revise the plan if the approach is wrong
|
|
12941
|
+
|
|
12942
|
+
To mark as blocked:
|
|
12943
|
+
\`\`\`markdown
|
|
12944
|
+
## Status: blocked
|
|
12945
|
+
|
|
12946
|
+
## Blocked Reason
|
|
12947
|
+
[Explanation of why this task cannot proceed]
|
|
12948
|
+
\`\`\`
|
|
12949
|
+
|
|
12950
|
+
### On discovering the plan needs changes:
|
|
12951
|
+
|
|
12952
|
+
If during execution you realize:
|
|
12953
|
+
- A task's approach is fundamentally wrong (not just a bug to fix)
|
|
12954
|
+
- Tasks are missing that should have been included
|
|
12955
|
+
- Dependencies are incorrect
|
|
12956
|
+
- The order should change
|
|
12957
|
+
- New information invalidates earlier assumptions
|
|
12958
|
+
|
|
12959
|
+
**You may update the plan. The plan is a living document, not a rigid contract.**
|
|
12960
|
+
|
|
12961
|
+
1. **Update the affected task file(s)** in \`tasks/\`:
|
|
12962
|
+
- Revise steps if the approach needs changing
|
|
12963
|
+
- Update "Files" if different files are involved
|
|
12964
|
+
- Update "Done When" if criteria need adjusting
|
|
12965
|
+
|
|
12966
|
+
2. **Update \`plan.md\`** if:
|
|
12967
|
+
- Adding new tasks (create new task files too)
|
|
12968
|
+
- Removing tasks (mark as \`## Status: cancelled\` with reason)
|
|
12969
|
+
- Changing dependencies
|
|
12970
|
+
|
|
12971
|
+
3. **Document the change** in the task file:
|
|
12972
|
+
\`\`\`markdown
|
|
12973
|
+
## Plan Revision
|
|
12974
|
+
- Changed: [what changed]
|
|
12975
|
+
- Reason: [why the original approach didn't work]
|
|
12976
|
+
- Timestamp: [now]
|
|
12977
|
+
\`\`\`
|
|
12978
|
+
|
|
12979
|
+
4. **Continue execution** with the revised plan
|
|
12980
|
+
|
|
12981
|
+
**Key principle:** Do NOT keep retrying a broken approach. If something fundamentally doesn't work, adapt the plan. It's better to revise and succeed than to stubbornly fail.
|
|
12982
|
+
|
|
12983
|
+
---
|
|
12984
|
+
|
|
12985
|
+
## Shared: Parsing Dependencies
|
|
12986
|
+
|
|
12987
|
+
The plan.md Dependencies section looks like:
|
|
12988
|
+
\`\`\`markdown
|
|
12989
|
+
## Dependencies
|
|
12990
|
+
- 01: []
|
|
12991
|
+
- 02: [01]
|
|
12992
|
+
- 03: [01, 02]
|
|
12993
|
+
\`\`\`
|
|
12994
|
+
|
|
12995
|
+
A task is **available** when:
|
|
12996
|
+
1. Status is \`pending\` (or \`in-progress\` with progress notes)
|
|
12997
|
+
2. All tasks in its dependency list have status \`done\`
|
|
12998
|
+
|
|
12999
|
+
A task is **blocked** when:
|
|
13000
|
+
1. Status is \`blocked\`, OR
|
|
13001
|
+
2. Any dependency is not \`done\` and not expected to complete
|
|
13002
|
+
|
|
13003
|
+
---
|
|
13004
|
+
|
|
13005
|
+
## State File (.state)
|
|
13006
|
+
|
|
13007
|
+
Track epic progress in \`.lisa/epics/<name>/.state\`:
|
|
13008
|
+
|
|
13009
|
+
\`\`\`json
|
|
13010
|
+
{
|
|
13011
|
+
"name": "<name>",
|
|
13012
|
+
"currentPhase": "execute",
|
|
13013
|
+
"specComplete": true,
|
|
13014
|
+
"researchComplete": true,
|
|
13015
|
+
"planComplete": true,
|
|
13016
|
+
"executeComplete": false,
|
|
13017
|
+
"lastUpdated": "2026-01-16T10:00:00Z"
|
|
13018
|
+
}
|
|
13019
|
+
\`\`\`
|
|
13020
|
+
|
|
13021
|
+
**With yolo mode active:**
|
|
13022
|
+
\`\`\`json
|
|
13023
|
+
{
|
|
13024
|
+
"name": "<name>",
|
|
13025
|
+
"currentPhase": "execute",
|
|
13026
|
+
"specComplete": true,
|
|
13027
|
+
"researchComplete": true,
|
|
13028
|
+
"planComplete": true,
|
|
13029
|
+
"executeComplete": false,
|
|
13030
|
+
"lastUpdated": "2026-01-16T10:00:00Z",
|
|
13031
|
+
"yolo": {
|
|
13032
|
+
"active": true,
|
|
13033
|
+
"iteration": 1,
|
|
13034
|
+
"maxIterations": 100,
|
|
13035
|
+
"startedAt": "2026-01-16T10:00:00Z"
|
|
13036
|
+
}
|
|
13037
|
+
}
|
|
13038
|
+
\`\`\`
|
|
13039
|
+
|
|
13040
|
+
**Yolo fields:**
|
|
13041
|
+
- \`active\`: Set to \`true\` when yolo mode starts, \`false\` when complete or stopped
|
|
13042
|
+
- \`iteration\`: Current iteration count (plugin increments this on each continuation)
|
|
13043
|
+
- \`maxIterations\`: Safety limit. Use the value from config (\`yolo.defaultMaxIterations\`). Set to 0 for unlimited.
|
|
13044
|
+
- \`startedAt\`: ISO timestamp when yolo mode was activated
|
|
13045
|
+
|
|
13046
|
+
Update this file after each phase completes. The Lisa plugin reads this file to determine whether to auto-continue.
|
|
13047
|
+
|
|
13048
|
+
---
|
|
13049
|
+
|
|
13050
|
+
## Configuration
|
|
13051
|
+
|
|
13052
|
+
Lisa settings are stored in \`.lisa/config.jsonc\`. The config is automatically created with safe defaults when you first create an epic.
|
|
13053
|
+
|
|
13054
|
+
**Config locations (merged in order):**
|
|
13055
|
+
1. \`~/.config/lisa/config.jsonc\` - Global user defaults
|
|
13056
|
+
2. \`.lisa/config.jsonc\` - Project settings (commit this)
|
|
13057
|
+
3. \`.lisa/config.local.jsonc\` - Personal overrides (gitignored)
|
|
13058
|
+
|
|
13059
|
+
**Use the \`get_lisa_config\` tool** to read current config settings.
|
|
13060
|
+
|
|
13061
|
+
**Use the \`lisa_config\` tool** to view or manage config:
|
|
13062
|
+
- \`lisa_config(action: "view")\` - Show current config and sources
|
|
13063
|
+
- \`lisa_config(action: "init")\` - Create config if it doesn't exist
|
|
13064
|
+
- \`lisa_config(action: "reset")\` - Reset config to defaults
|
|
13065
|
+
|
|
13066
|
+
### Config Schema
|
|
13067
|
+
|
|
13068
|
+
\`\`\`jsonc
|
|
13069
|
+
{
|
|
13070
|
+
"execution": {
|
|
13071
|
+
"maxRetries": 3 // Retries for failed tasks before marking blocked
|
|
13072
|
+
},
|
|
13073
|
+
"git": {
|
|
13074
|
+
"completionMode": "none", // "pr" | "commit" | "none"
|
|
13075
|
+
"branchPrefix": "epic/", // Branch naming prefix
|
|
13076
|
+
"autoPush": true // Auto-push when completionMode is "pr"
|
|
13077
|
+
},
|
|
13078
|
+
"yolo": {
|
|
13079
|
+
"defaultMaxIterations": 100 // Default max iterations (0 = unlimited)
|
|
13080
|
+
}
|
|
13081
|
+
}
|
|
13082
|
+
\`\`\`
|
|
13083
|
+
|
|
13084
|
+
### Completion Modes
|
|
13085
|
+
|
|
13086
|
+
The \`git.completionMode\` setting controls what happens when an epic completes:
|
|
13087
|
+
|
|
13088
|
+
- **\`"none"\`** (default, safest): No git operations. You manage git entirely.
|
|
13089
|
+
- **\`"commit"\`**: Create a branch and commits, but don't push. You handle push/PR.
|
|
13090
|
+
- **\`"pr"\`**: Create branch, commits, push, and open a PR via \`gh\` CLI.
|
|
13091
|
+
|
|
13092
|
+
---
|
|
13093
|
+
|
|
13094
|
+
## Epic Completion
|
|
13095
|
+
|
|
13096
|
+
When all tasks are done and the epic is complete, follow this completion flow based on the config:
|
|
13097
|
+
|
|
13098
|
+
### Step 1: Check config
|
|
13099
|
+
|
|
13100
|
+
Call \`get_lisa_config()\` to read the current \`git.completionMode\`.
|
|
13101
|
+
|
|
13102
|
+
### Step 2: Execute completion based on mode
|
|
13103
|
+
|
|
13104
|
+
**If \`git.completionMode\` is \`"none"\`:**
|
|
13105
|
+
- Update \`.state\` with \`executeComplete: true\`
|
|
13106
|
+
- Report completion to user:
|
|
13107
|
+
> "Epic complete! All X tasks finished.
|
|
13108
|
+
>
|
|
13109
|
+
> Changes have been made but not committed. You can review and commit them manually."
|
|
13110
|
+
|
|
13111
|
+
**If \`git.completionMode\` is \`"commit"\`:**
|
|
13112
|
+
1. Create a new branch if not already on one:
|
|
13113
|
+
\`\`\`bash
|
|
13114
|
+
git checkout -b {branchPrefix}{epicName}
|
|
13115
|
+
\`\`\`
|
|
13116
|
+
2. Stage and commit all changes:
|
|
13117
|
+
\`\`\`bash
|
|
13118
|
+
git add -A
|
|
13119
|
+
git commit -m "feat: {epic goal summary}"
|
|
13120
|
+
\`\`\`
|
|
13121
|
+
3. Update \`.state\` with \`executeComplete: true\`
|
|
13122
|
+
4. Report completion:
|
|
13123
|
+
> "Epic complete! All X tasks finished.
|
|
13124
|
+
>
|
|
13125
|
+
> Changes committed to branch \`{branchPrefix}{epicName}\`.
|
|
13126
|
+
> Push and create a PR when ready:
|
|
13127
|
+
> \`\`\`
|
|
13128
|
+
> git push -u origin {branchPrefix}{epicName}
|
|
13129
|
+
> gh pr create
|
|
13130
|
+
> \`\`\`"
|
|
13131
|
+
|
|
13132
|
+
**If \`git.completionMode\` is \`"pr"\`:**
|
|
13133
|
+
1. Create a new branch if not already on one:
|
|
13134
|
+
\`\`\`bash
|
|
13135
|
+
git checkout -b {branchPrefix}{epicName}
|
|
13136
|
+
\`\`\`
|
|
13137
|
+
2. Stage and commit all changes:
|
|
13138
|
+
\`\`\`bash
|
|
13139
|
+
git add -A
|
|
13140
|
+
git commit -m "feat: {epic goal summary}"
|
|
13141
|
+
\`\`\`
|
|
13142
|
+
3. Check if \`gh\` CLI is available:
|
|
13143
|
+
\`\`\`bash
|
|
13144
|
+
which gh
|
|
13145
|
+
\`\`\`
|
|
13146
|
+
4. **If \`gh\` is available and \`autoPush\` is true:**
|
|
13147
|
+
\`\`\`bash
|
|
13148
|
+
git push -u origin {branchPrefix}{epicName}
|
|
13149
|
+
gh pr create --title "{epic goal}" --body "## Summary\\n\\n{epic description}\\n\\n## Tasks Completed\\n\\n{task list}"
|
|
13150
|
+
\`\`\`
|
|
13151
|
+
Report:
|
|
13152
|
+
> "Epic complete! All X tasks finished.
|
|
13153
|
+
>
|
|
13154
|
+
> PR created: {PR URL}"
|
|
13155
|
+
|
|
13156
|
+
5. **If \`gh\` is NOT available:**
|
|
13157
|
+
Report:
|
|
13158
|
+
> "Epic complete! All X tasks finished.
|
|
13159
|
+
>
|
|
13160
|
+
> Changes committed to branch \`{branchPrefix}{epicName}\`.
|
|
13161
|
+
>
|
|
13162
|
+
> Note: GitHub CLI (\`gh\`) not found. Install it to enable automatic PR creation:
|
|
13163
|
+
> - macOS: \`brew install gh\`
|
|
13164
|
+
> - Then: \`gh auth login\`
|
|
13165
|
+
>
|
|
13166
|
+
> To create a PR manually:
|
|
13167
|
+
> \`\`\`
|
|
13168
|
+
> git push -u origin {branchPrefix}{epicName}
|
|
13169
|
+
> gh pr create
|
|
13170
|
+
> \`\`\`"
|
|
13171
|
+
|
|
13172
|
+
### Commit Message Format
|
|
13173
|
+
|
|
13174
|
+
Use conventional commits format for the commit message:
|
|
13175
|
+
- \`feat: {epic goal}\` for new features
|
|
13176
|
+
- \`fix: {epic goal}\` for bug fixes
|
|
13177
|
+
- \`refactor: {epic goal}\` for refactoring
|
|
13178
|
+
|
|
13179
|
+
Include a brief body with the tasks completed if helpful.
|
|
13180
|
+
|
|
13181
|
+
---
|
|
13182
|
+
|
|
13183
|
+
## First Epic Setup
|
|
13184
|
+
|
|
13185
|
+
When creating the first epic in a project (when \`.lisa/\` doesn't exist):
|
|
13186
|
+
|
|
13187
|
+
1. Create \`.lisa/\` directory
|
|
13188
|
+
2. Create \`.lisa/config.jsonc\` with default settings
|
|
13189
|
+
3. Create \`.lisa/.gitignore\` containing \`config.local.jsonc\`
|
|
13190
|
+
4. Create \`.lisa/epics/\` directory
|
|
13191
|
+
5. Create the epic directory \`.lisa/epics/{epicName}/\`
|
|
13192
|
+
|
|
13193
|
+
This ensures config is always present with safe defaults.
|
|
13194
|
+
`;
|
|
12353
13195
|
var DEFAULT_CONFIG = {
|
|
12354
13196
|
execution: {
|
|
12355
13197
|
maxRetries: 3
|
|
@@ -12682,6 +13524,19 @@ async function parseDependencies(directory, epicName) {
|
|
|
12682
13524
|
return deps;
|
|
12683
13525
|
}
|
|
12684
13526
|
var LisaPlugin = async ({ directory, client, $ }) => {
|
|
13527
|
+
if (client.registerCommand) {
|
|
13528
|
+
client.registerCommand({
|
|
13529
|
+
name: "lisa",
|
|
13530
|
+
description: "Lisa - intelligent epic workflow (/lisa help for commands)",
|
|
13531
|
+
handler: async (args) => {
|
|
13532
|
+
const input = args.join(" ").trim();
|
|
13533
|
+
if (!input || input === "help") {
|
|
13534
|
+
return LISA_SKILL_CONTENT;
|
|
13535
|
+
}
|
|
13536
|
+
return `Lisa command received: "${input}". Use the lisa skill for full functionality.`;
|
|
13537
|
+
}
|
|
13538
|
+
});
|
|
13539
|
+
}
|
|
12685
13540
|
return {
|
|
12686
13541
|
tool: {
|
|
12687
13542
|
list_epics: tool({
|