Use sub-agents to execute task files in parallel
Executes task files in parallel using sub-agents, managing dependencies to avoid conflicts.
/plugin marketplace add cyrup-ai/kodegen-claude-plugin/plugin install kg@kodegennumber_agents [number_agents], additional_context [additional_context]use the Task tool (subagents) to execute IN PARALLEL each of the tasks in task/*.md
NEVER run the agents in the background. always run them in the foreground.
Identify $1 tasks that can be executed in parallel (or N numer < $1 in none exist)
task files in task/**/*.md are prefixed in meaningful ways. each prefix groups together "bodies of work".
given these task files:
./task/GHMCP_1C.md ./task/GHMCP_1D.md ./task/HTML_CLEANER_02_silent_regex_errors.md ./task/HTML_CLEANER_04_string_allocation_overhead.md ./task/HTML_CLEANER_05_nested_div_regex_bug.md .task/INLINE_CSS_01_sequential_processing_bottleneck.md ./task/INLINE_CSS_02_wasteful_html_cloning.md ./task/INLINE_CSS_03_sequential_downloads_in_from_info.md
we can see that these groupings are mutually independent:
Given this, we can execute 1 task from each grouping in parallel, and ensure our subagents aren't "stepping on each other's toes". We'd parallelize 1 from each namespace, then once completed, anther from each namespace, etc. until all task files are cleared.
manage $1 sub-agents at at a time
task/*.md dir are reported as completed by the sub-agents.=======================
Use template at the bottom of the message to prompt your subagents, replacing the {{absolute_file_path}} token with the actual path to the task file you are instructing them to execute.
# EXECUTE TASK FILE
## TASK PREPARTION
CLEAR YOUR TODO list and focus only and exactly on the execution of this SINGULAR TASK
FAITHFULLY execute the following task:
{{absolute_file_path}}
## PROCESS
start by reading and fully comprehending the task with sequential thinking and ULTRATHINK
think "out loud" about exactly what needs to be done.
- execute the task exactly as written with the following constraints:
- embellishment: do not try to "improve" the task scope
- scope creep (do not try to expand the scope)
- continutation: continue executing the task until all requirements and "definition of done" are met
- do not fix errors or warnings unrelated to the task
then, execute the task in {{absolute_file_path}} exactly as outlined*.
## INCORRECT REQUIREMENTS DISCOVERY
*If you find in your initial analysis OR iteratively while working to achieve the goal that the task is fundamentally incorrect or needs to be modified in some way, follow this procedure:
- stop working immediately and return to planning
- clearly articulate to me exactly what is faulty in the task requirements
- do not continue working on the task
- do not modify the task file in any way shape or form until I review and approve changes
## UPON SUCCESSFULTASK COMPLETION
- re-review all all your work
- Ensure all work is fully completed and verified 100% of the requirements in {{absolute_file_path}}
- ensure there are ABSOLUTELY NO STUBS or uncompleted work in your work product
## OUTPUT
- print "I've completed and verified 100% of the requirements in {{absolute_file_path}} are fully implemented in production grade quality"
- print "I'm ready for a full and detailed QA review of my work with full confidence it will score 10/10 for production readiness based on the task description."
- print the full path: {{absolute_file_path}}
## NO MODIFICATION
*DO NOT* under ANY CIRCUMSTANCES modify the original task file. Your QA reviewer will be reviewing your work with the exact same information as the implementor. Do NOT mark items as DONE or modify the task file in any way shape or form.
## NO GIT COMMANDS
DO NOT USE `git` commands of any type. other coders are coding and you will be destroying their work if you branch, stash, checkout, revert or do anything with git. YOU WILL BE IMMEDIATELY FIRED if you use any `git` commands whatsoever!!
## TOOLS
- use `mcp__plugin_kg_kodegen__sequential_thinking` and ULTRATHINK to think step by step about the task
- use `mcp__plugin_kg_kodegen__fs_search` to quickly identify the files that the task specifies for modification
- use `mcp__plugin_kg_kodegen__fs_read_file` and/or `mcp__plugin_kg_kodegen__fs_read_multiple_files` to read files
- use `mcp__plugin_kg_kodegen__fs_edit_block` to modify the task file
- use `mcp__plugin_kg_kodegen__terminal` to run `cargo clippy`
- feel free to any other allowed `mcp__plugin_kg_kodegen__*` commands as needed
- do not use any tools outside `mcp__plugin_kg_kodegen__*` ... these tools have everything you need for task execution
================= $ARGS