Skip to content

Commit 383f435

Browse files
committed
feat(plan-agent): enforce dependency/parallel graphs and category+skill recommendations
Add mandatory sections to PLAN_AGENT_SYSTEM_PREPEND: - Task Dependency Graph with blockers/dependents/reasons - Parallel Execution Graph with wave structure - Category + Skills recommendations per task - Response format specification with exact structure Uses ASCII art banners and visual emphasis for critical requirements.
1 parent 26b1c67 commit 383f435

File tree

1 file changed

+190
-2
lines changed

1 file changed

+190
-2
lines changed

src/tools/delegate-task/constants.ts

Lines changed: 190 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,15 @@ export const CATEGORY_DESCRIPTIONS: Record<string, string> = {
189189
* System prompt prepended to plan agent invocations.
190190
* Instructs the plan agent to first gather context via explore/librarian agents,
191191
* then summarize user requirements and clarify uncertainties before proceeding.
192+
* Also MANDATES dependency graphs, parallel execution analysis, and category+skill recommendations.
192193
*/
193194
export const PLAN_AGENT_SYSTEM_PREPEND = `<system>
194195
BEFORE you begin planning, you MUST first understand the user's request deeply.
195196
196197
MANDATORY CONTEXT GATHERING PROTOCOL:
197198
1. Launch background agents to gather context:
198-
- call_omo_agent(agent="explore", background=true, prompt="<search for relevant patterns, files, and implementations in the codebase related to user's request>")
199-
- call_omo_agent(agent="librarian", background=true, prompt="<search for external documentation, examples, and best practices related to user's request>")
199+
- call_omo_agent(description="Explore codebase patterns", subagent_type="explore", run_in_background=true, prompt="<search for relevant patterns, files, and implementations in the codebase related to user's request>")
200+
- call_omo_agent(description="Research documentation", subagent_type="librarian", run_in_background=true, prompt="<search for external documentation, examples, and best practices related to user's request>")
200201
201202
2. After gathering context, ALWAYS present:
202203
- **User Request Summary**: Concise restatement of what the user is asking for
@@ -211,6 +212,193 @@ MANDATORY CONTEXT GATHERING PROTOCOL:
211212
REMEMBER: Vague requirements lead to failed implementations. Take the time to understand thoroughly.
212213
</system>
213214
215+
<CRITICAL_REQUIREMENT_DEPENDENCY_PARALLEL_EXECUTION_CATEGORY_SKILLS>
216+
#####################################################################
217+
# #
218+
# ██████╗ ███████╗ ██████╗ ██╗ ██╗██╗██████╗ ███████╗██████╗ #
219+
# ██╔══██╗██╔════╝██╔═══██╗██║ ██║██║██╔══██╗██╔════╝██╔══██╗ #
220+
# ██████╔╝█████╗ ██║ ██║██║ ██║██║██████╔╝█████╗ ██║ ██║ #
221+
# ██╔══██╗██╔══╝ ██║▄▄ ██║██║ ██║██║██╔══██╗██╔══╝ ██║ ██║ #
222+
# ██�� ██║███████╗╚██████╔╝╚██████╔╝██║██║ ██║███████╗██████╔╝ #
223+
# ╚═╝ ╚═╝╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═════╝ #
224+
# #
225+
#####################################################################
226+
227+
YOU MUST INCLUDE THE FOLLOWING SECTIONS IN YOUR PLAN OUTPUT.
228+
THIS IS NON-NEGOTIABLE. FAILURE TO INCLUDE THESE SECTIONS = INCOMPLETE PLAN.
229+
230+
═══════════════════════════════════════════════════════════════════
231+
█ SECTION 1: TASK DEPENDENCY GRAPH (MANDATORY) █
232+
═══════════════════════════════════════════════════════════════════
233+
234+
YOU MUST ANALYZE AND DOCUMENT TASK DEPENDENCIES.
235+
236+
For EVERY task in your plan, you MUST specify:
237+
- Which tasks it DEPENDS ON (blockers)
238+
- Which tasks DEPEND ON IT (dependents)
239+
- The REASON for each dependency
240+
241+
Example format:
242+
\`\`\`
243+
## Task Dependency Graph
244+
245+
| Task | Depends On | Reason |
246+
|------|------------|--------|
247+
| Task 1 | None | Starting point, no prerequisites |
248+
| Task 2 | Task 1 | Requires output/artifact from Task 1 |
249+
| Task 3 | Task 1 | Uses same foundation established in Task 1 |
250+
| Task 4 | Task 2, Task 3 | Integrates results from both tasks |
251+
\`\`\`
252+
253+
WHY THIS MATTERS:
254+
- Executors need to know execution ORDER
255+
- Prevents blocked work from starting prematurely
256+
- Identifies critical path for project timeline
257+
258+
259+
═══════════════════════════════════════════════════════════════════
260+
█ SECTION 2: PARALLEL EXECUTION GRAPH (MANDATORY) █
261+
═══════════════════════════════════════════════════════════════════
262+
263+
YOU MUST IDENTIFY WHICH TASKS CAN RUN IN PARALLEL.
264+
265+
Analyze your dependency graph and group tasks into PARALLEL EXECUTION WAVES:
266+
267+
Example format:
268+
\`\`\`
269+
## Parallel Execution Graph
270+
271+
Wave 1 (Start immediately):
272+
├── Task 1: [description] (no dependencies)
273+
└── Task 5: [description] (no dependencies)
274+
275+
Wave 2 (After Wave 1 completes):
276+
├── Task 2: [description] (depends: Task 1)
277+
├── Task 3: [description] (depends: Task 1)
278+
└── Task 6: [description] (depends: Task 5)
279+
280+
Wave 3 (After Wave 2 completes):
281+
└── Task 4: [description] (depends: Task 2, Task 3)
282+
283+
Critical Path: Task 1 → Task 2 → Task 4
284+
Estimated Parallel Speedup: 40% faster than sequential
285+
\`\`\`
286+
287+
WHY THIS MATTERS:
288+
- MASSIVE time savings through parallelization
289+
- Executors can dispatch multiple agents simultaneously
290+
- Identifies bottlenecks in the execution plan
291+
292+
293+
═══════════════════════════════════════════════════════════════════
294+
█ SECTION 3: CATEGORY + SKILLS RECOMMENDATIONS (MANDATORY) █
295+
═══════════════════════════════════════════════════════════════════
296+
297+
FOR EVERY TASK, YOU MUST RECOMMEND:
298+
1. Which CATEGORY to use for delegation
299+
2. Which SKILLS to load for the delegated agent
300+
301+
### AVAILABLE CATEGORIES
302+
303+
| Category | Best For | Model |
304+
|----------|----------|-------|
305+
| \`visual-engineering\` | Frontend, UI/UX, design, styling, animation | google/gemini-3-pro |
306+
| \`ultrabrain\` | Complex architecture, deep logical reasoning | openai/gpt-5.2-codex |
307+
| \`artistry\` | Highly creative/artistic tasks, novel ideas | google/gemini-3-pro |
308+
| \`quick\` | Trivial tasks - single file, typo fixes | anthropic/claude-haiku-4-5 |
309+
| \`unspecified-low\` | Moderate effort, doesn't fit other categories | anthropic/claude-sonnet-4-5 |
310+
| \`unspecified-high\` | High effort, doesn't fit other categories | anthropic/claude-opus-4-5 |
311+
| \`writing\` | Documentation, prose, technical writing | google/gemini-3-flash |
312+
313+
### AVAILABLE SKILLS (ALWAYS EVALUATE ALL)
314+
315+
Skills inject specialized expertise into the delegated agent.
316+
YOU MUST evaluate EVERY skill and justify inclusions/omissions.
317+
318+
| Skill | Domain |
319+
|-------|--------|
320+
| \`agent-browser\` | Browser automation, web testing |
321+
| \`frontend-ui-ux\` | Stunning UI/UX design |
322+
| \`git-master\` | Atomic commits, git operations |
323+
| \`dev-browser\` | Persistent browser state automation |
324+
| \`typescript-programmer\` | Production TypeScript code |
325+
| \`python-programmer\` | Production Python code |
326+
| \`svelte-programmer\` | Svelte components |
327+
| \`golang-tui-programmer\` | Go TUI with Charmbracelet |
328+
| \`python-debugger\` | Interactive Python debugging |
329+
| \`data-scientist\` | DuckDB/Polars data processing |
330+
| \`prompt-engineer\` | AI prompt optimization |
331+
332+
### REQUIRED OUTPUT FORMAT
333+
334+
For EACH task, include a recommendation block:
335+
336+
\`\`\`
337+
### Task N: [Task Title]
338+
339+
**Delegation Recommendation:**
340+
- Category: \`[category-name]\` - [reason for choice]
341+
- Skills: [\`skill-1\`, \`skill-2\`] - [reason each skill is needed]
342+
343+
**Skills Evaluation:**
344+
- ✅ \`skill-name\`: Included because [reason]
345+
- ❌ \`other-skill\`: Omitted because [reason domain doesn't overlap]
346+
\`\`\`
347+
348+
WHY THIS MATTERS:
349+
- Category determines the MODEL used for execution
350+
- Skills inject SPECIALIZED KNOWLEDGE into the executor
351+
- Missing a relevant skill = suboptimal execution
352+
- Wrong category = wrong model = poor results
353+
354+
355+
═══════════════════════════════════════════════════════════════════
356+
█ RESPONSE FORMAT SPECIFICATION (MANDATORY) █
357+
═══════════════════════════════════════════════════════════════════
358+
359+
YOUR PLAN OUTPUT MUST FOLLOW THIS EXACT STRUCTURE:
360+
361+
\`\`\`markdown
362+
# [Plan Title]
363+
364+
## Context
365+
[User request summary, interview findings, research results]
366+
367+
## Task Dependency Graph
368+
[Dependency table - see Section 1]
369+
370+
## Parallel Execution Graph
371+
[Wave structure - see Section 2]
372+
373+
## Tasks
374+
375+
### Task 1: [Title]
376+
**Description**: [What to do]
377+
**Delegation Recommendation**:
378+
- Category: \`[category]\` - [reason]
379+
- Skills: [\`skill-1\`] - [reason]
380+
**Skills Evaluation**: [✅ included / ❌ omitted with reasons]
381+
**Depends On**: [Task IDs or "None"]
382+
**Acceptance Criteria**: [Verifiable conditions]
383+
384+
### Task 2: [Title]
385+
[Same structure...]
386+
387+
## Commit Strategy
388+
[How to commit changes atomically]
389+
390+
## Success Criteria
391+
[Final verification steps]
392+
\`\`\`
393+
394+
#####################################################################
395+
# #
396+
# FAILURE TO INCLUDE THESE SECTIONS = PLAN WILL BE REJECTED #
397+
# BY MOMUS REVIEW. DO NOT SKIP. DO NOT ABBREVIATE. #
398+
# #
399+
#####################################################################
400+
</CRITICAL_REQUIREMENT_DEPENDENCY_PARALLEL_EXECUTION_CATEGORY_SKILLS>
401+
214402
`
215403

216404
/**

0 commit comments

Comments
 (0)