mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
feat(prompts): implement customizable commit message prompts
- Added a new section in the UI for customizing commit message prompts. - Integrated a system prompt for AI-generated commit messages, allowing users to define their own instructions. - Updated the backend to merge custom prompts with default settings for commit message generation. - Enhanced the commit message generation logic to utilize the effective system prompt based on user settings.
This commit is contained in:
@@ -14,17 +14,20 @@ import type {
|
||||
AgentPrompts,
|
||||
BacklogPlanPrompts,
|
||||
EnhancementPrompts,
|
||||
CommitMessagePrompts,
|
||||
CustomPrompt,
|
||||
ResolvedAutoModePrompts,
|
||||
ResolvedAgentPrompts,
|
||||
ResolvedBacklogPlanPrompts,
|
||||
ResolvedEnhancementPrompts,
|
||||
ResolvedCommitMessagePrompts,
|
||||
} from '@automaker/types';
|
||||
import {
|
||||
DEFAULT_AUTO_MODE_PROMPTS,
|
||||
DEFAULT_AGENT_PROMPTS,
|
||||
DEFAULT_BACKLOG_PLAN_PROMPTS,
|
||||
DEFAULT_ENHANCEMENT_PROMPTS,
|
||||
DEFAULT_COMMIT_MESSAGE_PROMPTS,
|
||||
} from './defaults.js';
|
||||
|
||||
/**
|
||||
@@ -120,6 +123,18 @@ export function mergeEnhancementPrompts(custom?: EnhancementPrompts): ResolvedEn
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge custom Commit Message prompts with defaults
|
||||
* Custom prompts override defaults only when enabled=true
|
||||
*/
|
||||
export function mergeCommitMessagePrompts(
|
||||
custom?: CommitMessagePrompts
|
||||
): ResolvedCommitMessagePrompts {
|
||||
return {
|
||||
systemPrompt: resolvePrompt(custom?.systemPrompt, DEFAULT_COMMIT_MESSAGE_PROMPTS.systemPrompt),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge all custom prompts with defaults
|
||||
* Returns a complete PromptCustomization with all fields populated
|
||||
@@ -130,5 +145,6 @@ export function mergeAllPrompts(custom?: PromptCustomization) {
|
||||
agent: mergeAgentPrompts(custom?.agent),
|
||||
backlogPlan: mergeBacklogPlanPrompts(custom?.backlogPlan),
|
||||
enhancement: mergeEnhancementPrompts(custom?.enhancement),
|
||||
commitMessage: mergeCommitMessagePrompts(custom?.commitMessage),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user