feat: add prompt for claude code to include context when generating tasks

This commit is contained in:
Ralph Khreish
2025-08-06 12:17:49 +02:00
parent ca4d93ee6a
commit 36468f3c93
7 changed files with 82 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ import { generateObjectService } from '../ai-services-unified.js';
import { getDebugFlag } from '../config-manager.js';
import { getPromptManager } from '../prompt-manager.js';
import { displayAiUsageSummary } from '../ui.js';
import { CUSTOM_PROVIDERS } from '../../../src/constants/providers.js';
// Define the Zod schema for a SINGLE task object
const prdSingleTaskSchema = z.object({
@@ -174,9 +175,16 @@ async function parsePRD(prdPath, tasksPath, numTasks, options = {}) {
const promptManager = getPromptManager();
// Get defaultTaskPriority from config
const { getDefaultPriority } = await import('../config-manager.js');
const { getDefaultPriority, getMainProvider, getResearchProvider } =
await import('../config-manager.js');
const defaultTaskPriority = getDefaultPriority(projectRoot) || 'medium';
// Check if Claude Code is being used as the provider
const currentProvider = research
? getResearchProvider(projectRoot)
: getMainProvider(projectRoot);
const isClaudeCode = currentProvider === CUSTOM_PROVIDERS.CLAUDE_CODE;
const { systemPrompt, userPrompt } = await promptManager.loadPrompt(
'parse-prd',
{
@@ -185,7 +193,9 @@ async function parsePRD(prdPath, tasksPath, numTasks, options = {}) {
nextId,
prdContent,
prdPath,
defaultTaskPriority
defaultTaskPriority,
isClaudeCode,
projectRoot: projectRoot || ''
}
);