feat(sisyphus): strengthen non-Claude parallel delegation guidance

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2026-03-07 00:47:55 +09:00
parent fa460469f0
commit d08bc04e67
15 changed files with 124 additions and 91 deletions
@@ -4,7 +4,7 @@ import { describe, it, expect } from "bun:test"
import {
buildCategorySkillsDelegationGuide,
buildUltraworkSection,
buildDeepParallelSection,
buildParallelDelegationSection,
buildNonClaudePlannerSection,
type AvailableSkill,
type AvailableCategory,
@@ -174,23 +174,39 @@ describe("buildUltraworkSection", () => {
})
})
describe("buildDeepParallelSection", () => {
describe("buildParallelDelegationSection", () => {
const deepCategory: AvailableCategory = { name: "deep", description: "Autonomous problem-solving" }
const unspecifiedHighCategory: AvailableCategory = { name: "unspecified-high", description: "High effort tasks" }
const otherCategory: AvailableCategory = { name: "quick", description: "Trivial tasks" }
it("#given non-Claude model with deep category #when building #then returns parallel delegation section", () => {
it("#given non-Claude model with deep category #when building #then returns aggressive delegation section", () => {
//#given
const model = "google/gemini-3-pro"
const categories = [deepCategory, otherCategory]
//#when
const result = buildDeepParallelSection(model, categories)
const result = buildParallelDelegationSection(model, categories)
//#then
expect(result).toContain("Deep Parallel Delegation")
expect(result).toContain("EVERY independent unit")
expect(result).toContain("DECOMPOSE AND DELEGATE")
expect(result).toContain("NOT AN IMPLEMENTER")
expect(result).toContain("run_in_background=true")
expect(result).toContain("4 independent units")
expect(result).toContain("NEVER implement directly")
})
it("#given non-Claude model with unspecified-high category #when building #then returns aggressive delegation section", () => {
//#given
const model = "openai/gpt-5.2"
const categories = [unspecifiedHighCategory, otherCategory]
//#when
const result = buildParallelDelegationSection(model, categories)
//#then
expect(result).toContain("DECOMPOSE AND DELEGATE")
expect(result).toContain("`deep` or `unspecified-high`")
expect(result).toContain("NEVER work sequentially")
})
it("#given Claude model #when building #then returns empty", () => {
@@ -199,19 +215,19 @@ describe("buildDeepParallelSection", () => {
const categories = [deepCategory]
//#when
const result = buildDeepParallelSection(model, categories)
const result = buildParallelDelegationSection(model, categories)
//#then
expect(result).toBe("")
})
it("#given non-Claude model without deep category #when building #then returns empty", () => {
it("#given non-Claude model without deep or unspecified-high category #when building #then returns empty", () => {
//#given
const model = "openai/gpt-5.2"
const categories = [otherCategory]
//#when
const result = buildDeepParallelSection(model, categories)
const result = buildParallelDelegationSection(model, categories)
//#then
expect(result).toBe("")
+27 -10
View File
@@ -359,21 +359,38 @@ Multi-step task? **ALWAYS consult Plan Agent first.** Do NOT start implementatio
Plan Agent returns a structured work breakdown with parallel execution opportunities. Follow it.`
}
export function buildDeepParallelSection(model: string, categories: AvailableCategory[]): string {
export function buildParallelDelegationSection(model: string, categories: AvailableCategory[]): string {
const isNonClaude = !model.toLowerCase().includes('claude')
const hasDeepCategory = categories.some(c => c.name === 'deep')
const hasDelegationCategory = categories.some(c => c.name === 'deep' || c.name === 'unspecified-high')
if (!isNonClaude || !hasDeepCategory) return ""
if (!isNonClaude || !hasDelegationCategory) return ""
return `### Deep Parallel Delegation
return `### DECOMPOSE AND DELEGATE — YOU ARE NOT AN IMPLEMENTER
Delegate EVERY independent unit to a \`deep\` agent in parallel (\`run_in_background=true\`).
If a task decomposes into 4 independent units, spawn 4 agents simultaneously — not 1 at a time.
**YOUR FAILURE MODE: You attempt to do work yourself instead of decomposing and delegating.** When you implement directly, the result is measurably worse than when specialized subagents do it. Subagents have domain-specific configurations, loaded skills, and tuned prompts that you lack.
1. Decompose the implementation into independent work units
2. Assign one \`deep\` agent per unit — all via \`run_in_background=true\`
3. Give each agent a clear GOAL with success criteria, not step-by-step instructions
4. Collect all results, integrate, verify coherence across units`
**MANDATORY — for ANY implementation task:**
1. **ALWAYS decompose** the task into independent work units. No exceptions. Even if the task "feels small", decompose it.
2. **ALWAYS delegate** EACH unit to a \`deep\` or \`unspecified-high\` agent in parallel (\`run_in_background=true\`).
3. **NEVER work sequentially.** If 4 independent units exist, spawn 4 agents simultaneously. Not 1 at a time. Not 2 then 2.
4. **NEVER implement directly** when delegation is possible. You write prompts, not code.
**YOUR PROMPT TO EACH AGENT MUST INCLUDE:**
- GOAL with explicit success criteria (what "done" looks like)
- File paths and constraints (where to work, what not to touch)
- Existing patterns to follow (reference specific files the agent should read)
- Clear scope boundary (what is IN scope, what is OUT of scope)
**Vague delegation = failed delegation.** If your prompt to the subagent is shorter than 5 lines, it is too vague.
| You Want To Do | You MUST Do Instead |
|---|---|
| Write code yourself | Delegate to \`deep\` or \`unspecified-high\` agent |
| Handle 3 changes sequentially | Spawn 3 agents in parallel |
| "Quickly fix this one thing" | Still delegate — your "quick fix" is slower and worse than a subagent's |
**Your value is orchestration, decomposition, and quality control. Delegating with crystal-clear prompts IS your work.**`
}
export function buildUltraworkSection(
+3 -3
View File
@@ -35,7 +35,7 @@ import {
buildOracleSection,
buildHardBlocksSection,
buildAntiPatternsSection,
buildDeepParallelSection,
buildParallelDelegationSection,
buildNonClaudePlannerSection,
categorizeTools,
} from "./dynamic-agent-prompt-builder";
@@ -64,7 +64,7 @@ function buildDynamicSisyphusPrompt(
const oracleSection = buildOracleSection(availableAgents);
const hardBlocks = buildHardBlocksSection();
const antiPatterns = buildAntiPatternsSection();
const deepParallelSection = buildDeepParallelSection(model, availableCategories);
const parallelDelegationSection = buildParallelDelegationSection(model, availableCategories);
const nonClaudePlannerSection = buildNonClaudePlannerSection(model);
const taskManagementSection = buildTaskManagementSection(useTaskSystem);
const todoHookNote = useTaskSystem
@@ -262,7 +262,7 @@ ${categorySkillsGuide}
${nonClaudePlannerSection}
${deepParallelSection}
${parallelDelegationSection}
${delegationTable}
+3 -3
View File
@@ -19,7 +19,7 @@ import {
buildOracleSection,
buildHardBlocksSection,
buildAntiPatternsSection,
buildDeepParallelSection,
buildParallelDelegationSection,
buildNonClaudePlannerSection,
categorizeTools,
} from "../dynamic-agent-prompt-builder";
@@ -158,7 +158,7 @@ export function buildDefaultSisyphusPrompt(
const oracleSection = buildOracleSection(availableAgents);
const hardBlocks = buildHardBlocksSection();
const antiPatterns = buildAntiPatternsSection();
const deepParallelSection = buildDeepParallelSection(model, availableCategories);
const parallelDelegationSection = buildParallelDelegationSection(model, availableCategories);
const nonClaudePlannerSection = buildNonClaudePlannerSection(model);
const taskManagementSection = buildTaskManagementSection(useTaskSystem);
const todoHookNote = useTaskSystem
@@ -356,7 +356,7 @@ ${categorySkillsGuide}
${nonClaudePlannerSection}
${deepParallelSection}
${parallelDelegationSection}
${delegationTable}