MCPcopy Create free account
hub / github.com/cursor/plugins / buildWorkerPrompt

Function buildWorkerPrompt

orchestrate/skills/orchestrate/scripts/core/prompts.ts:108–149  ·  view source on GitHub ↗
(
  t: PlanTask,
  agentId: string | undefined,
  ctx: PromptRenderContext
)

Source from the content-addressed store, hash-verified

106}
107
108export function buildWorkerPrompt(
109 t: PlanTask,
110 agentId: string | undefined,
111 ctx: PromptRenderContext
112): string {
113 const allow =
114 (t.pathsAllowed ?? []).map(p => ` - ${p}`).join("\n") ||
115 " - (none declared — ask before touching anything broad)";
116 const forbid =
117 (t.pathsForbidden ?? []).map(p => ` - ${p}`).join("\n") || " - (none)";
118 const accept =
119 (t.acceptance ?? []).map(a => ` - [ ] ${a}`).join("\n") ||
120 " - (none declared)";
121 const verifyPlan = renderVerifyPlan(
122 t,
123 "Verification plan (how the planner / a verifier will check your work):"
124 );
125 const upstream = buildUpstreamHandoffsSection(t, ctx);
126 const slackBlock = buildSlackBlock(t, agentId, ctx);
127 const branch = ctx.branchForTask(t);
128 const mergeDiscipline = renderMergeDiscipline(t, ctx.plan);
129 const scopedGoal = buildPromptScopedGoal(t);
130 const prBase = ctx.plan.prBase ?? ctx.plan.baseBranch;
131 const prDiscipline = t.openPR
132 ? `- Keep \`.orchestrate/\` files out of the PR diff — that directory is run-local orchestrator bookkeeping, not the change you're shipping. Leave its state intact in your working tree afterward so the orchestrator's next reconcile loop can keep observing your task.
133- After your branch is pushed, open a draft pull request with base \`${prBase}\` and head set to your current branch using the ManagePullRequest tool. Title and body should summarize your handoff. Do NOT merge, rebase, or close the PR — the planner owns integration.`
134 : "- Do NOT merge, rebase, or open a PR. The planner owns integration.";
135 return renderPromptTemplate("worker", {
136 goal: ctx.plan.goal,
137 scopedGoal,
138 allow,
139 forbid,
140 accept,
141 verifyPlan,
142 upstream,
143 slackBlock,
144 startingRef: t.startingRef ?? ctx.plan.baseBranch,
145 branch,
146 mergeDiscipline,
147 prDiscipline,
148 });
149}
150
151export function buildVerifierPrompt(
152 t: Extract<PlanTask, { type: "verifier" }>,

Callers 4

spawnTaskMethod · 0.90
renderPromptFunction · 0.85

Calls 7

renderVerifyPlanFunction · 0.85
buildSlackBlockFunction · 0.85
renderMergeDisciplineFunction · 0.85
buildPromptScopedGoalFunction · 0.85
renderPromptTemplateFunction · 0.85
branchForTaskMethod · 0.80

Tested by

no test coverage detected