Web Developer
Recommended Model
Primary: codex - Full-stack implementation, React components, API endpoints, database queries
Architecture: opus - Complex system design, architectural decisions, scalability planning
Quick fixes: sonnet - Bug fixes, small features, CSS tweaks
🔄 Automatic QA Policy
Status: ✅ ENABLED - Always iterate for UI/UX work; selective for backend
Why: Frontend/UI work is subjective and visual quality matters. Backend work is more objective but still benefits from completeness review.
What this means:
- Fitz automatically QA's all web development deliverables after sub-agent completion
- Creates detailed feedback document if requirements missing or quality issues found
- Spawns iteration agent with feedback until work is complete
- You only review finished, production-ready code
Quality Bar:
- ✅ Meets ALL requirements in task brief (not partial completion)
- ✅ UI work matches any design inspiration provided
- ✅ Code is clean, well-organized, and maintainable
- ✅ Responsive design works on mobile and desktop
- ✅ Dark mode support if applicable
- ✅ No placeholder/rough styling on customer-facing interfaces
- ✅ Backend APIs have proper error handling and validation
- ✅ Works correctly - no obvious bugs or breaking changes
Exceptions:
- Quick fixes/patches: Single QA review, don't iterate unless broken
- Backend-only work: Light QA (works correctly?), not visual polish
- Experiments/prototypes: Skip QA if marked as draft
You can override: Say "skip QA" or "good enough, ship it" to bypass iteration
Core Expertise
Frontend Development
- React - Modern hooks, component patterns, state management
- Vite - Fast builds, HMR, optimization
- Tailwind CSS - Utility-first styling, design systems
- Chart.js / D3 - Data visualization
- Responsive design - Mobile-first, accessible UIs
Backend Development
- Node.js + Express - RESTful APIs, middleware, routing
- Database integration - PostgreSQL, MongoDB, Supabase
- Authentication - OAuth, JWT, session management
- API design - RESTful patterns, versioning, documentation
Full-Stack Patterns
- Project structure - Monorepo vs. separate repos
- State management - Context, Zustand, React Query
- Error handling - Client + server side
- Performance optimization - Code splitting, lazy loading, caching
- Deployment - Vercel, Railway, PM2, Docker
Project Architecture Checklist
Before starting any web project, define:
1. Tech Stack
- Frontend framework (React, Vue, vanilla JS?)
- Build tool (Vite, Next.js, Create React App?)
- Styling approach (Tailwind, CSS modules, styled-components?)
- State management (Context, Zustand, Redux?)
- Backend runtime (Node, Deno, Bun?)
- Database (PostgreSQL, MongoDB, Supabase, Firebase?)
2. Project Structure
project-name/
├── frontend/ # React app
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── utils/
│ │ ├── api/ # API client functions
│ │ └── App.jsx
│ ├── public/
│ └── package.json
├── backend/ # Express API
│ ├── routes/
│ ├── controllers/
│ ├── models/
│ ├── middleware/
│ └── server.js
└── README.md
3. Data Flow
- How does data get from backend → frontend?
- Where is state stored (local, context, external store)?
- How are API calls handled (fetch, axios, React Query)?
- What's the caching strategy?
4. Error Handling
- Client-side error boundaries
- API error responses (consistent format)
- User-facing error messages
- Logging strategy
React Best Practices
Component Patterns
Presentational Components (UI only):
export function MetricCard({ title, value, change, status }) {
return (
<div className={`card status-${status}`}>
<h3>{title}</h3>
<div className="value">{value}</div>
<div className={`change ${change > 0 ? 'positive' : 'negative'}`}>
{change > 0 ? '↑' : '↓'} {Math.abs(change)}%
</div>
</div>
)
}
Container Components (logic):
export function Dashboard() {
const [data, setData] = useState(null)
const [loading, setLoading] = useState(true)
useEffect(() => {
fetchData().then(setData).finally(() => setLoading(false))
}, [])
if (loading) return <LoadingSpinner />
return <MetricCard {...data} />
}
Custom Hooks (reusable logic):
function useAPI(endpoint) {
const [data, setData] = useState(null)
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
useEffect(() => {
fetch(endpoint)
.then(res => res.json())
.then(setData)
.catch(setError)
.finally(() => setLoading(false))
}, [endpoint])
return { data, loading, error }
}
State Management Philosophy
- useState - Local component state
- useContext - Shared state (theme, user, global settings)
- React Query / SWR - Server state (API data, caching)
- Zustand / Redux - Complex global state (if really needed)
Rule: Keep state as local as possible. Lift only when necessary.
API Design Patterns
RESTful Endpoints
GET /api/portfolio/overview # Summary stats
GET /api/properties # List all properties
GET /api/properties/:id # Single property details
POST /api/properties/:id/metrics # Update metrics
GET /api/insights # AI-generated insights
GET /api/alerts # Active alerts
Response Format (Consistent)
{
"status": "success",
"data": { ... },
"meta": {
"timestamp": "2026-01-29T20:00:00Z",
"cached": true
}
}
Error Format
{
"status": "error",
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid property ID",
"details": { ... }
}
}
Performance Optimization
Frontend
- Code splitting - Lazy load routes/components
- Memoization -
useMemo, React.memo for expensive renders
- Virtualization - For long lists (react-window)
- Image optimization - WebP, lazy loading, srcset
- Bundle analysis - Keep bundle size < 500KB
Backend
- Caching - Redis, in-memory cache for frequent queries
- Database indexing - Index frequently queried fields
- Rate limiting - Prevent API abuse
- Compression - gzip/brotli responses
- Connection pooling - Reuse database connections
Network
- HTTP/2 - Multiplexing, server push
- CDN - Static assets served from edge
- Prefetching - Preload critical resources
- Service workers - Offline support, caching
Design System Integration
When building UIs, establish:
1. Color System
:root {
--color-primary: #6366f1;
--color-success: #10b981;
--color-warning: #f59e0b;
--color-danger: #ef4444;
--bg-primary: #ffffff;
--bg-secondary: #f8fafc;
--text-primary: #0f172a;
--text-secondary: #475569;
}
2. Typography Scale
--text-xs: 12px;
--text-sm: 14px;
--text-base: 16px;
--text-lg: 18px;
--text-xl: 20px;
--text-2xl: 24px;
--text-3xl: 30px;
--text-4xl: 36px;
3. Spacing System
--spacing-1: 4px;
--spacing-2: 8px;
--spacing-3: 12px;
--spacing-4: 16px;
--spacing-6: 24px;
--spacing-8: 32px;
4. Component Library
- Buttons (primary, secondary, danger, ghost)
- Cards (default, elevated, bordered)
- Inputs (text, select, checkbox, radio)
- Alerts (success, warning, error, info)
- Modals, tooltips, dropdowns
- Loading states (spinners, skeletons)
Common Pitfalls to Avoid
Frontend
- ❌ Prop drilling (use Context or composition)
- ❌ Too many useEffect hooks (consolidate logic)
- ❌ Inline styles (use CSS modules or Tailwind)
- ❌ Not handling loading/error states
- ❌ Forgetting accessibility (ARIA labels, keyboard nav)
Backend
- ❌ No input validation (validate everything)
- ❌ SQL injection vulnerabilities (use parameterized queries)
- ❌ Exposing sensitive data (sanitize responses)
- ❌ No rate limiting (protect against abuse)
- ❌ Poor error messages (be specific but safe)
Architecture
- ❌ Premature optimization (build it first, optimize later)
- ❌ Over-engineering (KISS principle)
- ❌ No separation of concerns (mix UI + logic)
- ❌ Tight coupling (components should be modular)
- ❌ No testing (at least smoke tests for critical paths)
Deployment Checklist
Before shipping:
Debugging Workflow
Frontend Issues
- Check browser console (errors, warnings)
- React DevTools (component tree, props, state)
- Network tab (API calls, response times)
- Performance tab (render times, memory leaks)
Backend Issues
- Check server logs (errors, stack traces)
- Test endpoints with curl/Postman
- Database query logs (slow queries)
- Memory/CPU usage (resource leaks)
Integration Issues
- CORS errors (check headers)
- Authentication failures (token expiration?)
- Data format mismatches (backend vs frontend)
- Caching issues (stale data)
Tech Stack Decision Matrix
| Need |
Recommended |
Alternative |
| Frontend framework |
React + Vite |
Next.js (if SSR needed) |
| Styling |
Tailwind CSS |
CSS Modules |
| State management |
Context + React Query |
Zustand |
| Backend |
Node + Express |
Fastify (faster) |
| Database |
PostgreSQL + Supabase |
MongoDB |
| Deployment |
Vercel (frontend) + Railway (backend) |
Docker + VPS |
| Auth |
Supabase Auth |
Auth0, Clerk |
| Charts |
Chart.js |
Recharts, D3 |
Example Project Structure (Analytics Dashboard)
analytics-dashboard/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── MetricCard.jsx
│ │ │ ├── PropertyCard.jsx
│ │ │ ├── InsightsPanel.jsx
│ │ │ └── TrafficChart.jsx
│ │ ├── pages/
│ │ │ ├── Dashboard.jsx
│ │ │ ├── PropertyDetail.jsx
│ │ │ └── InsightsHub.jsx
│ │ ├── hooks/
│ │ │ ├── useAPI.js
│ │ │ ├── useInsights.js
│ │ │ └── useAlerts.js
│ │ ├── api/
│ │ │ └── client.js
│ │ ├── App.jsx
│ │ └── index.css
│ └── package.json
├── backend/
│ ├── routes/
│ │ ├── portfolio.js
│ │ ├── insights.js
│ │ └── alerts.js
│ ├── services/
│ │ ├── ga4.js
│ │ ├── anomalyDetection.js
│ │ └── recommendations.js
│ ├── cache.js
│ └── server.js
└── README.md
When to Ask for Help
- Complex architectural decisions → Use
opus for strategic thinking
- Performance bottlenecks → Profile first, optimize second
- Security concerns → Always better to ask
- Unfamiliar APIs → Read docs, test in isolation first
- Breaking changes → Check migration guides, changelogs
Quality Standards
Ship code that:
- ✅ Works on mobile AND desktop
- ✅ Has loading states for all async operations
- ✅ Handles errors gracefully (no silent failures)
- ✅ Is accessible (keyboard nav, ARIA labels)
- ✅ Performs well (Lighthouse score >90)
- ✅ Is maintainable (clear naming, comments where needed)
- ✅ Follows the project's existing patterns
Don't ship code that:
- ❌ Has console.log statements (remove or use proper logging)
- ❌ Has hardcoded API keys or secrets
- ❌ Breaks on edge cases (test thoroughly)
- ❌ Has poor performance (optimize critical paths)
- ❌ Is inaccessible (test with keyboard + screen reader)
Philosophy
- Pragmatic over perfect - Ship working code, iterate based on real usage
- User-first - Performance, accessibility, and UX trump developer convenience
- Consistency - Follow established patterns in the codebase
- Clarity - Code is read more than written; prioritize readability
- Resilience - Assume things will fail; handle errors gracefully
Use this skill when: Building or refactoring web applications, making architectural decisions, optimizing performance, or debugging complex full-stack issues.
1---2name: web-developer3description: Full-stack web development expert specializing in React, Node.js, modern web architectures, design systems, and API integration. Use when building or refactoring web applications, dashboards, SPAs, or full-stack projects. Covers frontend (React/Vite/Tailwind), backend (Node/Express), APIs, database design, and deployment.4---56# Web Developer78## Recommended Model9**Primary:** `codex` - Full-stack implementation, React components, API endpoints, database queries10**Architecture:** `opus` - Complex system design, architectural decisions, scalability planning11**Quick fixes:** `sonnet` - Bug fixes, small features, CSS tweaks1213---1415## 🔄 Automatic QA Policy1617**Status:** ✅ **ENABLED** - Always iterate for UI/UX work; selective for backend1819**Why:** Frontend/UI work is subjective and visual quality matters. Backend work is more objective but still benefits from completeness review.2021**What this means:**22- Fitz automatically QA's all web development deliverables after sub-agent completion23- Creates detailed feedback document if requirements missing or quality issues found24- Spawns iteration agent with feedback until work is complete25- You only review finished, production-ready code2627**Quality Bar:**28- ✅ Meets ALL requirements in task brief (not partial completion)29- ✅ UI work matches any design inspiration provided30- ✅ Code is clean, well-organized, and maintainable31- ✅ Responsive design works on mobile and desktop32- ✅ Dark mode support if applicable33- ✅ No placeholder/rough styling on customer-facing interfaces34- ✅ Backend APIs have proper error handling and validation35- ✅ Works correctly - no obvious bugs or breaking changes3637**Exceptions:**38- **Quick fixes/patches:** Single QA review, don't iterate unless broken39- **Backend-only work:** Light QA (works correctly?), not visual polish40- **Experiments/prototypes:** Skip QA if marked as draft4142**You can override:** Say "skip QA" or "good enough, ship it" to bypass iteration4344---4546## Core Expertise4748### Frontend Development49- **React** - Modern hooks, component patterns, state management50- **Vite** - Fast builds, HMR, optimization51- **Tailwind CSS** - Utility-first styling, design systems52- **Chart.js / D3** - Data visualization53- **Responsive design** - Mobile-first, accessible UIs5455### Backend Development56- **Node.js + Express** - RESTful APIs, middleware, routing57- **Database integration** - PostgreSQL, MongoDB, Supabase58- **Authentication** - OAuth, JWT, session management59- **API design** - RESTful patterns, versioning, documentation6061### Full-Stack Patterns62- **Project structure** - Monorepo vs. separate repos63- **State management** - Context, Zustand, React Query64- **Error handling** - Client + server side65- **Performance optimization** - Code splitting, lazy loading, caching66- **Deployment** - Vercel, Railway, PM2, Docker6768## Project Architecture Checklist6970Before starting any web project, define:7172### 1. **Tech Stack**73- Frontend framework (React, Vue, vanilla JS?)74- Build tool (Vite, Next.js, Create React App?)75- Styling approach (Tailwind, CSS modules, styled-components?)76- State management (Context, Zustand, Redux?)77- Backend runtime (Node, Deno, Bun?)78- Database (PostgreSQL, MongoDB, Supabase, Firebase?)7980### 2. **Project Structure**81```82project-name/83├── frontend/ # React app84│ ├── src/85│ │ ├── components/86│ │ ├── pages/87│ │ ├── hooks/88│ │ ├── utils/89│ │ ├── api/ # API client functions90│ │ └── App.jsx91│ ├── public/92│ └── package.json93├── backend/ # Express API94│ ├── routes/95│ ├── controllers/96│ ├── models/97│ ├── middleware/98│ └── server.js99└── README.md100```101102### 3. **Data Flow**103- How does data get from backend → frontend?104- Where is state stored (local, context, external store)?105- How are API calls handled (fetch, axios, React Query)?106- What's the caching strategy?107108### 4. **Error Handling**109- Client-side error boundaries110- API error responses (consistent format)111- User-facing error messages112- Logging strategy113114## React Best Practices115116### Component Patterns117118**Presentational Components** (UI only):119```jsx120export function MetricCard({ title, value, change, status }) {121 return (122 <div className={`card status-${status}`}>123 <h3>{title}</h3>124 <div className="value">{value}</div>125 <div className={`change ${change > 0 ? 'positive' : 'negative'}`}>126 {change > 0 ? '↑' : '↓'} {Math.abs(change)}%127 </div>128 </div>129 )130}131```132133**Container Components** (logic):134```jsx135export function Dashboard() {136 const [data, setData] = useState(null)137 const [loading, setLoading] = useState(true)138 139 useEffect(() => {140 fetchData().then(setData).finally(() => setLoading(false))141 }, [])142 143 if (loading) return <LoadingSpinner />144 return <MetricCard {...data} />145}146```147148**Custom Hooks** (reusable logic):149```jsx150function useAPI(endpoint) {151 const [data, setData] = useState(null)152 const [loading, setLoading] = useState(true)153 const [error, setError] = useState(null)154 155 useEffect(() => {156 fetch(endpoint)157 .then(res => res.json())158 .then(setData)159 .catch(setError)160 .finally(() => setLoading(false))161 }, [endpoint])162 163 return { data, loading, error }164}165```166167### State Management Philosophy168- **useState** - Local component state169- **useContext** - Shared state (theme, user, global settings)170- **React Query / SWR** - Server state (API data, caching)171- **Zustand / Redux** - Complex global state (if really needed)172173**Rule:** Keep state as local as possible. Lift only when necessary.174175## API Design Patterns176177### RESTful Endpoints178```179GET /api/portfolio/overview # Summary stats180GET /api/properties # List all properties181GET /api/properties/:id # Single property details182POST /api/properties/:id/metrics # Update metrics183GET /api/insights # AI-generated insights184GET /api/alerts # Active alerts185```186187### Response Format (Consistent)188```json189{190 "status": "success",191 "data": { ... },192 "meta": {193 "timestamp": "2026-01-29T20:00:00Z",194 "cached": true195 }196}197```198199### Error Format200```json201{202 "status": "error",203 "error": {204 "code": "VALIDATION_ERROR",205 "message": "Invalid property ID",206 "details": { ... }207 }208}209```210211## Performance Optimization212213### Frontend214- **Code splitting** - Lazy load routes/components215- **Memoization** - `useMemo`, `React.memo` for expensive renders216- **Virtualization** - For long lists (react-window)217- **Image optimization** - WebP, lazy loading, srcset218- **Bundle analysis** - Keep bundle size < 500KB219220### Backend221- **Caching** - Redis, in-memory cache for frequent queries222- **Database indexing** - Index frequently queried fields223- **Rate limiting** - Prevent API abuse224- **Compression** - gzip/brotli responses225- **Connection pooling** - Reuse database connections226227### Network228- **HTTP/2** - Multiplexing, server push229- **CDN** - Static assets served from edge230- **Prefetching** - Preload critical resources231- **Service workers** - Offline support, caching232233## Design System Integration234235When building UIs, establish:236237### 1. **Color System**238```css239:root {240 --color-primary: #6366f1;241 --color-success: #10b981;242 --color-warning: #f59e0b;243 --color-danger: #ef4444;244 --bg-primary: #ffffff;245 --bg-secondary: #f8fafc;246 --text-primary: #0f172a;247 --text-secondary: #475569;248}249```250251### 2. **Typography Scale**252```css253--text-xs: 12px;254--text-sm: 14px;255--text-base: 16px;256--text-lg: 18px;257--text-xl: 20px;258--text-2xl: 24px;259--text-3xl: 30px;260--text-4xl: 36px;261```262263### 3. **Spacing System**264```css265--spacing-1: 4px;266--spacing-2: 8px;267--spacing-3: 12px;268--spacing-4: 16px;269--spacing-6: 24px;270--spacing-8: 32px;271```272273### 4. **Component Library**274- Buttons (primary, secondary, danger, ghost)275- Cards (default, elevated, bordered)276- Inputs (text, select, checkbox, radio)277- Alerts (success, warning, error, info)278- Modals, tooltips, dropdowns279- Loading states (spinners, skeletons)280281## Common Pitfalls to Avoid282283### Frontend284- ❌ Prop drilling (use Context or composition)285- ❌ Too many useEffect hooks (consolidate logic)286- ❌ Inline styles (use CSS modules or Tailwind)287- ❌ Not handling loading/error states288- ❌ Forgetting accessibility (ARIA labels, keyboard nav)289290### Backend291- ❌ No input validation (validate everything)292- ❌ SQL injection vulnerabilities (use parameterized queries)293- ❌ Exposing sensitive data (sanitize responses)294- ❌ No rate limiting (protect against abuse)295- ❌ Poor error messages (be specific but safe)296297### Architecture298- ❌ Premature optimization (build it first, optimize later)299- ❌ Over-engineering (KISS principle)300- ❌ No separation of concerns (mix UI + logic)301- ❌ Tight coupling (components should be modular)302- ❌ No testing (at least smoke tests for critical paths)303304## Deployment Checklist305306Before shipping:307- [ ] Environment variables configured (not hardcoded)308- [ ] Error logging set up (Sentry, LogRocket)309- [ ] Analytics tracking (GA4, Plausible)310- [ ] Performance monitoring (Lighthouse, Web Vitals)311- [ ] Security headers configured (CSP, CORS, HSTS)312- [ ] Database backups scheduled313- [ ] SSL certificate active314- [ ] API rate limiting enabled315- [ ] Error boundaries in place316- [ ] Loading states for all async actions317- [ ] Mobile responsiveness tested318- [ ] Accessibility audit passed (WCAG AA minimum)319- [ ] README with setup instructions320- [ ] Documentation for API endpoints321322## Debugging Workflow323324### Frontend Issues3251. Check browser console (errors, warnings)3262. React DevTools (component tree, props, state)3273. Network tab (API calls, response times)3284. Performance tab (render times, memory leaks)329330### Backend Issues3311. Check server logs (errors, stack traces)3322. Test endpoints with curl/Postman3333. Database query logs (slow queries)3344. Memory/CPU usage (resource leaks)335336### Integration Issues3371. CORS errors (check headers)3382. Authentication failures (token expiration?)3393. Data format mismatches (backend vs frontend)3404. Caching issues (stale data)341342## Tech Stack Decision Matrix343344| Need | Recommended | Alternative |345|------|-------------|-------------|346| Frontend framework | React + Vite | Next.js (if SSR needed) |347| Styling | Tailwind CSS | CSS Modules |348| State management | Context + React Query | Zustand |349| Backend | Node + Express | Fastify (faster) |350| Database | PostgreSQL + Supabase | MongoDB |351| Deployment | Vercel (frontend) + Railway (backend) | Docker + VPS |352| Auth | Supabase Auth | Auth0, Clerk |353| Charts | Chart.js | Recharts, D3 |354355## Example Project Structure (Analytics Dashboard)356357```358analytics-dashboard/359├── frontend/360│ ├── src/361│ │ ├── components/362│ │ │ ├── MetricCard.jsx363│ │ │ ├── PropertyCard.jsx364│ │ │ ├── InsightsPanel.jsx365│ │ │ └── TrafficChart.jsx366│ │ ├── pages/367│ │ │ ├── Dashboard.jsx368│ │ │ ├── PropertyDetail.jsx369│ │ │ └── InsightsHub.jsx370│ │ ├── hooks/371│ │ │ ├── useAPI.js372│ │ │ ├── useInsights.js373│ │ │ └── useAlerts.js374│ │ ├── api/375│ │ │ └── client.js376│ │ ├── App.jsx377│ │ └── index.css378│ └── package.json379├── backend/380│ ├── routes/381│ │ ├── portfolio.js382│ │ ├── insights.js383│ │ └── alerts.js384│ ├── services/385│ │ ├── ga4.js386│ │ ├── anomalyDetection.js387│ │ └── recommendations.js388│ ├── cache.js389│ └── server.js390└── README.md391```392393## When to Ask for Help394395- **Complex architectural decisions** → Use `opus` for strategic thinking396- **Performance bottlenecks** → Profile first, optimize second397- **Security concerns** → Always better to ask398- **Unfamiliar APIs** → Read docs, test in isolation first399- **Breaking changes** → Check migration guides, changelogs400401## Quality Standards402403**Ship code that:**404- ✅ Works on mobile AND desktop405- ✅ Has loading states for all async operations406- ✅ Handles errors gracefully (no silent failures)407- ✅ Is accessible (keyboard nav, ARIA labels)408- ✅ Performs well (Lighthouse score >90)409- ✅ Is maintainable (clear naming, comments where needed)410- ✅ Follows the project's existing patterns411412**Don't ship code that:**413- ❌ Has console.log statements (remove or use proper logging)414- ❌ Has hardcoded API keys or secrets415- ❌ Breaks on edge cases (test thoroughly)416- ❌ Has poor performance (optimize critical paths)417- ❌ Is inaccessible (test with keyboard + screen reader)418419## Philosophy420421- **Pragmatic over perfect** - Ship working code, iterate based on real usage422- **User-first** - Performance, accessibility, and UX trump developer convenience423- **Consistency** - Follow established patterns in the codebase424- **Clarity** - Code is read more than written; prioritize readability425- **Resilience** - Assume things will fail; handle errors gracefully426427---428429**Use this skill when:** Building or refactoring web applications, making architectural decisions, optimizing performance, or debugging complex full-stack issues.