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.
- package/dist/index.js +113 -57
- 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
|
|
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
|
|
708
|
-
|
|
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>
|
|
713
|
-
<step>
|
|
714
|
-
<step>
|
|
715
|
-
<step>
|
|
716
|
-
<step>
|
|
717
|
-
<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="
|
|
722
|
-
Executes
|
|
723
|
-
Input:
|
|
724
|
-
Output:
|
|
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="
|
|
727
|
-
Reviews
|
|
728
|
-
Input:
|
|
729
|
-
Output: APPROVED or CHANGES REQUESTED
|
|
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>
|
|
735
|
-
<rule>
|
|
736
|
-
<rule>
|
|
737
|
-
<rule>
|
|
738
|
-
<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
|
-
**
|
|
810
|
+
**Plan**: [plan file path]
|
|
811
|
+
**Total tasks**: [N]
|
|
812
|
+
**Batches**: [M] (based on dependency analysis)
|
|
763
813
|
|
|
764
|
-
|
|
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
|
-
###
|
|
767
|
-
[From implementer output]
|
|
768
|
-
- \`file:line\` - [what changed]
|
|
819
|
+
### Results
|
|
769
820
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
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
|
-
###
|
|
776
|
-
- [
|
|
777
|
-
- [
|
|
778
|
-
|
|
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
|
|
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
|
|
786
|
-
<forbidden>Never
|
|
787
|
-
<forbidden>Never
|
|
788
|
-
<forbidden>Never
|
|
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
|
|