@@ -18,8 +18,6 @@ export interface LoomPromptOptions {
1818 fingerprint ?: ProjectFingerprint | null
1919 /** Custom agent metadata for dynamic delegation sections */
2020 customAgents ?: AvailableAgent [ ]
21- /** Whether the atomic task system is enabled (default false for backward compat) */
22- taskSystemEnabled ?: boolean
2321}
2422
2523export function buildRoleSection ( ) : string {
@@ -30,32 +28,22 @@ You are the team lead. Understand the request, break it into tasks, delegate int
3028</Role>`
3129}
3230
33- export function buildDisciplineSection ( taskSystemEnabled = false ) : string {
34- if ( taskSystemEnabled ) {
35- return `<Discipline>
31+ export function buildDisciplineSection ( ) : string {
32+ return `<Discipline>
3633TASK TRACKING (NON-NEGOTIABLE):
3734- 2+ steps → task_create FIRST, one task per step
3835- task_update to in_progress before starting (ONE at a time)
3936- task_update to completed IMMEDIATELY after each step
4037- NEVER batch completions
4138
42- No tasks on multi-step work = INCOMPLETE WORK.
43- </Discipline>`
44- }
45- return `<Discipline>
46- TODO OBSESSION (NON-NEGOTIABLE):
47- - 2+ steps → todowrite FIRST, atomic breakdown
48- - Mark in_progress before starting (ONE at a time)
49- - Mark completed IMMEDIATELY after each step
50- - NEVER batch completions
39+ PLANS: Never execute plan tasks directly — always /start-work → Tapestry.
5140
52- No todos on multi-step work = INCOMPLETE WORK.
41+ No tasks on multi-step work = INCOMPLETE WORK.
5342</Discipline>`
5443}
5544
56- export function buildSidebarTodosSection ( taskSystemEnabled = false ) : string {
57- if ( taskSystemEnabled ) {
58- return `<SidebarTodos>
45+ export function buildSidebarTodosSection ( ) : string {
46+ return `<SidebarTodos>
5947The user sees a Todo sidebar (~35 char width). Use task_create and task_update to manage it:
6048
6149- task_create: creates a task and syncs to sidebar automatically
@@ -70,36 +58,6 @@ WORKFLOW:
70583. task_update({ id: "T-xxx", status: "completed" }) — when done
7159
7260FORMAT: Keep subjects under 35 chars. One in_progress at a time.
73- </SidebarTodos>`
74- }
75- return `<SidebarTodos>
76- The user sees a Todo sidebar (~35 char width). Use todowrite strategically:
77-
78- WHEN PLANNING (multi-step work):
79- - Create "in_progress": "Planning: [brief desc]"
80- - When plan ready: mark completed, add "Plan ready — /start-work"
81-
82- WHEN DELEGATING TO AGENTS:
83- - FIRST: Create "in_progress": "[agent]: [task]" (e.g. "thread: scan models")
84- - The todowrite call MUST come BEFORE the Task/call_weave_agent tool call in your response
85- - Mark "completed" AFTER summarizing what the agent returned
86- - If multiple delegations: one todo per active agent
87-
88- WHEN DOING QUICK TASKS (no plan needed):
89- - One "in_progress" todo for current step
90- - Mark "completed" immediately when done
91-
92- FORMAT RULES:
93- - Max 35 chars per todo content
94- - Max 5 visible todos at any time
95- - in_progress = yellow highlight — use for ACTIVE work only
96- - Prefix delegations with agent name
97-
98- BEFORE FINISHING (MANDATORY):
99- - ALWAYS issue a final todowrite before your last response
100- - Mark ALL in_progress items → "completed" (or "cancelled")
101- - Never leave in_progress items when done
102- - This is NON-NEGOTIABLE — skipping it breaks the UI
10361</SidebarTodos>`
10462}
10563
@@ -141,7 +99,7 @@ ${lines.join("\n")}
14199</Delegation>`
142100}
143101
144- export function buildDelegationNarrationSection ( disabled : Set < string > = new Set ( ) , taskSystemEnabled = false ) : string {
102+ export function buildDelegationNarrationSection ( disabled : Set < string > = new Set ( ) ) : string {
145103 const hints : string [ ] = [ ]
146104 if ( isAgentEnabled ( "pattern" , disabled ) ) {
147105 hints . push ( '- Pattern (planning): "This may take a moment — Pattern is researching the codebase and writing a detailed plan..."' )
@@ -159,18 +117,6 @@ export function buildDelegationNarrationSection(disabled: Set<string> = new Set(
159117 ? `\nDURATION HINTS — tell the user when something takes time:\n${ hints . join ( "\n" ) } `
160118 : ""
161119
162- const trackingTool = taskSystemEnabled ? "task_create/task_update" : "todowrite"
163- const trackingInstr = taskSystemEnabled
164- ? `2. BEFORE the Task tool call: Create a task (in_progress) for the delegation using task_create.
165- This ensures the sidebar updates immediately, not after the subagent finishes.`
166- : `2. BEFORE the Task tool call: Create/update a sidebar todo (in_progress) for the delegation.
167- The todowrite call MUST appear BEFORE the Task tool call in your response.
168- This ensures the sidebar updates immediately, not after the subagent finishes.`
169-
170- const completeInstr = taskSystemEnabled
171- ? `4. Mark the delegation task as "completed" using task_update after summarizing results.`
172- : `4. Mark the delegation todo as "completed" after summarizing results.`
173-
174120 return `<DelegationNarration>
175121EVERY delegation MUST follow this pattern — no exceptions:
176122
@@ -179,14 +125,15 @@ EVERY delegation MUST follow this pattern — no exceptions:
179125 - "Asking Pattern to create an implementation plan for the new feature..."
180126 - "Sending to Spindle to research the library's API docs..."
181127
182- ${ trackingInstr }
128+ 2. BEFORE the Task tool call: Create a task (in_progress) for the delegation using task_create.
129+ This ensures the sidebar updates immediately, not after the subagent finishes.
183130
1841313. AFTER the agent returns: Write a brief summary of what was found/produced:
185132 - "Thread found 3 files related to auth: src/auth/login.ts, src/auth/session.ts, src/auth/middleware.ts"
186133 - "Pattern saved the plan to .weave/plans/feature-x.md with 7 tasks"
187134 - "Spindle confirmed the library supports streaming — docs at [url]"
188135
189- ${ completeInstr }
136+ 4. Mark the delegation task as "completed" using task_update after summarizing results.
190137${ hintsBlock }
191138
192139The user should NEVER see a blank pause with no explanation. If you're about to call Task, WRITE SOMETHING FIRST.
@@ -250,6 +197,10 @@ export function buildPlanWorkflowSection(disabled: Set<string>): string {
250197- SKIP plan workflow: Quick fixes, single-file changes, simple questions` )
251198
252199 return `<PlanWorkflow>
200+ CRITICAL: NEVER execute plan tasks directly. ALWAYS delegate to Tapestry via /start-work.
201+ Only Tapestry has the plan execution protocol (checkbox marking, verification, post-execution review).
202+ If you execute plan tasks yourself, checkboxes won't be marked and progress will be lost.
203+
253204For complex tasks that benefit from structured planning before execution:
254205
255206${ steps . join ( "\n" ) }
@@ -351,15 +302,14 @@ export function composeLoomPrompt(options: LoomPromptOptions = {}): string {
351302 const disabled = options . disabledAgents ?? new Set ( )
352303 const fingerprint = options . fingerprint
353304 const customAgents = options . customAgents ?? [ ]
354- const taskSystemEnabled = options . taskSystemEnabled ?? false
355305
356306 const sections = [
357307 buildRoleSection ( ) ,
358308 buildProjectContextSection ( fingerprint ) ,
359- buildDisciplineSection ( taskSystemEnabled ) ,
360- buildSidebarTodosSection ( taskSystemEnabled ) ,
309+ buildDisciplineSection ( ) ,
310+ buildSidebarTodosSection ( ) ,
361311 buildDelegationSection ( disabled ) ,
362- buildDelegationNarrationSection ( disabled , taskSystemEnabled ) ,
312+ buildDelegationNarrationSection ( disabled ) ,
363313 buildCustomAgentDelegationSection ( customAgents , disabled ) ,
364314 buildPlanWorkflowSection ( disabled ) ,
365315 buildReviewWorkflowSection ( disabled ) ,
0 commit comments