Provide a clear prompt that follows best practice when providing instructions to a LLM. The goal of the prompt is to generate a document highlighting all possible use-cases for the getColor utility found in the ./packages/theming folder via examples written in react and styled-components. It should also highlight recommended patterns and discourage bad use. Give me 3 options. Use your best judgement. Double check your work.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
I'll provide 3 different prompt options, each with a different approach but following LLM best practices like being specific, providing context, and using examples to illustrate desired output.
Option 1 - Task-Based with Examples:
code
Generate a comprehensive guide for the getColor utility in Garden Design System's theming package. Structure your response as follows:
1. Show a basic usage example using styled-components that demonstrates getColor with:
- A simple color variable
- Theme-based color
- Transparency modification
2. Provide practical examples for each of these use-cases:
- Button styling
- Text coloring
- Background colors
- Border colors
- State changes (hover, active, disabled)
3. Include anti-patterns section showing:
- What not to do with getColor
- Common mistakes
- Performance implications
For each example, include both the styled-components implementation and a React component usage example.
Format your code examples using TypeScript with proper type annotations.
Option 2 - Scenario-Based Learning:
code
You are writing documentation for a senior React developer who needs to understand the Garden Design System's getColor utility. Create a guide that:
1. Starts with a "Quick Start" section showing the simplest possible usage of getColor
2. Progresses through real-world scenarios:
- Creating a custom themed button component
- Building a color system that responds to light/dark modes
- Implementing an accessible color palette
- Working with transparency and overlays
For each scenario:
- Show the problem it solves
- Provide the solution using getColor
- Explain why this is the recommended approach
- Include a "Gotchas" subsection
Use code examples in both styled-components and regular React components.
End with a "Best Practices" checklist.
Option 3 - Pattern-First Approach:
code
Create a detailed implementation guide for the Garden Design System's getColor utility that follows this structure:
1. Core Patterns
- Document each valid parameter combination for getColor:
* [Redacted Person]
* [Redacted Person]
* transparency
* variable
* offset
* light/dark objects
- Provide a working example for each
2. Integration Patterns
Show how to properly integrate getColor with:
- styled-components
- Theme overrides
- Dynamic theming
- RTL support
- Component variants
3. Advanced Usage
- Color manipulation techniques
- Performance optimization
- Testing strategies
- Migration from direct color values
For each section:
- Include TypeScript examples
- Show both successful and failed implementations
- Explain the reasoning behind each pattern
- Provide specific use-cases where each pattern is most appropriate
Use markdown formatting for code blocks and highlight important notes.
Recommendation:
I recommend Option 2 (Scenario-Based Learning) because it:
Provides a natural learning progression
Grounds the concepts in real-world usage
Addresses both basic and advanced use-cases
Includes practical considerations like accessibility
Maps well to how developers typically learn and implement new tools
The scenario-based approach makes it easier for developers to relate the utility to their own needs while still covering all technical aspects. It also naturally incorporates best practices and anti-patterns within relevant contexts rather than as abstract concepts.