diff --git a/packages/core/src/prompts/promptProvider.ts b/packages/core/src/prompts/promptProvider.ts
index 47f7e936cf..fa15c94e0e 100644
--- a/packages/core/src/prompts/promptProvider.ts
+++ b/packages/core/src/prompts/promptProvider.ts
@@ -178,6 +178,11 @@ export class PromptProvider {
}),
isPlanMode,
),
+ taskTracker: this.withSection(
+ 'taskTracker',
+ () => ({}),
+ config.isTrackerEnabled(),
+ ),
operationalGuidelines: this.withSection(
'operationalGuidelines',
() => ({
diff --git a/packages/core/src/prompts/snippets.legacy.ts b/packages/core/src/prompts/snippets.legacy.ts
index 8d46fd6a1a..9c927d33ea 100644
--- a/packages/core/src/prompts/snippets.legacy.ts
+++ b/packages/core/src/prompts/snippets.legacy.ts
@@ -18,6 +18,9 @@ import {
SHELL_TOOL_NAME,
WRITE_FILE_TOOL_NAME,
WRITE_TODOS_TOOL_NAME,
+ TRACKER_CREATE_TASK_TOOL_NAME,
+ TRACKER_LIST_TASKS_TOOL_NAME,
+ TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';
// --- Options Structs ---
@@ -30,6 +33,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
+ taskTracker?: TaskTrackerOptions;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
@@ -79,6 +83,9 @@ export interface PlanningWorkflowOptions {
approvedPlanPath?: string;
}
+export interface TaskTrackerOptions {
+}
+
export interface AgentSkillOptions {
name: string;
description: string;
@@ -113,6 +120,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}
+${renderTaskTracker(options.taskTracker)}
+
${renderOperationalGuidelines(options.operationalGuidelines)}
${renderInteractiveYoloMode(options.interactiveYoloMode)}
@@ -387,6 +396,24 @@ ${trimmed}
return `\n---\n\n\n${sections.join('\n')}\n`;
}
+export function renderTaskTracker(options?: TaskTrackerOptions): string {
+ if (!options) return '';
+ const trackerCreate = `\`${TRACKER_CREATE_TASK_TOOL_NAME}\``;
+ const trackerList = `\`${TRACKER_LIST_TASKS_TOOL_NAME}\``;
+ const trackerUpdate = `\`${TRACKER_UPDATE_TASK_TOOL_NAME}\``;
+
+ return `
+# TASK MANAGEMENT PROTOCOL
+You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:
+
+1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
+2. **ATOMICITY**: If a user request involves multiple steps (e.g., "Refactor the backend") or represents a complex task, you must first break this into discrete entries using ${trackerCreate} before writing any code.
+3. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
+4. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
+5. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
+6. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
+}
+
export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts
index 16b3feaa43..55f8b78823 100644
--- a/packages/core/src/prompts/snippets.ts
+++ b/packages/core/src/prompts/snippets.ts
@@ -17,6 +17,9 @@ import {
SHELL_TOOL_NAME,
WRITE_FILE_TOOL_NAME,
WRITE_TODOS_TOOL_NAME,
+ TRACKER_CREATE_TASK_TOOL_NAME,
+ TRACKER_LIST_TASKS_TOOL_NAME,
+ TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';
import type { HierarchicalMemory } from '../config/memory.js';
import { DEFAULT_CONTEXT_FILENAME } from '../tools/memoryTool.js';
@@ -31,6 +34,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
+ taskTracker?: TaskTrackerOptions;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
@@ -77,6 +81,9 @@ export interface PlanningWorkflowOptions {
approvedPlanPath?: string;
}
+export interface TaskTrackerOptions {
+}
+
export interface AgentSkillOptions {
name: string;
description: string;
@@ -112,6 +119,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}
+${renderTaskTracker(options.taskTracker)}
+
${renderOperationalGuidelines(options.operationalGuidelines)}
${renderInteractiveYoloMode(options.interactiveYoloMode)}
@@ -408,6 +417,24 @@ ${trimmed}
return `\n---\n\n\n${sections.join('\n')}\n`;
}
+export function renderTaskTracker(options?: TaskTrackerOptions): string {
+ if (!options) return '';
+ const trackerCreate = formatToolName(TRACKER_CREATE_TASK_TOOL_NAME);
+ const trackerList = formatToolName(TRACKER_LIST_TASKS_TOOL_NAME);
+ const trackerUpdate = formatToolName(TRACKER_UPDATE_TASK_TOOL_NAME);
+
+ return `
+# TASK MANAGEMENT PROTOCOL
+You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:
+
+1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
+2. **ATOMICITY**: If a user request involves multiple steps (e.g., "Refactor the backend") or represents a complex task, you must first break this into discrete entries using ${trackerCreate} before writing any code.
+3. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
+4. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
+5. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
+6. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
+}
+
export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
diff --git a/packages/core/src/services/trackerService.ts b/packages/core/src/services/trackerService.ts
index 4d60a6aed4..1486106ebc 100644
--- a/packages/core/src/services/trackerService.ts
+++ b/packages/core/src/services/trackerService.ts
@@ -15,7 +15,6 @@ export class TrackerService {
private initialized = false;
constructor(readonly trackerDir: string) {
- console.log('trackerDir', trackerDir);
this.tasksDir = trackerDir;
}