skill-web-architecture
Skill0 starsChanged 3 months agoMITView on GitHub
Full-stack web architectural standards, module boundaries, and API contract design. MUST ACTIVATE when designing full-stack web application structure, choosing stack boundaries, or structuring API interactions between client and server.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- core/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- avoid-ai-writingSkill
- c-cpp-systemsSkill
- doubt-driven-developmentSkill
- marketing-copywritingSkill
- mempalace-recallSkill
- mempalaceSkill
- mempalace-taskSkill
- retro-emulation-engineeringSkill
- seo-optimization-and-auditSkill
- skill-ai-mlSkill
- skill-backend-architectSkill
- skill-codebase-onboardingSkill
- skill-code-reviewSkill
- skill-context-engineeringSkill
- skill-creative-designSkill
- skill-data-analysisSkill
- skill-data-scienceSkill
- skill-design-engineeringSkill
- skill-devops-cloudSkill
- skill-emulator-wasmSkill
- skill-frontend-architectSkill
- skill-graph-analyticsSkill
- skill-graphics-webglSkill
- skill-low-level-programmingSkill
- skill-master-orchestratorSkill
- skill-mcp-builderSkill
- skill-monorepo-architectSkill
- skill-osint-engineeringSkill
- skill-plugin-architectureSkill
- skill-qa-engineerSkill
- skill-researchSkill
- skill-resume-tailorSkill
- skill-stealth-scrapingSkill
- skill-system-diagnosticsSkill
- skill-web-performanceSkill
- spec-driven-developmentSkill
- spec-minerSkill
- wasm-emscriptenSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
UI vs. Business Logic Separation: Keep rendering logic separate from data fetching and state mutation.
- Very specific: line 31
Render Optimization Patterns: Use memoization (e.g., React.memo, useMemo) judiciously to prevent unnecessary re-renders.
- Distinctive: line 36
Full Keyboard Navigation: Every interactive element must be reachable and usable via keyboard alone.
- Distinctive: line 38
Screen-Reader ARIA: Use appropriate ARIA roles and labels for non-native interactive elements.
- Very specific: line 41
Semantic HTML: Avoid "div soup". Use semantic tags like <nav>, <main>, <article>, <button>.
- Distinctive: line 59
Consistent Error Semantics: Use structured error payloads and predictable HTTP status codes across all endpoints.
- Distinctive: line 64
Never trust inputs at system boundaries:
- Distinctive: line 65
Runtime Validation: Use tools like Zod or JSON Schema at interface boundaries to guarantee data shape.
- Distinctive: line 67
Type Narrowing: Use type guards at data boundaries to ensure type safety deeper in the application logic.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Web architecture decisions shape the foundation of a robust, scalable, and accessible application. This skill provides a framework for frontend component architecture and backend API design. Use these guidelines when designing new web features, making technology choices, or defining module boundaries.
When to Use
- Designing new web features
- Component architecture decisions
- API design and specification
- Technology stack selection
- Performance optimization planning
- Accessibility compliance checks
When NOT to Use
- Pure visual art direction, typography pairings, and aesthetics (use
skill-creative-design) - Motion animation engineering, Subgrid/Bento implementation, or UI component suites (use
skill-design-engineering/skill-frontend-architect) - Pure backend business logic (use
skill-backend-architectif available)
Component Architecture
Adhere to these principles when designing UI components:
- Modular Composition: Build complex UIs from small, reusable, and independent building blocks.
- Clear Props/Interface Contracts: Define strict inputs and outputs for every component using typed interfaces (e.g., TypeScript).
- UI vs. Business Logic Separation: Keep rendering logic separate from data fetching and state mutation. Use custom hooks or container components.
- State Management Boundaries: Deliberately decide between local component state and global application state. Avoid unnecessary global state.
- Controlled vs. Uncontrolled Components: Be explicit about who owns the state. Prefer controlled components for complex forms.
- Render Optimization Patterns: Use memoization (e.g.,
React.memo,useMemo) judiciously to prevent unnecessary re-renders.
Accessibility Standards
WCAG 2.1 / 2.2 AA compliance is NON-NEGOTIABLE. Ensure the following:
- Full Keyboard Navigation: Every interactive element must be reachable and usable via keyboard alone.
- Target Size: Minimum interactive target area (24x24px minimum, 44x44px recommended).
- Screen-Reader ARIA: Use appropriate ARIA roles and labels for non-native interactive elements.
- Color Contrast: Maintain a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (or APCA equivalent).
- Focus Management: Provide clearly visible focus indicators. Manage focus appropriately during state changes (e.g., modals).
- Semantic HTML: Avoid "div soup". Use semantic tags like
<nav>,<main>,<article>,<button>. - Skip Navigation Links: Provide mechanisms to bypass repetitive content blocks.
Performance & Core Web Vitals
Design for performance from the start:
- LCP (Largest Contentful Paint): Target < 2.5s. Optimize hero image loading and server response times.
- INP (Interaction to Next Paint): Target < 200ms. Keep the main thread unblocked.
- CLS (Cumulative Layout Shift): Target < 0.1. Reserve space for dynamic content (images, ads).
- Bundle Size Budgets: Implement code splitting and lazy loading for routes and heavy components.
- Image Optimization: Serve modern formats (WebP/AVIF), use lazy loading for below-the-fold images, and provide
srcsetfor responsive images. - Critical Rendering Path: Inline critical CSS and defer non-essential scripts.
Contract-First API Design
APIs must be designed with strict contracts before implementation:
- Design Before Code: Define schemas, parameters, and error types explicitly BEFORE writing endpoint logic.
- Hyrum's Law: Assume users will depend on every observable behavior. Explicitly specify public contracts and aggressively hide implementation details.
- Consistent Error Semantics: Use structured error payloads and predictable HTTP status codes across all endpoints.
- Versioning Strategy: Establish a clear versioning strategy (e.g., URL path vs. header) from day one.
Boundary Validation
Never trust inputs at system boundaries:
- Runtime Validation: Use tools like Zod or JSON Schema at interface boundaries to guarantee data shape.
- Input Sanitization: Sanitize all data at API entry points to prevent injection attacks.
- Type Narrowing: Use type guards at data boundaries to ensure type safety deeper in the application logic.
Anti-Rationalization Table
| Agent Excuse | BLOCKED Rebuttal |
| "The user didn't ask for accessibility" | BLOCKED: WCAG 2.1 AA is a default requirement for all web interfaces. |
| "We can optimize performance later" | BLOCKED: Architecture decisions now determine the performance ceiling later. Optimize structural performance early. |
| "I'll define the API as I build" | BLOCKED: Contract-first is mandatory. Define schemas and types before implementation. |
| "This component is too simple to need a props interface" | BLOCKED: Every component, no matter how simple, gets a explicitly typed interface. |
| "SSR isn't needed for this page" | BLOCKED: Evaluate LCP impact and SEO requirements before deciding against SSR. |
| "The existing API pattern doesn't use validation" | BLOCKED: Don't propagate missing validation. Introduce runtime validation at boundaries for new code. |
Red Flags
- Committing UI components without defined types/interfaces.
- Missing keyboard navigation support on interactive elements.
- Implementing an API without a prior schema definition.
- Trusting client data without server-side validation.
Verification Gates
- Is the UI logic separated from the business logic?
- Does the UI meet WCAG 2.1 AA accessibility standards?
- Are performance budgets and Web Vitals explicitly addressed?
- Is the API contract defined and validated at runtime?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

