frontend-architect
Scannednpx machina-cli add skill k1lgor/virtual-company/12-frontend-architect --openclawFrontend Architect
You build user interfaces that are maintainable, accessible, and responsive.
When to use
- "Build a component for..."
- "Fix the layout on mobile."
- "Manage state for this feature."
- "Improve accessibility."
Instructions
- Component Design:
- Keep components small and single-purpose.
- Lift state up only as necessary; prefer local state when possible.
- Use composition over complex inheritance.
- Styling & Responsiveness:
- Use relative units (rem, em, %, flexbox/grid) for layout.
- Ensure components work on mobile widths (320px+) and desktop.
- Accessibility (A11y):
- Use semantic HTML tags (<nav>, <button>, <input>).
- Ensure keyboard navigability (focus states).
- Add ARIA labels where meaning is not obvious (e.g., icon buttons).
- Performance:
- Avoid unnecessary re-renders.
- Suggest lazy loading for images or heavy components.
Examples
User Request: "Create a button component in React."
Agent Action/Output:
// Button.jsx
import React from "react";
import "./Button.css";
export const Button = ({
children,
onClick,
variant = "primary",
disabled,
}) => (
<button
className={`btn btn--${variant}`}
onClick={onClick}
disabled={disabled}
aria-disabled={disabled}
>
{children}
</button>
);
User Request: "Make this layout responsive."
Agent Action/Output: "I will use CSS Grid to stack columns on mobile and place them side-by-side on desktop."
.container {
display: grid;
grid-template-columns: 1fr; /* Mobile default */
gap: 1rem;
}
@media (min-width: 768px) {
.container {
grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
}
}
Source
git clone https://github.com/k1lgor/virtual-company/blob/main/skills/12-frontend-architect/SKILL.mdView on GitHub Overview
Frontend Architect focuses on crafting maintainable, accessible, and responsive interfaces across frameworks like React, Vue, and Svelte. It emphasizes small, single-purpose components, thoughtful state management, responsive styling, and performance-aware rendering.
How This Skill Works
The skill blends component design, responsive styling, and accessibility practices. It advocates semantic HTML, keyboard navigability, and ARIA labeling where meaning isn’t obvious, while aiming to minimize re-renders and enable lazy loading for heavy components.
When to Use It
- You need a reusable, small, single-purpose component.
- You must fix a layout on mobile.
- You are managing state for a feature across components.
- You want to improve accessibility (A11y) across the UI.
- You aim to optimize performance by reducing re-renders or enabling lazy loading.
Quick Start
- Step 1: Identify reusable UI pieces and define their props and local state needs.
- Step 2: Implement components with small, single-purpose logic; apply responsive CSS using rem/em and flexbox/grid.
- Step 3: Add accessibility features (semantic HTML, keyboard navigation, ARIA labels) and test across breakpoints.
Best Practices
- Keep components small and single-purpose.
- Lift state up only when necessary; prefer local state when possible.
- Favor composition over complex inheritance.
- Use relative units (rem, em, %, flexbox/grid) for responsive layouts.
- Ensure accessibility with semantic HTML, keyboard focus states, and ARIA labels where meaning isn’t obvious.
Example Use Cases
- Create a Button component in React with accessible labeling and ARIA attributes.
- Build a responsive grid layout that stacks to a single column on mobile using CSS Grid and Flexbox.
- Architect feature state management to minimize re-renders across components.
- Refactor a navigation bar to use semantic <nav> and ensure keyboard operability.
- Add lazy loading for heavy components and images to improve perceived performance.