Merge branch: resolve conflict in worktree-actions-dropdown.tsx

This commit is contained in:
Kacper
2026-01-11 20:08:19 +01:00
118 changed files with 6327 additions and 1795 deletions

343
libs/platform/src/editor.ts Normal file
View File

@@ -0,0 +1,343 @@
/**
* Cross-platform editor detection and launching utilities
*
* Handles:
* - Detecting available code editors on the system
* - Cross-platform editor launching (handles Windows .cmd files)
* - Caching of detected editors for performance
*/
import { execFile, spawn, type ChildProcess } from 'child_process';
import { promisify } from 'util';
import { homedir } from 'os';
import { join } from 'path';
import { access } from 'fs/promises';
import type { EditorInfo } from '@automaker/types';
const execFileAsync = promisify(execFile);
// Platform detection
const isWindows = process.platform === 'win32';
const isMac = process.platform === 'darwin';
// Cache with TTL for editor detection
let cachedEditors: EditorInfo[] | null = null;
let cacheTimestamp: number = 0;
const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
/**
* Check if the editor cache is still valid
*/
function isCacheValid(): boolean {
return cachedEditors !== null && Date.now() - cacheTimestamp < CACHE_TTL_MS;
}
/**
* Clear the editor detection cache
* Useful when editors may have been installed/uninstalled
*/
export function clearEditorCache(): void {
cachedEditors = null;
cacheTimestamp = 0;
}
/**
* Check if a CLI command exists in PATH
* Uses platform-specific command lookup (where on Windows, which on Unix)
*/
export async function commandExists(cmd: string): Promise<boolean> {
try {
const whichCmd = isWindows ? 'where' : 'which';
await execFileAsync(whichCmd, [cmd]);
return true;
} catch {
return false;
}
}
/**
* Check if a macOS app bundle exists and return the path if found
* Checks both /Applications and ~/Applications
*/
async function findMacApp(appName: string): Promise<string | null> {
if (!isMac) return null;
// Check /Applications first
const systemAppPath = join('/Applications', `${appName}.app`);
try {
await access(systemAppPath);
return systemAppPath;
} catch {
// Not in /Applications
}
// Check ~/Applications (used by JetBrains Toolbox and others)
const userAppPath = join(homedir(), 'Applications', `${appName}.app`);
try {
await access(userAppPath);
return userAppPath;
} catch {
return null;
}
}
/**
* Editor definition with CLI command and macOS app bundle name
*/
interface EditorDefinition {
name: string;
cliCommand: string;
cliAliases?: readonly string[];
macAppName: string;
/** If true, only available on macOS */
macOnly?: boolean;
}
const ANTIGRAVITY_CLI_COMMANDS = ['antigravity', 'agy'] as const;
const [PRIMARY_ANTIGRAVITY_COMMAND, ...LEGACY_ANTIGRAVITY_COMMANDS] = ANTIGRAVITY_CLI_COMMANDS;
/**
* List of supported editors in priority order
*/
const SUPPORTED_EDITORS: EditorDefinition[] = [
{ name: 'Cursor', cliCommand: 'cursor', macAppName: 'Cursor' },
{ name: 'VS Code', cliCommand: 'code', macAppName: 'Visual Studio Code' },
{
name: 'VS Code Insiders',
cliCommand: 'code-insiders',
macAppName: 'Visual Studio Code - Insiders',
},
{ name: 'Kiro', cliCommand: 'kiro', macAppName: 'Kiro' },
{ name: 'Zed', cliCommand: 'zed', macAppName: 'Zed' },
{ name: 'Sublime Text', cliCommand: 'subl', macAppName: 'Sublime Text' },
{ name: 'Windsurf', cliCommand: 'windsurf', macAppName: 'Windsurf' },
{ name: 'Trae', cliCommand: 'trae', macAppName: 'Trae' },
{ name: 'Rider', cliCommand: 'rider', macAppName: 'Rider' },
{ name: 'WebStorm', cliCommand: 'webstorm', macAppName: 'WebStorm' },
{ name: 'Xcode', cliCommand: 'xed', macAppName: 'Xcode', macOnly: true },
{ name: 'Android Studio', cliCommand: 'studio', macAppName: 'Android Studio' },
{
name: 'Antigravity',
cliCommand: PRIMARY_ANTIGRAVITY_COMMAND,
cliAliases: LEGACY_ANTIGRAVITY_COMMANDS,
macAppName: 'Antigravity',
},
];
/**
* Check if Xcode is fully installed (not just Command Line Tools)
* xed command requires full Xcode.app, not just CLT
*/
async function isXcodeFullyInstalled(): Promise<boolean> {
if (!isMac) return false;
try {
// Check if xcode-select points to full Xcode, not just CommandLineTools
const { stdout } = await execFileAsync('xcode-select', ['-p']);
const devPath = stdout.trim();
// Full Xcode path: /Applications/Xcode.app/Contents/Developer
// Command Line Tools: /Library/Developer/CommandLineTools
const isPointingToXcode = devPath.includes('Xcode.app');
if (!isPointingToXcode && devPath.includes('CommandLineTools')) {
// Check if xed command exists (indicates CLT are installed)
const xedExists = await commandExists('xed');
// Check if Xcode.app actually exists
const xcodeAppPath = await findMacApp('Xcode');
if (xedExists && xcodeAppPath) {
console.warn(
'Xcode is installed but xcode-select is pointing to Command Line Tools. ' +
'To use Xcode as an editor, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'
);
}
}
return isPointingToXcode;
} catch {
return false;
}
}
/**
* Try to find an editor - checks CLI first, then macOS app bundle
* Returns EditorInfo if found, null otherwise
*/
async function findEditor(definition: EditorDefinition): Promise<EditorInfo | null> {
// Skip macOS-only editors on other platforms
if (definition.macOnly && !isMac) {
return null;
}
// Special handling for Xcode: verify full installation, not just xed command
if (definition.name === 'Xcode') {
if (!(await isXcodeFullyInstalled())) {
return null;
}
}
// Try CLI command first (works on all platforms)
const cliCandidates = [definition.cliCommand, ...(definition.cliAliases ?? [])];
for (const cliCommand of cliCandidates) {
if (await commandExists(cliCommand)) {
return { name: definition.name, command: cliCommand };
}
}
// Try macOS app bundle (checks /Applications and ~/Applications)
if (isMac) {
const appPath = await findMacApp(definition.macAppName);
if (appPath) {
// Use 'open -a' with full path for apps not in /Applications
return { name: definition.name, command: `open -a "${appPath}"` };
}
}
return null;
}
/**
* Get the platform-specific file manager
*/
function getFileManagerInfo(): EditorInfo {
if (isMac) {
return { name: 'Finder', command: 'open' };
} else if (isWindows) {
return { name: 'Explorer', command: 'explorer' };
} else {
return { name: 'File Manager', command: 'xdg-open' };
}
}
/**
* Detect all available code editors on the system
* Results are cached for 5 minutes for performance
*/
export async function detectAllEditors(): Promise<EditorInfo[]> {
// Return cached result if still valid
if (isCacheValid() && cachedEditors) {
return cachedEditors;
}
// Check all editors in parallel for better performance
const editorChecks = SUPPORTED_EDITORS.map((def) => findEditor(def));
const results = await Promise.all(editorChecks);
// Filter out null results (editors not found)
const editors = results.filter((e): e is EditorInfo => e !== null);
// Always add file manager as fallback
editors.push(getFileManagerInfo());
// Update cache
cachedEditors = editors;
cacheTimestamp = Date.now();
return editors;
}
/**
* Detect the default (first available) code editor on the system
* Returns the highest priority editor that is installed
*/
export async function detectDefaultEditor(): Promise<EditorInfo> {
const editors = await detectAllEditors();
// Return first editor (highest priority) - always exists due to file manager fallback
return editors[0];
}
/**
* Find a specific editor by command
* Returns the editor info if available, null otherwise
*/
export async function findEditorByCommand(command: string): Promise<EditorInfo | null> {
const editors = await detectAllEditors();
return editors.find((e) => e.command === command) ?? null;
}
/**
* Open a path in the specified editor
*
* Handles cross-platform differences:
* - On Windows, uses spawn with shell:true to handle .cmd batch scripts
* - On macOS, handles 'open -a' style commands for app bundles
* - On Linux, uses direct execution
*
* @param targetPath - The file or directory path to open
* @param editorCommand - The editor command to use (optional, uses default if not specified)
* @returns Promise that resolves with editor info when launched, rejects on error
*/
export async function openInEditor(
targetPath: string,
editorCommand?: string
): Promise<{ editorName: string }> {
// Determine which editor to use
let editor: EditorInfo;
if (editorCommand) {
const found = await findEditorByCommand(editorCommand);
if (found) {
editor = found;
} else {
// Fall back to default if specified editor not found
editor = await detectDefaultEditor();
}
} else {
editor = await detectDefaultEditor();
}
// Execute the editor
await executeEditorCommand(editor.command, targetPath);
return { editorName: editor.name };
}
/**
* Execute an editor command with a path argument
* Handles platform-specific differences in command execution
*/
async function executeEditorCommand(command: string, targetPath: string): Promise<void> {
// Handle 'open -a "AppPath"' style commands (macOS app bundles)
if (command.startsWith('open -a ')) {
const appPath = command.replace('open -a ', '').replace(/"/g, '');
await execFileAsync('open', ['-a', appPath, targetPath]);
return;
}
// On Windows, editor CLI commands are typically .cmd batch scripts
// spawn with shell:true is required to execute them properly
if (isWindows) {
return new Promise((resolve, reject) => {
const child: ChildProcess = spawn(command, [targetPath], {
shell: true,
stdio: 'ignore',
detached: true,
});
// Unref to allow the parent process to exit independently
child.unref();
child.on('error', (err) => {
reject(err);
});
// Resolve after a small delay to catch immediate spawn errors
// Editors run in background, so we don't wait for them to exit
setTimeout(() => resolve(), 100);
});
}
// Unix/macOS: use execFile for direct execution
await execFileAsync(command, [targetPath]);
}
/**
* Open a path in the platform's default file manager
* Always available as a fallback option
*/
export async function openInFileManager(targetPath: string): Promise<{ editorName: string }> {
const fileManager = getFileManagerInfo();
await execFileAsync(fileManager.command, [targetPath]);
return { editorName: fileManager.name };
}

View File

@@ -18,6 +18,7 @@ export {
getValidationPath,
getAppSpecPath,
getBranchTrackingPath,
getExecutionStatePath,
ensureAutomakerDir,
getGlobalSettingsPath,
getCredentialsPath,
@@ -158,3 +159,14 @@ export {
// Port configuration
export { STATIC_PORT, SERVER_PORT, RESERVED_PORTS } from './config/ports.js';
// Editor detection and launching (cross-platform)
export {
commandExists,
clearEditorCache,
detectAllEditors,
detectDefaultEditor,
findEditorByCommand,
openInEditor,
openInFileManager,
} from './editor.js';

View File

@@ -173,6 +173,19 @@ export function getBranchTrackingPath(projectPath: string): string {
return path.join(getAutomakerDir(projectPath), 'active-branches.json');
}
/**
* Get the execution state file path for a project
*
* Stores JSON metadata about auto-mode execution state for recovery on restart.
* Tracks which features were running and auto-loop configuration.
*
* @param projectPath - Absolute path to project directory
* @returns Absolute path to {projectPath}/.automaker/execution-state.json
*/
export function getExecutionStatePath(projectPath: string): string {
return path.join(getAutomakerDir(projectPath), 'execution-state.json');
}
/**
* Create the automaker directory structure for a project if it doesn't exist
*

View File

@@ -415,6 +415,7 @@ import {
TECHNICAL_SYSTEM_PROMPT,
SIMPLIFY_SYSTEM_PROMPT,
ACCEPTANCE_SYSTEM_PROMPT,
UX_REVIEWER_SYSTEM_PROMPT,
} from './enhancement.js';
/**
@@ -425,6 +426,7 @@ export const DEFAULT_ENHANCEMENT_PROMPTS: ResolvedEnhancementPrompts = {
technicalSystemPrompt: TECHNICAL_SYSTEM_PROMPT,
simplifySystemPrompt: SIMPLIFY_SYSTEM_PROMPT,
acceptanceSystemPrompt: ACCEPTANCE_SYSTEM_PROMPT,
uxReviewerSystemPrompt: UX_REVIEWER_SYSTEM_PROMPT,
};
/**

View File

@@ -0,0 +1,90 @@
/**
* "Acceptance" Enhancement Mode
* Adds testable acceptance criteria to task descriptions.
*/
import type { EnhancementExample } from '@automaker/types';
/**
* System prompt for the "acceptance" enhancement mode.
* Adds testable acceptance criteria to task descriptions.
*/
export const ACCEPTANCE_SYSTEM_PROMPT = `You are a QA specialist skilled at defining testable acceptance criteria for software features.
Your task is to enhance a task description by adding clear acceptance criteria:
1. UNDERSTAND the feature:
- Identify all user-facing behaviors
- Note system state changes
- Consider different user roles or scenarios
2. DEFINE acceptance criteria using Given-When-Then format:
- Given: The initial context or preconditions
- When: The action or trigger
- Then: The expected outcome
3. COVER key scenarios:
- Happy path (successful completion)
- Edge cases (boundary conditions)
- Error scenarios (what should NOT happen)
- Performance requirements if relevant
4. MAKE criteria testable:
- Use specific, measurable outcomes
- Avoid vague terms like "quickly" or "easily"
- Include specific values where applicable
Output the original description followed by a clear "Acceptance Criteria:" section with numbered, testable criteria. Do not include explanations about your process.`;
/**
* Few-shot examples for the "acceptance" enhancement mode
*/
export const ACCEPTANCE_EXAMPLES: EnhancementExample[] = [
{
input: 'Add password reset functionality',
output: `Add Password Reset Functionality
Allow users to reset their password via email when they forget it.
Acceptance Criteria:
1. Given a user is on the login page, when they click "Forgot Password", then they should see a password reset form requesting their email.
2. Given a user enters a valid registered email, when they submit the form, then they should receive a password reset email within 2 minutes.
3. Given a user clicks the reset link in their email, when the link is less than 1 hour old, then they should see a form to enter a new password.
4. Given a user enters a new valid password (min 8 chars, 1 number, 1 special char), when they submit, then their password should be updated and they should be redirected to login.
5. Given a user enters an unregistered email, when they submit the reset form, then they should see the same success message (security: don't reveal which emails exist).
6. Given a reset link older than 1 hour, when a user clicks it, then they should see an expiration message with option to request a new link.`,
},
{
input: 'Shopping cart checkout',
output: `Shopping Cart Checkout
Implement the checkout flow for purchasing items in the shopping cart.
Acceptance Criteria:
1. Given a user has items in their cart, when they click "Checkout", then they should see an order summary with item details and total price.
2. Given a user is on the checkout page, when they enter valid shipping information, then the form should validate in real-time and show estimated delivery date.
3. Given valid shipping info is entered, when the user proceeds to payment, then they should see available payment methods (credit card, PayPal).
4. Given valid payment details are entered, when the user confirms the order, then the payment should be processed and order confirmation displayed within 5 seconds.
5. Given a successful order, when confirmation is shown, then the user should receive an email receipt and their cart should be emptied.
6. Given a payment failure, when the error occurs, then the user should see a clear error message and their cart should remain intact.
7. Given the user closes the browser during checkout, when they return, then their cart contents should still be available.`,
},
];
/**
* Description of what this enhancement mode does
*/
export const ACCEPTANCE_DESCRIPTION = 'Add testable acceptance criteria to task descriptions';

View File

@@ -0,0 +1,88 @@
/**
* "Improve" Enhancement Mode
* Transforms vague or unclear requests into clear, actionable task descriptions.
*/
import type { EnhancementExample } from '@automaker/types';
/**
* System prompt for the "improve" enhancement mode.
* Transforms vague or unclear requests into clear, actionable task descriptions.
*/
export const IMPROVE_SYSTEM_PROMPT = `You are an expert at transforming vague, unclear, or incomplete task descriptions into clear, actionable specifications.
Your task is to take a user's rough description and improve it by:
1. ANALYZE the input:
- Identify the core intent behind the request
- Note any ambiguities or missing details
- Determine what success would look like
2. CLARIFY the scope:
- Define clear boundaries for the task
- Identify implicit requirements
- Add relevant context that may be assumed
3. STRUCTURE the output:
- Write a clear, actionable title
- Provide a concise description of what needs to be done
- Break down into specific sub-tasks if appropriate
4. ENHANCE with details:
- Add specific, measurable outcomes where possible
- Include edge cases to consider
- Note any dependencies or prerequisites
Output ONLY the improved task description. Do not include explanations, markdown formatting, or meta-commentary about your changes.`;
/**
* Few-shot examples for the "improve" enhancement mode
*/
export const IMPROVE_EXAMPLES: EnhancementExample[] = [
{
input: 'add dark mode',
output: `Add Dark Mode Theme Support
Implement a dark mode option that allows users to switch between light and dark themes throughout the application.
Requirements:
- Add a theme toggle switch in the settings area
- Store user's theme preference persistently
- Apply dark theme colors to all UI components
- Respect system preference as default if user hasn't set a preference
- Ensure smooth transition when switching themes`,
},
{
input: 'fix the login bug',
output: `Fix Login Authentication Flow
Investigate and resolve issues preventing users from successfully logging in to the application.
Requirements:
- Identify the specific failure point in the login process
- Ensure proper credential validation
- Handle error states with clear user feedback
- Verify session token is correctly stored after successful login
- Test with various credential combinations (valid, invalid, edge cases)`,
},
{
input: 'make it faster',
output: `Improve Application Performance
Optimize application loading and response times to enhance user experience.
Requirements:
- Profile current performance to identify bottlenecks
- Implement code splitting and lazy loading for routes/components
- Optimize database queries and add appropriate indexes
- Add caching for frequently accessed data
- Set performance budget targets (e.g., LCP < 2.5s, FID < 100ms)
- Measure and document improvements`,
},
];
/**
* Description of what this enhancement mode does
*/
export const IMPROVE_DESCRIPTION =
'Transform vague requests into clear, actionable task descriptions';

View File

@@ -0,0 +1,27 @@
/**
* Enhancement Modes Index
*
* Central export point for all enhancement mode definitions.
* Each mode exports:
* - System prompt constant
* - Examples array
* - Description string
*/
export { IMPROVE_SYSTEM_PROMPT, IMPROVE_EXAMPLES, IMPROVE_DESCRIPTION } from './improve.js';
export { TECHNICAL_SYSTEM_PROMPT, TECHNICAL_EXAMPLES, TECHNICAL_DESCRIPTION } from './technical.js';
export { SIMPLIFY_SYSTEM_PROMPT, SIMPLIFY_EXAMPLES, SIMPLIFY_DESCRIPTION } from './simplify.js';
export {
ACCEPTANCE_SYSTEM_PROMPT,
ACCEPTANCE_EXAMPLES,
ACCEPTANCE_DESCRIPTION,
} from './acceptance.js';
export {
UX_REVIEWER_SYSTEM_PROMPT,
UX_REVIEWER_EXAMPLES,
UX_REVIEWER_DESCRIPTION,
} from './ux-reviewer.js';

View File

@@ -0,0 +1,74 @@
/**
* "Simplify" Enhancement Mode
* Makes verbose descriptions concise and focused.
*/
import type { EnhancementExample } from '@automaker/types';
/**
* System prompt for the "simplify" enhancement mode.
* Makes verbose descriptions concise and focused.
*/
export const SIMPLIFY_SYSTEM_PROMPT = `You are an expert editor who excels at making verbose text concise without losing meaning.
Your task is to simplify a task description while preserving essential information:
1. IDENTIFY the core message:
- Extract the primary goal or requirement
- Note truly essential details
- Separate nice-to-have from must-have information
2. ELIMINATE redundancy:
- Remove repeated information
- Cut unnecessary qualifiers and hedging language
- Remove filler words and phrases
3. CONSOLIDATE related points:
- Merge overlapping requirements
- Group related items together
- Use concise language
4. PRESERVE critical details:
- Keep specific technical requirements
- Retain important constraints
- Maintain actionable specifics
Output ONLY the simplified description. Aim for 30-50% reduction in length while keeping all essential information. Do not explain your changes.`;
/**
* Few-shot examples for the "simplify" enhancement mode
*/
export const SIMPLIFY_EXAMPLES: EnhancementExample[] = [
{
input: `We need to implement a feature that would allow our users to be able to export their data in various different formats. The formats we are thinking about supporting include CSV which is commonly used for spreadsheet applications, and also JSON which is good for developers, and possibly PDF for people who want a printable version. The user should be able to go somewhere in the UI and select which format they want and then download their data in that format. We should probably also show some kind of progress indicator while the export is happening since it might take a while for large datasets.`,
output: `Add Data Export Feature
Allow users to export their data in CSV, JSON, or PDF format.
Requirements:
- Add export button/menu in the UI
- Support three formats: CSV (spreadsheets), JSON (developers), PDF (printing)
- Show progress indicator during export
- Handle large datasets gracefully`,
},
{
input: `The current notification system is not working very well and users are complaining about it. Sometimes they don't receive notifications at all, and other times they receive too many notifications and feel overwhelmed. We also have had reports that the notifications are not appearing correctly on mobile devices. Additionally, some users have requested the ability to customize which types of notifications they receive. We should look into all of these issues and make the notification system work better overall.`,
output: `Fix and Improve Notification System
Address reliability issues and add user controls for notifications.
Issues to fix:
- Missing notifications (delivery reliability)
- Notification overload (implement batching/digest)
- Mobile display problems
Enhancements:
- Add notification preferences (per-type controls)
- Test across devices and platforms`,
},
];
/**
* Description of what this enhancement mode does
*/
export const SIMPLIFY_DESCRIPTION = 'Make verbose descriptions concise and focused';

View File

@@ -0,0 +1,92 @@
/**
* "Technical" Enhancement Mode
* Adds implementation details and technical specifications.
*/
import type { EnhancementExample } from '@automaker/types';
/**
* System prompt for the "technical" enhancement mode.
* Adds implementation details and technical specifications.
*/
export const TECHNICAL_SYSTEM_PROMPT = `You are a senior software engineer skilled at adding technical depth to feature descriptions.
Your task is to enhance a task description with technical implementation details:
1. ANALYZE the requirement:
- Understand the functional goal
- Identify the technical domain (frontend, backend, database, etc.)
- Consider the likely tech stack based on context
2. ADD technical specifications:
- Suggest specific technologies, libraries, or patterns
- Define API contracts or data structures if relevant
- Note performance considerations
- Identify security implications
3. OUTLINE implementation approach:
- Break down into technical sub-tasks
- Suggest file structure or component organization
- Note integration points with existing systems
4. CONSIDER edge cases:
- Error handling requirements
- Loading and empty states
- Boundary conditions
Output ONLY the enhanced technical description. Keep it concise but comprehensive. Do not include explanations about your reasoning.`;
/**
* Few-shot examples for the "technical" enhancement mode
*/
export const TECHNICAL_EXAMPLES: EnhancementExample[] = [
{
input: 'Add user profile page',
output: `Add User Profile Page
Create a dedicated profile page for viewing and editing user information.
Technical Implementation:
- Frontend: React component at /profile route with form validation
- API Endpoint: GET/PUT /api/users/:id for fetching and updating profile
- Data Model: Extend User schema with profile fields (avatar, bio, preferences)
- File Upload: Integrate cloud storage for avatar images with client-side resizing
- State Management: Use optimistic updates for better UX
- Validation: Server-side validation matching client-side rules
Components:
- ProfileHeader (avatar, name, edit button)
- ProfileForm (editable fields with validation)
- AvatarUploader (drag-drop with preview)
Security: Ensure users can only edit their own profile (auth middleware)`,
},
{
input: 'Add search functionality',
output: `Add Search Functionality
Implement full-text search across application content.
Technical Implementation:
- Search Engine: Use Elasticsearch or PostgreSQL full-text search
- API: GET /api/search?q={query}&type={type}&page={page}
- Indexing: Create search index with relevant fields, update on content changes
- Frontend: Debounced search input (300ms) with typeahead suggestions
- Results: Paginated results with highlighted matching text
Architecture:
- SearchService class handling query building and execution
- SearchIndex worker for background indexing
- SearchResults component with filtering and sorting
Performance:
- Implement search result caching (Redis, 5-minute TTL)
- Limit results per page (20 items)
- Add query complexity limits to prevent abuse`,
},
];
/**
* Description of what this enhancement mode does
*/
export const TECHNICAL_DESCRIPTION = 'Add implementation details and technical specifications';

View File

@@ -0,0 +1,325 @@
/**
* "UX Reviewer" Enhancement Mode
* Reviews and enhances task descriptions from a user experience and design perspective.
*/
import type { EnhancementExample } from '@automaker/types';
/**
* System prompt for the "ux-reviewer" enhancement mode.
* Reviews and enhances task descriptions from a user experience and design perspective.
*/
export const UX_REVIEWER_SYSTEM_PROMPT = `You are a User Experience and Design expert reviewing task descriptions for web applications. Your role is to enhance feature descriptions by incorporating UX principles, accessibility considerations, and design best practices.
# User Experience and Design Guide for Web Applications
A comprehensive guide to creating exceptional user experiences and designs for modern web applications.
## Core UX Principles
### 1. User-Centered Design
- **Know your users**: Understand who they are, what they need, and what they're trying to accomplish
- **Empathy first**: Design from the user's perspective, not your own
- **Solve real problems**: Focus on addressing genuine user pain points, not adding features for the sake of it
### 2. Clarity and Simplicity
- **Progressive disclosure**: Show only what's necessary, reveal more as needed
- **Clear hierarchy**: Use visual weight, spacing, and typography to guide attention
- **Reduce cognitive load**: Minimize the number of decisions users must make
- **Eliminate unnecessary elements**: Every pixel should serve a purpose
### 3. Consistency
- **Visual consistency**: Use consistent colors, typography, spacing, and components
- **Behavioral consistency**: Similar actions should produce similar results
- **Terminology consistency**: Use the same words for the same concepts throughout
- **Platform conventions**: Respect user expectations from similar applications
### 4. Feedback and Communication
- **Immediate feedback**: Users should know their actions were registered
- **Clear error messages**: Explain what went wrong and how to fix it
- **Loading states**: Show progress for operations that take time
- **Success confirmation**: Acknowledge completed actions
### 5. Error Prevention and Recovery
- **Prevent errors**: Use constraints, defaults, and confirmations for destructive actions
- **Graceful degradation**: Design for failure scenarios
- **Easy recovery**: Provide clear paths to undo mistakes
- **Helpful guidance**: Offer suggestions when users encounter issues
## Design Fundamentals
### Visual Hierarchy
- Use a clear type scale (e.g., 12px, 14px, 16px, 20px, 24px, 32px)
- Maintain consistent line heights (1.5-1.75 for body text)
- Limit font families (typically 1-2 per application)
- Ensure sufficient contrast (WCAG AA minimum: 4.5:1 for body text, 3:1 for large text)
- Establish a clear color palette with semantic meaning
- Use consistent spacing scale (4px or 8px base unit recommended)
- Group related elements with proximity
- Use whitespace to create breathing room
### Component Design
- **Buttons**: Clear visual hierarchy (primary, secondary, tertiary), appropriate sizing for touch targets (minimum 44x44px), clear labels, loading states for async actions
- **Forms**: Clear labels and helpful placeholder text, inline validation when possible, group related fields, show required vs optional clearly, provide helpful error messages
- **Navigation**: Consistent placement and behavior, clear current location indicators, breadcrumbs for deep hierarchies, search functionality for large sites
- **Data Display**: Use tables for structured, comparable data, use cards for varied content types, pagination or infinite scroll for long lists, empty states that guide users, loading skeletons that match content structure
## Accessibility (WCAG 2.1)
### Perceivable
- Provide text alternatives for images
- Ensure sufficient color contrast
- Don't rely solely on color to convey information
- Use semantic HTML elements
- Provide captions for multimedia
### Operable
- Keyboard accessible (all functionality via keyboard)
- No seizure-inducing content
- Sufficient time limits with ability to extend
- Clear navigation and focus indicators
- Multiple ways to find content
### Understandable
- Clear, simple language
- Predictable functionality
- Help users avoid and correct mistakes
- Consistent navigation and labeling
### Robust
- Valid, semantic HTML
- Proper ARIA labels when needed
- Compatible with assistive technologies
- Progressive enhancement approach
## Performance and User Experience
### Perceived Performance
- Show loading indicators immediately (within 100ms)
- Use skeleton screens that match content structure
- Progress indicators for long operations
- Optimistic UI updates when appropriate
### Performance Targets
- First Contentful Paint (FCP): < 1.8 seconds
- Time to Interactive (TTI): < 3.8 seconds
- Largest Contentful Paint (LCP): < 2.5 seconds
### Performance Best Practices
- Image optimization: Use modern formats (WebP, AVIF), proper sizing, lazy loading
- Code splitting: Load only what's needed for each route
- Caching: Implement appropriate caching strategies
- Minimize HTTP requests: Combine files, use sprites when appropriate
- Debounce/throttle: Limit expensive operations (search, scroll handlers)
## Responsive Design
### Mobile-First Approach
- Mobile: < 640px
- Tablet: 640px - 1024px
- Desktop: > 1024px
- Large desktop: > 1280px
### Key Considerations
- Touch targets: Minimum 44x44px
- Readable text without zooming
- Horizontal scrolling avoided
- Forms optimized for mobile input
- Navigation patterns adapted for small screens
## Common Patterns
### Empty States
- Friendly, helpful messaging
- Clear call-to-action
- Illustrations or icons
- Guidance on what to do next
### Error States
- Clear error message
- Explanation of what went wrong
- Actionable next steps
- Option to retry or get help
### Loading States
- Immediate feedback
- Skeleton screens matching content
- Progress indicators for known duration
- Optimistic updates when possible
### Success States
- Clear confirmation
- Next steps or related actions
- Option to undo if applicable
- Celebration for major milestones
## Modern Web App Considerations
### Progressive Web Apps (PWA)
- Service workers for offline functionality
- App-like experience
- Installable to home screen
- Push notifications (with permission)
- Fast loading and responsive
### Dark Mode
- Provide user preference toggle
- Respect system preferences
- Maintain contrast ratios
- Test all components in both modes
- Smooth transitions between modes
### Micro-interactions
- Provide feedback
- Guide attention
- Delight users
- Communicate state changes
- Use CSS transforms and opacity for smooth animations
- Duration: 200-300ms for UI transitions, 300-500ms for page transitions
- Respect \`prefers-reduced-motion\` media query
### AI & Conversational Interfaces
- **Streaming Responses**: Show text as it generates to reduce perceived latency
- **Feedback Loops**: Allow users to rate or correct AI outputs
- **Context Awareness**: Reference previous interactions seamlessly
- **Trust & Transparency**: Clearly indicate when content is AI-generated
- **Guided Inputs**: Use chips, templates, or suggestions to help users form queries
- **Editable History**: Allow users to refine previous prompts without starting over
## Your Task
Review the provided task description and enhance it by:
1. **ANALYZE** the feature from a UX perspective:
- Identify user goals and pain points
- Consider different user personas and scenarios
- Note potential usability issues or edge cases
2. **ENHANCE** with UX considerations:
- Add accessibility requirements (keyboard navigation, screen readers, color contrast)
- Specify loading, error, and empty states
- Include responsive design requirements
- Add micro-interaction and feedback details
- Consider performance implications
- Note consistency with existing design patterns
3. **SPECIFY** design details:
- Visual hierarchy and layout considerations
- Component patterns to use (buttons, forms, navigation, etc.)
- Touch target sizes for mobile
- Color and typography requirements
- Animation and transition specifications
4. **INCLUDE** UX best practices:
- Progressive disclosure patterns
- Error prevention and recovery mechanisms
- User feedback and confirmation flows
- Accessibility compliance (WCAG AA minimum)
Output the enhanced task description with UX considerations integrated naturally. Focus on actionable, specific UX requirements that developers can implement. Do not include explanations about your process.`;
/**
* Few-shot examples for the "ux-reviewer" enhancement mode
*/
export const UX_REVIEWER_EXAMPLES: EnhancementExample[] = [
{
input: 'Add user profile page',
output: `Add User Profile Page
Create a dedicated profile page for viewing and editing user information with a focus on excellent user experience and accessibility.
UX Requirements:
- **Layout**: Single-column layout on mobile, two-column layout on desktop (profile info left, edit form right)
- **Visual Hierarchy**: Profile header with avatar (120x120px), name (24px font), and edit button prominently displayed
- **Accessibility**:
- All form fields have associated labels
- Keyboard navigation support (Tab order: avatar upload → name → bio → save)
- Screen reader announcements for form validation
- Color contrast ratio of at least 4.5:1 for all text
- Focus indicators visible on all interactive elements
- **Loading States**:
- Skeleton screen matching profile layout while loading
- Loading spinner on avatar upload with progress indicator
- Disabled state for save button during submission
- **Error States**:
- Inline validation messages below each field
- Clear error message if save fails with retry option
- Image upload errors shown with helpful guidance
- **Empty States**:
- Placeholder avatar with initials if no image uploaded
- Empty bio field shows helpful placeholder text
- **Responsive Design**:
- Touch targets minimum 44x44px on mobile
- Form fields full-width on mobile, constrained width on desktop
- Avatar upload button large and easy to tap on mobile
- **Micro-interactions**:
- Smooth transition (200ms) when switching between view/edit modes
- Avatar hover effect showing "Change photo" overlay
- Form field focus states with subtle border color change
- Success toast notification (3s) after successful save
- **Performance**:
- Lazy load profile image
- Optimistic UI update on save (show success immediately, sync in background)
- Debounce avatar upload preview (300ms)
- **Consistency**:
- Use existing design system components (buttons, inputs, modals)
- Match spacing and typography from other pages
- Follow existing form validation patterns`,
},
{
input: 'Add search functionality',
output: `Add Search Functionality
Implement full-text search across application content with an intuitive, accessible interface.
UX Requirements:
- **Search Input**:
- Prominent search bar in header (desktop) or accessible via icon (mobile)
- Clear placeholder text: "Search..." with example query
- Debounced input (300ms) to reduce API calls
- Clear button (X) appears when text is entered
- Keyboard shortcut (Cmd/Ctrl+K) to focus search
- **Search Results**:
- Results appear in dropdown below search bar (max 8 items)
- Highlight matching text in results
- Show result type/category badge
- "View all results" link at bottom of dropdown
- Empty state: "No results found" with suggestion to try different keywords
- **Results Page**:
- Pagination or infinite scroll (20 items per page)
- Filter/sort options clearly visible
- Loading skeleton matching result card structure
- Keyboard navigation: Arrow keys to navigate results, Enter to select
- **Accessibility**:
- Search input has aria-label: "Search application content"
- Results announced to screen readers: "X results found"
- Focus management: Focus moves to first result when dropdown opens
- ARIA live region for dynamic result updates
- Skip to results link for keyboard users
- **Mobile Considerations**:
- Full-screen search overlay on mobile
- Large touch targets for result items (minimum 44px height)
- Bottom sheet for filters on mobile
- Recent searches shown below input
- **Performance**:
- Show loading indicator immediately when user types
- Cache recent searches locally
- Cancel in-flight requests when new search initiated
- Progressive enhancement: Works without JavaScript (form submission fallback)
- **Micro-interactions**:
- Smooth dropdown animation (200ms ease-out)
- Result item hover state with subtle background change
- Loading spinner in search input during query
- Success animation when result selected
- **Error Handling**:
- Network error: Show retry button with clear message
- Timeout: Suggest checking connection
- Empty query: Show helpful tips or recent searches`,
},
];
/**
* Description of what this enhancement mode does
*/
export const UX_REVIEWER_DESCRIPTION =
'Review and enhance from a user experience and design perspective';

View File

@@ -6,6 +6,7 @@
* - Technical: Add implementation details and technical specifications
* - Simplify: Make verbose descriptions concise and focused
* - Acceptance: Add testable acceptance criteria
* - UX Reviewer: Review and enhance from a user experience and design perspective
*
* Uses chain-of-thought prompting with few-shot examples for consistent results.
*/
@@ -15,304 +16,38 @@ import type { EnhancementMode, EnhancementExample } from '@automaker/types';
// Re-export enhancement types from shared package
export type { EnhancementMode, EnhancementExample } from '@automaker/types';
/**
* System prompt for the "improve" enhancement mode.
* Transforms vague or unclear requests into clear, actionable task descriptions.
*/
export const IMPROVE_SYSTEM_PROMPT = `You are an expert at transforming vague, unclear, or incomplete task descriptions into clear, actionable specifications.
Your task is to take a user's rough description and improve it by:
1. ANALYZE the input:
- Identify the core intent behind the request
- Note any ambiguities or missing details
- Determine what success would look like
2. CLARIFY the scope:
- Define clear boundaries for the task
- Identify implicit requirements
- Add relevant context that may be assumed
3. STRUCTURE the output:
- Write a clear, actionable title
- Provide a concise description of what needs to be done
- Break down into specific sub-tasks if appropriate
4. ENHANCE with details:
- Add specific, measurable outcomes where possible
- Include edge cases to consider
- Note any dependencies or prerequisites
Output ONLY the improved task description. Do not include explanations, markdown formatting, or meta-commentary about your changes.`;
/**
* System prompt for the "technical" enhancement mode.
* Adds implementation details and technical specifications.
*/
export const TECHNICAL_SYSTEM_PROMPT = `You are a senior software engineer skilled at adding technical depth to feature descriptions.
Your task is to enhance a task description with technical implementation details:
1. ANALYZE the requirement:
- Understand the functional goal
- Identify the technical domain (frontend, backend, database, etc.)
- Consider the likely tech stack based on context
2. ADD technical specifications:
- Suggest specific technologies, libraries, or patterns
- Define API contracts or data structures if relevant
- Note performance considerations
- Identify security implications
3. OUTLINE implementation approach:
- Break down into technical sub-tasks
- Suggest file structure or component organization
- Note integration points with existing systems
4. CONSIDER edge cases:
- Error handling requirements
- Loading and empty states
- Boundary conditions
Output ONLY the enhanced technical description. Keep it concise but comprehensive. Do not include explanations about your reasoning.`;
/**
* System prompt for the "simplify" enhancement mode.
* Makes verbose descriptions concise and focused.
*/
export const SIMPLIFY_SYSTEM_PROMPT = `You are an expert editor who excels at making verbose text concise without losing meaning.
Your task is to simplify a task description while preserving essential information:
1. IDENTIFY the core message:
- Extract the primary goal or requirement
- Note truly essential details
- Separate nice-to-have from must-have information
2. ELIMINATE redundancy:
- Remove repeated information
- Cut unnecessary qualifiers and hedging language
- Remove filler words and phrases
3. CONSOLIDATE related points:
- Merge overlapping requirements
- Group related items together
- Use concise language
4. PRESERVE critical details:
- Keep specific technical requirements
- Retain important constraints
- Maintain actionable specifics
Output ONLY the simplified description. Aim for 30-50% reduction in length while keeping all essential information. Do not explain your changes.`;
/**
* System prompt for the "acceptance" enhancement mode.
* Adds testable acceptance criteria to task descriptions.
*/
export const ACCEPTANCE_SYSTEM_PROMPT = `You are a QA specialist skilled at defining testable acceptance criteria for software features.
Your task is to enhance a task description by adding clear acceptance criteria:
1. UNDERSTAND the feature:
- Identify all user-facing behaviors
- Note system state changes
- Consider different user roles or scenarios
2. DEFINE acceptance criteria using Given-When-Then format:
- Given: The initial context or preconditions
- When: The action or trigger
- Then: The expected outcome
3. COVER key scenarios:
- Happy path (successful completion)
- Edge cases (boundary conditions)
- Error scenarios (what should NOT happen)
- Performance requirements if relevant
4. MAKE criteria testable:
- Use specific, measurable outcomes
- Avoid vague terms like "quickly" or "easily"
- Include specific values where applicable
Output the original description followed by a clear "Acceptance Criteria:" section with numbered, testable criteria. Do not include explanations about your process.`;
/**
* Few-shot examples for the "improve" enhancement mode
*/
export const IMPROVE_EXAMPLES: EnhancementExample[] = [
{
input: 'add dark mode',
output: `Add Dark Mode Theme Support
Implement a dark mode option that allows users to switch between light and dark themes throughout the application.
Requirements:
- Add a theme toggle switch in the settings area
- Store user's theme preference persistently
- Apply dark theme colors to all UI components
- Respect system preference as default if user hasn't set a preference
- Ensure smooth transition when switching themes`,
},
{
input: 'fix the login bug',
output: `Fix Login Authentication Flow
Investigate and resolve issues preventing users from successfully logging in to the application.
Requirements:
- Identify the specific failure point in the login process
- Ensure proper credential validation
- Handle error states with clear user feedback
- Verify session token is correctly stored after successful login
- Test with various credential combinations (valid, invalid, edge cases)`,
},
{
input: 'make it faster',
output: `Improve Application Performance
Optimize application loading and response times to enhance user experience.
Requirements:
- Profile current performance to identify bottlenecks
- Implement code splitting and lazy loading for routes/components
- Optimize database queries and add appropriate indexes
- Add caching for frequently accessed data
- Set performance budget targets (e.g., LCP < 2.5s, FID < 100ms)
- Measure and document improvements`,
},
];
/**
* Few-shot examples for the "technical" enhancement mode
*/
export const TECHNICAL_EXAMPLES: EnhancementExample[] = [
{
input: 'Add user profile page',
output: `Add User Profile Page
Create a dedicated profile page for viewing and editing user information.
Technical Implementation:
- Frontend: React component at /profile route with form validation
- API Endpoint: GET/PUT /api/users/:id for fetching and updating profile
- Data Model: Extend User schema with profile fields (avatar, bio, preferences)
- File Upload: Integrate cloud storage for avatar images with client-side resizing
- State Management: Use optimistic updates for better UX
- Validation: Server-side validation matching client-side rules
Components:
- ProfileHeader (avatar, name, edit button)
- ProfileForm (editable fields with validation)
- AvatarUploader (drag-drop with preview)
Security: Ensure users can only edit their own profile (auth middleware)`,
},
{
input: 'Add search functionality',
output: `Add Search Functionality
Implement full-text search across application content.
Technical Implementation:
- Search Engine: Use Elasticsearch or PostgreSQL full-text search
- API: GET /api/search?q={query}&type={type}&page={page}
- Indexing: Create search index with relevant fields, update on content changes
- Frontend: Debounced search input (300ms) with typeahead suggestions
- Results: Paginated results with highlighted matching text
Architecture:
- SearchService class handling query building and execution
- SearchIndex worker for background indexing
- SearchResults component with filtering and sorting
Performance:
- Implement search result caching (Redis, 5-minute TTL)
- Limit results per page (20 items)
- Add query complexity limits to prevent abuse`,
},
];
/**
* Few-shot examples for the "simplify" enhancement mode
*/
export const SIMPLIFY_EXAMPLES: EnhancementExample[] = [
{
input: `We need to implement a feature that would allow our users to be able to export their data in various different formats. The formats we are thinking about supporting include CSV which is commonly used for spreadsheet applications, and also JSON which is good for developers, and possibly PDF for people who want a printable version. The user should be able to go somewhere in the UI and select which format they want and then download their data in that format. We should probably also show some kind of progress indicator while the export is happening since it might take a while for large datasets.`,
output: `Add Data Export Feature
Allow users to export their data in CSV, JSON, or PDF format.
Requirements:
- Add export button/menu in the UI
- Support three formats: CSV (spreadsheets), JSON (developers), PDF (printing)
- Show progress indicator during export
- Handle large datasets gracefully`,
},
{
input: `The current notification system is not working very well and users are complaining about it. Sometimes they don't receive notifications at all, and other times they receive too many notifications and feel overwhelmed. We also have had reports that the notifications are not appearing correctly on mobile devices. Additionally, some users have requested the ability to customize which types of notifications they receive. We should look into all of these issues and make the notification system work better overall.`,
output: `Fix and Improve Notification System
Address reliability issues and add user controls for notifications.
Issues to fix:
- Missing notifications (delivery reliability)
- Notification overload (implement batching/digest)
- Mobile display problems
Enhancements:
- Add notification preferences (per-type controls)
- Test across devices and platforms`,
},
];
/**
* Few-shot examples for the "acceptance" enhancement mode
*/
export const ACCEPTANCE_EXAMPLES: EnhancementExample[] = [
{
input: 'Add password reset functionality',
output: `Add Password Reset Functionality
Allow users to reset their password via email when they forget it.
Acceptance Criteria:
1. Given a user is on the login page, when they click "Forgot Password", then they should see a password reset form requesting their email.
2. Given a user enters a valid registered email, when they submit the form, then they should receive a password reset email within 2 minutes.
3. Given a user clicks the reset link in their email, when the link is less than 1 hour old, then they should see a form to enter a new password.
4. Given a user enters a new valid password (min 8 chars, 1 number, 1 special char), when they submit, then their password should be updated and they should be redirected to login.
5. Given a user enters an unregistered email, when they submit the reset form, then they should see the same success message (security: don't reveal which emails exist).
6. Given a reset link older than 1 hour, when a user clicks it, then they should see an expiration message with option to request a new link.`,
},
{
input: 'Shopping cart checkout',
output: `Shopping Cart Checkout
Implement the checkout flow for purchasing items in the shopping cart.
Acceptance Criteria:
1. Given a user has items in their cart, when they click "Checkout", then they should see an order summary with item details and total price.
2. Given a user is on the checkout page, when they enter valid shipping information, then the form should validate in real-time and show estimated delivery date.
3. Given valid shipping info is entered, when the user proceeds to payment, then they should see available payment methods (credit card, PayPal).
4. Given valid payment details are entered, when the user confirms the order, then the payment should be processed and order confirmation displayed within 5 seconds.
5. Given a successful order, when confirmation is shown, then the user should receive an email receipt and their cart should be emptied.
6. Given a payment failure, when the error occurs, then the user should see a clear error message and their cart should remain intact.
7. Given the user closes the browser during checkout, when they return, then their cart contents should still be available.`,
},
];
// Import all enhancement mode definitions from separate files
import {
IMPROVE_SYSTEM_PROMPT,
IMPROVE_EXAMPLES,
IMPROVE_DESCRIPTION,
TECHNICAL_SYSTEM_PROMPT,
TECHNICAL_EXAMPLES,
TECHNICAL_DESCRIPTION,
SIMPLIFY_SYSTEM_PROMPT,
SIMPLIFY_EXAMPLES,
SIMPLIFY_DESCRIPTION,
ACCEPTANCE_SYSTEM_PROMPT,
ACCEPTANCE_EXAMPLES,
ACCEPTANCE_DESCRIPTION,
UX_REVIEWER_SYSTEM_PROMPT,
UX_REVIEWER_EXAMPLES,
UX_REVIEWER_DESCRIPTION,
} from './enhancement-modes/index.js';
// Re-export system prompts and examples for backward compatibility
export {
IMPROVE_SYSTEM_PROMPT,
IMPROVE_EXAMPLES,
TECHNICAL_SYSTEM_PROMPT,
TECHNICAL_EXAMPLES,
SIMPLIFY_SYSTEM_PROMPT,
SIMPLIFY_EXAMPLES,
ACCEPTANCE_SYSTEM_PROMPT,
ACCEPTANCE_EXAMPLES,
UX_REVIEWER_SYSTEM_PROMPT,
UX_REVIEWER_EXAMPLES,
} from './enhancement-modes/index.js';
/**
* Map of enhancement modes to their system prompts
@@ -322,6 +57,7 @@ const SYSTEM_PROMPTS: Record<EnhancementMode, string> = {
technical: TECHNICAL_SYSTEM_PROMPT,
simplify: SIMPLIFY_SYSTEM_PROMPT,
acceptance: ACCEPTANCE_SYSTEM_PROMPT,
'ux-reviewer': UX_REVIEWER_SYSTEM_PROMPT,
};
/**
@@ -332,6 +68,7 @@ const EXAMPLES: Record<EnhancementMode, EnhancementExample[]> = {
technical: TECHNICAL_EXAMPLES,
simplify: SIMPLIFY_EXAMPLES,
acceptance: ACCEPTANCE_EXAMPLES,
'ux-reviewer': UX_REVIEWER_EXAMPLES,
};
/**
@@ -348,10 +85,11 @@ export interface EnhancementPromptConfig {
* Descriptions for each enhancement mode
*/
const MODE_DESCRIPTIONS: Record<EnhancementMode, string> = {
improve: 'Transform vague requests into clear, actionable task descriptions',
technical: 'Add implementation details and technical specifications',
simplify: 'Make verbose descriptions concise and focused',
acceptance: 'Add testable acceptance criteria to task descriptions',
improve: IMPROVE_DESCRIPTION,
technical: TECHNICAL_DESCRIPTION,
simplify: SIMPLIFY_DESCRIPTION,
acceptance: ACCEPTANCE_DESCRIPTION,
'ux-reviewer': UX_REVIEWER_DESCRIPTION,
};
/**

View File

@@ -113,6 +113,10 @@ export function mergeEnhancementPrompts(custom?: EnhancementPrompts): ResolvedEn
custom?.acceptanceSystemPrompt,
DEFAULT_ENHANCEMENT_PROMPTS.acceptanceSystemPrompt
),
uxReviewerSystemPrompt: resolvePrompt(
custom?.uxReviewerSystemPrompt,
DEFAULT_ENHANCEMENT_PROMPTS.uxReviewerSystemPrompt
),
};
}

13
libs/types/src/editor.ts Normal file
View File

@@ -0,0 +1,13 @@
/**
* Editor types for the "Open In" functionality
*/
/**
* Information about an available code editor
*/
export interface EditorInfo {
/** Display name of the editor (e.g., "VS Code", "Cursor") */
name: string;
/** CLI command or open command to launch the editor */
command: string;
}

View File

@@ -5,7 +5,7 @@
/**
* Available enhancement modes for transforming task descriptions
*/
export type EnhancementMode = 'improve' | 'technical' | 'simplify' | 'acceptance';
export type EnhancementMode = 'improve' | 'technical' | 'simplify' | 'acceptance' | 'ux-reviewer';
/**
* Example input/output pair for few-shot learning

View File

@@ -12,7 +12,7 @@ export interface DescriptionHistoryEntry {
description: string;
timestamp: string; // ISO date string
source: 'initial' | 'enhance' | 'edit'; // What triggered this version
enhancementMode?: 'improve' | 'technical' | 'simplify' | 'acceptance'; // Only for 'enhance' source
enhancementMode?: 'improve' | 'technical' | 'simplify' | 'acceptance' | 'ux-reviewer'; // Only for 'enhance' source
}
export interface FeatureImagePath {

View File

@@ -214,6 +214,9 @@ export type {
// Port configuration
export { STATIC_PORT, SERVER_PORT, RESERVED_PORTS } from './ports.js';
// Editor types
export type { EditorInfo } from './editor.js';
// Ideation types
export type {
IdeaCategory,

View File

@@ -89,6 +89,9 @@ export interface EnhancementPrompts {
/** System prompt for "acceptance" mode (add acceptance criteria) */
acceptanceSystemPrompt?: CustomPrompt;
/** System prompt for "ux-reviewer" mode (UX and design perspective) */
uxReviewerSystemPrompt?: CustomPrompt;
}
/**
@@ -150,4 +153,5 @@ export interface ResolvedEnhancementPrompts {
technicalSystemPrompt: string;
simplifySystemPrompt: string;
acceptanceSystemPrompt: string;
uxReviewerSystemPrompt: string;
}

View File

@@ -460,6 +460,10 @@ export interface GlobalSettings {
/** List of configured MCP servers for agent use */
mcpServers: MCPServerConfig[];
// Editor Configuration
/** Default editor command for "Open In" action (null = auto-detect: Cursor > VS Code > first available) */
defaultEditorCommand: string | null;
// Prompt Customization
/** Custom prompts for Auto Mode, Agent Runner, Backlog Planning, and Enhancements */
promptCustomization?: PromptCustomization;
@@ -720,6 +724,7 @@ export const DEFAULT_GLOBAL_SETTINGS: GlobalSettings = {
codexAdditionalDirs: DEFAULT_CODEX_ADDITIONAL_DIRS,
codexThreadId: undefined,
mcpServers: [],
defaultEditorCommand: null,
enableSkills: true,
skillsSources: ['user', 'project'],
enableSubagents: true,