Frontend UI Engineering
TaskList.stories.tsx # Storybook stories (if using)
Frontend UI Engineering
What Is This
Frontend UI Engineering is the practice of building user interfaces that meet professional standards of quality, accessibility, and usability. Rather than producing generic, AI-generated layouts, this skill emphasizes creating interfaces that would be indistinguishable from those crafted by experienced engineers at top-tier technology companies. Frontend UI Engineering covers the entire lifecycle of user interface components - from initial implementation and layout, through state management and interaction, to production-ready polish.
This skill is not just about writing code that renders on the screen. It is about constructing UI components and pages that align with a design system, follow accessibility best practices, and deliver a seamless and engaging user experience. The skill also enforces a robust, maintainable code structure, leveraging composition patterns and modularization to keep UI code scalable and testable.
Why Use It
Using Frontend UI Engineering ensures your application’s user interfaces are:
- Production Quality: Components are visually polished, consistent, and adhere to the design system.
- Accessible: UI elements meet accessibility standards, providing a better experience for all users, including those with disabilities.
- Performant: Interfaces are optimized for responsiveness and speed, supporting a wide range of devices and screen sizes.
- Maintainable: Components are designed with clear structure, separation of concerns, and testability in mind.
- Professional: Avoids the telltale signs of auto-generated layouts or unrefined design, presenting a trustworthy face for your product.
This skill is essential in teams striving for high product quality, aiming to minimize technical debt, and seeking to deliver interfaces that not only function, but also delight users.
How to Use It
1. Component Architecture
A core aspect of Frontend UI Engineering is organizing code around components in a scalable and maintainable way. Each UI component should colocate its implementation, tests, stories, hooks, and types:
src/components/
TaskList/
TaskList.tsx // Component implementation
TaskList.test.tsx // Unit tests
TaskList.stories.tsx // Storybook stories (if using)
use-task-list.ts // Custom hook for state logic (if needed)
types.ts // Component-specific TypeScript typesThis structure keeps related files together, making components easier to develop, review, and refactor.
2. Composition Over Configuration
Prefer building components by composing smaller pieces rather than overloading them with configuration options. This leads to more flexible and reusable code.
Example: Using Composition
// Good: Composable component structure
<Card>
<CardHeader>
<CardTitle>Tasks</CardTitle>
</CardHeader>
<CardBody>
<TaskList tasks={tasks} />
</CardBody>
</Card>3. Implementing State and Interactivity
Keep state management close to the UI when possible, using custom hooks for complex logic. This makes components easier to read and maintain.
// use-task-list.ts
import { useState } from 'react';
export function useTaskList(initialTasks) {
const [tasks, setTasks] = useState(initialTasks);
const addTask = (task) => setTasks([...tasks, task]);
return { tasks, addTask };
}4. Accessibility
Accessibility is non-negotiable. Use semantic HTML elements, proper ARIA attributes, and ensure full keyboard navigation.
// Accessible button example
<button aria-label="Add task" onClick={addTask}>
Add
</button>5. Storybook Stories
If using Storybook, create stories for each state of your component to document and test its appearance and behavior.
// TaskList.stories.tsx
import { TaskList } from './TaskList';
export default { title: 'Components/TaskList', component: TaskList };
export const Default = () => <TaskList tasks={[]} />;
export const WithTasks = () => <TaskList tasks={[{ id: 1, text: 'Sample Task' }]} />;When to Use It
Apply the Frontend UI Engineering skill in the following scenarios:
- Building entirely new UI components or application pages
- Modifying or refactoring existing user-facing interfaces
- Implementing responsive layouts for desktop, tablet, and mobile
- Adding or updating interactivity, state logic, or component behaviors
- Diagnosing and fixing visual defects or user experience issues
- Ensuring UI elements conform to a design system and accessibility standards
Important Notes
- Design System Alignment: Always adhere to the established design system, including spacing, typography, color, and component usage.
- No "AI Aesthetic": The output should not look auto-generated or generic. Focus on details and polish.
- Test Coverage: Write unit and integration tests for components to prevent regressions.
- Storybook Stories: When using Storybook, document all visual and interactive states.
- Separation of Concerns: Keep logic and presentation separate. Use custom hooks for non-trivial state or effects.
- Accessibility: Never compromise on accessibility. Test with screen readers and keyboard navigation.
By following these principles, you ensure every part of your UI meets the highest standards of quality and professionalism, delivering value to users and maintainers alike.
More Skills You Might Like
Explore similar skills to enhance your workflow
Openai Image Gen
Batch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery
Incremental Implementation
- Any time you're tempted to write more than ~100 lines before testing
Inspiration Analyzer
Analyze websites for design inspiration, extracting colors, typography, layouts, and patterns. Use when you have specific URLs to analyze for a design
User Personas
Create refined user personas from research data — 3 personas with JTBD, pains, gains, and unexpected insights. Use when building personas from
SQL Queries
Generate SQL queries from natural language descriptions. Supports BigQuery, PostgreSQL, MySQL, and other dialects. Reads database schemas from
Vector Index Tuning
Guide to optimizing vector indexes for production performance