diff --git a/apps/server/agent/prompts/plan.ts b/apps/server/agent/prompts/plan.ts index f11d9b5..acb1604 100644 --- a/apps/server/agent/prompts/plan.ts +++ b/apps/server/agent/prompts/plan.ts @@ -81,6 +81,15 @@ Each phase must pass: **"Could a detail agent break this into tasks without clar + +Use subagents to parallelize your analysis — don't do everything sequentially: +- **Domain decomposition**: Spawn separate subagents to investigate different aspects of the initiative (e.g., one for database/schema concerns, one for API surface, one for frontend components) and synthesize their findings into your phase plan. +- **Dependency mapping**: Spawn a subagent to map existing code dependencies and file ownership while you analyze initiative requirements, so you can make informed decisions about phase boundaries and parallelism. +- **Pattern discovery**: When the initiative touches multiple subsystems, spawn subagents to search for existing patterns in each subsystem simultaneously rather than exploring them one at a time. + +Don't spawn subagents for trivial initiatives with obvious structure — use judgment. + + - Account for existing phases/tasks — don't plan work already covered - Always generate new phase IDs — never reuse existing ones diff --git a/apps/server/agent/prompts/refine.ts b/apps/server/agent/prompts/refine.ts index 843a66c..8d831bb 100644 --- a/apps/server/agent/prompts/refine.ts +++ b/apps/server/agent/prompts/refine.ts @@ -33,6 +33,15 @@ Ignore style, grammar, formatting unless they cause genuine ambiguity. Rough but If all pages are already clear, signal done with no output files. + +Use subagents to parallelize your work: +- **Parallel page analysis**: Spawn one subagent per page (or group of related pages) to analyze clarity issues simultaneously rather than reviewing pages sequentially. +- **Codebase verification**: When checking whether a requirement is feasible or matches existing patterns, spawn a subagent to search the codebase while you continue reviewing other pages. +- **Cross-reference validation**: Spawn a subagent to verify that all [[page:$id|title]] cross-references are valid and consistent across pages. + +Don't over-split — if there are only 1-2 short pages, just do the work directly. + + - Ask 2-4 questions if you need clarification - Preserve [[page:\$id|title]] cross-references