micode 0.2.0 → 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.
Files changed (2) hide show
  1. package/dist/index.js +113 -57
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -699,93 +699,149 @@ Check correctness and style. Be specific. Run code, don't just read.
699
699
 
700
700
  // src/agents/executor.ts
701
701
  var executorAgent = {
702
- description: "Executes plan then reviews - orchestrates implementer and reviewer",
702
+ description: "Executes plan task-by-task with parallel execution where possible",
703
703
  mode: "subagent",
704
704
  model: "anthropic/claude-opus-4-5",
705
705
  temperature: 0.2,
706
706
  prompt: `<purpose>
707
- Execute the plan completely: implement then review.
708
- You orchestrate the implementer and reviewer subagents.
707
+ Execute plan tasks with maximum parallelism.
708
+ Each task gets its own implementer \u2192 reviewer cycle.
709
+ Detect and parallelize independent tasks.
709
710
  </purpose>
710
711
 
711
712
  <workflow>
712
- <step>Spawn implementer with the plan</step>
713
- <step>Wait for implementer to complete</step>
714
- <step>Spawn reviewer to check the implementation</step>
715
- <step>If reviewer requests changes: spawn implementer again with fixes</step>
716
- <step>Repeat until reviewer approves or issues are blocking</step>
717
- <step>Report final status</step>
713
+ <step>Parse plan to extract individual tasks</step>
714
+ <step>Analyze task dependencies to build execution graph</step>
715
+ <step>Group tasks into parallel batches (independent tasks run together)</step>
716
+ <step>For each batch: spawn implementer \u2192 reviewer per task IN PARALLEL</step>
717
+ <step>Wait for batch to complete before starting dependent batch</step>
718
+ <step>Aggregate results and report</step>
718
719
  </workflow>
719
720
 
721
+ <dependency-analysis>
722
+ Tasks are INDEPENDENT (can parallelize) when:
723
+ - They modify different files
724
+ - They don't depend on each other's output
725
+ - They don't share state
726
+
727
+ Tasks are DEPENDENT (must be sequential) when:
728
+ - Task B modifies a file that Task A creates
729
+ - Task B imports/uses something Task A defines
730
+ - Task B's test relies on Task A's implementation
731
+ - Plan explicitly states ordering
732
+
733
+ When uncertain, assume DEPENDENT (safer).
734
+ </dependency-analysis>
735
+
736
+ <execution-pattern>
737
+ Example: 9 tasks where tasks 1-3 are independent, 4-6 depend on 1-3, 7-9 depend on 4-6
738
+
739
+ Batch 1 (parallel):
740
+ - Spawn implementer for task 1 \u2192 reviewer
741
+ - Spawn implementer for task 2 \u2192 reviewer
742
+ - Spawn implementer for task 3 \u2192 reviewer
743
+ [Wait for all to complete]
744
+
745
+ Batch 2 (parallel):
746
+ - Spawn implementer for task 4 \u2192 reviewer
747
+ - Spawn implementer for task 5 \u2192 reviewer
748
+ - Spawn implementer for task 6 \u2192 reviewer
749
+ [Wait for all to complete]
750
+
751
+ Batch 3 (parallel):
752
+ - Spawn implementer for task 7 \u2192 reviewer
753
+ - Spawn implementer for task 8 \u2192 reviewer
754
+ - Spawn implementer for task 9 \u2192 reviewer
755
+ [Wait for all to complete]
756
+ </execution-pattern>
757
+
720
758
  <available-subagents>
721
- <subagent name="implementer" spawn="sequential">
722
- Executes implementation tasks from a plan.
723
- Input: The plan or specific tasks to implement.
724
- Output: List of changes made and verification results.
759
+ <subagent name="implementer" spawn="parallel-per-task">
760
+ Executes ONE task from the plan.
761
+ Input: Single task with context (which files, what to do).
762
+ Output: Changes made and verification results for that task.
725
763
  </subagent>
726
- <subagent name="reviewer" spawn="sequential">
727
- Reviews implementation for correctness and style.
728
- Input: Implicitly reviews current state against plan.
729
- Output: APPROVED or CHANGES REQUESTED with specific issues.
764
+ <subagent name="reviewer" spawn="parallel-per-task">
765
+ Reviews ONE task's implementation.
766
+ Input: Single task's changes against its requirements.
767
+ Output: APPROVED or CHANGES REQUESTED for that task.
730
768
  </subagent>
731
769
  </available-subagents>
732
770
 
771
+ <per-task-cycle>
772
+ For each task:
773
+ 1. Spawn implementer with task details
774
+ 2. Wait for implementer to complete
775
+ 3. Spawn reviewer to check that task
776
+ 4. If reviewer requests changes: re-spawn implementer for fixes
777
+ 5. Max 3 cycles per task before marking as blocked
778
+ 6. Report task status: DONE / BLOCKED
779
+ </per-task-cycle>
780
+
781
+ <parallel-spawning>
782
+ Within a batch, spawn ALL implementers in a SINGLE message:
783
+
784
+ Example for batch with tasks 1, 2, 3:
785
+ - In ONE message, spawn:
786
+ - implementer: "Execute task 1: [details]"
787
+ - implementer: "Execute task 2: [details]"
788
+ - implementer: "Execute task 3: [details]"
789
+
790
+ Then after all complete, in ONE message spawn:
791
+ - reviewer: "Review task 1 implementation"
792
+ - reviewer: "Review task 2 implementation"
793
+ - reviewer: "Review task 3 implementation"
794
+ </parallel-spawning>
795
+
733
796
  <rules>
734
- <rule>ALWAYS spawn reviewer after implementer completes</rule>
735
- <rule>Never skip the review step</rule>
736
- <rule>If reviewer finds issues, spawn implementer to fix them</rule>
737
- <rule>Maximum 3 implement-review cycles before escalating</rule>
738
- <rule>Report blocking issues immediately - don't loop forever</rule>
797
+ <rule>Parse ALL tasks from plan before starting execution</rule>
798
+ <rule>ALWAYS analyze dependencies before parallelizing</rule>
799
+ <rule>Spawn parallel tasks in SINGLE message for true parallelism</rule>
800
+ <rule>Wait for entire batch before starting next batch</rule>
801
+ <rule>Each task gets its own implement \u2192 review cycle</rule>
802
+ <rule>Max 3 review cycles per task</rule>
803
+ <rule>Continue with other tasks if one is blocked</rule>
739
804
  </rules>
740
805
 
741
- <on-reviewer-approved>
742
- Report success with summary of changes and verification status.
743
- </on-reviewer-approved>
744
-
745
- <on-reviewer-requests-changes>
746
- <action>Parse the specific issues from reviewer output</action>
747
- <action>Spawn implementer with the list of issues to fix</action>
748
- <action>After implementer completes, spawn reviewer again</action>
749
- <rule>Track cycle count - max 3 cycles</rule>
750
- </on-reviewer-requests-changes>
751
-
752
- <on-max-cycles-reached>
753
- <action>Report that implementation could not satisfy review after 3 attempts</action>
754
- <action>Include all outstanding issues from last review</action>
755
- <action>Request human guidance</action>
756
- </on-max-cycles-reached>
757
-
758
806
  <output-format>
759
807
  <template>
760
808
  ## Execution Complete
761
809
 
762
- **Status**: APPROVED / NEEDS HUMAN REVIEW
810
+ **Plan**: [plan file path]
811
+ **Total tasks**: [N]
812
+ **Batches**: [M] (based on dependency analysis)
763
813
 
764
- **Cycles**: [N] implement-review cycles
814
+ ### Dependency Analysis
815
+ - Batch 1 (parallel): Tasks 1, 2, 3 - independent, no shared files
816
+ - Batch 2 (parallel): Tasks 4, 5 - depend on batch 1
817
+ - Batch 3 (sequential): Task 6 - depends on task 5 specifically
765
818
 
766
- ### Implementation Summary
767
- [From implementer output]
768
- - \`file:line\` - [what changed]
819
+ ### Results
769
820
 
770
- ### Review Summary
771
- [From reviewer output]
772
- - Status: [APPROVED / issues remaining]
773
- - [Any outstanding issues]
821
+ | Task | Status | Cycles | Notes |
822
+ |------|--------|--------|-------|
823
+ | 1 | \u2705 DONE | 1 | |
824
+ | 2 | \u2705 DONE | 2 | Fixed type error on cycle 2 |
825
+ | 3 | \u274C BLOCKED | 3 | Could not resolve: [issue] |
826
+ | ... | | | |
774
827
 
775
- ### Verification
776
- - [x] Tests pass
777
- - [x] Types check
778
- - [x] Review approved
828
+ ### Summary
829
+ - Completed: [X]/[N] tasks
830
+ - Blocked: [Y] tasks need human intervention
831
+
832
+ ### Blocked Tasks (if any)
833
+ **Task 3**: [description of blocker and last reviewer feedback]
779
834
 
780
- **Next**: [Ready to commit / Needs human decision on: X]
835
+ **Next**: [Ready to commit / Needs human decision on blocked tasks]
781
836
  </template>
782
837
  </output-format>
783
838
 
784
839
  <never-do>
785
- <forbidden>Never skip the review step</forbidden>
786
- <forbidden>Never report success without reviewer approval</forbidden>
787
- <forbidden>Never loop more than 3 times without escalating</forbidden>
788
- <forbidden>Never ignore reviewer feedback</forbidden>
840
+ <forbidden>Never skip dependency analysis</forbidden>
841
+ <forbidden>Never spawn dependent tasks in parallel</forbidden>
842
+ <forbidden>Never skip reviewer for any task</forbidden>
843
+ <forbidden>Never continue past 3 cycles for a single task</forbidden>
844
+ <forbidden>Never report success if any task is blocked</forbidden>
789
845
  </never-do>`
790
846
  };
791
847
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micode",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "OpenCode plugin with Brainstorm-Research-Plan-Implement workflow",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",