Guide feature development with architecture patterns for any tech stack. Covers frontend, backend, full-stack, and automation projects...
Guide feature development across any tech stack.
Use for:
Don't use when:
generic-design-systemgeneric-ux-designergeneric-code-reviewerproject/
āāā index.html
āāā css/ # variables.css, style.css
āāā js/ # main.js, utils.js
āāā assets/
Patterns: CSS variables, ES modules, event delegation
src/
āāā components/ # ui/, features/, layout/
āāā hooks/
āāā stores/
āāā services/
āāā types/
Patterns: Container/Presentational, custom hooks, Zustand/React Query
src/
āāā modules/[feature]/
ā āāā feature.module.ts
ā āāā feature.controller.ts
ā āāā feature.service.ts
ā āāā dto/
āāā common/ # guards, decorators
Patterns: Module organization, DTOs, Guards, Prisma
| Scope | Action |
|---|---|
| Single component | Implement directly |
| Cross-cutting concern | Design interface first |
| New subsystem | Create architecture doc, get approval |
| Factor | Build Custom | Use Library |
|---|---|---|
| Core to product | Yes | |
| Commodity feature | Yes | |
| Tight integration needed | Yes | |
| Time-critical | Yes | |
| Long-term ownership | Yes |
| Scope | Solution |
|---|---|
| Component-local | useState/useReducer |
| Feature-wide | Context or Zustand slice |
| App-wide | Zustand/Redux store |
| Server state | React Query/SWR |
| Form state | React Hook Form |
User Action ā Event Handler ā State Update ā Re-render ā UI Feedback
Request ā Auth Check ā Validation ā Business Logic ā Database ā Response
| Event Type | Approach |
|---|---|
| User events | Immediate feedback |
| Server events | WebSocket/SSE for real-time |
| Background tasks | Queue for long operations |
| Error Type | Frontend | Backend |
|---|---|---|
| Validation | Inline field errors | 400 + field errors |
| Auth | Redirect to login | 401/403 |
| Not Found | Empty state or redirect | 404 |
| Server Error | Generic message + retry | 500 + log |
| Network | Offline indicator + queue | N/A |
try {
await apiCall();
} catch (error) {
if (error instanceof ValidationError) showFieldErrors(error.fields);
else showGenericError();
}
if (err instanceof ValidationError)
return res.status(400).json({ errors: err.errors });
if (err instanceof AuthError)
return res.status(401).json({ message: "Unauthorized" });
| Layer | Type | Tools |
|---|---|---|
| UI | Component | Testing Library |
| Logic | Unit | Jest, Vitest |
| API | Integration | Supertest |
| E2E | End-to-end | Playwright |
Frontend: Code splitting, lazy loading, memoization, debounce Backend: DB indexing, caching, connection pooling, background jobs
Before marking feature complete:
generic-design-system - For styling and visual consistencygeneric-ux-designer - For UX flow decisionsCLAUDE.md - Workflow rulesREAD shared standards when: