mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
feat: centralize prompts and add customization UI for App Spec, Context, Suggestions, Tasks
- Add 4 new prompt type interfaces (AppSpecPrompts, ContextDescriptionPrompts, SuggestionsPrompts, TaskExecutionPrompts) with resolved types - Add default prompts for all new categories to @automaker/prompts/defaults.ts - Add merge functions for new prompt categories in merge.ts - Update settings-helpers.ts getPromptCustomization() to return all 12 categories - Update server routes (generate-spec, generate-features-from-spec, describe-file, describe-image, generate-suggestions) to use centralized prompts - Add 4 new tabs in prompt customization UI (App Spec, Context, Suggestions, Tasks) - Fix Ideation tab layout using grid-cols-4 for even distribution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,14 @@ import {
|
||||
mergeAgentPrompts,
|
||||
mergeBacklogPlanPrompts,
|
||||
mergeEnhancementPrompts,
|
||||
mergeCommitMessagePrompts,
|
||||
mergeTitleGenerationPrompts,
|
||||
mergeIssueValidationPrompts,
|
||||
mergeIdeationPrompts,
|
||||
mergeAppSpecPrompts,
|
||||
mergeContextDescriptionPrompts,
|
||||
mergeSuggestionsPrompts,
|
||||
mergeTaskExecutionPrompts,
|
||||
} from '@automaker/prompts';
|
||||
|
||||
const logger = createLogger('SettingsHelper');
|
||||
@@ -218,6 +226,14 @@ export async function getPromptCustomization(
|
||||
agent: ReturnType<typeof mergeAgentPrompts>;
|
||||
backlogPlan: ReturnType<typeof mergeBacklogPlanPrompts>;
|
||||
enhancement: ReturnType<typeof mergeEnhancementPrompts>;
|
||||
commitMessage: ReturnType<typeof mergeCommitMessagePrompts>;
|
||||
titleGeneration: ReturnType<typeof mergeTitleGenerationPrompts>;
|
||||
issueValidation: ReturnType<typeof mergeIssueValidationPrompts>;
|
||||
ideation: ReturnType<typeof mergeIdeationPrompts>;
|
||||
appSpec: ReturnType<typeof mergeAppSpecPrompts>;
|
||||
contextDescription: ReturnType<typeof mergeContextDescriptionPrompts>;
|
||||
suggestions: ReturnType<typeof mergeSuggestionsPrompts>;
|
||||
taskExecution: ReturnType<typeof mergeTaskExecutionPrompts>;
|
||||
}> {
|
||||
let customization: PromptCustomization = {};
|
||||
|
||||
@@ -239,6 +255,14 @@ export async function getPromptCustomization(
|
||||
agent: mergeAgentPrompts(customization.agent),
|
||||
backlogPlan: mergeBacklogPlanPrompts(customization.backlogPlan),
|
||||
enhancement: mergeEnhancementPrompts(customization.enhancement),
|
||||
commitMessage: mergeCommitMessagePrompts(customization.commitMessage),
|
||||
titleGeneration: mergeTitleGenerationPrompts(customization.titleGeneration),
|
||||
issueValidation: mergeIssueValidationPrompts(customization.issueValidation),
|
||||
ideation: mergeIdeationPrompts(customization.ideation),
|
||||
appSpec: mergeAppSpecPrompts(customization.appSpec),
|
||||
contextDescription: mergeContextDescriptionPrompts(customization.contextDescription),
|
||||
suggestions: mergeSuggestionsPrompts(customization.suggestions),
|
||||
taskExecution: mergeTaskExecutionPrompts(customization.taskExecution),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { streamingQuery } from '../../providers/simple-query-service.js';
|
||||
import { parseAndCreateFeatures } from './parse-and-create-features.js';
|
||||
import { getAppSpecPath } from '@automaker/platform';
|
||||
import type { SettingsService } from '../../services/settings-service.js';
|
||||
import { getAutoLoadClaudeMdSetting } from '../../lib/settings-helpers.js';
|
||||
import { getAutoLoadClaudeMdSetting, getPromptCustomization } from '../../lib/settings-helpers.js';
|
||||
|
||||
const logger = createLogger('SpecRegeneration');
|
||||
|
||||
@@ -53,38 +53,16 @@ export async function generateFeaturesFromSpec(
|
||||
return;
|
||||
}
|
||||
|
||||
// Get customized prompts from settings
|
||||
const prompts = await getPromptCustomization(settingsService, '[FeatureGeneration]');
|
||||
|
||||
const prompt = `Based on this project specification:
|
||||
|
||||
${spec}
|
||||
|
||||
Generate a prioritized list of implementable features. For each feature provide:
|
||||
${prompts.appSpec.generateFeaturesFromSpecPrompt}
|
||||
|
||||
1. **id**: A unique lowercase-hyphenated identifier
|
||||
2. **category**: Functional category (e.g., "Core", "UI", "API", "Authentication", "Database")
|
||||
3. **title**: Short descriptive title
|
||||
4. **description**: What this feature does (2-3 sentences)
|
||||
5. **priority**: 1 (high), 2 (medium), or 3 (low)
|
||||
6. **complexity**: "simple", "moderate", or "complex"
|
||||
7. **dependencies**: Array of feature IDs this depends on (can be empty)
|
||||
|
||||
Format as JSON:
|
||||
{
|
||||
"features": [
|
||||
{
|
||||
"id": "feature-id",
|
||||
"category": "Feature Category",
|
||||
"title": "Feature Title",
|
||||
"description": "What it does",
|
||||
"priority": 1,
|
||||
"complexity": "moderate",
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Generate ${featureCount} features that build on each other logically.
|
||||
|
||||
IMPORTANT: Do not ask for clarification. The specification is provided above. Generate the JSON immediately.`;
|
||||
Generate ${featureCount} features that build on each other logically.`;
|
||||
|
||||
logger.info('========== PROMPT BEING SENT ==========');
|
||||
logger.info(`Prompt length: ${prompt.length} chars`);
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
|
||||
import * as secureFs from '../../lib/secure-fs.js';
|
||||
import type { EventEmitter } from '../../lib/events.js';
|
||||
import {
|
||||
specOutputSchema,
|
||||
specToXml,
|
||||
getStructuredSpecPromptInstruction,
|
||||
type SpecOutput,
|
||||
} from '../../lib/app-spec-format.js';
|
||||
import { specOutputSchema, specToXml, type SpecOutput } from '../../lib/app-spec-format.js';
|
||||
import { createLogger } from '@automaker/utils';
|
||||
import { DEFAULT_PHASE_MODELS, isCursorModel } from '@automaker/types';
|
||||
import { resolvePhaseModel } from '@automaker/model-resolver';
|
||||
@@ -21,7 +16,7 @@ import { streamingQuery } from '../../providers/simple-query-service.js';
|
||||
import { generateFeaturesFromSpec } from './generate-features-from-spec.js';
|
||||
import { ensureAutomakerDir, getAppSpecPath } from '@automaker/platform';
|
||||
import type { SettingsService } from '../../services/settings-service.js';
|
||||
import { getAutoLoadClaudeMdSetting } from '../../lib/settings-helpers.js';
|
||||
import { getAutoLoadClaudeMdSetting, getPromptCustomization } from '../../lib/settings-helpers.js';
|
||||
|
||||
const logger = createLogger('SpecRegeneration');
|
||||
|
||||
@@ -43,6 +38,9 @@ export async function generateSpec(
|
||||
logger.info('analyzeProject:', analyzeProject);
|
||||
logger.info('maxFeatures:', maxFeatures);
|
||||
|
||||
// Get customized prompts from settings
|
||||
const prompts = await getPromptCustomization(settingsService, '[SpecRegeneration]');
|
||||
|
||||
// Build the prompt based on whether we should analyze the project
|
||||
let analysisInstructions = '';
|
||||
let techStackDefaults = '';
|
||||
@@ -66,9 +64,7 @@ export async function generateSpec(
|
||||
Use these technologies as the foundation for the specification.`;
|
||||
}
|
||||
|
||||
const prompt = `You are helping to define a software project specification.
|
||||
|
||||
IMPORTANT: Never ask for clarification or additional information. Use the information provided and make reasonable assumptions to create the best possible specification. If details are missing, infer them based on common patterns and best practices.
|
||||
const prompt = `${prompts.appSpec.generateSpecSystemPrompt}
|
||||
|
||||
Project Overview:
|
||||
${projectOverview}
|
||||
@@ -77,7 +73,7 @@ ${techStackDefaults}
|
||||
|
||||
${analysisInstructions}
|
||||
|
||||
${getStructuredSpecPromptInstruction()}`;
|
||||
${prompts.appSpec.structuredSpecInstructions}`;
|
||||
|
||||
logger.info('========== PROMPT BEING SENT ==========');
|
||||
logger.info(`Prompt length: ${prompt.length} chars`);
|
||||
|
||||
@@ -19,7 +19,10 @@ import { simpleQuery } from '../../../providers/simple-query-service.js';
|
||||
import * as secureFs from '../../../lib/secure-fs.js';
|
||||
import * as path from 'path';
|
||||
import type { SettingsService } from '../../../services/settings-service.js';
|
||||
import { getAutoLoadClaudeMdSetting } from '../../../lib/settings-helpers.js';
|
||||
import {
|
||||
getAutoLoadClaudeMdSetting,
|
||||
getPromptCustomization,
|
||||
} from '../../../lib/settings-helpers.js';
|
||||
|
||||
const logger = createLogger('DescribeFile');
|
||||
|
||||
@@ -130,11 +133,12 @@ export function createDescribeFileHandler(
|
||||
// Get the filename for context
|
||||
const fileName = path.basename(resolvedPath);
|
||||
|
||||
// Get customized prompts from settings
|
||||
const prompts = await getPromptCustomization(settingsService, '[DescribeFile]');
|
||||
|
||||
// Build prompt with file content passed as structured data
|
||||
// The file content is included directly, not via tool invocation
|
||||
const prompt = `Analyze the following file and provide a 1-2 sentence description suitable for use as context in an AI coding assistant. Focus on what the file contains, its purpose, and why an AI agent might want to use this context in the future (e.g., "API documentation for the authentication endpoints", "Configuration file for database connections", "Coding style guidelines for the project").
|
||||
|
||||
Respond with ONLY the description text, no additional formatting, preamble, or explanation.
|
||||
const prompt = `${prompts.contextDescription.describeFilePrompt}
|
||||
|
||||
File: ${fileName}${truncated ? ' (truncated)' : ''}
|
||||
|
||||
|
||||
@@ -19,7 +19,10 @@ import { simpleQuery } from '../../../providers/simple-query-service.js';
|
||||
import * as secureFs from '../../../lib/secure-fs.js';
|
||||
import * as path from 'path';
|
||||
import type { SettingsService } from '../../../services/settings-service.js';
|
||||
import { getAutoLoadClaudeMdSetting } from '../../../lib/settings-helpers.js';
|
||||
import {
|
||||
getAutoLoadClaudeMdSetting,
|
||||
getPromptCustomization,
|
||||
} from '../../../lib/settings-helpers.js';
|
||||
|
||||
const logger = createLogger('DescribeImage');
|
||||
|
||||
@@ -278,12 +281,11 @@ export function createDescribeImageHandler(
|
||||
|
||||
logger.info(`[${requestId}] Using model: ${model}`);
|
||||
|
||||
// Build the instruction text
|
||||
const instructionText =
|
||||
`Describe this image in 1-2 sentences suitable for use as context in an AI coding assistant. ` +
|
||||
`Focus on what the image shows and its purpose (e.g., "UI mockup showing login form with email/password fields", ` +
|
||||
`"Architecture diagram of microservices", "Screenshot of error message in terminal").\n\n` +
|
||||
`Respond with ONLY the description text, no additional formatting, preamble, or explanation.`;
|
||||
// Get customized prompts from settings
|
||||
const prompts = await getPromptCustomization(settingsService, '[DescribeImage]');
|
||||
|
||||
// Build the instruction text from centralized prompts
|
||||
const instructionText = prompts.contextDescription.describeImagePrompt;
|
||||
|
||||
// Build prompt based on provider capability
|
||||
// Some providers (like Cursor) may not support image content blocks
|
||||
|
||||
@@ -15,7 +15,7 @@ import { FeatureLoader } from '../../services/feature-loader.js';
|
||||
import { getAppSpecPath } from '@automaker/platform';
|
||||
import * as secureFs from '../../lib/secure-fs.js';
|
||||
import type { SettingsService } from '../../services/settings-service.js';
|
||||
import { getAutoLoadClaudeMdSetting } from '../../lib/settings-helpers.js';
|
||||
import { getAutoLoadClaudeMdSetting, getPromptCustomization } from '../../lib/settings-helpers.js';
|
||||
|
||||
const logger = createLogger('Suggestions');
|
||||
|
||||
@@ -137,11 +137,15 @@ export async function generateSuggestions(
|
||||
modelOverride?: string,
|
||||
thinkingLevelOverride?: ThinkingLevel
|
||||
): Promise<void> {
|
||||
// Get customized prompts from settings
|
||||
const prompts = await getPromptCustomization(settingsService, '[Suggestions]');
|
||||
|
||||
// Map suggestion types to their prompts
|
||||
const typePrompts: Record<string, string> = {
|
||||
features: 'Analyze this project and suggest new features that would add value.',
|
||||
refactoring: 'Analyze this project and identify refactoring opportunities.',
|
||||
security: 'Analyze this project for security vulnerabilities and suggest fixes.',
|
||||
performance: 'Analyze this project for performance issues and suggest optimizations.',
|
||||
features: prompts.suggestions.featuresPrompt,
|
||||
refactoring: prompts.suggestions.refactoringPrompt,
|
||||
security: prompts.suggestions.securityPrompt,
|
||||
performance: prompts.suggestions.performancePrompt,
|
||||
};
|
||||
|
||||
// Load existing context to avoid duplicates
|
||||
@@ -151,15 +155,7 @@ export async function generateSuggestions(
|
||||
${existingContext}
|
||||
|
||||
${existingContext ? '\nIMPORTANT: Do NOT suggest features that are already implemented or already in the backlog above. Focus on NEW ideas that complement what already exists.\n' : ''}
|
||||
Look at the codebase and provide 3-5 concrete suggestions.
|
||||
|
||||
For each suggestion, provide:
|
||||
1. A category (e.g., "User Experience", "Security", "Performance")
|
||||
2. A clear description of what to implement
|
||||
3. Priority (1=high, 2=medium, 3=low)
|
||||
4. Brief reasoning for why this would help
|
||||
|
||||
The response will be automatically formatted as structured JSON.`;
|
||||
${prompts.suggestions.baseTemplate}`;
|
||||
|
||||
// Don't send initial message - let the agent output speak for itself
|
||||
// The first agent message will be captured as an info entry
|
||||
|
||||
@@ -13,6 +13,13 @@ import {
|
||||
Info,
|
||||
AlertTriangle,
|
||||
GitCommitHorizontal,
|
||||
Type,
|
||||
CheckCircle,
|
||||
Lightbulb,
|
||||
FileCode,
|
||||
FileText,
|
||||
Wand2,
|
||||
Cog,
|
||||
} from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import type { PromptCustomization, CustomPrompt } from '@automaker/types';
|
||||
@@ -22,6 +29,13 @@ import {
|
||||
DEFAULT_BACKLOG_PLAN_PROMPTS,
|
||||
DEFAULT_ENHANCEMENT_PROMPTS,
|
||||
DEFAULT_COMMIT_MESSAGE_PROMPTS,
|
||||
DEFAULT_TITLE_GENERATION_PROMPTS,
|
||||
DEFAULT_ISSUE_VALIDATION_PROMPTS,
|
||||
DEFAULT_IDEATION_PROMPTS,
|
||||
DEFAULT_APP_SPEC_PROMPTS,
|
||||
DEFAULT_CONTEXT_DESCRIPTION_PROMPTS,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS,
|
||||
} from '@automaker/prompts';
|
||||
|
||||
interface PromptCustomizationSectionProps {
|
||||
@@ -221,7 +235,7 @@ export function PromptCustomizationSection({
|
||||
{/* Tabs */}
|
||||
<div className="p-6">
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab}>
|
||||
<TabsList className="grid grid-cols-5 w-full">
|
||||
<TabsList className="grid grid-cols-4 gap-1 h-auto w-full bg-transparent p-0">
|
||||
<TabsTrigger value="auto-mode" className="gap-2">
|
||||
<Bot className="w-4 h-4" />
|
||||
Auto Mode
|
||||
@@ -232,7 +246,7 @@ export function PromptCustomizationSection({
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="backlog-plan" className="gap-2">
|
||||
<KanbanSquare className="w-4 h-4" />
|
||||
Backlog Plan
|
||||
Backlog
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="enhancement" className="gap-2">
|
||||
<Sparkles className="w-4 h-4" />
|
||||
@@ -242,6 +256,34 @@ export function PromptCustomizationSection({
|
||||
<GitCommitHorizontal className="w-4 h-4" />
|
||||
Commit
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="title-generation" className="gap-2">
|
||||
<Type className="w-4 h-4" />
|
||||
Title
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="issue-validation" className="gap-2">
|
||||
<CheckCircle className="w-4 h-4" />
|
||||
Issues
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="ideation" className="gap-2">
|
||||
<Lightbulb className="w-4 h-4" />
|
||||
Ideation
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="app-spec" className="gap-2">
|
||||
<FileCode className="w-4 h-4" />
|
||||
App Spec
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="context-description" className="gap-2">
|
||||
<FileText className="w-4 h-4" />
|
||||
Context
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="suggestions" className="gap-2">
|
||||
<Wand2 className="w-4 h-4" />
|
||||
Suggestions
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="task-execution" className="gap-2">
|
||||
<Cog className="w-4 h-4" />
|
||||
Tasks
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
{/* Auto Mode Tab */}
|
||||
@@ -313,6 +355,71 @@ export function PromptCustomizationSection({
|
||||
critical={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Template Prompts Section */}
|
||||
<div className="pt-4 border-t border-border/50">
|
||||
<h4 className="text-sm font-medium text-muted-foreground mb-4">Template Prompts</h4>
|
||||
|
||||
{/* Info Banner for Templates */}
|
||||
<div className="flex items-start gap-3 p-4 rounded-xl bg-blue-500/10 border border-blue-500/20 mb-4">
|
||||
<Info className="w-5 h-5 text-blue-500 mt-0.5 flex-shrink-0" />
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm text-foreground font-medium">Template Variables</p>
|
||||
<p className="text-xs text-muted-foreground/80 leading-relaxed">
|
||||
Template prompts use Handlebars syntax for variable substitution. Available
|
||||
variables include{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">{'{{featureId}}'}</code>,{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">{'{{title}}'}</code>,{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">
|
||||
{'{{description}}'}
|
||||
</code>
|
||||
, etc.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Feature Prompt Template"
|
||||
description="Template for building feature implementation prompts. Variables: featureId, title, description, spec, imagePaths, dependencies, verificationInstructions"
|
||||
defaultValue={DEFAULT_AUTO_MODE_PROMPTS.featurePromptTemplate}
|
||||
customValue={promptCustomization?.autoMode?.featurePromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('autoMode', 'featurePromptTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Follow-up Prompt Template"
|
||||
description="Template for follow-up prompts when resuming work. Variables: featurePrompt, previousContext, followUpInstructions"
|
||||
defaultValue={DEFAULT_AUTO_MODE_PROMPTS.followUpPromptTemplate}
|
||||
customValue={promptCustomization?.autoMode?.followUpPromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('autoMode', 'followUpPromptTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Continuation Prompt Template"
|
||||
description="Template for continuation prompts. Variables: featurePrompt, previousContext"
|
||||
defaultValue={DEFAULT_AUTO_MODE_PROMPTS.continuationPromptTemplate}
|
||||
customValue={promptCustomization?.autoMode?.continuationPromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('autoMode', 'continuationPromptTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Pipeline Step Prompt Template"
|
||||
description="Template for pipeline step execution prompts. Variables: stepName, featurePrompt, previousContext, stepInstructions"
|
||||
defaultValue={DEFAULT_AUTO_MODE_PROMPTS.pipelineStepPromptTemplate}
|
||||
customValue={promptCustomization?.autoMode?.pipelineStepPromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('autoMode', 'pipelineStepPromptTemplate', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Agent Tab */}
|
||||
@@ -379,6 +486,17 @@ export function PromptCustomizationSection({
|
||||
onCustomValueChange={(value) => updatePrompt('backlogPlan', 'systemPrompt', value)}
|
||||
critical={true}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="User Prompt Template"
|
||||
description="Template for the user prompt sent to the AI. Variables: currentFeatures, userRequest"
|
||||
defaultValue={DEFAULT_BACKLOG_PLAN_PROMPTS.userPromptTemplate}
|
||||
customValue={promptCustomization?.backlogPlan?.userPromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('backlogPlan', 'userPromptTemplate', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
@@ -477,6 +595,402 @@ export function PromptCustomizationSection({
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Title Generation Tab */}
|
||||
<TabsContent value="title-generation" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Title Generation Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('titleGeneration')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="System Prompt"
|
||||
description="Instructions for generating concise, descriptive feature titles from descriptions. Used when auto-generating titles for new features."
|
||||
defaultValue={DEFAULT_TITLE_GENERATION_PROMPTS.systemPrompt}
|
||||
customValue={promptCustomization?.titleGeneration?.systemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('titleGeneration', 'systemPrompt', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Issue Validation Tab */}
|
||||
<TabsContent value="issue-validation" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Issue Validation Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('issueValidation')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Critical Warning for Issue Validation */}
|
||||
<div className="flex items-start gap-3 p-4 rounded-xl bg-amber-500/10 border border-amber-500/20">
|
||||
<AlertTriangle className="w-5 h-5 text-amber-500 mt-0.5 flex-shrink-0" />
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm text-foreground font-medium">Warning: Critical Prompt</p>
|
||||
<p className="text-xs text-muted-foreground/80 leading-relaxed">
|
||||
The issue validation prompt guides the AI through a structured validation process
|
||||
and expects specific output format. Modifying this prompt incorrectly may affect
|
||||
validation accuracy.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="System Prompt"
|
||||
description="Instructions for validating GitHub issues against the codebase. Guides the AI to determine if issues are valid, invalid, or need clarification."
|
||||
defaultValue={DEFAULT_ISSUE_VALIDATION_PROMPTS.systemPrompt}
|
||||
customValue={promptCustomization?.issueValidation?.systemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('issueValidation', 'systemPrompt', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Ideation Tab */}
|
||||
<TabsContent value="ideation" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Ideation Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('ideation')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Ideation Chat System Prompt"
|
||||
description="System prompt for AI-powered ideation chat conversations. Guides the AI to brainstorm and suggest feature ideas."
|
||||
defaultValue={DEFAULT_IDEATION_PROMPTS.ideationSystemPrompt}
|
||||
customValue={promptCustomization?.ideation?.ideationSystemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('ideation', 'ideationSystemPrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Suggestions System Prompt"
|
||||
description="System prompt for generating structured feature suggestions. Used when generating batch suggestions from prompts."
|
||||
defaultValue={DEFAULT_IDEATION_PROMPTS.suggestionsSystemPrompt}
|
||||
customValue={promptCustomization?.ideation?.suggestionsSystemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('ideation', 'suggestionsSystemPrompt', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* App Spec Tab */}
|
||||
<TabsContent value="app-spec" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">App Specification Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('appSpec')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Generate Spec System Prompt"
|
||||
description="System prompt for generating project specifications from overview"
|
||||
defaultValue={DEFAULT_APP_SPEC_PROMPTS.generateSpecSystemPrompt}
|
||||
customValue={promptCustomization?.appSpec?.generateSpecSystemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('appSpec', 'generateSpecSystemPrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Structured Spec Instructions"
|
||||
description="Instructions for structured specification output format"
|
||||
defaultValue={DEFAULT_APP_SPEC_PROMPTS.structuredSpecInstructions}
|
||||
customValue={promptCustomization?.appSpec?.structuredSpecInstructions}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('appSpec', 'structuredSpecInstructions', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Generate Features from Spec"
|
||||
description="Prompt for generating features from a project specification"
|
||||
defaultValue={DEFAULT_APP_SPEC_PROMPTS.generateFeaturesFromSpecPrompt}
|
||||
customValue={promptCustomization?.appSpec?.generateFeaturesFromSpecPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('appSpec', 'generateFeaturesFromSpecPrompt', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Context Description Tab */}
|
||||
<TabsContent value="context-description" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Context Description Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('contextDescription')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Describe File Prompt"
|
||||
description="Prompt for generating descriptions of text files added as context"
|
||||
defaultValue={DEFAULT_CONTEXT_DESCRIPTION_PROMPTS.describeFilePrompt}
|
||||
customValue={promptCustomization?.contextDescription?.describeFilePrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('contextDescription', 'describeFilePrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Describe Image Prompt"
|
||||
description="Prompt for generating descriptions of images added as context"
|
||||
defaultValue={DEFAULT_CONTEXT_DESCRIPTION_PROMPTS.describeImagePrompt}
|
||||
customValue={promptCustomization?.contextDescription?.describeImagePrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('contextDescription', 'describeImagePrompt', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Suggestions Tab */}
|
||||
<TabsContent value="suggestions" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Suggestions Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('suggestions')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Features Suggestion Prompt"
|
||||
description="Prompt for analyzing the project and suggesting new features"
|
||||
defaultValue={DEFAULT_SUGGESTIONS_PROMPTS.featuresPrompt}
|
||||
customValue={promptCustomization?.suggestions?.featuresPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('suggestions', 'featuresPrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Refactoring Suggestion Prompt"
|
||||
description="Prompt for identifying refactoring opportunities"
|
||||
defaultValue={DEFAULT_SUGGESTIONS_PROMPTS.refactoringPrompt}
|
||||
customValue={promptCustomization?.suggestions?.refactoringPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('suggestions', 'refactoringPrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Security Suggestion Prompt"
|
||||
description="Prompt for analyzing security vulnerabilities"
|
||||
defaultValue={DEFAULT_SUGGESTIONS_PROMPTS.securityPrompt}
|
||||
customValue={promptCustomization?.suggestions?.securityPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('suggestions', 'securityPrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Performance Suggestion Prompt"
|
||||
description="Prompt for identifying performance issues"
|
||||
defaultValue={DEFAULT_SUGGESTIONS_PROMPTS.performancePrompt}
|
||||
customValue={promptCustomization?.suggestions?.performancePrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('suggestions', 'performancePrompt', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Base Template"
|
||||
description="Base template applied to all suggestion types"
|
||||
defaultValue={DEFAULT_SUGGESTIONS_PROMPTS.baseTemplate}
|
||||
customValue={promptCustomization?.suggestions?.baseTemplate}
|
||||
onCustomValueChange={(value) => updatePrompt('suggestions', 'baseTemplate', value)}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
|
||||
{/* Task Execution Tab */}
|
||||
<TabsContent value="task-execution" className="space-y-6 mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-sm font-medium text-foreground">Task Execution Prompts</h3>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => resetToDefaults('taskExecution')}
|
||||
className="gap-2"
|
||||
>
|
||||
<RotateCcw className="w-3 h-3" />
|
||||
Reset Section
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Info Banner for Task Execution */}
|
||||
<div className="flex items-start gap-3 p-4 rounded-xl bg-blue-500/10 border border-blue-500/20">
|
||||
<Info className="w-5 h-5 text-blue-500 mt-0.5 flex-shrink-0" />
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm text-foreground font-medium">Template Variables</p>
|
||||
<p className="text-xs text-muted-foreground/80 leading-relaxed">
|
||||
Task execution prompts use Handlebars syntax for variable substitution. Variables
|
||||
include{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">{'{{taskId}}'}</code>,{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">
|
||||
{'{{taskDescription}}'}
|
||||
</code>
|
||||
,{' '}
|
||||
<code className="px-1 py-0.5 rounded bg-muted text-xs">
|
||||
{'{{completedTasks}}'}
|
||||
</code>
|
||||
, etc.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<PromptField
|
||||
label="Task Prompt Template"
|
||||
description="Template for building individual task execution prompts"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.taskPromptTemplate}
|
||||
customValue={promptCustomization?.taskExecution?.taskPromptTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'taskPromptTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Implementation Instructions"
|
||||
description="Instructions appended to feature implementation prompts"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.implementationInstructions}
|
||||
customValue={promptCustomization?.taskExecution?.implementationInstructions}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'implementationInstructions', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Playwright Verification Instructions"
|
||||
description="Instructions for automated Playwright verification (when enabled)"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.playwrightVerificationInstructions}
|
||||
customValue={promptCustomization?.taskExecution?.playwrightVerificationInstructions}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'playwrightVerificationInstructions', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Learning Extraction System Prompt"
|
||||
description="System prompt for extracting learnings/ADRs from implementation output"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.learningExtractionSystemPrompt}
|
||||
customValue={promptCustomization?.taskExecution?.learningExtractionSystemPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'learningExtractionSystemPrompt', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Learning Extraction User Template"
|
||||
description="User prompt template for learning extraction. Variables: featureTitle, implementationLog"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.learningExtractionUserPromptTemplate}
|
||||
customValue={
|
||||
promptCustomization?.taskExecution?.learningExtractionUserPromptTemplate
|
||||
}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'learningExtractionUserPromptTemplate', value)
|
||||
}
|
||||
critical={true}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Plan Revision Template"
|
||||
description="Template for prompting plan revisions. Variables: planVersion, previousPlan, userFeedback"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.planRevisionTemplate}
|
||||
customValue={promptCustomization?.taskExecution?.planRevisionTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'planRevisionTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Continuation After Approval Template"
|
||||
description="Template for continuation after plan approval. Variables: userFeedback, approvedPlan"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.continuationAfterApprovalTemplate}
|
||||
customValue={promptCustomization?.taskExecution?.continuationAfterApprovalTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'continuationAfterApprovalTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Resume Feature Template"
|
||||
description="Template for resuming interrupted features. Variables: featurePrompt, previousContext"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.resumeFeatureTemplate}
|
||||
customValue={promptCustomization?.taskExecution?.resumeFeatureTemplate}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'resumeFeatureTemplate', value)
|
||||
}
|
||||
/>
|
||||
|
||||
<PromptField
|
||||
label="Project Analysis Prompt"
|
||||
description="Prompt for AI-powered project analysis"
|
||||
defaultValue={DEFAULT_TASK_EXECUTION_PROMPTS.projectAnalysisPrompt}
|
||||
customValue={promptCustomization?.taskExecution?.projectAnalysisPrompt}
|
||||
onCustomValueChange={(value) =>
|
||||
updatePrompt('taskExecution', 'projectAnalysisPrompt', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,9 @@ import type {
|
||||
ResolvedBacklogPlanPrompts,
|
||||
ResolvedEnhancementPrompts,
|
||||
ResolvedCommitMessagePrompts,
|
||||
ResolvedTitleGenerationPrompts,
|
||||
ResolvedIssueValidationPrompts,
|
||||
ResolvedIdeationPrompts,
|
||||
} from '@automaker/types';
|
||||
import { STATIC_PORT, SERVER_PORT } from '@automaker/types';
|
||||
|
||||
@@ -464,6 +467,482 @@ export const DEFAULT_COMMIT_MESSAGE_PROMPTS: ResolvedCommitMessagePrompts = {
|
||||
systemPrompt: DEFAULT_COMMIT_MESSAGE_SYSTEM_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* TITLE GENERATION PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_TITLE_GENERATION_SYSTEM_PROMPT = `You are a title generator. Your task is to create a concise, descriptive title (5-10 words max) for a software feature based on its description.
|
||||
|
||||
Rules:
|
||||
- Output ONLY the title, nothing else
|
||||
- Keep it short and action-oriented (e.g., "Add dark mode toggle", "Fix login validation")
|
||||
- Start with a verb when possible (Add, Fix, Update, Implement, Create, etc.)
|
||||
- No quotes, periods, or extra formatting
|
||||
- Capture the essence of the feature in a scannable way`;
|
||||
|
||||
/**
|
||||
* Default Title Generation prompts (for AI feature title generation)
|
||||
*/
|
||||
export const DEFAULT_TITLE_GENERATION_PROMPTS: ResolvedTitleGenerationPrompts = {
|
||||
systemPrompt: DEFAULT_TITLE_GENERATION_SYSTEM_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* ISSUE VALIDATION PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_ISSUE_VALIDATION_SYSTEM_PROMPT = `You are an expert code analyst validating GitHub issues against a codebase.
|
||||
|
||||
Your task is to analyze a GitHub issue and determine if it's valid by scanning the codebase.
|
||||
|
||||
## Validation Process
|
||||
|
||||
1. **Read the issue carefully** - Understand what is being reported or requested
|
||||
2. **Search the codebase** - Use Glob to find relevant files by pattern, Grep to search for keywords
|
||||
3. **Examine the code** - Use Read to look at the actual implementation in relevant files
|
||||
4. **Check linked PRs** - If there are linked pull requests, use \`gh pr diff <PR_NUMBER>\` to review the changes
|
||||
5. **Form your verdict** - Based on your analysis, determine if the issue is valid
|
||||
|
||||
## Verdicts
|
||||
|
||||
- **valid**: The issue describes a real problem that exists in the codebase, or a clear feature request that can be implemented. The referenced files/components exist and the issue is actionable.
|
||||
|
||||
- **invalid**: The issue describes behavior that doesn't exist, references non-existent files or components, is based on a misunderstanding of the code, or the described "bug" is actually expected behavior.
|
||||
|
||||
- **needs_clarification**: The issue lacks sufficient detail to verify. Specify what additional information is needed in the missingInfo field.
|
||||
|
||||
## For Bug Reports, Check:
|
||||
- Do the referenced files/components exist?
|
||||
- Does the code match what the issue describes?
|
||||
- Is the described behavior actually a bug or expected?
|
||||
- Can you locate the code that would cause the reported issue?
|
||||
|
||||
## For Feature Requests, Check:
|
||||
- Does the feature already exist?
|
||||
- Is the implementation location clear?
|
||||
- Is the request technically feasible given the codebase structure?
|
||||
|
||||
## Analyzing Linked Pull Requests
|
||||
|
||||
When an issue has linked PRs (especially open ones), you MUST analyze them:
|
||||
|
||||
1. **Run \`gh pr diff <PR_NUMBER>\`** to see what changes the PR makes
|
||||
2. **Run \`gh pr view <PR_NUMBER>\`** to see PR description and status
|
||||
3. **Evaluate if the PR fixes the issue** - Does the diff address the reported problem?
|
||||
4. **Provide a recommendation**:
|
||||
- \`wait_for_merge\`: The PR appears to fix the issue correctly. No additional work needed - just wait for it to be merged.
|
||||
- \`pr_needs_work\`: The PR attempts to fix the issue but is incomplete or has problems.
|
||||
- \`no_pr\`: No relevant PR exists for this issue.
|
||||
|
||||
5. **Include prAnalysis in your response** with:
|
||||
- hasOpenPR: true/false
|
||||
- prFixesIssue: true/false (based on diff analysis)
|
||||
- prNumber: the PR number you analyzed
|
||||
- prSummary: brief description of what the PR changes
|
||||
- recommendation: one of the above values
|
||||
|
||||
## Response Guidelines
|
||||
|
||||
- **Always include relatedFiles** when you find relevant code
|
||||
- **Set bugConfirmed to true** only if you can definitively confirm a bug exists in the code
|
||||
- **Provide a suggestedFix** when you have a clear idea of how to address the issue
|
||||
- **Use missingInfo** when the verdict is needs_clarification to list what's needed
|
||||
- **Include prAnalysis** when there are linked PRs - this is critical for avoiding duplicate work
|
||||
- **Set estimatedComplexity** to help prioritize:
|
||||
- trivial: Simple text changes, one-line fixes
|
||||
- simple: Small changes to one file
|
||||
- moderate: Changes to multiple files or moderate logic changes
|
||||
- complex: Significant refactoring or new feature implementation
|
||||
- very_complex: Major architectural changes or cross-cutting concerns
|
||||
|
||||
Be thorough in your analysis but focus on files that are directly relevant to the issue.`;
|
||||
|
||||
/**
|
||||
* Default Issue Validation prompts (for GitHub issue validation)
|
||||
*/
|
||||
export const DEFAULT_ISSUE_VALIDATION_PROMPTS: ResolvedIssueValidationPrompts = {
|
||||
systemPrompt: DEFAULT_ISSUE_VALIDATION_SYSTEM_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* IDEATION PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_IDEATION_SYSTEM_PROMPT = `You are an AI product strategist and UX expert helping brainstorm ideas for improving a software project.
|
||||
|
||||
Your role is to:
|
||||
- Analyze the codebase structure and patterns
|
||||
- Identify opportunities for improvement
|
||||
- Suggest actionable ideas with clear rationale
|
||||
- Consider user experience, technical feasibility, and business value
|
||||
- Be specific and reference actual files/components when possible
|
||||
|
||||
When suggesting ideas:
|
||||
1. Provide a clear, concise title
|
||||
2. Explain the problem or opportunity
|
||||
3. Describe the proposed solution
|
||||
4. Highlight the expected benefit
|
||||
5. Note any dependencies or considerations
|
||||
|
||||
IMPORTANT: Do NOT suggest features or ideas that already exist in the project. Check the "Existing Features" and "Existing Ideas" sections below to avoid duplicates.
|
||||
|
||||
Focus on practical, implementable suggestions that would genuinely improve the product.`;
|
||||
|
||||
export const DEFAULT_SUGGESTIONS_SYSTEM_PROMPT = `You are an AI product strategist helping brainstorm feature ideas for a software project.
|
||||
|
||||
IMPORTANT: You do NOT have access to any tools. You CANNOT read files, search code, or run commands.
|
||||
You must generate suggestions based ONLY on the project context provided below.
|
||||
Do NOT say "I'll analyze" or "Let me explore" - you cannot do those things.
|
||||
|
||||
Based on the project context and the user's prompt, generate creative and actionable feature suggestions.
|
||||
|
||||
YOUR RESPONSE MUST BE ONLY A JSON ARRAY - nothing else. No explanation, no preamble, no markdown code fences.
|
||||
|
||||
Each suggestion must have this structure:
|
||||
{
|
||||
"title": "Short, actionable title (max 60 chars)",
|
||||
"description": "Clear description of what to build or improve (2-3 sentences)",
|
||||
"rationale": "Why this is valuable - the problem it solves or opportunity it creates",
|
||||
"priority": "high" | "medium" | "low"
|
||||
}
|
||||
|
||||
Guidelines:
|
||||
- Be specific and actionable - avoid vague ideas
|
||||
- Mix different priority levels (some high, some medium, some low)
|
||||
- Each suggestion should be independently implementable
|
||||
- Think creatively - include both obvious improvements and innovative ideas
|
||||
- Consider the project's domain and target users
|
||||
- IMPORTANT: Do NOT suggest features or ideas that already exist in the "Existing Features" or "Existing Ideas" sections below`;
|
||||
|
||||
/**
|
||||
* Default Ideation prompts (for AI-powered brainstorming and suggestions)
|
||||
*/
|
||||
export const DEFAULT_IDEATION_PROMPTS: ResolvedIdeationPrompts = {
|
||||
ideationSystemPrompt: DEFAULT_IDEATION_SYSTEM_PROMPT,
|
||||
suggestionsSystemPrompt: DEFAULT_SUGGESTIONS_SYSTEM_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* APP SPEC PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_APP_SPEC_GENERATE_SYSTEM_PROMPT = `You are helping to define a software project specification.
|
||||
|
||||
IMPORTANT: Never ask for clarification or additional information. Use the information provided and make reasonable assumptions to create the best possible specification. If details are missing, infer them based on common patterns and best practices.`;
|
||||
|
||||
export const DEFAULT_APP_SPEC_STRUCTURED_INSTRUCTIONS = `Analyze the project and provide a comprehensive specification with:
|
||||
|
||||
1. **project_name**: The name of the project
|
||||
2. **overview**: A comprehensive description of what the project does, its purpose, and key goals
|
||||
3. **technology_stack**: List all technologies, frameworks, libraries, and tools used
|
||||
4. **core_capabilities**: List the main features and capabilities the project provides
|
||||
5. **implemented_features**: For each implemented feature, provide:
|
||||
- name: Feature name
|
||||
- description: What it does
|
||||
- file_locations: Key files where it's implemented (optional)
|
||||
6. **additional_requirements**: Any system requirements, dependencies, or constraints (optional)
|
||||
7. **development_guidelines**: Development standards and best practices (optional)
|
||||
8. **implementation_roadmap**: Project phases with status (completed/in_progress/pending) (optional)
|
||||
|
||||
Be thorough in your analysis. The output will be automatically formatted as structured JSON.`;
|
||||
|
||||
export const DEFAULT_GENERATE_FEATURES_FROM_SPEC_PROMPT = `Generate a prioritized list of implementable features. For each feature provide:
|
||||
|
||||
1. **id**: A unique lowercase-hyphenated identifier
|
||||
2. **category**: Functional category (e.g., "Core", "UI", "API", "Authentication", "Database")
|
||||
3. **title**: Short descriptive title
|
||||
4. **description**: What this feature does (2-3 sentences)
|
||||
5. **priority**: 1 (high), 2 (medium), or 3 (low)
|
||||
6. **complexity**: "simple", "moderate", or "complex"
|
||||
7. **dependencies**: Array of feature IDs this depends on (can be empty)
|
||||
|
||||
Format as JSON:
|
||||
{
|
||||
"features": [
|
||||
{
|
||||
"id": "feature-id",
|
||||
"category": "Feature Category",
|
||||
"title": "Feature Title",
|
||||
"description": "What it does",
|
||||
"priority": 1,
|
||||
"complexity": "moderate",
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Generate features that build on each other logically.
|
||||
|
||||
IMPORTANT: Do not ask for clarification. The specification is provided above. Generate the JSON immediately.`;
|
||||
|
||||
/**
|
||||
* Default App Spec prompts (for project specification generation)
|
||||
*/
|
||||
export const DEFAULT_APP_SPEC_PROMPTS: import('@automaker/types').ResolvedAppSpecPrompts = {
|
||||
generateSpecSystemPrompt: DEFAULT_APP_SPEC_GENERATE_SYSTEM_PROMPT,
|
||||
structuredSpecInstructions: DEFAULT_APP_SPEC_STRUCTURED_INSTRUCTIONS,
|
||||
generateFeaturesFromSpecPrompt: DEFAULT_GENERATE_FEATURES_FROM_SPEC_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* CONTEXT DESCRIPTION PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_DESCRIBE_FILE_PROMPT = `Analyze the following file and provide a 1-2 sentence description suitable for use as context in an AI coding assistant. Focus on what the file contains, its purpose, and why an AI agent might want to use this context in the future (e.g., "API documentation for the authentication endpoints", "Configuration file for database connections", "Coding style guidelines for the project").
|
||||
|
||||
Respond with ONLY the description text, no additional formatting, preamble, or explanation.`;
|
||||
|
||||
export const DEFAULT_DESCRIBE_IMAGE_PROMPT = `Describe this image in 1-2 sentences suitable for use as context in an AI coding assistant. Focus on what the image shows and its purpose (e.g., "UI mockup showing login form with email/password fields", "Architecture diagram of microservices", "Screenshot of error message in terminal").
|
||||
|
||||
Respond with ONLY the description text, no additional formatting, preamble, or explanation.`;
|
||||
|
||||
/**
|
||||
* Default Context Description prompts (for file/image descriptions)
|
||||
*/
|
||||
export const DEFAULT_CONTEXT_DESCRIPTION_PROMPTS: import('@automaker/types').ResolvedContextDescriptionPrompts =
|
||||
{
|
||||
describeFilePrompt: DEFAULT_DESCRIBE_FILE_PROMPT,
|
||||
describeImagePrompt: DEFAULT_DESCRIBE_IMAGE_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* SUGGESTIONS PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_SUGGESTIONS_FEATURES_PROMPT =
|
||||
'Analyze this project and suggest new features that would add value.';
|
||||
export const DEFAULT_SUGGESTIONS_REFACTORING_PROMPT =
|
||||
'Analyze this project and identify refactoring opportunities.';
|
||||
export const DEFAULT_SUGGESTIONS_SECURITY_PROMPT =
|
||||
'Analyze this project for security vulnerabilities and suggest fixes.';
|
||||
export const DEFAULT_SUGGESTIONS_PERFORMANCE_PROMPT =
|
||||
'Analyze this project for performance issues and suggest optimizations.';
|
||||
|
||||
export const DEFAULT_SUGGESTIONS_BASE_TEMPLATE = `Look at the codebase and provide 3-5 concrete suggestions.
|
||||
|
||||
For each suggestion, provide:
|
||||
1. A category (e.g., "User Experience", "Security", "Performance")
|
||||
2. A clear description of what to implement
|
||||
3. Priority (1=high, 2=medium, 3=low)
|
||||
4. Brief reasoning for why this would help
|
||||
|
||||
The response will be automatically formatted as structured JSON.`;
|
||||
|
||||
/**
|
||||
* Default Suggestions prompts (for features, refactoring, security, performance)
|
||||
*/
|
||||
export const DEFAULT_SUGGESTIONS_PROMPTS: import('@automaker/types').ResolvedSuggestionsPrompts = {
|
||||
featuresPrompt: DEFAULT_SUGGESTIONS_FEATURES_PROMPT,
|
||||
refactoringPrompt: DEFAULT_SUGGESTIONS_REFACTORING_PROMPT,
|
||||
securityPrompt: DEFAULT_SUGGESTIONS_SECURITY_PROMPT,
|
||||
performancePrompt: DEFAULT_SUGGESTIONS_PERFORMANCE_PROMPT,
|
||||
baseTemplate: DEFAULT_SUGGESTIONS_BASE_TEMPLATE,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* TASK EXECUTION PROMPTS
|
||||
* ========================================================================
|
||||
*/
|
||||
|
||||
export const DEFAULT_TASK_PROMPT_TEMPLATE = `# Task Execution: {{taskId}}
|
||||
|
||||
You are executing a specific task as part of a larger feature implementation.
|
||||
|
||||
## Your Current Task
|
||||
|
||||
**Task ID:** {{taskId}}
|
||||
**Description:** {{taskDescription}}
|
||||
{{#if filePath}}**Primary File:** {{filePath}}{{/if}}
|
||||
{{#if phase}}**Phase:** {{phase}}{{/if}}
|
||||
|
||||
## Context
|
||||
|
||||
{{#if completedTasks}}
|
||||
### Already Completed ({{completedTasksCount}} tasks)
|
||||
{{#each completedTasks}}
|
||||
- [x] {{id}}: {{description}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{#if remainingTasks}}
|
||||
### Remaining Tasks ({{remainingTasksCount}} tasks)
|
||||
{{#each remainingTasks}}
|
||||
- [ ] {{id}}: {{description}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{#if userFeedback}}
|
||||
## User Feedback
|
||||
{{userFeedback}}
|
||||
{{/if}}
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Focus ONLY on completing task {{taskId}}: "{{taskDescription}}"
|
||||
2. Do not work on other tasks
|
||||
3. Use the existing codebase patterns
|
||||
4. When done, summarize what you implemented
|
||||
|
||||
Begin implementing task {{taskId}} now.`;
|
||||
|
||||
export const DEFAULT_IMPLEMENTATION_INSTRUCTIONS = `## Instructions
|
||||
|
||||
Implement this feature by:
|
||||
1. First, explore the codebase to understand the existing structure
|
||||
2. Plan your implementation approach
|
||||
3. Write the necessary code changes
|
||||
4. Ensure the code follows existing patterns and conventions
|
||||
|
||||
When done, wrap your final summary in <summary> tags like this:
|
||||
|
||||
<summary>
|
||||
## Summary: [Feature Title]
|
||||
|
||||
### Changes Implemented
|
||||
- [List of changes made]
|
||||
|
||||
### Files Modified
|
||||
- [List of files]
|
||||
|
||||
### Notes for Developer
|
||||
- [Any important notes]
|
||||
</summary>
|
||||
|
||||
This helps parse your summary correctly in the output logs.`;
|
||||
|
||||
export const DEFAULT_PLAYWRIGHT_VERIFICATION_INSTRUCTIONS = `## Verification with Playwright (REQUIRED)
|
||||
|
||||
After implementing the feature, you MUST verify it works correctly using Playwright:
|
||||
|
||||
1. **Create a temporary Playwright test** to verify the feature works as expected
|
||||
2. **Run the test** to confirm the feature is working
|
||||
3. **Delete the test file** after verification - this is a temporary verification test, not a permanent test suite addition
|
||||
|
||||
Example verification workflow:
|
||||
\`\`\`bash
|
||||
# Create a simple verification test
|
||||
npx playwright test my-verification-test.spec.ts
|
||||
|
||||
# After successful verification, delete the test
|
||||
rm my-verification-test.spec.ts
|
||||
\`\`\`
|
||||
|
||||
The test should verify the core functionality of the feature. If the test fails, fix the implementation and re-test.
|
||||
|
||||
When done, include in your summary:
|
||||
|
||||
### Verification Status
|
||||
- [Describe how the feature was verified with Playwright]`;
|
||||
|
||||
export const DEFAULT_LEARNING_EXTRACTION_SYSTEM_PROMPT =
|
||||
'You are a JSON extraction assistant. You MUST respond with ONLY valid JSON, no explanations, no markdown, no other text. Extract learnings from the provided implementation context and return them as JSON.';
|
||||
|
||||
export const DEFAULT_LEARNING_EXTRACTION_USER_TEMPLATE = `You are an Architecture Decision Record (ADR) extractor. Analyze this implementation and return ONLY JSON with learnings. No explanations.
|
||||
|
||||
Feature: "{{featureTitle}}"
|
||||
|
||||
Implementation log:
|
||||
{{implementationLog}}
|
||||
|
||||
Extract MEANINGFUL learnings - not obvious things. For each, capture:
|
||||
- DECISIONS: Why this approach vs alternatives? What would break if changed?
|
||||
- GOTCHAS: What was unexpected? What's the root cause? How to avoid?
|
||||
- PATTERNS: Why this pattern? What problem does it solve? Trade-offs?
|
||||
|
||||
JSON format ONLY (no markdown, no text):
|
||||
{"learnings": [{
|
||||
"category": "architecture|api|ui|database|auth|testing|performance|security|gotchas",
|
||||
"type": "decision|gotcha|pattern",
|
||||
"content": "What was done/learned",
|
||||
"context": "Problem being solved or situation faced",
|
||||
"why": "Reasoning - why this approach",
|
||||
"rejected": "Alternative considered and why rejected",
|
||||
"tradeoffs": "What became easier/harder",
|
||||
"breaking": "What breaks if this is changed/removed"
|
||||
}]}
|
||||
|
||||
IMPORTANT: Only include NON-OBVIOUS learnings with real reasoning. Skip trivial patterns.
|
||||
If nothing notable: {"learnings": []}`;
|
||||
|
||||
export const DEFAULT_PLAN_REVISION_TEMPLATE = `The user has requested revisions to the plan/specification.
|
||||
|
||||
## Previous Plan (v{{planVersion}})
|
||||
{{previousPlan}}
|
||||
|
||||
## User Feedback
|
||||
{{userFeedback}}
|
||||
|
||||
## Instructions
|
||||
Please regenerate the specification incorporating the user's feedback.
|
||||
Keep the same format with the \`\`\`tasks block for task definitions.
|
||||
After generating the revised spec, output:
|
||||
"[SPEC_GENERATED] Please review the revised specification above."`;
|
||||
|
||||
export const DEFAULT_CONTINUATION_AFTER_APPROVAL_TEMPLATE = `The plan/specification has been approved. Now implement it.
|
||||
{{#if userFeedback}}
|
||||
|
||||
## User Feedback
|
||||
{{userFeedback}}
|
||||
{{/if}}
|
||||
|
||||
## Approved Plan
|
||||
|
||||
{{approvedPlan}}
|
||||
|
||||
## Instructions
|
||||
|
||||
Implement all the changes described in the plan above.`;
|
||||
|
||||
export const DEFAULT_RESUME_FEATURE_TEMPLATE = `## Continuing Feature Implementation
|
||||
|
||||
{{featurePrompt}}
|
||||
|
||||
## Previous Context
|
||||
The following is the output from a previous implementation attempt. Continue from where you left off:
|
||||
|
||||
{{previousContext}}
|
||||
|
||||
## Instructions
|
||||
Review the previous work and continue the implementation. If the feature appears complete, verify it works correctly.`;
|
||||
|
||||
export const DEFAULT_PROJECT_ANALYSIS_PROMPT = `Analyze this project and provide a summary of:
|
||||
1. Project structure and architecture
|
||||
2. Main technologies and frameworks used
|
||||
3. Key components and their responsibilities
|
||||
4. Build and test commands
|
||||
5. Any existing conventions or patterns
|
||||
|
||||
Format your response as a structured markdown document.`;
|
||||
|
||||
/**
|
||||
* Default Task Execution prompts (for Auto Mode task execution, learning extraction)
|
||||
*/
|
||||
export const DEFAULT_TASK_EXECUTION_PROMPTS: import('@automaker/types').ResolvedTaskExecutionPrompts =
|
||||
{
|
||||
taskPromptTemplate: DEFAULT_TASK_PROMPT_TEMPLATE,
|
||||
implementationInstructions: DEFAULT_IMPLEMENTATION_INSTRUCTIONS,
|
||||
playwrightVerificationInstructions: DEFAULT_PLAYWRIGHT_VERIFICATION_INSTRUCTIONS,
|
||||
learningExtractionSystemPrompt: DEFAULT_LEARNING_EXTRACTION_SYSTEM_PROMPT,
|
||||
learningExtractionUserPromptTemplate: DEFAULT_LEARNING_EXTRACTION_USER_TEMPLATE,
|
||||
planRevisionTemplate: DEFAULT_PLAN_REVISION_TEMPLATE,
|
||||
continuationAfterApprovalTemplate: DEFAULT_CONTINUATION_AFTER_APPROVAL_TEMPLATE,
|
||||
resumeFeatureTemplate: DEFAULT_RESUME_FEATURE_TEMPLATE,
|
||||
projectAnalysisPrompt: DEFAULT_PROJECT_ANALYSIS_PROMPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* ========================================================================
|
||||
* COMBINED DEFAULTS
|
||||
@@ -479,4 +958,11 @@ export const DEFAULT_PROMPTS = {
|
||||
backlogPlan: DEFAULT_BACKLOG_PLAN_PROMPTS,
|
||||
enhancement: DEFAULT_ENHANCEMENT_PROMPTS,
|
||||
commitMessage: DEFAULT_COMMIT_MESSAGE_PROMPTS,
|
||||
titleGeneration: DEFAULT_TITLE_GENERATION_PROMPTS,
|
||||
issueValidation: DEFAULT_ISSUE_VALIDATION_PROMPTS,
|
||||
ideation: DEFAULT_IDEATION_PROMPTS,
|
||||
appSpec: DEFAULT_APP_SPEC_PROMPTS,
|
||||
contextDescription: DEFAULT_CONTEXT_DESCRIPTION_PROMPTS,
|
||||
suggestions: DEFAULT_SUGGESTIONS_PROMPTS,
|
||||
taskExecution: DEFAULT_TASK_EXECUTION_PROMPTS,
|
||||
} as const;
|
||||
|
||||
@@ -43,6 +43,40 @@ export {
|
||||
DEFAULT_ENHANCEMENT_PROMPTS,
|
||||
DEFAULT_COMMIT_MESSAGE_SYSTEM_PROMPT,
|
||||
DEFAULT_COMMIT_MESSAGE_PROMPTS,
|
||||
DEFAULT_TITLE_GENERATION_SYSTEM_PROMPT,
|
||||
DEFAULT_TITLE_GENERATION_PROMPTS,
|
||||
DEFAULT_ISSUE_VALIDATION_SYSTEM_PROMPT,
|
||||
DEFAULT_ISSUE_VALIDATION_PROMPTS,
|
||||
DEFAULT_IDEATION_SYSTEM_PROMPT,
|
||||
DEFAULT_SUGGESTIONS_SYSTEM_PROMPT,
|
||||
DEFAULT_IDEATION_PROMPTS,
|
||||
// App Spec prompts
|
||||
DEFAULT_APP_SPEC_GENERATE_SYSTEM_PROMPT,
|
||||
DEFAULT_APP_SPEC_STRUCTURED_INSTRUCTIONS,
|
||||
DEFAULT_GENERATE_FEATURES_FROM_SPEC_PROMPT,
|
||||
DEFAULT_APP_SPEC_PROMPTS,
|
||||
// Context Description prompts
|
||||
DEFAULT_DESCRIBE_FILE_PROMPT,
|
||||
DEFAULT_DESCRIBE_IMAGE_PROMPT,
|
||||
DEFAULT_CONTEXT_DESCRIPTION_PROMPTS,
|
||||
// Suggestions prompts
|
||||
DEFAULT_SUGGESTIONS_FEATURES_PROMPT,
|
||||
DEFAULT_SUGGESTIONS_REFACTORING_PROMPT,
|
||||
DEFAULT_SUGGESTIONS_SECURITY_PROMPT,
|
||||
DEFAULT_SUGGESTIONS_PERFORMANCE_PROMPT,
|
||||
DEFAULT_SUGGESTIONS_BASE_TEMPLATE,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS,
|
||||
// Task Execution prompts
|
||||
DEFAULT_TASK_PROMPT_TEMPLATE,
|
||||
DEFAULT_IMPLEMENTATION_INSTRUCTIONS,
|
||||
DEFAULT_PLAYWRIGHT_VERIFICATION_INSTRUCTIONS,
|
||||
DEFAULT_LEARNING_EXTRACTION_SYSTEM_PROMPT,
|
||||
DEFAULT_LEARNING_EXTRACTION_USER_TEMPLATE,
|
||||
DEFAULT_PLAN_REVISION_TEMPLATE,
|
||||
DEFAULT_CONTINUATION_AFTER_APPROVAL_TEMPLATE,
|
||||
DEFAULT_RESUME_FEATURE_TEMPLATE,
|
||||
DEFAULT_PROJECT_ANALYSIS_PROMPT,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS,
|
||||
DEFAULT_PROMPTS,
|
||||
} from './defaults.js';
|
||||
|
||||
@@ -53,6 +87,13 @@ export {
|
||||
mergeBacklogPlanPrompts,
|
||||
mergeEnhancementPrompts,
|
||||
mergeCommitMessagePrompts,
|
||||
mergeTitleGenerationPrompts,
|
||||
mergeIssueValidationPrompts,
|
||||
mergeIdeationPrompts,
|
||||
mergeAppSpecPrompts,
|
||||
mergeContextDescriptionPrompts,
|
||||
mergeSuggestionsPrompts,
|
||||
mergeTaskExecutionPrompts,
|
||||
mergeAllPrompts,
|
||||
} from './merge.js';
|
||||
|
||||
@@ -63,4 +104,11 @@ export type {
|
||||
ResolvedBacklogPlanPrompts,
|
||||
ResolvedEnhancementPrompts,
|
||||
ResolvedCommitMessagePrompts,
|
||||
ResolvedTitleGenerationPrompts,
|
||||
ResolvedIssueValidationPrompts,
|
||||
ResolvedIdeationPrompts,
|
||||
ResolvedAppSpecPrompts,
|
||||
ResolvedContextDescriptionPrompts,
|
||||
ResolvedSuggestionsPrompts,
|
||||
ResolvedTaskExecutionPrompts,
|
||||
} from '@automaker/types';
|
||||
|
||||
@@ -15,12 +15,26 @@ import type {
|
||||
BacklogPlanPrompts,
|
||||
EnhancementPrompts,
|
||||
CommitMessagePrompts,
|
||||
TitleGenerationPrompts,
|
||||
IssueValidationPrompts,
|
||||
IdeationPrompts,
|
||||
AppSpecPrompts,
|
||||
ContextDescriptionPrompts,
|
||||
SuggestionsPrompts,
|
||||
TaskExecutionPrompts,
|
||||
CustomPrompt,
|
||||
ResolvedAutoModePrompts,
|
||||
ResolvedAgentPrompts,
|
||||
ResolvedBacklogPlanPrompts,
|
||||
ResolvedEnhancementPrompts,
|
||||
ResolvedCommitMessagePrompts,
|
||||
ResolvedTitleGenerationPrompts,
|
||||
ResolvedIssueValidationPrompts,
|
||||
ResolvedIdeationPrompts,
|
||||
ResolvedAppSpecPrompts,
|
||||
ResolvedContextDescriptionPrompts,
|
||||
ResolvedSuggestionsPrompts,
|
||||
ResolvedTaskExecutionPrompts,
|
||||
} from '@automaker/types';
|
||||
import {
|
||||
DEFAULT_AUTO_MODE_PROMPTS,
|
||||
@@ -28,6 +42,13 @@ import {
|
||||
DEFAULT_BACKLOG_PLAN_PROMPTS,
|
||||
DEFAULT_ENHANCEMENT_PROMPTS,
|
||||
DEFAULT_COMMIT_MESSAGE_PROMPTS,
|
||||
DEFAULT_TITLE_GENERATION_PROMPTS,
|
||||
DEFAULT_ISSUE_VALIDATION_PROMPTS,
|
||||
DEFAULT_IDEATION_PROMPTS,
|
||||
DEFAULT_APP_SPEC_PROMPTS,
|
||||
DEFAULT_CONTEXT_DESCRIPTION_PROMPTS,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS,
|
||||
} from './defaults.js';
|
||||
|
||||
/**
|
||||
@@ -135,6 +156,166 @@ export function mergeCommitMessagePrompts(
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Title Generation prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeTitleGenerationPrompts(
|
||||
custom?: TitleGenerationPrompts
|
||||
): ResolvedTitleGenerationPrompts {
|
||||
return {
|
||||
systemPrompt: resolvePrompt(
|
||||
custom?.systemPrompt,
|
||||
DEFAULT_TITLE_GENERATION_PROMPTS.systemPrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Issue Validation prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeIssueValidationPrompts(
|
||||
custom?: IssueValidationPrompts
|
||||
): ResolvedIssueValidationPrompts {
|
||||
return {
|
||||
systemPrompt: resolvePrompt(
|
||||
custom?.systemPrompt,
|
||||
DEFAULT_ISSUE_VALIDATION_PROMPTS.systemPrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Ideation prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeIdeationPrompts(custom?: IdeationPrompts): ResolvedIdeationPrompts {
|
||||
return {
|
||||
ideationSystemPrompt: resolvePrompt(
|
||||
custom?.ideationSystemPrompt,
|
||||
DEFAULT_IDEATION_PROMPTS.ideationSystemPrompt
|
||||
),
|
||||
suggestionsSystemPrompt: resolvePrompt(
|
||||
custom?.suggestionsSystemPrompt,
|
||||
DEFAULT_IDEATION_PROMPTS.suggestionsSystemPrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom App Spec prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeAppSpecPrompts(custom?: AppSpecPrompts): ResolvedAppSpecPrompts {
|
||||
return {
|
||||
generateSpecSystemPrompt: resolvePrompt(
|
||||
custom?.generateSpecSystemPrompt,
|
||||
DEFAULT_APP_SPEC_PROMPTS.generateSpecSystemPrompt
|
||||
),
|
||||
structuredSpecInstructions: resolvePrompt(
|
||||
custom?.structuredSpecInstructions,
|
||||
DEFAULT_APP_SPEC_PROMPTS.structuredSpecInstructions
|
||||
),
|
||||
generateFeaturesFromSpecPrompt: resolvePrompt(
|
||||
custom?.generateFeaturesFromSpecPrompt,
|
||||
DEFAULT_APP_SPEC_PROMPTS.generateFeaturesFromSpecPrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Context Description prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeContextDescriptionPrompts(
|
||||
custom?: ContextDescriptionPrompts
|
||||
): ResolvedContextDescriptionPrompts {
|
||||
return {
|
||||
describeFilePrompt: resolvePrompt(
|
||||
custom?.describeFilePrompt,
|
||||
DEFAULT_CONTEXT_DESCRIPTION_PROMPTS.describeFilePrompt
|
||||
),
|
||||
describeImagePrompt: resolvePrompt(
|
||||
custom?.describeImagePrompt,
|
||||
DEFAULT_CONTEXT_DESCRIPTION_PROMPTS.describeImagePrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Suggestions prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeSuggestionsPrompts(custom?: SuggestionsPrompts): ResolvedSuggestionsPrompts {
|
||||
return {
|
||||
featuresPrompt: resolvePrompt(
|
||||
custom?.featuresPrompt,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS.featuresPrompt
|
||||
),
|
||||
refactoringPrompt: resolvePrompt(
|
||||
custom?.refactoringPrompt,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS.refactoringPrompt
|
||||
),
|
||||
securityPrompt: resolvePrompt(
|
||||
custom?.securityPrompt,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS.securityPrompt
|
||||
),
|
||||
performancePrompt: resolvePrompt(
|
||||
custom?.performancePrompt,
|
||||
DEFAULT_SUGGESTIONS_PROMPTS.performancePrompt
|
||||
),
|
||||
baseTemplate: resolvePrompt(custom?.baseTemplate, DEFAULT_SUGGESTIONS_PROMPTS.baseTemplate),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Task Execution prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeTaskExecutionPrompts(
|
||||
custom?: TaskExecutionPrompts
|
||||
): ResolvedTaskExecutionPrompts {
|
||||
return {
|
||||
taskPromptTemplate: resolvePrompt(
|
||||
custom?.taskPromptTemplate,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.taskPromptTemplate
|
||||
),
|
||||
implementationInstructions: resolvePrompt(
|
||||
custom?.implementationInstructions,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.implementationInstructions
|
||||
),
|
||||
playwrightVerificationInstructions: resolvePrompt(
|
||||
custom?.playwrightVerificationInstructions,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.playwrightVerificationInstructions
|
||||
),
|
||||
learningExtractionSystemPrompt: resolvePrompt(
|
||||
custom?.learningExtractionSystemPrompt,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.learningExtractionSystemPrompt
|
||||
),
|
||||
learningExtractionUserPromptTemplate: resolvePrompt(
|
||||
custom?.learningExtractionUserPromptTemplate,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.learningExtractionUserPromptTemplate
|
||||
),
|
||||
planRevisionTemplate: resolvePrompt(
|
||||
custom?.planRevisionTemplate,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.planRevisionTemplate
|
||||
),
|
||||
continuationAfterApprovalTemplate: resolvePrompt(
|
||||
custom?.continuationAfterApprovalTemplate,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.continuationAfterApprovalTemplate
|
||||
),
|
||||
resumeFeatureTemplate: resolvePrompt(
|
||||
custom?.resumeFeatureTemplate,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.resumeFeatureTemplate
|
||||
),
|
||||
projectAnalysisPrompt: resolvePrompt(
|
||||
custom?.projectAnalysisPrompt,
|
||||
DEFAULT_TASK_EXECUTION_PROMPTS.projectAnalysisPrompt
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge all custom prompts with defaults
|
||||
* Returns a complete PromptCustomization with all fields populated
|
||||
@@ -146,5 +327,12 @@ export function mergeAllPrompts(custom?: PromptCustomization) {
|
||||
backlogPlan: mergeBacklogPlanPrompts(custom?.backlogPlan),
|
||||
enhancement: mergeEnhancementPrompts(custom?.enhancement),
|
||||
commitMessage: mergeCommitMessagePrompts(custom?.commitMessage),
|
||||
titleGeneration: mergeTitleGenerationPrompts(custom?.titleGeneration),
|
||||
issueValidation: mergeIssueValidationPrompts(custom?.issueValidation),
|
||||
ideation: mergeIdeationPrompts(custom?.ideation),
|
||||
appSpec: mergeAppSpecPrompts(custom?.appSpec),
|
||||
contextDescription: mergeContextDescriptionPrompts(custom?.contextDescription),
|
||||
suggestions: mergeSuggestionsPrompts(custom?.suggestions),
|
||||
taskExecution: mergeTaskExecutionPrompts(custom?.taskExecution),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,12 +100,26 @@ export type {
|
||||
BacklogPlanPrompts,
|
||||
EnhancementPrompts,
|
||||
CommitMessagePrompts,
|
||||
TitleGenerationPrompts,
|
||||
IssueValidationPrompts,
|
||||
IdeationPrompts,
|
||||
AppSpecPrompts,
|
||||
ContextDescriptionPrompts,
|
||||
SuggestionsPrompts,
|
||||
TaskExecutionPrompts,
|
||||
PromptCustomization,
|
||||
ResolvedAutoModePrompts,
|
||||
ResolvedAgentPrompts,
|
||||
ResolvedBacklogPlanPrompts,
|
||||
ResolvedEnhancementPrompts,
|
||||
ResolvedCommitMessagePrompts,
|
||||
ResolvedTitleGenerationPrompts,
|
||||
ResolvedIssueValidationPrompts,
|
||||
ResolvedIdeationPrompts,
|
||||
ResolvedAppSpecPrompts,
|
||||
ResolvedContextDescriptionPrompts,
|
||||
ResolvedSuggestionsPrompts,
|
||||
ResolvedTaskExecutionPrompts,
|
||||
} from './prompts.js';
|
||||
export { DEFAULT_PROMPT_CUSTOMIZATION } from './prompts.js';
|
||||
|
||||
|
||||
@@ -104,6 +104,125 @@ export interface CommitMessagePrompts {
|
||||
systemPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* TitleGenerationPrompts - Customizable prompts for AI feature title generation
|
||||
*
|
||||
* Controls how the AI generates short, descriptive titles for features.
|
||||
*/
|
||||
export interface TitleGenerationPrompts {
|
||||
/** System prompt for generating feature titles from descriptions */
|
||||
systemPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* IssueValidationPrompts - Customizable prompts for GitHub issue validation
|
||||
*
|
||||
* Controls how the AI validates GitHub issues against the codebase,
|
||||
* determining if issues are valid, invalid, or need clarification.
|
||||
*/
|
||||
export interface IssueValidationPrompts {
|
||||
/** System prompt for validating GitHub issues against codebase */
|
||||
systemPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* IdeationPrompts - Customizable prompts for AI-powered ideation and brainstorming
|
||||
*
|
||||
* Controls how the AI generates feature ideas and suggestions for the project.
|
||||
*/
|
||||
export interface IdeationPrompts {
|
||||
/** System prompt for ideation chat conversations */
|
||||
ideationSystemPrompt?: CustomPrompt;
|
||||
|
||||
/** System prompt for generating feature suggestions */
|
||||
suggestionsSystemPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* AppSpecPrompts - Customizable prompts for project specification generation
|
||||
*
|
||||
* Controls how the AI generates project specifications and features from specs.
|
||||
*/
|
||||
export interface AppSpecPrompts {
|
||||
/** System prompt for generating project specifications */
|
||||
generateSpecSystemPrompt?: CustomPrompt;
|
||||
|
||||
/** Instructions for structured specification output format */
|
||||
structuredSpecInstructions?: CustomPrompt;
|
||||
|
||||
/** System prompt for generating features from a specification */
|
||||
generateFeaturesFromSpecPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* ContextDescriptionPrompts - Customizable prompts for context file/image descriptions
|
||||
*
|
||||
* Controls how the AI describes context files and images.
|
||||
*/
|
||||
export interface ContextDescriptionPrompts {
|
||||
/** System prompt for describing text files added as context */
|
||||
describeFilePrompt?: CustomPrompt;
|
||||
|
||||
/** System prompt for describing images added as context */
|
||||
describeImagePrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* SuggestionsPrompts - Customizable prompts for generating various suggestions
|
||||
*
|
||||
* Controls how the AI generates feature, refactoring, security, and performance suggestions.
|
||||
*/
|
||||
export interface SuggestionsPrompts {
|
||||
/** Prompt for generating new feature suggestions */
|
||||
featuresPrompt?: CustomPrompt;
|
||||
|
||||
/** Prompt for generating refactoring suggestions */
|
||||
refactoringPrompt?: CustomPrompt;
|
||||
|
||||
/** Prompt for generating security suggestions */
|
||||
securityPrompt?: CustomPrompt;
|
||||
|
||||
/** Prompt for generating performance suggestions */
|
||||
performancePrompt?: CustomPrompt;
|
||||
|
||||
/** Base template for all suggestion types */
|
||||
baseTemplate?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* TaskExecutionPrompts - Customizable prompts for Auto Mode task execution
|
||||
*
|
||||
* Controls how the AI executes tasks, extracts learnings, and handles continuations.
|
||||
*/
|
||||
export interface TaskExecutionPrompts {
|
||||
/** Template for building task execution prompts */
|
||||
taskPromptTemplate?: CustomPrompt;
|
||||
|
||||
/** Instructions appended to feature implementation prompts */
|
||||
implementationInstructions?: CustomPrompt;
|
||||
|
||||
/** Instructions for Playwright verification (when enabled) */
|
||||
playwrightVerificationInstructions?: CustomPrompt;
|
||||
|
||||
/** System prompt for extracting learnings/ADRs from implementation */
|
||||
learningExtractionSystemPrompt?: CustomPrompt;
|
||||
|
||||
/** User prompt template for learning extraction */
|
||||
learningExtractionUserPromptTemplate?: CustomPrompt;
|
||||
|
||||
/** Template for prompting plan revisions */
|
||||
planRevisionTemplate?: CustomPrompt;
|
||||
|
||||
/** Template for continuation after plan approval */
|
||||
continuationAfterApprovalTemplate?: CustomPrompt;
|
||||
|
||||
/** Template for resuming interrupted features */
|
||||
resumeFeatureTemplate?: CustomPrompt;
|
||||
|
||||
/** Template for project analysis */
|
||||
projectAnalysisPrompt?: CustomPrompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* PromptCustomization - Complete set of customizable prompts
|
||||
*
|
||||
@@ -125,6 +244,27 @@ export interface PromptCustomization {
|
||||
|
||||
/** Commit message prompts (AI-generated commit messages) */
|
||||
commitMessage?: CommitMessagePrompts;
|
||||
|
||||
/** Title generation prompts (AI-generated feature titles) */
|
||||
titleGeneration?: TitleGenerationPrompts;
|
||||
|
||||
/** Issue validation prompts (GitHub issue validation) */
|
||||
issueValidation?: IssueValidationPrompts;
|
||||
|
||||
/** Ideation prompts (AI-powered brainstorming and suggestions) */
|
||||
ideation?: IdeationPrompts;
|
||||
|
||||
/** App specification prompts (project spec generation) */
|
||||
appSpec?: AppSpecPrompts;
|
||||
|
||||
/** Context description prompts (file/image descriptions) */
|
||||
contextDescription?: ContextDescriptionPrompts;
|
||||
|
||||
/** Suggestions prompts (features, refactoring, security, performance) */
|
||||
suggestions?: SuggestionsPrompts;
|
||||
|
||||
/** Task execution prompts (Auto Mode task execution, learning extraction) */
|
||||
taskExecution?: TaskExecutionPrompts;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,6 +276,13 @@ export const DEFAULT_PROMPT_CUSTOMIZATION: PromptCustomization = {
|
||||
backlogPlan: {},
|
||||
enhancement: {},
|
||||
commitMessage: {},
|
||||
titleGeneration: {},
|
||||
issueValidation: {},
|
||||
ideation: {},
|
||||
appSpec: {},
|
||||
contextDescription: {},
|
||||
suggestions: {},
|
||||
taskExecution: {},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -173,3 +320,47 @@ export interface ResolvedEnhancementPrompts {
|
||||
export interface ResolvedCommitMessagePrompts {
|
||||
systemPrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedTitleGenerationPrompts {
|
||||
systemPrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedIssueValidationPrompts {
|
||||
systemPrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedIdeationPrompts {
|
||||
ideationSystemPrompt: string;
|
||||
suggestionsSystemPrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedAppSpecPrompts {
|
||||
generateSpecSystemPrompt: string;
|
||||
structuredSpecInstructions: string;
|
||||
generateFeaturesFromSpecPrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedContextDescriptionPrompts {
|
||||
describeFilePrompt: string;
|
||||
describeImagePrompt: string;
|
||||
}
|
||||
|
||||
export interface ResolvedSuggestionsPrompts {
|
||||
featuresPrompt: string;
|
||||
refactoringPrompt: string;
|
||||
securityPrompt: string;
|
||||
performancePrompt: string;
|
||||
baseTemplate: string;
|
||||
}
|
||||
|
||||
export interface ResolvedTaskExecutionPrompts {
|
||||
taskPromptTemplate: string;
|
||||
implementationInstructions: string;
|
||||
playwrightVerificationInstructions: string;
|
||||
learningExtractionSystemPrompt: string;
|
||||
learningExtractionUserPromptTemplate: string;
|
||||
planRevisionTemplate: string;
|
||||
continuationAfterApprovalTemplate: string;
|
||||
resumeFeatureTemplate: string;
|
||||
projectAnalysisPrompt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user