-
Notifications
You must be signed in to change notification settings - Fork 482
feat: centralize prompts and add customization UI for App Spec, Context, Suggestions, Tasks #501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…xt, 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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis PR introduces centralized prompt customization infrastructure across the application. It adds new prompt type definitions, merge utilities for combining custom and default prompts, and wires SettingsService through route handlers to enable dynamic, user-configurable prompts throughout multiple features including title generation, issue validation, app spec generation, context description, suggestions, and ideation. Changes
Sequence DiagramsequenceDiagram
participant UI as Settings UI
participant SS as SettingsService
participant SH as settings-helpers
participant PM as Prompt Library
participant RH as Route Handler
UI->>SS: Save custom prompts<br/>(titleGeneration, issueValidation, etc.)
Note over SS: Store customization<br/>by context/category
RH->>SH: getPromptCustomization(settingsService, '[Context]')
SH->>SS: Fetch stored customization
SS-->>SH: Return custom prompts (if any)
SH->>PM: mergeTitleGenerationPrompts(custom)
SH->>PM: mergeIssueValidationPrompts(custom)
SH->>PM: mergeSuggestionsPrompts(custom)<br/>(and others...)
PM-->>SH: Merged prompts<br/>(custom + defaults)
SH-->>RH: Resolved prompt object
RH->>RH: Use customized prompts<br/>in prompt construction
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's prompt customization capabilities by centralizing the management of various AI prompts and introducing a dedicated user interface for their configuration. It allows users to fine-tune prompts for App Specification generation, Context description, Suggestion generation, and Task Execution, moving away from hardcoded prompts to a flexible, user-configurable system. This change improves the adaptability and control users have over the AI's behavior across several core functionalities. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and valuable refactoring by centralizing various AI prompts into a customizable system. The changes are well-structured, adding new prompt categories, default values, and a comprehensive UI for customization in the settings. This greatly improves the maintainability and flexibility of the application. The code is clean and consistent across the backend and frontend. I've only found a minor inconsistency in how some types are imported, for which I've provided suggestions to improve code style.
- Fix inline type imports in defaults.ts (move to top-level imports) - Update ideation-service.ts to use centralized prompts from settings - Update generate-title.ts to use centralized prompts - Update validate-issue.ts to use centralized prompts - Clean up validation-schema.ts (prompts already centralized) - Minor server index cleanup Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a significant and well-executed refactoring to centralize AI prompts across the application. By moving hardcoded prompts into a dedicated @automaker/prompts package and introducing a comprehensive UI for customization, you've greatly improved the maintainability and flexibility of the system. The changes are consistent and cover many different features, from app spec generation to issue validation and ideation.
I've included a couple of suggestions to further improve the maintainability of the new UI code and the effectiveness of one of the new default prompts. Overall, this is an excellent contribution.
apps/ui/src/components/views/settings-view/prompts/prompt-customization-section.tsx
Outdated
Show resolved
Hide resolved
Update auto-mode-service.ts to use centralized Task Execution prompts from settings, making all 9 task execution prompts customizable via UI: - buildFeaturePrompt: uses implementationInstructions and playwrightVerificationInstructions from settings - buildTaskPrompt: uses taskPromptTemplate with variable substitution - buildPipelineStepPrompt: updated to pass prompts through - executeFeatureWithContext: uses resumeFeatureTemplate - resolvePlanApproval recovery: uses continuationAfterApprovalTemplate - Multi-agent continuation: uses continuationAfterApprovalTemplate - recordLearningsFromFeature: uses learningExtractionSystemPrompt and learningExtractionUserPromptTemplate All 12 prompt categories are now fully customizable from the UI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…} placeholder
- Create PromptTabContent reusable component in prompt-customization-section.tsx
- Update all tabs (Agent, Commit Message, Title Generation, Ideation, App Spec,
Context Description, Suggestions, Task Execution) to use the new component
- Add {{count}} placeholder to DEFAULT_SUGGESTIONS_SYSTEM_PROMPT for dynamic
suggestion count
Addresses PR review comments from Gemini.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace repetitive JSX with TAB_CONFIGS array defining all tabs and fields - Create reusable Banner component for info/warning banners - Create PromptFieldList component for rendering fields from config - Support nested sections (like Auto Mode's Template Prompts section) - Reduce file from ~950 lines to ~810 lines (-15% code) Benefits: - Adding new prompt tabs/fields is now declarative (just add to config) - Consistent structure enforced by TypeScript interfaces - Much easier to maintain and extend Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Split prompt-customization-section.tsx into focused modules: - types.ts (51 lines) - Type definitions - tab-configs.ts (448 lines) - Configuration data for all tabs - components.tsx (159 lines) - Reusable Banner, PromptField, PromptFieldList - prompt-customization-section.tsx (176 lines) - Main component Benefits: - Main component reduced from ~810 to 176 lines - Clear separation of concerns - Easier to find and modify specific parts - Configuration data isolated for easy updates Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request significantly refactors the prompt management system by centralizing prompt definitions and customization. It introduces new prompt categories for commit messages, title generation, issue validation, ideation, app specifications, context descriptions, suggestions, and task execution. The changes involve updating settings-helpers.ts to import and merge these new prompt types, and modifying various server-side routes and services (e.g., app-spec, context, features, github, suggestions, and auto-mode) to fetch and utilize these customizable prompts via a settingsService instead of relying on hardcoded strings or local constants. The UI components for prompt customization are also updated to reflect these new categories and provide a more structured interface for managing them.
- auto-mode-service-planning.test.ts: Add taskExecutionPrompts argument to buildFeaturePrompt calls, update test for implementation instructions - claude-usage-service.test.ts: Skip deprecated Mac tests (service now uses PTY for all platforms), rename Windows tests to PTY tests, update to use process.cwd() instead of home directory - claude-provider.test.ts: Add missing model parameter to environment variable passthrough tests All tests now pass (1093 passed, 23 skipped). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
@automaker/types(AppSpecPrompts, ContextDescriptionPrompts, SuggestionsPrompts, TaskExecutionPrompts) with resolved types@automaker/prompts/defaults.tsmerge.tssettings-helpers.tsgetPromptCustomization()to return all 12 categoriesTest plan
npm run build:packages && npm run build:server🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.