Loading...
Loading...
Compare original and translation side by side
references/optimization-principles.mdreferences/optimization-principles.mdreferences/optimization-principles.mdreferences/optimization-principles.mdAskUserQuestion({
questions: [
{
question: "What technology stack should this use?",
header: "Tech Stack",
multiSelect: false,
options: [
{
label: "React + TypeScript",
description: "Modern React with full type safety"
},
{
label: "React + JavaScript",
description: "React without TypeScript"
},
{
label: "Vue 3",
description: "Vue 3 Composition API"
},
{
label: "Vanilla JavaScript",
description: "Plain JS without frameworks"
}
]
},
{
question: "What styling approach would you like?",
header: "Styling",
multiSelect: false,
options: [
{
label: "Tailwind CSS",
description: "Utility-first CSS framework"
},
{
label: "CSS Modules",
description: "Scoped CSS with modules"
},
{
label: "styled-components",
description: "CSS-in-JS solution"
}
]
},
{
question: "Which features are needed?",
header: "Features",
multiSelect: true,
options: [
{
label: "Multiple variants",
description: "Different color/style variants (primary, secondary, etc.)"
},
{
label: "Size options",
description: "Different sizes (sm, md, lg)"
},
{
label: "Loading state",
description: "Show spinner during async operations"
},
{
label: "Disabled state",
description: "Disabled/inactive state"
}
]
},
{
question: "Any additional requirements or constraints?",
header: "Extra Needs",
multiSelect: false,
options: [
{
label: "No, that's all",
description: "I don't need anything else"
},
{
label: "Yes, let me specify",
description: "I have additional requirements (use 'Other' to describe)"
}
]
}
]
})AskUserQuestion({
questions: [
{
question: "What technology stack should this use?",
header: "Tech Stack",
multiSelect: false,
options: [
{
label: "React + TypeScript",
description: "Modern React with full type safety"
},
{
label: "React + JavaScript",
description: "React without TypeScript"
},
{
label: "Vue 3",
description: "Vue 3 Composition API"
},
{
label: "Vanilla JavaScript",
description: "Plain JS without frameworks"
}
]
},
{
question: "What styling approach would you like?",
header: "Styling",
multiSelect: false,
options: [
{
label: "Tailwind CSS",
description: "Utility-first CSS framework"
},
{
label: "CSS Modules",
description: "Scoped CSS with modules"
},
{
label: "styled-components",
description: "CSS-in-JS solution"
}
]
},
{
question: "Which features are needed?",
header: "Features",
multiSelect: true,
options: [
{
label: "Multiple variants",
description: "Different color/style variants (primary, secondary, etc.)"
},
{
label: "Size options",
description: "Different sizes (sm, md, lg)"
},
{
label: "Loading state",
description: "Show spinner during async operations"
},
{
label: "Disabled state",
description: "Disabled/inactive state"
}
]
},
{
question: "Any additional requirements or constraints?",
header: "Extra Needs",
multiSelect: false,
options: [
{
label: "No, that's all",
description: "I don't need anything else"
},
{
label: "Yes, let me specify",
description: "I have additional requirements (use 'Other' to describe)"
}
]
}
]
})undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined我会通过几个问题来帮你明确需求。
[Calls AskUserQuestion with 4 targeted questions]
Question 1: 使用什么技术栈?
- React + TypeScript
- React + JavaScript
- Vue 3
- Other
Question 2: 使用什么样式方案?
- Tailwind CSS
- CSS Modules
- styled-components
- Other
Question 3: 需要哪些功能?(可多选)
- 多种变体 (primary, secondary, danger等)
- 多种尺寸 (sm, md, lg)
- Loading 状态
- Disabled 状态
Question 4: 还有其他需求或约束吗?
- 不需要,就这些
- 需要,让我补充 (可以在 "Other" 中输入)undefined我会通过几个问题来帮你明确需求。
[调用AskUserQuestion工具,传入4个针对性问题]
问题1:使用什么技术栈?
- React + TypeScript
- React + JavaScript
- Vue 3
- 其他
问题2:使用什么样式方案?
- Tailwind CSS
- CSS Modules
- styled-components
- 其他
问题3:需要哪些功能?(可多选)
- 多种变体 (primary, secondary, danger等)
- 多种尺寸 (sm, md, lg)
- Loading 状态
- Disabled 状态
问题4:还有其他需求或约束吗?
- 不需要,就这些
- 需要,让我补充 (可以在 "其他" 中输入)undefined
**Example 2 - User with extra needs**:
User selects: React + TypeScript, Tailwind CSS, [多种变体, Loading 状态], "Other: 需要支持图标,并且要有 fullWidth 选项让按钮占满整行"
**Prompt Optimizer**:
**示例2 - 用户有额外需求**:
用户选择:React + TypeScript、Tailwind CSS、[多种变体, Loading 状态]、"其他: 需要支持图标,并且要有 fullWidth 选项让按钮占满整行"
**提示词优化器**:
---
---undefinedundefinedundefinedundefinedCreate a reusable Button component in React with TypeScript and Tailwind CSS.
Requirements:
- Support variants: primary, secondary, danger
- Support sizes: sm, md, lg
- Accept onClick handler and children
- Include loading and disabled states
- Proper TypeScript types for all props
Example usage:
<Button variant="primary" size="md" onClick={handleClick}>
Click me
</Button>Create a reusable Button component in React with TypeScript and Tailwind CSS.
Requirements:
- Support variants: primary, secondary, danger
- Support sizes: sm, md, lg
- Accept onClick handler and children
- Include loading and disabled states
- Proper TypeScript types for all props
Example usage:
<Button variant="primary" size="md" onClick={handleClick}>
Click me
</Button>Debug and fix the crash in the Shopping Cart component.
Current behavior:
- App crashes when clicking "Checkout" button
- Only when cart has more than 5 items
- Console error: "Cannot read property 'price' of undefined"
Location:
- File: src/components/ShoppingCart.tsx
- Started after recent pricing logic refactor
Expected behavior:
- Checkout button should work regardless of cart size
- Should navigate to checkout page
Steps to reproduce:
1. Add 6+ items to cart
2. Click "Checkout" button
3. Observe crashDebug and fix the crash in the Shopping Cart component.
Current behavior:
- App crashes when clicking "Checkout" button
- Only when cart has more than 5 items
- Console error: "Cannot read property 'price' of undefined"
Location:
- File: src/components/ShoppingCart.tsx
- Started after recent pricing logic refactor
Expected behavior:
- Checkout button should work regardless of cart size
- Should navigate to checkout page
Steps to reproduce:
1. Add 6+ items to cart
2. Click "Checkout" button
3. Observe crashCreate a responsive analytics dashboard with the following requirements:
Data to Display:
- User statistics (total users, active users, new signups)
- Revenue metrics (daily, weekly, monthly)
- Traffic sources (chart showing breakdown)
- Recent activity feed
Technical Requirements:
- React with TypeScript
- Chart library: Chart.js or Recharts
- State management: Zustand
- Styling: Tailwind CSS
- Responsive design (mobile, tablet, desktop)
Features:
- Date range filter
- Data refresh button
- CSV export functionality
- Loading states for data fetching
Layout:
- Grid layout with stat cards at top
- Charts in middle section
- Activity feed on the side or bottomCreate a responsive analytics dashboard with the following requirements:
Data to Display:
- User statistics (total users, active users, new signups)
- Revenue metrics (daily, weekly, monthly)
- Traffic sources (chart showing breakdown)
- Recent activity feed
Technical Requirements:
- React with TypeScript
- Chart library: Chart.js or Recharts
- State management: Zustand
- Styling: Tailwind CSS
- Responsive design (mobile, tablet, desktop)
Features:
- Date range filter
- Data refresh button
- CSV export functionality
- Loading states for data fetching
Layout:
- Grid layout with stat cards at top
- Charts in middle section
- Activity feed on the side or bottomreferences/optimization-principles.mdreferences/optimization-principles.mdrequest-analyzerrequest-analyzerprompt-optimizerrequest-analyzerrequest-analyzerrequest-analyzerprompt-optimizerrequest-analyzer