diff --git a/packages/prompts-core/prompts/mode/hyperplan.md b/packages/prompts-core/prompts/mode/hyperplan.md new file mode 100644 index 000000000..bb70c4ee0 --- /dev/null +++ b/packages/prompts-core/prompts/mode/hyperplan.md @@ -0,0 +1,25 @@ + +**MANDATORY**: Say "HYPERPLAN MODE ENABLED!" as your first response, exactly once. + +The user invoked **hyperplan mode** — adversarial multi-agent planning via team-mode. + +LOAD THE HYPERPLAN SKILL IMMEDIATELY: + +``` +skill(name="hyperplan") +``` + +After loading, follow the skill's full workflow EXACTLY: +1. Acknowledge and capture the planning request +2. Spawn the adversarial team via `team_create` with category members `unspecified-low`, `unspecified-high`, `ultrabrain`, and `artistry`; include `deep` only if the category is enabled +3. Round 1 — Independent analysis (each member produces findings) +4. Round 2 — Cross-attack (each member ruthlessly attacks the other 4's findings) +5. Round 3 — Defend, refine, or concede +6. Distill defensible insights into a structured bundle (Lead does NOT write the plan) +7. MANDATORY: hand the bundle to the `plan` agent via `task(subagent_type="plan", ...)` — the plan agent owns sequencing, parallelization, and verification gates +8. Present the plan agent's output verbatim with provenance line, then clean up the team + +Do NOT improvise. Do NOT skip rounds. Do NOT write the plan yourself in step 6 — the handoff to the plan agent in step 7 is non-negotiable. Be the lead orchestrator and let the adversarial members do the cross-critique. + +If team-mode is unavailable (`team_*` tools missing), instruct the user to set `team_mode.enabled: true` in `~/.config/opencode/oh-my-opencode.jsonc` and restart opencode. + diff --git a/packages/prompts-core/src/index.ts b/packages/prompts-core/src/index.ts index d867877a5..c2e9572ea 100644 --- a/packages/prompts-core/src/index.ts +++ b/packages/prompts-core/src/index.ts @@ -9,4 +9,9 @@ export type { export { resolveVariant } from "./variant-resolver" export type { ResolveVariantInput } from "./variant-resolver" export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader" -export { ANALYZE_MODE_PROMPT, SEARCH_MODE_PROMPT, TEAM_MODE_PROMPT } from "./mode-prompts" +export { + ANALYZE_MODE_PROMPT, + HYPERPLAN_MODE_PROMPT, + SEARCH_MODE_PROMPT, + TEAM_MODE_PROMPT, +} from "./mode-prompts" diff --git a/packages/prompts-core/src/mode-prompts.ts b/packages/prompts-core/src/mode-prompts.ts index a17096ea3..3603e3c12 100644 --- a/packages/prompts-core/src/mode-prompts.ts +++ b/packages/prompts-core/src/mode-prompts.ts @@ -1,8 +1,10 @@ +import hyperplanModePrompt from "../prompts/mode/hyperplan.md" with { type: "text" } import analyzeModePrompt from "../prompts/mode/analyze.md" with { type: "text" } import searchModePrompt from "../prompts/mode/search.md" with { type: "text" } import teamModePrompt from "../prompts/mode/team.md" with { type: "text" } export const ANALYZE_MODE_PROMPT = stripFinalLineFeed(analyzeModePrompt) +export const HYPERPLAN_MODE_PROMPT = stripFinalLineFeed(hyperplanModePrompt) export const SEARCH_MODE_PROMPT = stripFinalLineFeed(searchModePrompt) export const TEAM_MODE_PROMPT = stripFinalLineFeed(teamModePrompt) diff --git a/src/hooks/keyword-detector/hyperplan/default.ts b/src/hooks/keyword-detector/hyperplan/default.ts index cf27e087a..e049c8c5d 100644 --- a/src/hooks/keyword-detector/hyperplan/default.ts +++ b/src/hooks/keyword-detector/hyperplan/default.ts @@ -1,3 +1,5 @@ +import { HYPERPLAN_MODE_PROMPT } from "@oh-my-opencode/prompts-core" + /** * Hyperplan keyword detector. * @@ -17,28 +19,4 @@ export const HYPERPLAN_PATTERN = /\bhyperplan\b|(? -**MANDATORY**: Say "HYPERPLAN MODE ENABLED!" as your first response, exactly once. - -The user invoked **hyperplan mode** — adversarial multi-agent planning via team-mode. - -LOAD THE HYPERPLAN SKILL IMMEDIATELY: - -\`\`\` -skill(name="hyperplan") -\`\`\` - -After loading, follow the skill's full workflow EXACTLY: -1. Acknowledge and capture the planning request -2. Spawn the adversarial team via \`team_create\` with category members \`unspecified-low\`, \`unspecified-high\`, \`ultrabrain\`, and \`artistry\`; include \`deep\` only if the category is enabled -3. Round 1 — Independent analysis (each member produces findings) -4. Round 2 — Cross-attack (each member ruthlessly attacks the other 4's findings) -5. Round 3 — Defend, refine, or concede -6. Distill defensible insights into a structured bundle (Lead does NOT write the plan) -7. MANDATORY: hand the bundle to the \`plan\` agent via \`task(subagent_type="plan", ...)\` — the plan agent owns sequencing, parallelization, and verification gates -8. Present the plan agent's output verbatim with provenance line, then clean up the team - -Do NOT improvise. Do NOT skip rounds. Do NOT write the plan yourself in step 6 — the handoff to the plan agent in step 7 is non-negotiable. Be the lead orchestrator and let the adversarial members do the cross-critique. - -If team-mode is unavailable (\`team_*\` tools missing), instruct the user to set \`team_mode.enabled: true\` in \`~/.config/opencode/oh-my-opencode.jsonc\` and restart opencode. -` +export const HYPERPLAN_MESSAGE = HYPERPLAN_MODE_PROMPT